The application will run and schedule the start of the Exaroton server at the specified time in the configured time zone. And it will send a notification to the specified webhook URL when the server is started.
Important
- Python 3.10 to latest 🐍
- An Exaroton account 🌐
- Docker 🐳 (optional)
- 🚀 Exaroton Server Scheduler
- 📋 Requirements
- ⭐ Direct Script Execution
- 🐳 Docker Execution
- 🌱 Explanation of Environment Variables
- 🤝 Contributions
- 📄 License
-
Clone the repository:
git clone https://github.com/sergisvk/exaroton-reset.git cd exaroton-reset
-
Create a
.env
file in the root directory of the project and add the following environment variables:TOKEN= TIMEZONE=Europe/Madrid WEBHOOK_URL= CRON_SCHEDULE_START="0 6 * * *" # Start the server at 6:00 AM CRON_SCHEDULE_STOP="0 22 * * *" # Stop the server at 10:00 PM ID_SERVER="" LANGUAGE=""
Note
Click here to see the explanation of each environment variable.
-
Install the dependencies:
pip install -r requirements.txt
-
Run the script:
python main.py
-
Clone the repository:
git clone https://github.com/sergisvk/exaroton-reset.git cd exaroton-reset
-
Create a
.env
file in the root directory of the project and add the following environment variables:TOKEN= TIMEZONE=Europe/Madrid WEBHOOK_URL= CRON_SCHEDULE_START="0 6 * * *" # Start the server at 6:00 AM CRON_SCHEDULE_STOP="0 22 * * *" # Stop the server at 10:00 PM ID_SERVER="" LANGUAGE="es-ES"
Note
Click here to see the explanation of each environment variable.
- Build the Docker image and run the container:
docker build -t exaroton-reset . docker run --env-file .env exaroton-reset
Tip
In my opinion, this is the best way to run the container using Docker Compose.
-
Create a
docker-compose.yml
file in the root directory of the project with the following content:version: '3.8' services: exaroton-reset: image: ghcr.io/sergisvk/exaroton-reset:latest environment: - TOKEN=${TOKEN} - TIMEZONE=${TIMEZONE} - WEBHOOK_URL=${WEBHOOK_URL} - ID_SERVER=${ID_SERVER} - CRON_SCHEDULE_START=${CRON_SCHEDULE_START} - CRON_SCHEDULE_STOP=${CRON_SCHEDULE_STOP} - LANGUAGE=${LANGUAGE} restart: unless-stopped
-
Run the following command to start the container: Another way to run the container using Docker Compose is to pass the
.env
file in theenvironment
section of thedocker-compose.yml
file.version: '3.8' services: exaroton-reset: image: ghcr.io/sergisvk/exaroton-reset:latest env_file: - .env restart: unless-stopped
This will start the container using the latest image published in the GitHub Container Registry and the environment variables defined in the .env
file.
-
TOKEN
: This is the Exaroton API token used to authenticate requests to the Exaroton API. You must get this token from your Exaroton account. -
TIMEZONE
: The time zone in which you want to schedule the server start. It must be in a recognized tz format (e.g.,Europe/Madrid
). -
WEBHOOK_URL
: The webhook URL where notifications will be sent. This can be a Discord webhook URL or another service that accepts webhooks. -
CRON_SCHEDULE_START
: The cron schedule for starting the server. In this case, it is set to start the server every day at 6:00 AM ("0 6 * * *"
). -
CRON_SCHEDULE_STOP
: The cron schedule for stopping the server. In this case, it is set to stop the server every day at 10:00 PM ("0 22 * * *"
). -
ID_SERVER
: The ID of your Exaroton server. This ID is unique for each server and is used to identify the server you want to start. -
LANGUAGE
: The language in which the notifications will be sent. The available languages areen-UK
,es-ES
,fr-FR
,pt-PT
The cron format is used to schedule tasks at specific intervals. The syntax of a cron expression is as follows:
* * * * *
| | | | |
| | | | +---- Day of the week (0 - 7) (Sunday to Saturday, where 0 and 7 are Sunday)
| | | +------ Month (1 - 12)
| | +-------- Day of the month (1 - 31)
| +---------- Hour (0 - 23)
+------------ Minute (0 - 59)
Each field can contain one or more values, separated by commas. Values can be specific numbers, ranges of numbers, or special characters such as *
(any value), /
(increments), and -
(ranges).
Contributions are welcome. Please open an issue or a pull request to discuss any changes you would like to make.
This project is maintained by SergiSvK. If you find this project helpful, please consider making a donation.
This project is licensed under the MIT Licence. See the LICENSE file for more information.