« Gogs » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
Ligne 10 : | Ligne 10 : | ||
flush privileges; | flush privileges; | ||
</kode> | </kode> | ||
<filebox fn='/etc/systemd/system/gogs.service' lang='ini'> | |||
[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=git | |||
Group=git | |||
WorkingDirectory=/opt/gogs | |||
ExecStart=/opt/gogs web | |||
Restart=always | |||
Environment=USER=git HOME=/home/git | |||
# 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 | |||
</filebox> | |||
<kode lang='bash'> | <kode lang='bash'> |
Version du 15 octobre 2023 à 20:25
Install on Ubuntu
-- 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; |
/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=git Group=git WorkingDirectory=/opt/gogs ExecStart=/opt/gogs web Restart=always Environment=USER=git HOME=/home/git # 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 |
cd gogs ./gogs web # open http://servername:3000 |