mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-10 18:36:17 +00:00
* Script will run on container start, and continue to run daily at 5:00 am. The goal of this update was to add in-built cronjob support so that the script runs immediately on container start, then will schedule the script to run the daily at 5:00 am without requiring the user to manually create a cronjob. After starting the container and completing the first run, the container should remain active (running) but idle until the next scheduled run. Ideally, the next step will be to include support for environmental variables that will allow the user to customize when the script scheduled runs occur within the docker compose.yaml. * added --build to docker compose command instructions building/rebuilding the image (and the script) may reduce problems if folks make changes to their configs * Updated the crontab default to run twice daily by default, 5am and 11am * Update crontab Newline needed * Environmental variable support, custom scheduling This is a massive update that includes docker environmental variable support for all config options. If specified, the custom env var value will supersede the default values in the config.json. You do not need to change the values in the config.json if you set a custom env var. For example, if you have headless=false in the config.json, but set it as true in the compose.yaml, it will run as HEADLESS=true. If you do not specify a particular env var, the script will automatically use the default value. Please test and contribute wherever possible! * Fix scheduled runs, tidied up readme * timezone support Minor adjustment to attempt to fix timezone env var support * Run on start, npm script env Hopefully two fixes here, the container should again, by default, run on start, then continue per schedule. This defaults to true; however, can be optionally over-ridden in the compose.yaml with the env var RUN_ON_START=false. If set to false, the script should only run on the specified cron schedule. I also passed the TZ write into the npm start command, rather than just the container overall so it should show the proper time. * Keep docker running after run_on_start to wait for cron Accidentally set it up like a run_once, this should keep the container active after run_on_start to wait for the next schedule. * improve order of cmd This should (1) set time zone for script, (2) run once if set, then (3) idle for scheduled cron job. It was a little hacky before, this should be tidier. * updated compose to auto-restart container Noticed the container was exited this am, likely after automated updated to system, adding restart: unless-stopped to compose should keep container running in such circumstances. * Update env vars in readme
35 lines
1.5 KiB
YAML
35 lines
1.5 KiB
YAML
services:
|
|
microsoft-rewards-script:
|
|
build: .
|
|
container_name: netsky
|
|
environment:
|
|
- 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
|
|
- CRON_START_TIME=0 5,11 * * *
|
|
### Run on start, set as false to only run the script per the cron schedule
|
|
- RUN_ON_START=true
|
|
restart: unless-stopped
|
|
volumes:
|
|
- .:/usr/src/microsoft-rewards-script
|