Restore config.json template for epicgamesfree

This commit is contained in:
Alexandre
2025-11-23 15:14:34 +00:00
parent 818cd564e0
commit 966758bf74
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)
- Update to latest version from charlocharlie/epicgames-freegames
## "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
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 are stored in `/config/addons_config/epicgamesfree/`:
- **config.yaml**: Main configuration file
- **config.json**: Main configuration file
- **cookies.json**: Authentication cookies (optional)
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
Create `/config/addons_config/epicgamesfree/config.yaml`:
Create `/config/addons_config/epicgamesfree/config.json`:
```json
{
"runOnStartup": true,
"cronSchedule": "0 */6 * * *",
"logLevel": "info",
"webPortalConfig": {
"baseUrl": "https://epic.example.com"
},
"accounts": [
{
"email": "your-epic-email@example.com",
"email": "your-epic-email@example.com",
"password": "your-password",
"totp": "OPTIONAL_2FA_SECRET"
}
],
"intervalHours": 24,
"onlyWeekly": false,
"searchStrategy": "purchase",
"browserNavigationTimeout": 300000,
"notifications": {
"email": {
"notifiers": [
{
"type": "email",
"smtpHost": "smtp.gmail.com",
"smtpPort": 587,
"emailSenderAddress": "notifications@example.com",
@@ -71,7 +74,7 @@ Create `/config/addons_config/epicgamesfree/config.yaml`:
"pass": "your-app-password"
}
}
}
]
}
```
@@ -80,51 +83,52 @@ Create `/config/addons_config/epicgamesfree/config.yaml`:
| Option | Type | Description |
|--------|------|-------------|
| `accounts` | array | List of Epic Games accounts |
| `intervalHours` | number | Check interval in hours (default: 24) |
| `onlyWeekly` | boolean | Only claim weekly free games |
| `searchStrategy` | string | Search strategy: "purchase" or "claim" |
| `browserNavigationTimeout` | number | Browser timeout in milliseconds |
| `notifications` | object | Notification settings (email, webhook, etc.) |
| `cronSchedule` | string | Cron schedule to claim games (default: `0 */6 * * *`) |
| `runOnStartup` | boolean | Run a claim cycle when the add-on starts |
| `logLevel` | string | Application log level |
| `webPortalConfig.baseUrl` | string | Base URL used by the included web portal |
| `notifiers` | array | Notification targets such as email, Discord, Telegram, Apprise, etc. |
### Account Configuration
For each account in the `accounts` array:
```json
{
"email": "account@example.com",
"password": "password",
"totp": "TOTP_SECRET",
"onlyWeekly": true
}
```yaml
email: account@example.com
password: password
totp: TOTP_SECRET
onlyWeekly: true
```
### Notification Methods
#### Email Notifications
```json
"notifications": {
"email": {
"smtpHost": "smtp.gmail.com",
"smtpPort": 587,
"emailSenderAddress": "sender@example.com",
"emailRecipientAddress": "recipient@example.com",
"secure": false,
"auth": {
"user": "sender@example.com",
"pass": "app-password"
}
}
}
```yaml
notifications:
email:
smtpHost: smtp.gmail.com
smtpPort: 587
emailSenderAddress: sender@example.com
emailRecipientAddress: recipient@example.com
secure: false
auth:
user: sender@example.com
pass: app-password
```
#### Webhook Notifications
```json
"notifications": {
"webhook": {
"url": "https://your-webhook-url.com",
"events": ["purchase-success", "already-owned"]
}
{
"notifiers": [
{
"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
#### Timeout Errors
Add the following to your config.yaml:
Add the following to your config.json:
```json
"browserNavigationTimeout": 300000
{
"browserNavigationTimeout": 300000
}
```
#### Login Issues
@@ -172,7 +178,7 @@ The installation of this add-on is pretty straightforward and not different in c
### 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

View File

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

View File

@@ -7,15 +7,22 @@ set -e
##############
HOME="/config/addons_config/epicgamesfree"
if [ ! -f "$HOME"/config.json ]; then
# Copy default config.json
cp /templates/config.json "$HOME"/config.json
chmod 755 "$HOME"/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#json-configuration and restart the add-on"
sleep 5
bashio::exit.nok
CONFIG_JSON="$HOME/config.json"
LEGACY_YAML="$HOME/config.yaml"
if [ ! -f "$CONFIG_JSON" ]; then
if [ -f "$LEGACY_YAML" ]; then
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."
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
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
# 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