mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-03 16:00:29 +01:00
API_KEY
This commit is contained in:
@@ -39,6 +39,7 @@ Options can be configured through two ways :
|
||||
```yaml
|
||||
"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
|
||||
"API_KEY": 12 characters # This is your encryption key, don't lose it!
|
||||
"DB_HOST": "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
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"name": "Firefly iii",
|
||||
"options": {
|
||||
"DB_CONNECTION": "sqlite",
|
||||
"API_KEY": "CHANGEME_32_CHARS_EuC5dfn3LAPzeO",
|
||||
"CONFIG_LOCATION": "/config/addons_config/fireflyiii/config.yaml"
|
||||
},
|
||||
"ports": {
|
||||
@@ -21,6 +22,7 @@
|
||||
},
|
||||
"schema": {
|
||||
"CONFIG_LOCATION": "str",
|
||||
"API_KEY": "str(32,32)",
|
||||
"DB_CONNECTION": "list(sqlite|mariadb_addon|remotedb)",
|
||||
"DB_HOST": "str?",
|
||||
"DB_PORT": "str?",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bashio
|
||||
|
||||
echo "Connecting database to /config/addons_config/firefly_iii"
|
||||
echo "Connecting database to /config/addons_config/fireflyiii"
|
||||
|
||||
# Create directory
|
||||
mkdir -p /config/addons_config/firefly_iii
|
||||
mkdir -p /config/addons_config/fireflyiii
|
||||
|
||||
# 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
|
||||
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"
|
||||
|
||||
# Create API key if needed
|
||||
if ! bashio::fs.file_exists "/data/firefly/appkey.txt"; then
|
||||
#Command fails without appkey set, this won't be used again
|
||||
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
|
||||
# Backup API_KEY file
|
||||
bashio::log.info "Backuping API_KEY to /config/addons_config/fireflyiii/API_KEY_BACKUP.txt"
|
||||
echo "$(bashio::config 'API_KEY')" >/config/addons_config/fireflyiii/API_KEY_BACKUP.txt
|
||||
|
||||
# Define database
|
||||
bashio::log.info "Defining database"
|
||||
case $(bashio::config 'DB_CONNECTION') in
|
||||
|
||||
# Use sqlite
|
||||
|
||||
Reference in New Issue
Block a user