README.md aktualisiert

This commit is contained in:
Simon Rieger 2023-11-24 14:24:57 +01:00
parent f8b62a8330
commit d61e68a7e5

134
README.md
View file

@ -1,67 +1,67 @@
# GO ical ntfy reminder # GO ical ntfy reminder
This is a simple Go application that does iCalendar files (.ics) analyzes and sends notifications by ntfy based on the events in these iCalendar files. This is a simple Go application that does iCalendar files (.ics) analyzes and sends notifications by ntfy based on the events in these iCalendar files.
## Prerequisites ## Prerequisites
Before you begin, ensure you have the following installed: Before you begin, ensure you have the following installed:
- [Docker](https://docs.docker.com/get-docker/) - [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/) - [Docker Compose](https://docs.docker.com/compose/install/)
## Getting Started ## Getting Started
1. **Clone the repository:** 1. **Clone the repository:**
```bash ```bash
git clone https://code.brothertec.eu/simono41/go-ical-ntfy-reminder.git git clone https://code.brothertec.eu/simono41/go-ical-ntfy-reminder.git
``` ```
2. **Create an environment variables file:** 2. **Create an environment variables file:**
Create a file named `.env` in your project directory. Fill this file with the required environment variables: Create a file named `.env` in your project directory. Fill this file with the required environment variables:
```env ```env
TO_EMAIL=recipient@example.com (optional) TO_EMAIL=recipient@example.com (optional)
NTFY_AUTH=echo "Basic $(echo -n 'testuser:fakepassword' | base64)" NTFY_AUTH=echo "Basic $(echo -n 'testuser:fakepassword' | base64)"
NTFY_HOST=https://ntfy.sh/alerts NTFY_HOST=https://ntfy.sh/alerts
LOCATION=Europe/Berlin (default) LOCATION=Europe/Berlin (default)
ICS_DIR=/path/to/ics/files ICS_DIR=/path/to/ics/files
``` ```
Customize the values according to your application. Customize the values according to your application.
3. **Build and run the Docker container:** 3. **Build and run the Docker container:**
```bash ```bash
docker compose up --build docker compose up -d --build
``` ```
This command uses Docker Compose to build and run the container, loading environment variables from the `.env` file. This command uses Docker Compose to build and run the container, loading environment variables from the `.env` file.
4. **Access your application:** 4. **Access your application:**
Open your web browser and go to [http://localhost:8080](http://localhost:8080). Open your web browser and go to [http://localhost:8080](http://localhost:8080).
## Customizing the Docker Image ## Customizing the Docker Image
- If your application uses additional environment variables, add them to the `.env` file. - If your application uses additional environment variables, add them to the `.env` file.
- Customize the Dockerfile or docker-compose.yml if needed. - Customize the Dockerfile or docker-compose.yml if needed.
## Running as a Cronjob ## Running as a Cronjob
To run your application as a daily cronjob at 6 AM, add the following cronjob entry: To run your application as a daily cronjob at 6 AM, add the following cronjob entry:
```cron ```cron
0 6 * * * docker compose -f /opt/containers/mail-reminder/docker-compose.yml up --build --exit-code-from go-app 0 6 * * * docker compose -f /opt/containers/mail-reminder/docker-compose.yml up --build --exit-code-from go-app
``` ```
This cronjob will execute the Docker Compose command daily at 6 AM. This cronjob will execute the Docker Compose command daily at 6 AM.
## Contributing ## Contributing
If you'd like to contribute, please fork the repository and create a pull request. Feel free to open an issue if you encounter any problems or have suggestions. If you'd like to contribute, please fork the repository and create a pull request. Feel free to open an issue if you encounter any problems or have suggestions.
## License ## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.