diff --git a/.env.example b/.env.example index 1f95edc..78ccf9e 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,5 @@ EVE_SSO_SECRET=Secret Key EVE_SSO_CALLBACK_URL=Callback URL (This should be the domain you are hosting at or if run locally it should be http://localhost:3000) NEXT_PUBLIC_PRAISAL_URL=https://praisal.avanto.tk/appraisal/structured.json?persist=no SENTRY_AUTH_TOKEN=Sentry token for error reporting. -LOG_LEVEL=warn \ No newline at end of file +LOG_LEVEL=warn +WEBHOOK_URL=Webhook URL \ No newline at end of file diff --git a/README.md b/README.md index 72d34e1..c1e40a6 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Features: - Backup to download characters to a file - Rstore from a file. Must be from the same instance! - View the 3D render of the planet with your PI setup by clicking the planet +- Webhook notifications for extractor expiry, storage capacity, and launch pad capacity ## Support with hosting @@ -65,6 +66,7 @@ You will need these env variables from the application settings: EVE_SSO_CLIENT_ID=Client ID EVE_SSO_SECRET=Secret Key EVE_SSO_CALLBACK_URL=Callback URL (This should be the domain you are hosting at or if run locally it should be http://localhost:3000) +WEBHOOK_URL=Discord webhook URL for notifications (optional) ``` ## Run locally @@ -72,6 +74,25 @@ EVE_SSO_CALLBACK_URL=Callback URL (This should be the domain you are hosting at 1. Create .env file in the directory root and populate with env variables you get from the EVE app you created. Example env file: .env.example 2. run `npm run dev` +## Webhook Notifications + +The application supports webhook notifications for various PI events: + +- **Extractor expiry warnings**: Notify when extractors are about to run out (configurable hours before expiry) +- **Extractor expired**: Notify when extractors have run out +- **Storage capacity warnings**: Notify when storage is about to be full (configurable percentage) +- **Storage full**: Notify when storage is at 100% capacity +- **Launch pad capacity warnings**: Notify when launch pads are about to be full (configurable percentage) +- **Launch pad full**: Notify when launch pads are at 100% capacity + +To enable webhook notifications: + +1. Set the `WEBHOOK_URL` environment variable to your Discord webhook URL +2. Enable webhook notifications in the Settings dialog +3. Configure warning thresholds for extractors, storage, and launch pads + +The webhook URL is kept secure in environment variables and not stored in the browser. + ## Run the container 1. Populate the environment variables in .env file diff --git a/compose.yml b/compose.yml index 6fce319..4578f51 100644 --- a/compose.yml +++ b/compose.yml @@ -8,6 +8,7 @@ services: - EVE_SSO_SECRET=${EVE_SSO_SECRET} - NEXT_PUBLIC_PRAISAL_URL=${NEXT_PUBLIC_PRAISAL_URL} - SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} + - WEBHOOK_URL=${WEBHOOK_URL} - LOG_LEVEL=warn ports: - 3000:3000