forgejo-app/start.sh

30 lines
979 B
Bash
Raw Normal View History

2015-04-26 19:45:32 +00:00
#!/bin/bash
set -eu -o pipefail
2015-04-29 00:12:16 +00:00
fqdn=$(hostname -f)
2015-04-26 19:45:32 +00:00
2015-04-29 00:12:16 +00:00
mkdir -p /home/cloudron/gogs/custom/conf
sed -e "s/##HOSTNAME/${fqdn}/g" \
-e "s/##SSH_PORT/${SSH_PORT}/g" \
-e "s/##MYSQL_HOST/${MYSQL_HOST}/g" \
-e "s/##MYSQL_PORT/${MYSQL_PORT}/g" \
-e "s/##MYSQL_USERNAME/${MYSQL_USERNAME}/g" \
-e "s/##MYSQL_PASSWORD/${MYSQL_PASSWORD}/g" \
-e "s/##MYSQL_DATABASE/${MYSQL_DATABASE}/g" \
-e "s/##MAIL_SERVER/${MAIL_SMTP_SERVER}/g" \
2015-04-29 02:29:12 +00:00
-e "s/##MAIL_PORT/${MAIL_SMTP_PORT}/g" \
2015-04-29 00:12:16 +00:00
-e "s/##MAIL_FROM/${MAIL_SMTP_USERNAME}@${MAIL_DOMAIN}/g" \
/home/cloudron/app.ini.template > "/home/cloudron/gogs/custom/conf/app.ini"
chown -R cloudron.cloudron /app/data
2015-04-29 02:29:12 +00:00
# Dockerfile changes the ownership of this file to make it writable by cloudron user
sed -e "s/^Port .*/Port ${SSH_PORT}/" \
-e "s/^#ListenAddress .*/ListenAddress 0.0.0.0/" \
-i /etc/ssh/sshd_config
/usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gogs
2015-04-26 19:45:32 +00:00