Build config.exs from config.exs.tpl
This commit is contained in:
parent
d804d339fe
commit
267626aeba
2
debian/install
vendored
2
debian/install
vendored
@ -1,2 +1,2 @@
|
||||
debian/config.exs etc/mobilizon
|
||||
debian/config.exs.tpl etc/mobilizon
|
||||
_build/prod/rel/mobilizon usr/share
|
||||
|
34
debian/postinst
vendored
34
debian/postinst
vendored
@ -10,7 +10,7 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# TODO create system user
|
||||
# Create a dedicated system user
|
||||
if ! getent passwd mobilizon >/dev/null; then
|
||||
adduser \
|
||||
--disabled-password \
|
||||
@ -23,24 +23,30 @@ case "$1" in
|
||||
mobilizon
|
||||
fi
|
||||
|
||||
# Use debconf values to initialize config.exs
|
||||
db_get mobilizon/domain_name
|
||||
sed -i "s/__DOMAIN_NAME__/${RET}/" /etc/mobilizon/config.exs
|
||||
if [ ! -f /etc/mobilizon/config.exs ]; then
|
||||
# Use debconf values to initialize config.exs
|
||||
cp /etc/mobilizon/config.exs.tpl /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/listen_port
|
||||
sed -i "s/__LISTEN_PORT__/${RET}/" /etc/mobilizon/config.exs
|
||||
db_get mobilizon/domain_name
|
||||
sed -i "s/__DOMAIN_NAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/db_host
|
||||
sed -i "s/__DB_HOST__/${RET}/" /etc/mobilizon/config.exs
|
||||
db_get mobilizon/listen_port
|
||||
sed -i "s/__LISTEN_PORT__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/db_name
|
||||
sed -i "s/__DB_NAME__/${RET}/" /etc/mobilizon/config.exs
|
||||
db_get mobilizon/db_host
|
||||
sed -i "s/__DB_HOST__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/db_username
|
||||
sed -i "s/__DB_USERNAME__/${RET}/" /etc/mobilizon/config.exs
|
||||
db_get mobilizon/db_name
|
||||
sed -i "s/__DB_NAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/db_userpass
|
||||
sed -i "s/__DB_USERPASS__/${RET}/" /etc/mobilizon/config.exs
|
||||
db_get mobilizon/db_username
|
||||
sed -i "s/__DB_USERNAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
db_get mobilizon/db_userpass
|
||||
sed -i "s/__DB_USERPASS__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||
|
||||
mv /etc/mobilizon/config.exs.tmp /etc/mobilizon/config.exs
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user