[PHP-FPM, Config] API key generated via mailcow.conf as rw access

master
andryyy 2020-04-10 21:21:11 +02:00
parent 08d2bdd6c7
commit 730fa16a69
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
3 changed files with 3 additions and 2 deletions

View File

@ -132,7 +132,7 @@ if [[ ${API_ALLOW_FROM} != "invalid" ]] && \
if [[ ! -z ${VALIDATED_IPS} ]]; then if [[ ! -z ${VALIDATED_IPS} ]]; then
mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} << EOF mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} << EOF
DELETE FROM api; DELETE FROM api;
INSERT INTO api (api_key, active, allow_from) VALUES ("${API_KEY}", "1", "${VALIDATED_IPS}"); INSERT INTO api (api_key, active, allow_from, access) VALUES ("${API_KEY}", "1", "${VALIDATED_IPS}", "rw");
EOF EOF
fi fi
fi fi

View File

@ -102,7 +102,7 @@ services:
- rspamd - rspamd
php-fpm-mailcow: php-fpm-mailcow:
image: mailcow/phpfpm:1.58 image: mailcow/phpfpm:1.59
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0" command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
depends_on: depends_on:
- redis-mailcow - redis-mailcow

View File

@ -277,6 +277,7 @@ IPV6_NETWORK=fd4d:6169:6c63:6f77::/64
# Create or override API key for web ui # Create or override API key for web ui
# You _must_ define API_ALLOW_FROM, which is a comma separated list of IPs # You _must_ define API_ALLOW_FROM, which is a comma separated list of IPs
# The API key defined here has read-write access
# API_KEY allowed chars: a-z, A-Z, 0-9, - # API_KEY allowed chars: a-z, A-Z, 0-9, -
#API_KEY= #API_KEY=