Docker: improved env var handling (#113)

* Improve env var handling, clarify instructions

updateConfig.js will update dist/config.json with any values specified in the docker compose file as environmental variables (env vars). If not specified it will use the default values in src/config.json (the 'usual' place where folks can customize their config).

A user can make changes to an env var (e.g., disabling Scroll Random Results), then docker compose up -d to quickly restart the container with the change.

* minor update to env vars in table

Make sure to change your compose so the updated flattened values work.

* TZ handling for cron runs of the script

docker logs netsky should now show the proper time zone for script runs that were initiated via cron schedule.
This commit is contained in:
mgrimace
2024-06-01 08:50:29 -04:00
committed by GitHub
parent c6ab80fe54
commit 8d19129906
6 changed files with 69 additions and 45 deletions

View File

@@ -6,29 +6,8 @@ services:
- TZ=America/Toronto #change to your local timezone
- NODE_ENV=production
- HEADLESS=true #do not change
### the following are optional, you only need to include them if you want to enter a custom value, removing them will use the default values
- BASE_URL=https://rewards.bing.com
- SESSION_PATH=sessions
- RUN_ON_ZERO_POINTS=false
- CLUSTERS=1
- SAVE_FINGERPRINT=false
- WORKERS_DO_DAILY_SET=true
- WORKERS_DO_MORE_PROMOTIONS=true
- WORKERS_DO_PUNCH_CARDS=true
- WORKERS_DO_DESKTOP_SEARCH=true
- WORKERS_DO_MOBILE_SEARCH=true
- SEARCH_SETTINGS_USE_GEO_LOCALE_QUERIES=false
- SEARCH_SETTINGS_SCROLL_RANDOM_RESULTS=true
- SEARCH_SETTINGS_CLICK_RANDOM_RESULTS=true
- SEARCH_SETTINGS_SEARCH_DELAY_MIN=10000 # Set the search delay longer, e.g. MIN=180000 and MAX=270000 if you live in a region where MS enforces a search cooldown
- SEARCH_SETTINGS_SEARCH_DELAY_MAX=20000
- SEARCH_SETTINGS_RETRY_MOBILE_SEARCH=true
- WEBHOOK_ENABLED=false
- WEBHOOK_URL=
### Customize your run schedule, default 5:00 am and 11:00 am, use crontab.guru if you're not sure
### Customize your run schedule, default 5:00 am and 11:00 am, use crontab.guru for formatting
- CRON_START_TIME=0 5,11 * * *
### Run on start, set as false to only run the script per the cron schedule
### Run on start, set to false to only run the script per the cron schedule
- RUN_ON_START=true
restart: unless-stopped
volumes:
- .:/usr/src/microsoft-rewards-script
restart: unless-stopped