From 1431511b73458411196bfbfb4d86c1e8f6321800 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 12 May 2016 15:17:37 +0100 Subject: [PATCH] Improve gogs config --- src/freedombone | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/freedombone b/src/freedombone index a2ebfc79..4d8581f7 100755 --- a/src/freedombone +++ b/src/freedombone @@ -6710,10 +6710,11 @@ function install_gogs { fi # create the configuration - if [ ! -d /home/git/go/src/github.com/gogits/gogs/custom/conf ]; then - mkdir -p /home/git/go/src/github.com/gogits/gogs/custom/conf + GOGS_CONFIG_PATH=/home/git/gvm/pkgsets/go${GO_VERSION}/global/src/github.com/gogits/gogs/custom/conf + if [ ! -d $GOGS_CONFIG_PATH ]; then + mkdir -p $GOGS_CONFIG_PATH fi - GOGS_CONFIG_FILE=/home/git/go/src/github.com/gogits/gogs/custom/conf/app.ini + GOGS_CONFIG_FILE=$GOGS_CONFIG_PATH/app.ini echo 'RUN_USER = git' > $GOGS_CONFIG_FILE echo 'RUN_MODE = prod' >> $GOGS_CONFIG_FILE echo '' >> $GOGS_CONFIG_FILE @@ -6730,10 +6731,18 @@ function install_gogs { echo 'ROOT = /home/git/gogs-repositories' >> $GOGS_CONFIG_FILE echo '' >> $GOGS_CONFIG_FILE echo '[server]' >> $GOGS_CONFIG_FILE - echo 'DOMAIN = coder.uk.to' >> $GOGS_CONFIG_FILE + if [[ $ONION_ONLY == 'no' ]]; then + echo "DOMAIN = ${GIT_DOMAIN_NAME}" >> $GOGS_CONFIG_FILE + else + echo "DOMAIN = ${GIT_ONION_HOSTNAME}" >> $GOGS_CONFIG_FILE + fi echo 'HTTP_PORT = 3000' >> $GOGS_CONFIG_FILE echo "ROOT_URL = http://$GIT_DOMAIN_NAME/" >> $GOGS_CONFIG_FILE echo "SSH_PORT = $SSH_PORT" >> $GOGS_CONFIG_FILE + echo 'SSH_DOMAIN = %(DOMAIN)s' >> $GOGS_CONFIG_FILE + echo "CERT_FILE = /etc/ssl/certs/${GIT_DOMAIN_NAME}.crt" >> $GOGS_CONFIG_FILE + echo "KEY_FILE = /etc/ssl/private/${GIT_DOMAIN_NAME}.key" >> $GOGS_CONFIG_FILE + echo 'DISABLE_ROUTER_LOG = true' >> $GOGS_CONFIG_FILE echo '' >> $GOGS_CONFIG_FILE echo '[session]' >> $GOGS_CONFIG_FILE echo 'PROVIDER = file' >> $GOGS_CONFIG_FILE @@ -6748,8 +6757,10 @@ function install_gogs { echo '' >> $GOGS_CONFIG_FILE echo '[service]' >> $GOGS_CONFIG_FILE echo 'DISABLE_REGISTRATION = false' >> $GOGS_CONFIG_FILE + echo 'SHOW_REGISTRATION_BUTTON = true' >> $GOGS_CONFIG_FILE + echo 'REQUIRE_SIGNIN_VIEW = false' >> $GOGS_CONFIG_FILE + echo 'ENABLE_CAPTCHA = false' >> $GOGS_CONFIG_FILE - #cp -r /home/git/go/src/github.com/gogits/gogs/custom /home/git/gvm/pkgsets/go${GO_VERSION}/global/src/github.com/gogits/gogs chmod 750 $GOGS_CONFIG_FILE chown -R git:git /home/git