diff --git a/ankerctl/Dockerfile b/ankerctl/Dockerfile index c865247..b8fc2cc 100644 --- a/ankerctl/Dockerfile +++ b/ankerctl/Dockerfile @@ -9,17 +9,31 @@ FROM $BUILD_FROM # 2 Modify Image # ################## +ARG CONFIG_PATH='/data/options.json' + +# Add run.sh +COPY data/run.sh / +RUN chmod a+x /run.sh + # Set S6 wait time ENV S6_CMD_WAIT_FOR_SERVICES=1 \ S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ - S6_SERVICES_GRACETIME=0 \ - FLASK_HOST=0.0.0.0 \ - FLASK_PORT=4470 + S6_SERVICES_GRACETIME=0 +# FLASK_HOSTE=$(jq --raw-output '.flask_host // empty' $CONFIG_PATH) RUN ln -s /root/.config /config +RUN apt-get update && apt-get install -y jq && rm -rf /var/lib/apt/lists/* + +################ +# 3 Entrypoint # +################ + +ENTRYPOINT ["sh"] +CMD ["/run.sh"] + ############ -# 5 Labels # +# 4 Labels # ############ ARG BUILD_ARCH ARG BUILD_DATE diff --git a/ankerctl/config.yaml b/ankerctl/config.yaml index f9582ac..625f329 100644 --- a/ankerctl/config.yaml +++ b/ankerctl/config.yaml @@ -9,11 +9,15 @@ init: false host_network: true map: - config:rw +options: + flask_host: "0.0.0.0" +schema: + flask_host: str arch: - aarch64 - amd64 - armv7 ports: - "4470": 4470 + 4470/tcp: 4470 ports_description: - "4470": "The webinterface for ankerctl" + 4470/tcp: "The webinterface for ankerctl" diff --git a/ankerctl/data/run.sh b/ankerctl/data/run.sh new file mode 100644 index 0000000..79b646f --- /dev/null +++ b/ankerctl/data/run.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +CONFIG_PATH=/data/options.json + +FLASK_HOST="$(jq --raw-output '.flask_host // empty' $CONFIG_PATH)" + +/app/ankerctl.py webserver run --host="${FLASK_HOST}" diff --git a/ankerctl/translations/en.yaml b/ankerctl/translations/en.yaml new file mode 100644 index 0000000..53548e6 --- /dev/null +++ b/ankerctl/translations/en.yaml @@ -0,0 +1,6 @@ +configuration: + flask_host: + name: "flask bind address" + description: "The address flask should bind to. NOTE: binding to 0.0.0.0 means everyone on your network can control your printer!" +network: + 4470/TCP: The webserver port (Not used for Ingress)