Revert oauth changes

gogs implements oauth just for sign up verification
This commit is contained in:
Girish Ramakrishnan 2015-06-24 08:12:29 -07:00
parent 59b2ce400a
commit 804ce16088
3 changed files with 5 additions and 33 deletions

View file

@ -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

View file

@ -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

View file

@ -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