gitサーバ
url /mydom.com/git/ でgogsが動作するようにインストールする
gitユーザ
sudo adduser --disabled-login --gecos 'Gogs' git #gitユーザに変更 sudo su - git
ubuntuでbinaryインストール
#gitユーザで実行 unzip /home/git/gogs-xxxxxxxx.zip mkdir /home/git/repos
一旦localhost:3000を/(root)に設定する
#sites-enabled/git.conf <location /> ProxyPass http://localhost:3000/ ProxyPassReverse http://localhost:3000/ </location>
ブラウザでmydom.com/に接続して/installページで設定しインストールを行う。 その際urlをmydom.com/git/とする。その後再度proxy設定を行う。
#sites-enabled/git.conf <location /git/> ProxyPass http://localhost:3000/ ProxyPassReverse http://localhost:3000/ </location>
ヘッダメニューの“エクスプローラ”を非表示にするため 該当箇所を下記のようにIf.IsLoggedの判定を追加し、ログインしないと表示できないようにする
{{If .IsLogged}} <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubURL}}/explore/repos">....</a> {{end}}
<div class="ui user list"> {{If .IsLogged}}
systemdに登録するには、インストールした
backup_gogs.sh
cd /my/gogs tar -zcvf ./gogsrepos.tgz ./repos