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
|
_build/prod/rel/mobilizon usr/share
|
||||||
|
20
debian/postinst
vendored
20
debian/postinst
vendored
@ -10,7 +10,7 @@ set -e
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
# TODO create system user
|
# Create a dedicated system user
|
||||||
if ! getent passwd mobilizon >/dev/null; then
|
if ! getent passwd mobilizon >/dev/null; then
|
||||||
adduser \
|
adduser \
|
||||||
--disabled-password \
|
--disabled-password \
|
||||||
@ -23,24 +23,30 @@ case "$1" in
|
|||||||
mobilizon
|
mobilizon
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /etc/mobilizon/config.exs ]; then
|
||||||
# Use debconf values to initialize config.exs
|
# Use debconf values to initialize config.exs
|
||||||
|
cp /etc/mobilizon/config.exs.tpl /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/domain_name
|
db_get mobilizon/domain_name
|
||||||
sed -i "s/__DOMAIN_NAME__/${RET}/" /etc/mobilizon/config.exs
|
sed -i "s/__DOMAIN_NAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/listen_port
|
db_get mobilizon/listen_port
|
||||||
sed -i "s/__LISTEN_PORT__/${RET}/" /etc/mobilizon/config.exs
|
sed -i "s/__LISTEN_PORT__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/db_host
|
db_get mobilizon/db_host
|
||||||
sed -i "s/__DB_HOST__/${RET}/" /etc/mobilizon/config.exs
|
sed -i "s/__DB_HOST__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/db_name
|
db_get mobilizon/db_name
|
||||||
sed -i "s/__DB_NAME__/${RET}/" /etc/mobilizon/config.exs
|
sed -i "s/__DB_NAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/db_username
|
db_get mobilizon/db_username
|
||||||
sed -i "s/__DB_USERNAME__/${RET}/" /etc/mobilizon/config.exs
|
sed -i "s/__DB_USERNAME__/${RET}/" /etc/mobilizon/config.exs.tmp
|
||||||
|
|
||||||
db_get mobilizon/db_userpass
|
db_get mobilizon/db_userpass
|
||||||
sed -i "s/__DB_USERPASS__/${RET}/" /etc/mobilizon/config.exs
|
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