start.sh 979 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. set -eu -o pipefail
  3. fqdn=$(hostname -f)
  4. mkdir -p /home/cloudron/gogs/custom/conf
  5. sed -e "s/##HOSTNAME/${fqdn}/g" \
  6. -e "s/##SSH_PORT/${SSH_PORT}/g" \
  7. -e "s/##MYSQL_HOST/${MYSQL_HOST}/g" \
  8. -e "s/##MYSQL_PORT/${MYSQL_PORT}/g" \
  9. -e "s/##MYSQL_USERNAME/${MYSQL_USERNAME}/g" \
  10. -e "s/##MYSQL_PASSWORD/${MYSQL_PASSWORD}/g" \
  11. -e "s/##MYSQL_DATABASE/${MYSQL_DATABASE}/g" \
  12. -e "s/##MAIL_SERVER/${MAIL_SMTP_SERVER}/g" \
  13. -e "s/##MAIL_PORT/${MAIL_SMTP_PORT}/g" \
  14. -e "s/##MAIL_FROM/${MAIL_SMTP_USERNAME}@${MAIL_DOMAIN}/g" \
  15. /home/cloudron/app.ini.template > "/home/cloudron/gogs/custom/conf/app.ini"
  16. chown -R cloudron.cloudron /app/data
  17. # Dockerfile changes the ownership of this file to make it writable by cloudron user
  18. sed -e "s/^Port .*/Port ${SSH_PORT}/" \
  19. -e "s/^#ListenAddress .*/ListenAddress 0.0.0.0/" \
  20. -i /etc/ssh/sshd_config
  21. /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gogs