|
@@ -55,24 +55,42 @@ sed -e "s/^Port .*/Port ${SSH_PORT}/" \
|
|
-e "s,^HostKey /etc/ssh/,HostKey /app/data/sshd/," \
|
|
-e "s,^HostKey /etc/ssh/,HostKey /app/data/sshd/," \
|
|
/etc/ssh/sshd_config > /run/gogs/sshd_config
|
|
/etc/ssh/sshd_config > /run/gogs/sshd_config
|
|
|
|
|
|
-sed -e "s/##DOMAIN/${APP_DOMAIN}/g" \
|
|
|
|
- -e "s/##SSH_PORT/${SSH_PORT}/g" \
|
|
|
|
- -e "s/##DISABLE_SSH/${disable_ssh}/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" \
|
|
|
|
- -e "s/##MAIL_PORT/${MAIL_SMTP_PORT}/g" \
|
|
|
|
- -e "s/##MAIL_FROM/${MAIL_FROM}/g" \
|
|
|
|
- -e "s/##MAIL_SMTP_USERNAME/${MAIL_SMTP_USERNAME}/g" \
|
|
|
|
- -e "s/##MAIL_SMTP_PASSWORD/${MAIL_SMTP_PASSWORD}/g" \
|
|
|
|
- -e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \
|
|
|
|
- /home/git/app.ini.template > "/run/gogs/app.ini"
|
|
|
|
-
|
|
|
|
-# merge any user config file
|
|
|
|
-[[ -f /app/data/app.ini ]] && cat "/app/data/app.ini" >> "/run/gogs/app.ini"
|
|
|
|
|
|
+cp /home/git/app.ini.template "/run/gogs/app.ini"
|
|
|
|
+
|
|
|
|
+# create default user config file
|
|
|
|
+if ! [ -f /app/data/app.ini ]; then
|
|
|
|
+ cp /home/git/app.ini.template /app/data/app.ini
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+# merge user config file
|
|
|
|
+crudini --merge "/run/gogs/app.ini" < "/app/data/app.ini"
|
|
|
|
+
|
|
|
|
+# override important values
|
|
|
|
+crudini --set "/run/gogs/app.ini" database DB_TYPE mysql
|
|
|
|
+crudini --set "/run/gogs/app.ini" database HOST "${MYSQL_HOST}:${MYSQL_PORT}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" database NAME "${MYSQL_DATABASE}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" database USER "${MYSQL_USERNAME}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" database PASSWD "${MYSQL_PASSWORD}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" database SSL_MODE "disable"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server PROTOCOL "http"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server DOMAIN "${APP_DOMAIN}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server ROOT_URL "https://%(DOMAIN)s/"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server HTTP_ADDR ""
|
|
|
|
+crudini --set "/run/gogs/app.ini" server HTTP_PORT "3000"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server DISABLE_SSH "${disable_ssh}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server SSH_PORT "${SSH_PORT}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" server APP_DATA_PATH "/app/data/appdata"
|
|
|
|
+crudini --set "/run/gogs/app.ini" repository ROOT "/app/data/repository"
|
|
|
|
+crudini --set "/run/gogs/app.ini" repository.upload TEMP_PATH "/run/gogs/tmp/uploads"
|
|
|
|
+crudini --set "/run/gogs/app.ini" mailer HOST "${MAIL_SMTP_SERVER}:${MAIL_SMTP_PORT}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" mailer USER "${MAIL_SMTP_USERNAME}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" mailer PASSWD "${MAIL_SMTP_PASSWORD}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" mailer FROM "${MAIL_FROM}"
|
|
|
|
+crudini --set "/run/gogs/app.ini" mailer SKIP_VERIFY "true"
|
|
|
|
+crudini --set "/run/gogs/app.ini" security SECRET_KEY $(pwgen -1 -s)
|
|
|
|
+crudini --set "/run/gogs/app.ini" security INSTALL_LOCK "true"
|
|
|
|
+crudini --set "/run/gogs/app.ini" log MODE "console"
|
|
|
|
+crudini --set "/run/gogs/app.ini" log ROOT_PATH "/run/gogs"
|
|
|
|
|
|
mkdir -p /app/data/repository /app/data/ssh
|
|
mkdir -p /app/data/repository /app/data/ssh
|
|
|
|
|