jyunhanlin / daka

MIT License
5 stars 11 forks source link

Daka

Check the holidays and your personal events, then daka!!

Usage

Use Crontab, GitHub Actions, or Docker one of them to run the schedule.

Crontab

npm install
crontab -e

0 10 * * * /NODE_PATH/node /DAKA_FOLDER/src/index.js S >>/LOG_FOLDER/daka.log 2>&1
0 19 * * * /NODE_PATH/node /DAKA_FOLDER/src/index.js E >>/LOG_FOLDER/daka.log 2>&1

GitHub Actions

Note: The time of the scheduled event might delay.

on:
  schedule:
    - cron: '30 0 * * *'
    - cron: '0 11 * * *'

Docker

docker pull jyunhanlin/daka:latest

# or

docker pull ghcr.io/jyunhanlin/daka:latest

# or build your image

docker build -t daka .
docker run -e MODULE=module -e USERNAME=your_username -e PASSWORD=your_password DAKA_IMAGE

Environment Variables

Required

env variable description
MODULE the Daka module (mayo | femas)
USERNAME user name for the module
PASSWORD password for the module

Options

env variable default description
MODULE_OPTIONS undefine the specific options for the module
DELAY_START_MINS 5 the delay mins before start daka, range from 0 to DELAY_START_MINS
DELAY_END_MINS 15 the delay mins before end daka, range from DELAY_START_MINS to DELAY_END_MINS
IMMEDIATE_DAKA 0 immediate daka without delay (1: enable, 0: disable)
MAX_RETRY_COUNT 3 total retry times