diff --git a/docker/Dockerfile b/docker/Dockerfile index 676535d9..f1420549 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -124,6 +124,7 @@ RUN mkdir /data /configs -p ${WGDASH}/src /etc/amnezia/amneziawg \ COPY ./src ${WGDASH}/src COPY --from=pip-builder /opt/wgdashboard/src/venv /opt/wgdashboard/src/venv COPY ./docker/wg0.conf.template /tmp/wg0.conf.template +COPY ./docker/wg-dashboard-oidc-providers.json.template /tmp/wg-dashboard-oidc-providers.json.template # Copy in the runtime script, essential. COPY ./docker/entrypoint.sh /entrypoint.sh diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 22292132..daef69ca 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -122,7 +122,7 @@ ensure_installation() { # PERSISTENCE FOR wg-dashboard-oidc-providers.json if [ ! -f "/data/wg-dashboard-oidc-providers.json" ]; then echo "Creating wg-dashboard-oidc-providers.json file" - touch "/data/wg-dashboard-oidc-providers.json" + cp -v /tmp/wg-dashboard-oidc-providers.json.template /data/wg-dashboard-oidc-providers.json fi if [[ ! -L "${WGDASH}/src/wg-dashboard-oidc-providers.json" ]] && [[ -f "${WGDASH}/src/wg-dashboard-oidc-providers.json" ]]; then echo "Removing ${WGDASH}/src/wg-dashboard-oidc-providers.json since its not a symbolic link." diff --git a/docker/wg-dashboard-oidc-providers.json.template b/docker/wg-dashboard-oidc-providers.json.template new file mode 100644 index 00000000..3764d0d2 --- /dev/null +++ b/docker/wg-dashboard-oidc-providers.json.template @@ -0,0 +1,16 @@ +{ + "Admin": { + "Provider": { + "client_id": "", + "client_secret": "", + "issuer": "" + } + }, + "Client": { + "Provider": { + "client_id": "", + "client_secret": "", + "issuer": "" + } + } +}