Our custom `docker-entrypoint.sh` starts nginx by directly calling
`nginx -g "daemon off;"`. However, we need the `docker-entrypoint.sh`
built-in in the nginx docker image to convert `default.conf.template` to
the actual nginx config file. Without going through nginx's
`docker-entrypoint.sh`, the resultant docker image fallback to the
default nginx configuration, which doesn't forward traffic to webdav
backend server.
This patch fixes this by calling the nginx's `docker-entrypoint.sh` at
the end of our custom `docker-entrypoint.sh`.
Fix: The first issue in https://github.com/johannesjo/super-productivity/issues/4545#issuecomment-2974843258
In the docker setup, allow admin to provide the default values for
WebDAV settings in the "Sync" section of the "Settings" page, via
setting some environment variables of the docker container. This could
be used for single user instances to pre-fill those settings. The
available environment variables are:
- WEBDAV_BASE_URL=<base-url>
- WEBDAV_USERNAME=<username>
- WEBDAV_SYNC_FOLDER_PATH=<sync-folder-path>
- SYNC_INTERVAL=<integer-in-minutes>
- IS_COMPRESSION_ENABLED=<true-or-false>
- IS_ENCRYPTION_ENABLED=<true-or-false>
These configurations are provided as environment variables after the
build process of the app, so they have to be loaded at runtime, instead
of build process. This can be achieved by the following way:
1. The environment variables are loaded into the docker container.
2. The container starts with `docker-entrypoint.sh`.
3. `docker-entrypoint.sh` converts the variables into a JSON file placed
at `assets/sync-config-default-override.json`.
4. `sync-config.service.ts` fetches
`assets/sync-config-default-override.json` dynamically at runtime to
override the default values from `default-global-config.const.ts`.