Skip to content

Instantly share code, notes, and snippets.

@Peregrinox
Last active April 6, 2018 09:58
Show Gist options
  • Save Peregrinox/e82e80b59aac6411de9b70e3c63f009c to your computer and use it in GitHub Desktop.
Save Peregrinox/e82e80b59aac6411de9b70e3c63f009c to your computer and use it in GitHub Desktop.
Install and configuration of gogs.io

goto https://gogs.io/docs/installation/install_from_binary and choose a link for raspberry/armv6

cd /opt
sudo wget https://cdn.gogs.io/0.11.34/raspi2_armv6.zip

test if run for first time:

cd gogs
./gogs web

make custom config file:

$ sudo mkdir custom
$ sudo mkdir custom/conf
$ sudo touch custom/conf/app.ini

set git user as owner

sudo adduser --disabled-login --gecos 'Gogs' git
cd /opt/
sudo chown -R git: /opt/gogs

(see login with ssh at the end)

enable external access to your gogs app.

to enable external access through nginx, edit and append to your domain:

$ sudo nano /etc/nginx/sites-available/default
...
location /gogs/ {
    proxy_pass http://localhost:3000/;
}

and restart nginx:

$  sudo systemctl restart nginx

later, you should add

[server] ROOT_URL = http://yourdomain.org/gogs/

to your gogs configuration.

Configuration

https://gogs.io/docs/installation/configuration_and_run.html

Scripts are in the scripts directory, but execute them at the root of the repository

to change configuration run

./gogs web

and go to http://localhost:3000/install

create database gogs with scripts/mysql.sql from patch for 11.34:

https://github.com/m2nlight/gogs/releases/tag/v0.11.34_patch

SET GLOBAL innodb_file_per_table = ON,
           innodb_file_format = Barracuda,
           innodb_large_prefix = ON;
DROP DATABASE IF EXISTS gogs;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

run your gogs server and laung initial configuration:

/home/git/gogs/gogs web

https://localhost:3000

gogs Error 1071: Specified key was too long; max key length is 767 bytes

again, get patch for 11.34: https://github.com/m2nlight/gogs/releases/tag/v0.11.34_patch

create database with new script and change binary gogs with patched one.

links:

https://gogs.io/docs/advanced/configuration_cheat_sheet

https://gogs.io/docs/intro/faqs

https://gogs.io/docs/installation/configuration_and_run

login with ssh:

https://discuss.gogs.io/t/how-to-config-ssh-settings/34

http://arlimus.github.io/articles/usepam/

Last one worked for me in osmc, with the user git disabled I could not connect to anu repo with ssh link, so the correct option is to set user git with an impossible * password to disable login and mantaining the user active

sudo usermod -p "*" git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment