Gitea: Difference between revisions
Ktprograms (talk | contribs) No edit summary |
Ktprograms (talk | contribs) m (Move expand template to Post installation section) |
||
Line 1: | Line 1: | ||
[https://gitea.io Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs. | [https://gitea.io Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs. | ||
Line 105: | Line 103: | ||
== Post installation == | == Post installation == | ||
{{Expand}} | |||
After installing Gitea, go to http://localhost:3000 and start the post-installation process. | After installing Gitea, go to http://localhost:3000 and start the post-installation process. |
Revision as of 14:05, 11 December 2021
Gitea is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.
Installation
First, Enable the Community Repository
Then install the gitea package:
apk add gitea
Setting up the Database
Install the MariaDB and mariadb-client packages:
apk add mariadb mariadb-client
Set up the MariaDB installation and secure it:
mysql_install_db --user=mysql --datadir=/var/lib/mysql service mariadb start rc-update add mariadb mysql_secure_installation
Create the gitea
database and a user with access to it:
mysql -u root -p
should be typed in the MariaDB prompt (looks like MariaDB [(none)]>
)mysql -u root -p CREATE DATABASE gitea DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL ON gitea.* TO 'giteauser'@'localhost' IDENTIFIED BY 'giteapassword'; FLUSH PRIVILEGES; EXIT
If you want, you can uninstall the mariadb-client
now as it's not needed anymore:
apk del mariadb-client
In /etc/gitea/app.ini, replace the contents of the [database]
section with the following:
DB_TYPE = mysql HOST = /var/run/mysqld/mysqld.sock NAME = gitea ; The database name set with 'CREATE DATABASE' USER = giteauser ; The database user PASSWD = giteapassword ; The password for the database user
Configurations
The Gitea service can be configured using /etc/conf.d/gitea:
Description | Configuration Variable | Default Value |
---|---|---|
User to run Gitea under | GITEA_USER | gitea |
Gitea working directory | GITEA_WORK_DIR | /var/lib/gitea/ |
Gitea configuration file | GITEA_CONF | /etc/gitea/app.ini |
Some additional settings in /etc/gitea/app.ini:
Description | Configuration Variable | Default Value |
---|---|---|
Gitea customization directory | Cannot be configured |
/var/lib/gitea/custom/ |
Web files | STATIC_ROOT_PATH | /usr/share/webapps/gitea/ |
Data files | APP_DATA_PATH | /var/lib/gitea/data/ |
Git repository storage directory | ROOT | /var/lib/gitea/git/ |
Log directory | ROOT_PATH | /var/log/gitea/ |
Controlling and starting gitea
You should not start Gitea without setting certain environment variables and passing some options, since it won't know where to store data and logs, so it is recommended to start gitea using the init script:
service gitea start
To add Gitea to the default runlevel (such that it runs automatically on every boot):
rc-update add gitea
To stop the Gitea service:
service gitea stop
Running Gitea without the init script
If (for whatever reason), you would like to start Gitea without using the initscript, you should first stop the Gitea service:
service gitea stop
Then, run Gitea with this command (as the gitea
user):
GITEA_WORK_DIR=/var/lib/gitea gitea web --config /etc/gitea/app.ini
This will use the correct configuration file and write to the correct directories.
Post installation
This material needs expanding ... Please feel free to help us complete it. |
After installing Gitea, go to http://localhost:3000 and start the post-installation process.