1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-11 16:32:59 +00:00

improve config options for grapi (#269)

* make it possible to configure grapi through its cfg
* add test for config setting in grapi
* add volume for persistent data
* chown and add tests for dir
This commit is contained in:
Felix Bartels
2019-10-23 14:54:25 +02:00
committed by GitHub
parent bcb0926c6d
commit 5077bbd1b6
6 changed files with 46 additions and 5 deletions
+17
View File
@@ -0,0 +1,17 @@
tests:
start-service script:
command: bash -c "shopt -s expand_aliases; alias exec='echo'; . /kopano/start-service.sh && env"
exit-code: 0
stdout:
contains:
- enable_experimental_endpoints=true
config:
env:
KCCONF_GRAPI_ENABLE_EXPERIMENTAL_ENDPOINTS: true
config:
env:
DEBUG: ${DEBUG}
GRAPI_BACKEND: ${GRAPI_BACKEND}
LANG: ${LANG}
SERVICE_TO_START: ${SERVICE_TO_START}
PATH: ${PATH}
+4 -1
View File
@@ -1,7 +1,10 @@
tests:
test sending mail:
command: apt update && apt install -y swaks netbase && dockerize -wait tcp://"$KCCONF_SPOOLER_SMTP_SERVER":25 -timeout 1080s swaks --to user1@kopano.demo --server $KCCONF_SPOOLER_SMTP_SERVER
command: apt update && apt install -y swaks netbase && dockerize -wait tcp://"$KCCONF_SPOOLER_SMTP_SERVER":25 -timeout 1080s && swaks --to user1@kopano.demo --server $KCCONF_SPOOLER_SMTP_SERVER
exit-code: 0
stdout:
contains:
- "250 2.0.0 Ok: queued as"
config:
env:
+13
View File
@@ -1,7 +1,20 @@
file:
/var/lib/kopano-grapi:
exists: true
mode: "0755"
size: 4096
owner: kapi
group: kopano
filetype: directory
/var/run/kopano/grapi:
exists: true
mode: "0755"
owner: kapi
group: kopano
filetype: directory
mount:
/var/lib/kopano-grapi:
exists: true
opts:
- rw
- relatime
+8 -4
View File
@@ -22,7 +22,7 @@ ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"')
fi
done
mkdir -p /kopano/data/attachments /kopano/data/kapi-kvs /tmp/"$SERVICE_TO_START" /var/run/kopano
mkdir -p /kopano/data/attachments /kopano/data/kapi-kvs /tmp/"$SERVICE_TO_START" /var/run/kopano /var/lib/kopano-grapi
echo "Configure core service '$SERVICE_TO_START'" | ts
/usr/bin/python3 /kopano/"$SERVICE_TO_START".py
@@ -31,7 +31,8 @@ echo "Configure core service '$SERVICE_TO_START'" | ts
rm -f /var/run/kopano/"$SERVICE_TO_START".pid
echo "Set ownership" | ts
chown kopano:kopano /kopano/data/ /kopano/data/attachments
chown kopano:kopano /kopano/data/ /kopano/data/attachments
chown kapi:kopano /var/lib/kopano-grapi
# allow helper commands given by "docker-compose run"
if [ $# -gt 0 ]; then
@@ -127,6 +128,9 @@ grapi)
fi
;;
esac
sed s/\ *=\ */=/g /etc/kopano/grapi.cfg > /tmp/grapi-env
# shellcheck disable=SC2046
export $(grep -v '^#' /tmp/grapi-env | xargs -d '\n')
# cleaning up env variables
unset "${!KCCONF_@}"
# the backend option is only available in more recent versions of grapi
@@ -151,9 +155,9 @@ kapi)
-timeout 360s
fi
LC_CTYPE=en_US.UTF-8
sed -i s/\ *=\ */=/g /etc/kopano/kapid.cfg
sed s/\ *=\ */=/g /etc/kopano/kapid.cfg > /tmp/kapid-env
# shellcheck disable=SC2046
export $(grep -v '^#' /etc/kopano/kapid.cfg | xargs -d '\n')
export $(grep -v '^#' /tmp/kapid-env | xargs -d '\n')
kopano-kapid setup
# cleaning up env variables
unset "${!KCCONF_@}"