From aa50e74d9a76d10da39616ed9d17825038b32591 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 12 Jul 2021 17:23:55 +0200 Subject: [PATCH] Move to Cadoles namespace --- Dockerfile | 6 ++++-- Makefile | 11 ++++++----- misc/sample.conf | 15 +++++++++++++++ misc/start.sh | 23 +++++++++++++++-------- 4 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 misc/sample.conf diff --git a/Dockerfile b/Dockerfile index f6e8b5f..42ebafc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.8 +FROM alpine:3.9 ARG HTTP_PROXY= ARG HTTPS_PROXY= @@ -6,6 +6,7 @@ ARG http_proxy= ARG https_proxy= ARG FDROIDSERVER_VERSION=1.0.10 ARG TIMEZONE=Europe/Paris +ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1 RUN apk add --no-cache \ python3 build-base freetype-dev libffi-dev \ @@ -47,7 +48,8 @@ VOLUME /fdroid/metadata VOLUME /fdroid/keystore EXPOSE 2222 -EXPOSE 8080 +EXPOSE 80 +EXPOSE 443 ENV FDROID_ARCHIVE_OLDER=3 ENV FDROID_REPO_ICON=fdroid-icon.png diff --git a/Makefile b/Makefile index a076294..f19d952 100644 --- a/Makefile +++ b/Makefile @@ -12,25 +12,26 @@ build: run: docker run -it --rm \ -p 2222:2222 \ - -p 8080:2015 \ + -p 8080:80 \ + -p 8443:443 \ -v "$(PWD)/data/repo:/fdroid/repo" \ -v "$(PWD)/data/metadata:/fdroid/metadata" \ -v "$(PWD)/data/keystore:/fdroid/keystore" \ - -e "FDROID_REPO_HOST=0.0.0.0" \ + -e "FDROID_REPO_HOST=:80" \ -e "FDROID_REPO_NAME=My local repo" \ -e "FDROID_REPO_DESCRIPTION=My repo description" \ -e "FDROID_KEYSTORE_PASS=mykeystorepass" \ -e "FDROID_KEYSTORE_KEYPASS=mykeystorekeypass" \ -e "FDROID_KEYSTORE_KEY_ALIAS=fdroidkey" \ + -e "FDROID_REPO_EMAIL=contact@cadoles.com" \ -e "SSH_PUBLIC_KEY=$(SSH_PUBLIC_KEY)" \ -e "FDROID_KEYSTORE_DNAME=CN=cadoles.com, OU=ID, O=Cadoles, L=Dijon, S=France, C=FR" \ fdroid-repository:latest \ $(DOCKER_CMD) push: - docker image tag fdroid-repository:latest bornholm/fdroid-repository:latest - docker push bornholm/fdroid-repository:latest - + docker image tag fdroid-repository:latest cadoles/fdroid-repository:latest + docker push cadoles/fdroid-repository:latest clean: docker rmi fdroid-repository diff --git a/misc/sample.conf b/misc/sample.conf new file mode 100644 index 0000000..bf558d7 --- /dev/null +++ b/misc/sample.conf @@ -0,0 +1,15 @@ +DOCKER_HTTP_PORT="127.0.0.1:8080:80" +DOCKER_HTTPS_PORT="127.0.0.1:8443:443" +DOCKER_SSH_PORT="2222:2222" +FDROID_REPO_DIR="/opt/fdroid/data/stable/repo" +FDROID_METADATA_DIR="/opt/fdroid/data/stable/metadata" +FDROID_KEYSTORE_DIR="/opt/fdroid/data/stable/keystore" +REPO_HOST="*:80" +REPO_EMAIL="myemail@" +REPO_NAME="My FDroid Repository" +REPO_DESCRIPTION="My FDroid Repo" +KEYSTORE_PASS="" +KEYSTORE_KEY_PASS="" +KEYSTORE_KEY_ALIAS="" +KEYSTORE_DNAME="" +SSH_PUBLIC_KEY="" \ No newline at end of file diff --git a/misc/start.sh b/misc/start.sh index f8a28ff..48c6fd8 100644 --- a/misc/start.sh +++ b/misc/start.sh @@ -2,18 +2,25 @@ set -eo pipefail +CONFIG_FILE=$1 + +if [ ! -f "${CONFIG_FILE}" ]; then + echo 1>&2 "You must provide a configuration file." + exit 1 +fi + set -a -. "${PWD}/repo.conf" +. "$CONFIG_FILE" set +a docker run -it -d \ --restart always \ - -p 80:80 \ - -p 443:443 \ - -p 2222:2222 \ - -v "${PWD}/data/repo:/fdroid/repo" \ - -v "${PWD}/data/metadata:/fdroid/metadata" \ - -v "${PWD}/data/keystore:/fdroid/keystore" \ + -p "${DOCKER_HTTP_PORT}" \ + -p "${DOCKER_HTTPS_PORT}" \ + -p "${DOCKER_SSH_PORT}" \ + -v "${FDROID_REPO_DIR}:/fdroid/repo" \ + -v "${FDROID_METADATA_DIR}:/fdroid/metadata" \ + -v "${FDROID_KEYSTORE_DIR}:/fdroid/keystore" \ -e "FDROID_REPO_HOST=${REPO_HOST}" \ -e "FDROID_REPO_EMAIL=${REPO_EMAIL}" \ -e "FDROID_REPO_NAME=${REPO_NAME}" \ @@ -23,4 +30,4 @@ docker run -it -d \ -e "FDROID_KEYSTORE_KEY_ALIAS=${KEYSTORE_KEY_ALIAS}" \ -e "FDROID_KEYSTORE_DNAME=${KEYSTORE_DNAME}" \ -e "SSH_PUBLIC_KEY=${SSH_PUBLIC_KEY}" \ - bornholm/fdroid-repository:latest \ No newline at end of file + cadoles/fdroid-repository:latest