« Gogs » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
 
(8 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
= Links =
* [https://computingforgeeks.com/install-gogs-self-hosted-git-service-on-ubuntu/ Install Gogs Git service on Ubuntu]
= [https://gogs.io/docs/installation/configuration_and_run Configuration] =
<filebox fn='/opt/gogs/custom/conf/app.ini'>
[auth]
DISABLE_REGISTRATION        = true
REQUIRE_SIGNIN_VIEW        = true
[log]
ROOT_PATH = /var/log/gogs
</filebox>
= Install on Ubuntu =
= Install on Ubuntu =
* [https://gogs.io/docs/installation Prerequisites]
* [https://gogs.io/docs/installation Prerequisites]
Ligne 12 : Ligne 25 :


<kode lang='bash'>
<kode lang='bash'>
sudo useradd -r -m -N -s /sbin/nologin gogs
sudo useradd -r -s /sbin/nologin gogs
# -r system user without home folder
# -r system user without home folder
# -N do not create group
# -s /sbin/nologin do not allow the user to login
# -s /sbin/nologin do not allow the user to login
sudo mkdir /var/log/gogs                       
sudo chown -R gogs:gogs /var/log/gogs/
</kode>
</kode>


<filebox fn='/etc/systemd/system/gogs.service' lang='ini'>
* [https://wiki.bananeatomic.fr/wiki/Ufw#Applications_custom create an UFW application]
 
<filebox fn='/etc/systemd/system/gogs.service' lang='ini' collapsed>
[Unit]
[Unit]
Description=Gogs
Description=Gogs
Ligne 27 : Ligne 44 :
[Service]
[Service]
Type=simple
Type=simple
User=git
User=gogs
Group=git
Group=gogs
WorkingDirectory=/opt/gogs
WorkingDirectory=/opt/gogs
ExecStart=/opt/gogs web
ExecStart=/opt/gogs/gogs web
Restart=always
Restart=always
Environment=USER=git HOME=/home/git
Environment=USER=gogs HOME=/opt/gogs


# Some distributions may not support these hardening directives. If you cannot start the service due
# Some distributions may not support these hardening directives. If you cannot start the service due
Ligne 46 : Ligne 63 :


<kode lang='bash'>
<kode lang='bash'>
cd gogs
tar xf gogs_0.13.0_linux_armv8.tar.gz
./gogs web
sudo mv gogs /opt
sudo chown -R gogs:gogs /opt/gogs
sc-start gogs
# open http://servername:3000
# open http://servername:3000
</kode>
</kode>
{{info | The file {{boxx|/opt/gogs/custom/conf/app.ini}} is created.}}
<kode lang='bash'>
sudo chmod 640 /opt/gogs/custom/conf/app.ini
</kode>
{{info | First sign up user will be admin}}

Dernière version du 15 octobre 2023 à 22:15

Links

Configuration

/opt/gogs/custom/conf/app.ini
[auth]
DISABLE_REGISTRATION        = true
REQUIRE_SIGNIN_VIEW         = true

[log]
ROOT_PATH = /var/log/gogs

Install on Ubuntu

Mariadb.svg
-- use the scripts/mysql.sql script to create the database
create database gogs character set utf8mb4 collate utf8mb4_general_ci;
create user gogs@localhost identified by 'PWD';
grant all privileges on gogs.* to gogs@localhost;
flush privileges;
Bash.svg
sudo useradd -r -s /sbin/nologin gogs
# -r system user without home folder
# -s /sbin/nologin do not allow the user to login

sudo mkdir /var/log/gogs                        
sudo chown -R gogs:gogs /var/log/gogs/
/etc/systemd/system/gogs.service
[Unit]
Description=Gogs
After=syslog.target
After=network.target
After=mariadb.service mysql.service mysqld.service postgresql.service memcached.service redis.service

[Service]
Type=simple
User=gogs
Group=gogs
WorkingDirectory=/opt/gogs
ExecStart=/opt/gogs/gogs web
Restart=always
Environment=USER=gogs HOME=/opt/gogs

# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
ProtectSystem=full
PrivateDevices=yes
PrivateTmp=yes
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
Bash.svg
tar xf gogs_0.13.0_linux_armv8.tar.gz
sudo mv gogs /opt
sudo chown -R gogs:gogs /opt/gogs
sc-start gogs
# open http://servername:3000
The file /opt/gogs/custom/conf/app.ini is created.
Bash.svg
sudo chmod 640 /opt/gogs/custom/conf/app.ini
First sign up user will be admin