<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Epsi1on</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Epsi1on"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Epsi1on"/>
	<updated>2026-05-05T18:46:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31078</id>
		<title>Gitea</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31078"/>
		<updated>2025-09-28T10:26:51Z</updated>

		<summary type="html">&lt;p&gt;Epsi1on: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitea.com Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.&lt;br /&gt;
&lt;br /&gt;
{{Note|This guide is not for installing Gitea in Docker. If you want to install Gitea in a Docker container, follow [https://docs.gitea.com/installation/install-with-docker the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
First, [[Enable Community Repository]]&lt;br /&gt;
&lt;br /&gt;
Then install the {{pkg|gitea}} package:&lt;br /&gt;
{{cmd|apk add gitea}}&lt;br /&gt;
&lt;br /&gt;
== Setting up the Database ==&lt;br /&gt;
&lt;br /&gt;
{{Note|These instructions are for MariaDB. If you would like to set up another database, follow [https://docs.gitea.com/installation/database-prep the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
Install the MariaDB and {{pkg|mariadb-client}} packages:&lt;br /&gt;
{{cmd|apk add mariadb mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
Set up the MariaDB installation and secure it:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mysql_install_db --user=mysql --datadir=/var/lib/mysql&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
service mariadb start&lt;br /&gt;
rc-update add mariadb&lt;br /&gt;
mysql_secure_installation}}&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; database and a user with access to it:&lt;br /&gt;
{{Note|Everything after the &amp;lt;code&amp;gt;mysql -u root -p&amp;lt;/code&amp;gt; should be typed in the MariaDB prompt (looks like &amp;lt;code&amp;gt;MariaDB [(none)]&amp;gt;&amp;lt;/code&amp;gt;)}}&lt;br /&gt;
{{Note|Replace the above username &#039;giteauser&#039; and password &#039;giteapassword&#039; with something secure. Remember these settings. You will need them later when setting up Gitea.}}&lt;br /&gt;
{{cmd|mysql -u root -p&lt;br /&gt;
&lt;br /&gt;
CREATE DATABASE gitea DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
GRANT ALL ON gitea.* TO &#039;giteauser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;giteapassword&#039;;&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
EXIT}}&lt;br /&gt;
&lt;br /&gt;
If you want, you can uninstall the &amp;lt;code&amp;gt;mariadb-client&amp;lt;/code&amp;gt; now as it&#039;s not needed anymore:&lt;br /&gt;
{{cmd|apk del mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
In {{path|/etc/gitea/app.ini}}, replace the contents of the &amp;lt;code&amp;gt;[database]&amp;lt;/code&amp;gt; section with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_TYPE = mysql&lt;br /&gt;
HOST = /var/run/mysqld/mysqld.sock&lt;br /&gt;
NAME = gitea			; The database name set with &#039;CREATE DATABASE&#039;&lt;br /&gt;
USER = giteauser		; The database user&lt;br /&gt;
PASSWD = giteapassword		; The password for the database user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configurations ==&lt;br /&gt;
&lt;br /&gt;
The Gitea service can be configured using {{path|/etc/conf.d/gitea}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| User to run Gitea under || GITEA_USER || gitea&lt;br /&gt;
|-&lt;br /&gt;
| Gitea working directory || GITEA_WORK_DIR || /var/lib/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Gitea configuration file || GITEA_CONF || /etc/gitea/app.ini&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Some additional settings in {{path|/etc/gitea/app.ini}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| Gitea customization directory || &amp;lt;code&amp;gt;Cannot be configured&amp;lt;/code&amp;gt; || /var/lib/gitea/custom/&lt;br /&gt;
|-&lt;br /&gt;
| Web files || STATIC_ROOT_PATH || /usr/share/webapps/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Data files || APP_DATA_PATH || /var/lib/gitea/data/&lt;br /&gt;
|-&lt;br /&gt;
| Git repository storage directory || ROOT || /var/lib/gitea/git/&lt;br /&gt;
|-&lt;br /&gt;
| Log directory || ROOT_PATH || /var/log/gitea/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|Gitea has a built-in web server, so there is no need to configure one. However, you can [https://docs.gitea.com/administration/reverse-proxies set up a reverse proxy].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|To customize the look and feel of Gitea, find the correct path in {{path|/usr/share/webapps/gitea/}} and make the same path in {{path|/var/lib/gitea/custom/}}. For example, to add a new Gitea theme, create the {{path|/var/lib/gitea/custom/public/css/}} directory, then add the css for the theme there.}}&lt;br /&gt;
&lt;br /&gt;
== Controlling and starting gitea ==&lt;br /&gt;
&lt;br /&gt;
You should not start Gitea without setting certain environment variables and passing some options, since it won&#039;t know where to store data and logs, so it is recommended to start gitea using the init script:&lt;br /&gt;
{{cmd|service gitea start}}&lt;br /&gt;
&lt;br /&gt;
To add Gitea to the default runlevel (such that it runs automatically on every boot):&lt;br /&gt;
{{cmd|rc-update add gitea}}&lt;br /&gt;
&lt;br /&gt;
To stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
=== Running Gitea without the init script ===&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason), you would like to start Gitea without using the initscript, you should first stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
Then, run Gitea with this command (as the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; user):&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;GITEA_WORK_DIR=/var/lib/gitea gitea web --config /etc/gitea/app.ini&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will use the correct configuration file and write to the correct directories.&lt;br /&gt;
&lt;br /&gt;
== Post installation ==&lt;br /&gt;
&lt;br /&gt;
{{Expand}}&lt;br /&gt;
&lt;br /&gt;
After installing Gitea, go to &amp;lt;nowiki&amp;gt;http://localhost:3000&amp;lt;/nowiki&amp;gt; and start the post-installation process.&lt;br /&gt;
&lt;br /&gt;
== Setting up SSH Git access ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not&#039;&#039;&#039; try to be clever and use &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt;, as it will not have the correct command set.&lt;br /&gt;
&lt;br /&gt;
As an example, if this is the public key:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line in {{path|.ssh/authorized_keys}} needs to be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command=&amp;quot;/usr/bin/gitea --config=/etc/gitea/app.ini serv key-2&amp;quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to do this, [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent generate a SSH key], then go to the Gitea settings panel and click the &amp;lt;code&amp;gt;Add Key&amp;lt;/code&amp;gt; button, then paste in your public key.&lt;br /&gt;
&lt;br /&gt;
Now, once you&#039;ve added your private key to the SSH agent, you can use SSH with Gitea like you normally would with GitHub, GitLab, etc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Epsi1on</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31077</id>
		<title>Gitea</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31077"/>
		<updated>2025-09-28T10:26:39Z</updated>

		<summary type="html">&lt;p&gt;Epsi1on: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitea.com Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.&lt;br /&gt;
&lt;br /&gt;
{{Note|This guide is not for installing Gitea in Docker. If you want to install Gitea in a Docker container, follow [https://docs.gitea.com/installation/install-with-docker the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
First, Enable Community Repository [[Enable Community Repository]]&lt;br /&gt;
&lt;br /&gt;
Then install the {{pkg|gitea}} package:&lt;br /&gt;
{{cmd|apk add gitea}}&lt;br /&gt;
&lt;br /&gt;
== Setting up the Database ==&lt;br /&gt;
&lt;br /&gt;
{{Note|These instructions are for MariaDB. If you would like to set up another database, follow [https://docs.gitea.com/installation/database-prep the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
Install the MariaDB and {{pkg|mariadb-client}} packages:&lt;br /&gt;
{{cmd|apk add mariadb mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
Set up the MariaDB installation and secure it:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mysql_install_db --user=mysql --datadir=/var/lib/mysql&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
service mariadb start&lt;br /&gt;
rc-update add mariadb&lt;br /&gt;
mysql_secure_installation}}&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; database and a user with access to it:&lt;br /&gt;
{{Note|Everything after the &amp;lt;code&amp;gt;mysql -u root -p&amp;lt;/code&amp;gt; should be typed in the MariaDB prompt (looks like &amp;lt;code&amp;gt;MariaDB [(none)]&amp;gt;&amp;lt;/code&amp;gt;)}}&lt;br /&gt;
{{Note|Replace the above username &#039;giteauser&#039; and password &#039;giteapassword&#039; with something secure. Remember these settings. You will need them later when setting up Gitea.}}&lt;br /&gt;
{{cmd|mysql -u root -p&lt;br /&gt;
&lt;br /&gt;
CREATE DATABASE gitea DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
GRANT ALL ON gitea.* TO &#039;giteauser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;giteapassword&#039;;&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
EXIT}}&lt;br /&gt;
&lt;br /&gt;
If you want, you can uninstall the &amp;lt;code&amp;gt;mariadb-client&amp;lt;/code&amp;gt; now as it&#039;s not needed anymore:&lt;br /&gt;
{{cmd|apk del mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
In {{path|/etc/gitea/app.ini}}, replace the contents of the &amp;lt;code&amp;gt;[database]&amp;lt;/code&amp;gt; section with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_TYPE = mysql&lt;br /&gt;
HOST = /var/run/mysqld/mysqld.sock&lt;br /&gt;
NAME = gitea			; The database name set with &#039;CREATE DATABASE&#039;&lt;br /&gt;
USER = giteauser		; The database user&lt;br /&gt;
PASSWD = giteapassword		; The password for the database user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configurations ==&lt;br /&gt;
&lt;br /&gt;
The Gitea service can be configured using {{path|/etc/conf.d/gitea}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| User to run Gitea under || GITEA_USER || gitea&lt;br /&gt;
|-&lt;br /&gt;
| Gitea working directory || GITEA_WORK_DIR || /var/lib/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Gitea configuration file || GITEA_CONF || /etc/gitea/app.ini&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Some additional settings in {{path|/etc/gitea/app.ini}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| Gitea customization directory || &amp;lt;code&amp;gt;Cannot be configured&amp;lt;/code&amp;gt; || /var/lib/gitea/custom/&lt;br /&gt;
|-&lt;br /&gt;
| Web files || STATIC_ROOT_PATH || /usr/share/webapps/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Data files || APP_DATA_PATH || /var/lib/gitea/data/&lt;br /&gt;
|-&lt;br /&gt;
| Git repository storage directory || ROOT || /var/lib/gitea/git/&lt;br /&gt;
|-&lt;br /&gt;
| Log directory || ROOT_PATH || /var/log/gitea/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|Gitea has a built-in web server, so there is no need to configure one. However, you can [https://docs.gitea.com/administration/reverse-proxies set up a reverse proxy].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|To customize the look and feel of Gitea, find the correct path in {{path|/usr/share/webapps/gitea/}} and make the same path in {{path|/var/lib/gitea/custom/}}. For example, to add a new Gitea theme, create the {{path|/var/lib/gitea/custom/public/css/}} directory, then add the css for the theme there.}}&lt;br /&gt;
&lt;br /&gt;
== Controlling and starting gitea ==&lt;br /&gt;
&lt;br /&gt;
You should not start Gitea without setting certain environment variables and passing some options, since it won&#039;t know where to store data and logs, so it is recommended to start gitea using the init script:&lt;br /&gt;
{{cmd|service gitea start}}&lt;br /&gt;
&lt;br /&gt;
To add Gitea to the default runlevel (such that it runs automatically on every boot):&lt;br /&gt;
{{cmd|rc-update add gitea}}&lt;br /&gt;
&lt;br /&gt;
To stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
=== Running Gitea without the init script ===&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason), you would like to start Gitea without using the initscript, you should first stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
Then, run Gitea with this command (as the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; user):&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;GITEA_WORK_DIR=/var/lib/gitea gitea web --config /etc/gitea/app.ini&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will use the correct configuration file and write to the correct directories.&lt;br /&gt;
&lt;br /&gt;
== Post installation ==&lt;br /&gt;
&lt;br /&gt;
{{Expand}}&lt;br /&gt;
&lt;br /&gt;
After installing Gitea, go to &amp;lt;nowiki&amp;gt;http://localhost:3000&amp;lt;/nowiki&amp;gt; and start the post-installation process.&lt;br /&gt;
&lt;br /&gt;
== Setting up SSH Git access ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not&#039;&#039;&#039; try to be clever and use &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt;, as it will not have the correct command set.&lt;br /&gt;
&lt;br /&gt;
As an example, if this is the public key:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line in {{path|.ssh/authorized_keys}} needs to be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command=&amp;quot;/usr/bin/gitea --config=/etc/gitea/app.ini serv key-2&amp;quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to do this, [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent generate a SSH key], then go to the Gitea settings panel and click the &amp;lt;code&amp;gt;Add Key&amp;lt;/code&amp;gt; button, then paste in your public key.&lt;br /&gt;
&lt;br /&gt;
Now, once you&#039;ve added your private key to the SSH agent, you can use SSH with Gitea like you normally would with GitHub, GitLab, etc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Epsi1on</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31076</id>
		<title>Gitea</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=31076"/>
		<updated>2025-09-28T10:25:28Z</updated>

		<summary type="html">&lt;p&gt;Epsi1on: link to Enable the Community Repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitea.com Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.&lt;br /&gt;
&lt;br /&gt;
{{Note|This guide is not for installing Gitea in Docker. If you want to install Gitea in a Docker container, follow [https://docs.gitea.com/installation/install-with-docker the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
First, &lt;br /&gt;
&lt;br /&gt;
[[Enable Community Repository| Link 1]]&lt;br /&gt;
[[Repositories#Managing_repositories| Link2 ]]&lt;br /&gt;
&lt;br /&gt;
Then install the {{pkg|gitea}} package:&lt;br /&gt;
{{cmd|apk add gitea}}&lt;br /&gt;
&lt;br /&gt;
== Setting up the Database ==&lt;br /&gt;
&lt;br /&gt;
{{Note|These instructions are for MariaDB. If you would like to set up another database, follow [https://docs.gitea.com/installation/database-prep the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
Install the MariaDB and {{pkg|mariadb-client}} packages:&lt;br /&gt;
{{cmd|apk add mariadb mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
Set up the MariaDB installation and secure it:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mysql_install_db --user=mysql --datadir=/var/lib/mysql&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
service mariadb start&lt;br /&gt;
rc-update add mariadb&lt;br /&gt;
mysql_secure_installation}}&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; database and a user with access to it:&lt;br /&gt;
{{Note|Everything after the &amp;lt;code&amp;gt;mysql -u root -p&amp;lt;/code&amp;gt; should be typed in the MariaDB prompt (looks like &amp;lt;code&amp;gt;MariaDB [(none)]&amp;gt;&amp;lt;/code&amp;gt;)}}&lt;br /&gt;
{{Note|Replace the above username &#039;giteauser&#039; and password &#039;giteapassword&#039; with something secure. Remember these settings. You will need them later when setting up Gitea.}}&lt;br /&gt;
{{cmd|mysql -u root -p&lt;br /&gt;
&lt;br /&gt;
CREATE DATABASE gitea DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
GRANT ALL ON gitea.* TO &#039;giteauser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;giteapassword&#039;;&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
EXIT}}&lt;br /&gt;
&lt;br /&gt;
If you want, you can uninstall the &amp;lt;code&amp;gt;mariadb-client&amp;lt;/code&amp;gt; now as it&#039;s not needed anymore:&lt;br /&gt;
{{cmd|apk del mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
In {{path|/etc/gitea/app.ini}}, replace the contents of the &amp;lt;code&amp;gt;[database]&amp;lt;/code&amp;gt; section with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_TYPE = mysql&lt;br /&gt;
HOST = /var/run/mysqld/mysqld.sock&lt;br /&gt;
NAME = gitea			; The database name set with &#039;CREATE DATABASE&#039;&lt;br /&gt;
USER = giteauser		; The database user&lt;br /&gt;
PASSWD = giteapassword		; The password for the database user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configurations ==&lt;br /&gt;
&lt;br /&gt;
The Gitea service can be configured using {{path|/etc/conf.d/gitea}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| User to run Gitea under || GITEA_USER || gitea&lt;br /&gt;
|-&lt;br /&gt;
| Gitea working directory || GITEA_WORK_DIR || /var/lib/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Gitea configuration file || GITEA_CONF || /etc/gitea/app.ini&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Some additional settings in {{path|/etc/gitea/app.ini}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| Gitea customization directory || &amp;lt;code&amp;gt;Cannot be configured&amp;lt;/code&amp;gt; || /var/lib/gitea/custom/&lt;br /&gt;
|-&lt;br /&gt;
| Web files || STATIC_ROOT_PATH || /usr/share/webapps/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Data files || APP_DATA_PATH || /var/lib/gitea/data/&lt;br /&gt;
|-&lt;br /&gt;
| Git repository storage directory || ROOT || /var/lib/gitea/git/&lt;br /&gt;
|-&lt;br /&gt;
| Log directory || ROOT_PATH || /var/log/gitea/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|Gitea has a built-in web server, so there is no need to configure one. However, you can [https://docs.gitea.com/administration/reverse-proxies set up a reverse proxy].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|To customize the look and feel of Gitea, find the correct path in {{path|/usr/share/webapps/gitea/}} and make the same path in {{path|/var/lib/gitea/custom/}}. For example, to add a new Gitea theme, create the {{path|/var/lib/gitea/custom/public/css/}} directory, then add the css for the theme there.}}&lt;br /&gt;
&lt;br /&gt;
== Controlling and starting gitea ==&lt;br /&gt;
&lt;br /&gt;
You should not start Gitea without setting certain environment variables and passing some options, since it won&#039;t know where to store data and logs, so it is recommended to start gitea using the init script:&lt;br /&gt;
{{cmd|service gitea start}}&lt;br /&gt;
&lt;br /&gt;
To add Gitea to the default runlevel (such that it runs automatically on every boot):&lt;br /&gt;
{{cmd|rc-update add gitea}}&lt;br /&gt;
&lt;br /&gt;
To stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
=== Running Gitea without the init script ===&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason), you would like to start Gitea without using the initscript, you should first stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
Then, run Gitea with this command (as the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; user):&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;GITEA_WORK_DIR=/var/lib/gitea gitea web --config /etc/gitea/app.ini&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will use the correct configuration file and write to the correct directories.&lt;br /&gt;
&lt;br /&gt;
== Post installation ==&lt;br /&gt;
&lt;br /&gt;
{{Expand}}&lt;br /&gt;
&lt;br /&gt;
After installing Gitea, go to &amp;lt;nowiki&amp;gt;http://localhost:3000&amp;lt;/nowiki&amp;gt; and start the post-installation process.&lt;br /&gt;
&lt;br /&gt;
== Setting up SSH Git access ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not&#039;&#039;&#039; try to be clever and use &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt;, as it will not have the correct command set.&lt;br /&gt;
&lt;br /&gt;
As an example, if this is the public key:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line in {{path|.ssh/authorized_keys}} needs to be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command=&amp;quot;/usr/bin/gitea --config=/etc/gitea/app.ini serv key-2&amp;quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to do this, [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent generate a SSH key], then go to the Gitea settings panel and click the &amp;lt;code&amp;gt;Add Key&amp;lt;/code&amp;gt; button, then paste in your public key.&lt;br /&gt;
&lt;br /&gt;
Now, once you&#039;ve added your private key to the SSH agent, you can use SSH with Gitea like you normally would with GitHub, GitLab, etc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Epsi1on</name></author>
	</entry>
</feed>