diff --git a/Dockerfile b/Dockerfile index 99c6a37..a16b20f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update && \ FROM debian:trixie COPY start.sh . +COPY initialconfig.json . COPY --from=builder /usr/bin/hyperiond /usr/bin/hyperiond RUN apt-get update && \ apt-get upgrade -y -q && \ @@ -45,5 +46,4 @@ ENV UID=1000 ENV GID=1000 SHELL ["/bin/bash", "-c"] -ENTRYPOINT bash start.sh uid="$UID" gid="$GID" -#ENTRYPOINT tail -f /dev/null +ENTRYPOINT bash start.sh uid="$UID" gid="$GID" server_address="$SERVER_ADDRESS" diff --git a/initialconfig.json b/initialconfig.json new file mode 100644 index 0000000..d481156 --- /dev/null +++ b/initialconfig.json @@ -0,0 +1,11 @@ +{ + "global": { + "settings":{ + "network":{ + "internetAccessAPI":true, + "localApiAuth":false, + "restirctedInternetAccessAPI":false + } + } + } +} \ No newline at end of file diff --git a/start.sh b/start.sh index 304477e..5748c11 100644 --- a/start.sh +++ b/start.sh @@ -4,7 +4,7 @@ for arg in "$@"; do case "$arg" in uid=*) uid="${arg#*=}" ;; - gid=*) gid="${arg#*=}" ;; + gid=*) gid="${arg#*=}" ;; esac done @@ -12,4 +12,8 @@ done groupmod -g $gid hyperion usermod -u $uid hyperion chown -R hyperion:hyperion /config +if test -f "initialconfig.json"; then + sudo -u hyperion /usr/bin/hyperiond/bin/hyperiond -i --userdata /config --importConfig initialconfig.json + rm initialconfig.json +fi sudo -u hyperion /usr/bin/hyperiond/bin/hyperiond -i --userdata /config \ No newline at end of file