umbrel-apps/maybe/hooks/pre-install
Simon Green f61b89bc27
App Submission: Maybe (#1105)
Co-authored-by: nmfretz <nmfretz@gmail.com>
2024-06-25 21:42:26 -07:00

23 lines
824 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# As of 26 June 2024, self-hosted Maybe requires a Synth API key (https://synthfinance.com/) for basic multi-currency support.
# Ideally Maybe will support API key input via the UI in the future, but for now we create a persistent .env file for Advanced users to input their API key and restart Maybe.
PERSISTENT_ENV_FILE="$(dirname "${BASH_SOURCE[0]}")/../.env"
DESIRED_OWNER="1000:1000"
create_env_file() {
cat <<EOF > "${PERSISTENT_ENV_FILE}"
# Uncomment the SYNTH_API_KEY line and replace YOUR_SYNTH_API_KEY with your personal Synth API key
# SYNTH_API_KEY=YOUR_SYNTH_API_KEY
EOF
chown "${DESIRED_OWNER}" "${PERSISTENT_ENV_FILE}"
}
if [[ ! -f "${PERSISTENT_ENV_FILE}" ]]; then
echo ".env file for Maybe has not been created yet. Creating one now..."
create_env_file
fi