[Config] Add API_KEY_READ_ONLY

This commit is contained in:
andryyy
2020-04-11 20:57:35 +02:00
parent 4efc35abde
commit 5e5642148c
3 changed files with 14 additions and 3 deletions

View File

@@ -185,6 +185,7 @@ CONFIG_ARRAY=(
"COMPOSE_PROJECT_NAME"
"SQL_PORT"
"API_KEY"
"API_KEY_READ_ONLY"
"API_ALLOW_FROM"
"MAILDIR_GC_TIME"
"MAILDIR_SUB"
@@ -250,6 +251,12 @@ for option in ${CONFIG_ARRAY[@]}; do
echo '# Create or override API key for web UI' >> mailcow.conf
echo "#API_KEY=" >> mailcow.conf
fi
elif [[ ${option} == "API_KEY_READ_ONLY" ]]; then
if ! grep -q ${option} mailcow.conf; then
echo "Adding new option \"${option}\" to mailcow.conf"
echo '# Create or override read-only API key for web UI' >> mailcow.conf
echo "#API_KEY_READ_ONLY=" >> mailcow.conf
fi
elif [[ ${option} == "API_ALLOW_FROM" ]]; then
if ! grep -q ${option} mailcow.conf; then
echo "Adding new option \"${option}\" to mailcow.conf"