From 804ce160885981834d5daa79fa58cebbd3c27046 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 24 Jun 2015 08:12:29 -0700 Subject: [PATCH] Revert oauth changes gogs implements oauth just for sign up verification --- Dockerfile | 19 +++++-------------- app.ini.template | 12 ------------ start.sh | 7 ------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76bed36..2b2a0b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,20 +6,11 @@ RUN apt-get update && \ ADD supervisor/ /etc/supervisor/conf.d/ -ENV GOPATH /home/cloudron -RUN mkdir -p /home/cloudron/gogs/ - -## TODO: use redis as well -RUN mkdir -p ${GOPATH}/src/github.com/gogits && \ - cd ${GOPATH}/src/github.com/gogits && \ - git clone https://github.com/cloudron-io/gogs.git && \ - cd gogs && \ - go get ./... && \ - go build && \ - go install && \ - mv ${GOPATH}/bin/gogs /home/cloudron/gogs/ && \ - cp -r ${GOPATH}/src/github.com/gogits/gogs/templates/ /home/cloudron/gogs/. && \ - cp -r ${GOPATH}/src/github.com/gogits/gogs/public/ /home/cloudron/gogs/. +RUN cd /tmp && \ + wget https://github.com/gogits/gogs/releases/download/v0.6.1/linux_amd64.zip && \ + unzip linux_amd64.zip -d /home/cloudron && \ + chown -R cloudron:cloudron /home/cloudron/gogs && \ + rm linux_amd64.zip ADD app.ini.template /home/cloudron/app.ini.template ADD start.sh /home/cloudron/start.sh diff --git a/app.ini.template b/app.ini.template index 733d6e4..e329f95 100644 --- a/app.ini.template +++ b/app.ini.template @@ -42,15 +42,3 @@ SECRET_KEY = ##SECRET_KEY DISABLE_REGISTRATION = false SHOW_REGISTRATION_BUTTON = false -[oauth] -ENABLED = true - -[oauth.cloudron] -ENABLED = true -CLIENT_ID = ##OAUTH_CLIENT_ID -CLIENT_SECRET = ##OAUTH_CLIENT_SECRET -SCOPES = root,profile,apps,roleAdmin,user -AUTH_URL = ##OAUTH_AUTH_URL -TOKEN_URL = ##OAUTH_TOKEN_URL -CLOUDRON_ORIGIN = ##CLOUDRON_ORIGIN - diff --git a/start.sh b/start.sh index 1b7a555..62755ed 100755 --- a/start.sh +++ b/start.sh @@ -5,8 +5,6 @@ set -eu -o pipefail fqdn=$(hostname -f) chown -R cloudron.cloudron /app/data -mkdir -p /home/cloudron/gogs/log -chown cloudron:cloudron /home/cloudron/gogs/log # Dockerfile changes the ownership of this file to make it writable by cloudron user sed -e "s/^Port .*/Port ${SSH_PORT}/" \ @@ -57,11 +55,6 @@ sed -e "s/##HOSTNAME/${fqdn}/g" \ -e "s/##MAIL_PORT/${MAIL_SMTP_PORT}/g" \ -e "s/##MAIL_FROM/${MAIL_SMTP_USERNAME}@${MAIL_DOMAIN}/g" \ -e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \ - -e "s/##OAUTH_CLIENT_ID/${OAUTH_CLIENT_ID}/g" \ - -e "s/##OAUTH_CLIENT_SECRET/${OAUTH_CLIENT_SECRET}/g" \ - -e "s,##OAUTH_AUTH_URL,${ADMIN_ORIGIN}/api/v1/oauth/dialog/authorize,g" \ - -e "s,##OAUTH_TOKEN_URL,${ADMIN_ORIGIN}/api/v1/oauth/token,g" \ - -e "s,##CLOUDRON_ORIGIN,${ADMIN_ORIGIN},g" \ /home/cloudron/app.ini.template > "/home/cloudron/gogs/custom/conf/app.ini" supervisorctl restart gogs