Merge pull request #2230 from alexbelgium/codex/fix-issue-with-hassio-addons

Restore epicgamesfree config.json template
This commit is contained in:
Alexandre
2025-11-23 15:16:27 +00:00
committed by GitHub
6 changed files with 148 additions and 104 deletions

View File

@@ -1,4 +1,7 @@
## debian-2025-11-18 (2025-11-18)
- Restore the default configuration template to config.json with the expected sample values
## debian-2025-11-16 (2025-11-16) ## debian-2025-11-16 (2025-11-16)
- Update to latest version from charlocharlie/epicgames-freegames - Update to latest version from charlocharlie/epicgames-freegames
## "debian-2025-11-09" (09-11-2025) ## "debian-2025-11-09" (09-11-2025)

View File

@@ -28,13 +28,13 @@ This addon is based on the docker image https://hub.docker.com/r/charlocharlie/e
## Configuration ## Configuration
Addon options expose the `env_vars` field for passing extra environment variables; all other configuration is done via JSON files. Addon options expose the `env_vars` field for passing extra environment variables; all other configuration is done via the JSON file.
### Configuration Files ### Configuration Files
Configuration files are stored in `/config/addons_config/epicgamesfree/`: Configuration files are stored in `/config/addons_config/epicgamesfree/`:
- **config.yaml**: Main configuration file - **config.json**: Main configuration file
- **cookies.json**: Authentication cookies (optional) - **cookies.json**: Authentication cookies (optional)
If these files don't exist, they will be created at first boot with default settings. If these files don't exist, they will be created at first boot with default settings.
@@ -43,23 +43,26 @@ If these files don't exist, they will be created at first boot with default sett
### Basic Configuration ### Basic Configuration
Create `/config/addons_config/epicgamesfree/config.yaml`: Create `/config/addons_config/epicgamesfree/config.json`:
```json ```json
{ {
"runOnStartup": true,
"cronSchedule": "0 */6 * * *",
"logLevel": "info",
"webPortalConfig": {
"baseUrl": "https://epic.example.com"
},
"accounts": [ "accounts": [
{ {
"email": "your-epic-email@example.com", "email": "your-epic-email@example.com",
"password": "your-password", "password": "your-password",
"totp": "OPTIONAL_2FA_SECRET" "totp": "OPTIONAL_2FA_SECRET"
} }
], ],
"intervalHours": 24, "notifiers": [
"onlyWeekly": false, {
"searchStrategy": "purchase", "type": "email",
"browserNavigationTimeout": 300000,
"notifications": {
"email": {
"smtpHost": "smtp.gmail.com", "smtpHost": "smtp.gmail.com",
"smtpPort": 587, "smtpPort": 587,
"emailSenderAddress": "notifications@example.com", "emailSenderAddress": "notifications@example.com",
@@ -71,7 +74,7 @@ Create `/config/addons_config/epicgamesfree/config.yaml`:
"pass": "your-app-password" "pass": "your-app-password"
} }
} }
} ]
} }
``` ```
@@ -80,51 +83,52 @@ Create `/config/addons_config/epicgamesfree/config.yaml`:
| Option | Type | Description | | Option | Type | Description |
|--------|------|-------------| |--------|------|-------------|
| `accounts` | array | List of Epic Games accounts | | `accounts` | array | List of Epic Games accounts |
| `intervalHours` | number | Check interval in hours (default: 24) | | `cronSchedule` | string | Cron schedule to claim games (default: `0 */6 * * *`) |
| `onlyWeekly` | boolean | Only claim weekly free games | | `runOnStartup` | boolean | Run a claim cycle when the add-on starts |
| `searchStrategy` | string | Search strategy: "purchase" or "claim" | | `logLevel` | string | Application log level |
| `browserNavigationTimeout` | number | Browser timeout in milliseconds | | `webPortalConfig.baseUrl` | string | Base URL used by the included web portal |
| `notifications` | object | Notification settings (email, webhook, etc.) | | `notifiers` | array | Notification targets such as email, Discord, Telegram, Apprise, etc. |
### Account Configuration ### Account Configuration
For each account in the `accounts` array: For each account in the `accounts` array:
```json ```yaml
{ email: account@example.com
"email": "account@example.com", password: password
"password": "password", totp: TOTP_SECRET
"totp": "TOTP_SECRET", onlyWeekly: true
"onlyWeekly": true
}
``` ```
### Notification Methods ### Notification Methods
#### Email Notifications #### Email Notifications
```json ```yaml
"notifications": { notifications:
"email": { email:
"smtpHost": "smtp.gmail.com", smtpHost: smtp.gmail.com
"smtpPort": 587, smtpPort: 587
"emailSenderAddress": "sender@example.com", emailSenderAddress: sender@example.com
"emailRecipientAddress": "recipient@example.com", emailRecipientAddress: recipient@example.com
"secure": false, secure: false
"auth": { auth:
"user": "sender@example.com", user: sender@example.com
"pass": "app-password" pass: app-password
}
}
}
``` ```
#### Webhook Notifications #### Webhook Notifications
```json ```json
"notifications": { {
"webhook": { "notifiers": [
"url": "https://your-webhook-url.com", {
"events": ["purchase-success", "already-owned"] "type": "webhook",
} "url": "https://your-webhook-url.com",
"events": [
"purchase-success",
"already-owned"
]
}
]
} }
``` ```
@@ -144,9 +148,11 @@ For detailed cookie import instructions, see: https://github.com/claabs/epicgame
### Troubleshooting ### Troubleshooting
#### Timeout Errors #### Timeout Errors
Add the following to your config.yaml: Add the following to your config.json:
```json ```json
"browserNavigationTimeout": 300000 {
"browserNavigationTimeout": 300000
}
``` ```
#### Login Issues #### Login Issues
@@ -172,7 +178,7 @@ The installation of this add-on is pretty straightforward and not different in c
### Timeout error ### Timeout error
Please try adding `"browserNavigationTimeout": 300000,` to your config.yaml (https://github.com/alexbelgium/hassio-addons/issues/675#issuecomment-1407675351) Please try adding `"browserNavigationTimeout": 300000,` to your config.json (https://github.com/alexbelgium/hassio-addons/issues/675#issuecomment-1407675351)
### Other errors ### Other errors

View File

@@ -86,5 +86,5 @@ schema:
slug: epicgamesfree slug: epicgamesfree
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons url: https://github.com/alexbelgium/hassio-addons
version: "debian-2025-11-16" version: "debian-2025-11-18"
webui: "[PROTO:ssl]://[HOST]:[PORT:3000]" webui: "[PROTO:ssl]://[HOST]:[PORT:3000]"

View File

@@ -7,15 +7,22 @@ set -e
############## ##############
HOME="/config/addons_config/epicgamesfree" HOME="/config/addons_config/epicgamesfree"
if [ ! -f "$HOME"/config.json ]; then CONFIG_JSON="$HOME/config.json"
# Copy default config.json LEGACY_YAML="$HOME/config.yaml"
cp /templates/config.json "$HOME"/config.json
chmod 755 "$HOME"/config.json if [ ! -f "$CONFIG_JSON" ]; then
bashio::log.warning "A default config.json file was copied in $HOME. Please customize according to https://github.com/claabs/epicgames-freegames-node#json-configuration and restart the add-on" if [ -f "$LEGACY_YAML" ]; then
sleep 5 bashio::log.warning "A config.yaml file was found but the add-on expects config.json. Please convert your configuration to JSON as documented upstream."
bashio::exit.nok else
# Copy default config.json
cp /templates/config.json "$CONFIG_JSON"
chmod 755 "$CONFIG_JSON"
bashio::log.warning "A default config.json file was copied in $HOME. Please customize according to https://github.com/claabs/epicgames-freegames-node#configuration and restart the add-on"
sleep 5
bashio::exit.nok
fi
else else
bashio::log.warning "The config.json file found in $HOME will be used. Please customize according to https://github.com/claabs/epicgames-freegames-node#json-configuration and restart the add-on" bashio::log.warning "The config.json file found in $HOME will be used. Please customize according to https://github.com/claabs/epicgames-freegames-node#configuration and restart the add-on"
fi fi
# Permissions # Permissions

View File

@@ -0,0 +1,78 @@
{
"runOnStartup":true,
"cronSchedule":"0 */6 * * *",
"logLevel":"info",
"webPortalConfig":{
"baseUrl":"https://epic.example.com"
},
"accounts":[
{
"email":"example@gmail.com"
}
],
"notifiers":[
{
"type":"email",
"smtpHost":"smtp.gmail.com",
"smtpPort":587,
"emailSenderAddress":"hello@gmail.com",
"emailSenderName":"Epic Games Captchas",
"emailRecipientAddress":"hello@gmail.com",
"secure":false,
"auth":{
"user":"hello@gmail.com",
"pass":"abc123"
}
},
{
"type":"discord",
"webhookUrl":"https://discord.com/api/webhooks/123456789123456789/A-abcdefghijklmn-abcdefghijklmnopqrst12345678-abcdefghijklmnop123456",
"mentionedUsers":[
"914360712086843432"
],
"mentionedRoles":[
"734548250895319070"
]
},
{
"type":"telegram",
"apiUrl":"https://api.telegram.org",
"token":"644739147:AAGMPo-Jz3mKRnHRTnrPEDi7jUF1vqNOD5k",
"chatId":"-987654321"
},
{
"type":"apprise",
"apiUrl":"http://192.168.1.2:8000",
"urls":"mailto://user:pass@gmail.com"
},
{
"type":"pushover",
"token":"a172fyyl9gw99p2xi16tq8hnib48p2",
"userKey":"uvgidym7l5ggpwu2r8i1oy6diaapll"
},
{
"type":"gotify",
"apiUrl":"https://gotify.net",
"token":"SnL-wAvmfo_QT"
},
{
"type":"homeassistant",
"instance":"https://homeassistant.example.com",
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"notifyservice":"mobile_app_smartphone_name"
},
{
"type":"bark",
"key":"xxxxxxxxxxxxxxxxxxxxxx",
"title":"epicgames-freegames",
"group":"epicgames-freegames",
"apiUrl":"https://api.day.app"
},
{
"type":"ntfy",
"webhookUrl":"https://ntfy.example.com/mytopic",
"priority":"urgent",
"token":"tk_mytoken"
}
]
}

View File

@@ -1,50 +0,0 @@
runOnStartup: true
cronSchedule: 0 */6 * * *
logLevel: info
webPortalConfig:
baseUrl: https://epic.example.com
accounts:
- email: example@gmail.com
notifiers:
- type: email
smtpHost: smtp.gmail.com
smtpPort: 587
emailSenderAddress: hello@gmail.com
emailSenderName: Epic Games Captchas
emailRecipientAddress: hello@gmail.com
secure: false
auth:
user: hello@gmail.com
pass: abc123
- type: discord
webhookUrl: https://discord.com/api/webhooks/123456789123456789/A-abcdefghijklmn-abcdefghijklmnopqrst12345678-abcdefghijklmnop123456
mentionedUsers:
- "914360712086843432"
mentionedRoles:
- "734548250895319070"
- type: telegram
apiUrl: https://api.telegram.org
token: 644739147:AAGMPo-Jz3mKRnHRTnrPEDi7jUF1vqNOD5k
chatId: "-987654321"
- type: apprise
apiUrl: http://192.168.1.2:8000
urls: mailto://user:pass@gmail.com
- type: pushover
token: a172fyyl9gw99p2xi16tq8hnib48p2
userKey: uvgidym7l5ggpwu2r8i1oy6diaapll
- type: gotify
apiUrl: https://gotify.net
token: SnL-wAvmfo_QT
- type: homeassistant
instance: https://homeassistant.example.com
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
notifyservice: mobile_app_smartphone_name
- type: bark
key: xxxxxxxxxxxxxxxxxxxxxx
title: epicgames-freegames
group: epicgames-freegames
apiUrl: https://api.day.app
- type: ntfy
webhookUrl: https://ntfy.example.com/mytopic
priority: urgent
token: tk_mytoken