« Gogs » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications
Ligne 52 : Ligne 52 :
sc-start gogs
sc-start gogs
# open http://servername:3000
# open http://servername:3000
</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>
</kode>

Version du 15 octobre 2023 à 21:57

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