Hello, the main focus of this PR is to enhance experimental Docker support
Environmental Variable Support
Each config option now has a corresponding environmental variable that can be optionally specified in the compose.yaml or run statement (e.g., 'HEADLESS=true').
I updated the readme with these variables added to the table.
If a value is provided in the compose file (or run command), it takes priority over the value in the config.yaml. If a value is not provided, the value in the config.yaml is used instead (e.g., the default value).
at this point, I'd recommend docker compose vs., docker run
Scheduling
This PR now has built-in cron-based daily scheduling
A daily schedule can be customized by adding the environmental variable:CRON_START_TIME= to the compose file, for example with a value such as 0 5,11 * * * which would run the script daily at 5:00 am and 11:00 am. Users could refer to crotab.guru to create their own preferred cron-based schedule (or use the default provided in the sample compose.yaml).
After the script completes, the container itself stays running, but idle. Then, the script runs again according to the cron schedule provided, no system cron settings or configuration required.
Per my own preference, I added entropy (randomization) to the scheduled start time. This is in seen in run_daily.sh file. My intention with this is to have a bit more naturalized use, hopefully as a preventative measure.
Since I added scheduling, I included an option to enable or disable running the script on container start, set to 'true' by default which matches the current default behaviour of the script.
"Migrating"
If you're already using docker, I'd suggest removing the previously-created image using the following for a 'clean' install:
docker stop netsky && docker rm netsky
docker system prune -a -f
docker compose up -d --build
Testing
Otherwise, I've tested this now for a few weeks with personally zero issues. Thank you to @Ryely-Squires for testing as well. If this fits with your overall goals for docker please feel free to use it or discard it as you see fit. I would definitely still consider this experimental, and it's very likely I've missed things and made mistakes.
Hello, the main focus of this PR is to enhance experimental Docker support
Environmental Variable Support
Scheduling
CRON_START_TIME=
to the compose file, for example with a value such as0 5,11 * * *
which would run the script daily at 5:00 am and 11:00 am. Users could refer to crotab.guru to create their own preferred cron-based schedule (or use the default provided in the sample compose.yaml)."Migrating"
Testing
Otherwise, I've tested this now for a few weeks with personally zero issues. Thank you to @Ryely-Squires for testing as well. If this fits with your overall goals for docker please feel free to use it or discard it as you see fit. I would definitely still consider this experimental, and it's very likely I've missed things and made mistakes.