mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-24 01:31:51 +02:00
API_KEY
This commit is contained in:
@@ -39,6 +39,7 @@ Options can be configured through two ways :
|
|||||||
```yaml
|
```yaml
|
||||||
"CONFIG_LOCATION": location of the config.yaml file that allows setting additional environment variables (see below)
|
"CONFIG_LOCATION": location of the config.yaml file that allows setting additional environment variables (see below)
|
||||||
"DB_CONNECTION": "list(sqlite_internal|mariadb_addon|mysql|pgsql)" # Defines if you are using the built in sqlite ; the mariadb addon ; or a remote database
|
"DB_CONNECTION": "list(sqlite_internal|mariadb_addon|mysql|pgsql)" # Defines if you are using the built in sqlite ; the mariadb addon ; or a remote database
|
||||||
|
"API_KEY": 12 characters # This is your encryption key, don't lose it!
|
||||||
"DB_HOST": "CHANGEME" # only needed if using a remote database
|
"DB_HOST": "CHANGEME" # only needed if using a remote database
|
||||||
"DB_PORT": "CHANGEME" # only needed if using a remote database
|
"DB_PORT": "CHANGEME" # only needed if using a remote database
|
||||||
"DB_DATABASE": "CHANGEME" # only needed if using a remote database
|
"DB_DATABASE": "CHANGEME" # only needed if using a remote database
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"name": "Firefly iii",
|
"name": "Firefly iii",
|
||||||
"options": {
|
"options": {
|
||||||
"DB_CONNECTION": "sqlite",
|
"DB_CONNECTION": "sqlite",
|
||||||
|
"API_KEY": "CHANGEME_32_CHARS_EuC5dfn3LAPzeO",
|
||||||
"CONFIG_LOCATION": "/config/addons_config/fireflyiii/config.yaml"
|
"CONFIG_LOCATION": "/config/addons_config/fireflyiii/config.yaml"
|
||||||
},
|
},
|
||||||
"ports": {
|
"ports": {
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"CONFIG_LOCATION": "str",
|
"CONFIG_LOCATION": "str",
|
||||||
|
"API_KEY": "str(32,32)",
|
||||||
"DB_CONNECTION": "list(sqlite|mariadb_addon|remotedb)",
|
"DB_CONNECTION": "list(sqlite|mariadb_addon|remotedb)",
|
||||||
"DB_HOST": "str?",
|
"DB_HOST": "str?",
|
||||||
"DB_PORT": "str?",
|
"DB_PORT": "str?",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/env bashio
|
#!/usr/bin/env bashio
|
||||||
|
|
||||||
echo "Connecting database to /config/addons_config/firefly_iii"
|
echo "Connecting database to /config/addons_config/fireflyiii"
|
||||||
|
|
||||||
# Create directory
|
# Create directory
|
||||||
mkdir -p /config/addons_config/firefly_iii
|
mkdir -p /config/addons_config/fireflyiii
|
||||||
|
|
||||||
# Make sure permissions are right
|
# Make sure permissions are right
|
||||||
chown $(id -u):$(id -g) /config/addons_config/firefly_iii
|
chown $(id -u):$(id -g) /config/addons_config/fireflyiii
|
||||||
|
|
||||||
# Make symlink
|
# Make symlink
|
||||||
ln -snf /var/www/html/storage /config/addons_config/firefly_iii
|
ln -snf /var/www/html/storage /config/addons_config/fireflyiii
|
||||||
|
|||||||
@@ -2,17 +2,12 @@
|
|||||||
|
|
||||||
bashio::log.info "Launching app"
|
bashio::log.info "Launching app"
|
||||||
|
|
||||||
# Create API key if needed
|
# Backup API_KEY file
|
||||||
if ! bashio::fs.file_exists "/data/firefly/appkey.txt"; then
|
bashio::log.info "Backuping API_KEY to /config/addons_config/fireflyiii/API_KEY_BACKUP.txt"
|
||||||
#Command fails without appkey set, this won't be used again
|
echo "$(bashio::config 'API_KEY')" >/config/addons_config/fireflyiii/API_KEY_BACKUP.txt
|
||||||
export APP_KEY=SomeRandomStringOf32CharsExactly
|
|
||||||
bashio::log.info "Generating app key"
|
|
||||||
key=$(php /var/www/firefly/artisan key:generate --show)
|
|
||||||
echo "${key}" >/data/firefly/appkey.txt
|
|
||||||
bashio::log.info "App Key generated: ${key}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define database
|
# Define database
|
||||||
|
bashio::log.info "Defining database"
|
||||||
case $(bashio::config 'DB_CONNECTION') in
|
case $(bashio::config 'DB_CONNECTION') in
|
||||||
|
|
||||||
# Use sqlite
|
# Use sqlite
|
||||||
|
|||||||
Reference in New Issue
Block a user