Difference between revisions of "Alpine newbie developer: gitea"

From Alpine Linux
Jump to: navigation, search
(gitea wiki page started.. only 50% done.. rest are copy of others)
 
(Installation: warning about gitea user, documented)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
''gitea'' is now available from repositories: https://pkgs.alpinelinux.org/packages?name=gitea currently at 2020 still remains in edge brand but this guide does work either if are or not in main.
 
''gitea'' is now available from repositories: https://pkgs.alpinelinux.org/packages?name=gitea currently at 2020 still remains in edge brand but this guide does work either if are or not in main.
 
{{TOC right}}
 
  
 
== Clarifications ==
 
== Clarifications ==
Line 18: Line 16:
  
 
* CVS command line
 
* CVS command line
** Git almost 1.9.4 as minimun
+
** git
 +
** git-lfs
 
* Database:
 
* Database:
** MariaDB/MySQL
+
** mysql
** PostgreSQL
+
** postgresql
** SQLite
+
** sqlite
** TiDB tidbAUR (experimental, not recommended)
+
** tidb
 +
 
 +
For database professional setup please refers to the [[Production_DataBases_:_mysql]] page or [[Production_DataBases_:_postgresql]] page
 +
 
 +
A hostname is a unique name created to identify a machine on a network, configured in /etc/hostname.
 +
To change the computer's hostname edit the <code>/etc/hostname</code> file or execute the following command
 +
(make sure to replace <code>myhostname</code> with your desired hostname):
 +
 
 +
<pre># echo "myhostname" > /etc/hostname</pre>
 +
 
 +
You should also add the hostname to your hosts file (<code>/etc/hosts</code>):
 +
 
 +
<pre>
 +
127.0.0.1  localhost.localdomain localhost
 +
127.0.1.1  myhostname.mydomain myhostname
 +
::1        localhost.localdomain localhost
 +
</pre>
  
 
== Installation ==
 
== Installation ==
  
This guide does work either if are or not in main or edge the gitea package:, '''take note, do not install any more from edge.. so in fact all gitea dependencies must be listed and installed before gitea and edge brand are activated''', so the following process will guide and show you how to do that:
+
This guide does work either if are or not in main or edge the gitea package:, '''take note, do not install any more from edge.. so in fact all gitea dependencies must be listed and installed before gitea and edge brand are activated''', so the following process will guide and show you how to do that; first  gain root privileges or access ssh to your alpine server and then:
  
1. first  gain root privileges or access ssh to your alpine server
+
# added and update normal repositories
2. added and update normal repositories
+
# install direct dependences: git, gnupg, make, bash, coreutils and from normal stable repositories
3. install git from normal stable repositories
+
# install indirect dependences: manpages, grep, lsof, less, curl, binutils, attr, dialog
4. alternate edge repositories
+
# alternate edge repositories
5. install gitea from edge repository
+
# install gitea from edge repository
6. restore normal repository
+
# restore normal repository
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 44: Line 59:
 
apk update
 
apk update
  
apk add bash git git-lfs gnupg gnupg1
+
apk add git git-lfs git-doc gnupg gnupg1 make bash bash-doc coreutils
 +
 
 +
apk add man man-pages grep grep-doc lsof lsof-doc less less-doc curl curl-doc binutils dialog dialog-doc attr
 +
 
 +
export PAGER=less
  
 
cat >> /etc/apk/repositories << EOF; $(echo)
 
cat >> /etc/apk/repositories << EOF; $(echo)
Line 65: Line 84:
 
</nowiki></pre>
 
</nowiki></pre>
  
Take in consideration that the user gitea or a gitea system user must be in the system.
+
{{warning|Take in consideration that the user <code>gitea</code> or "a gitea" system user must be in the system. Check if the <code>gitea</code> package already crated the user, if not, just created but set home to <code>/var/lib/gitea</code>}}
  
=== Setting the hostname ===
+
== Configurations ==
  
A hostname is a unique name created to identify a machine on a network, configured in /etc/hostname.
+
Gitea configurations are defined by the gitea service at <code>/etc/init.d/gitea</code> script:
To change the computer's hostname edit the <code>/etc/hostname</code> file or execute the following command
 
(make sure to replace <code>myhostname</code> with your desired hostname):
 
  
<pre># echo "myhostname" > /etc/hostname</pre>
+
{| class="wikitable"
 +
|-
 +
! Artifac !! Name !! Path related
 +
|-
 +
| Daemon script || gitea || /etc/init.d/gitea
 +
|-
 +
| Daemon user || gitea || /var/lib/gitea/
 +
|-
 +
| Group user || www-data || /var/www/
 +
|-
 +
| Binary program || gitea || /usr/bin/gitea
 +
|-
 +
| Working dir || GITEA_WORK_DIR || /var/lib/gitea/
 +
|-
 +
| Customizing || GITEA_CUSTOM || /var/lib/gitea/custom/
 +
|-
 +
| Config global || gitea.ini || /etc/gitea/app.ini
 +
|-
 +
| Web files || STATIC_ROOT_PATH  || /usr/share/webapps/gitea/
 +
|-
 +
| Data files || APP_DATA_PATH  || /var/lib/gitea/data/
 +
|}
  
You should also add the hostname to your hosts file (<code>/etc/hosts</code>):
+
Gitea '''runs as <code>gitea</code> user, and <code>www-data</code> group''', so are ''compatible with any web deploy in system webservers packages of alpine repositories'', but not with any other external installation if does not are same as.
  
<pre>
+
Gitea has two configuration files, the '''system defaults at <code>/var/lib/gitea/conf/app.ini</code>''' and modifiable '''package defaults, at <code>/etc/gitea/app.ini</code>'''. Original files are in <code>/usr/share/webapps/gitea</code> and are defaults non-modifiable. For alterations see next sections where are defined initialization, customization and configurations.
127.0.0.1  localhost localhost.localdomain
 
127.0.1.1  myhostname myhostname.localdomain
 
::1        localhost localhost.localdomain
 
</pre>
 
  
=== Network configuration ===
+
Gitea can be customized: just '''take same path from <code>/usr/share/webapps/gitea/</code> and put in same manner at <code>/var/lib/gitea/custom/</code> place'''.
  
There are three types of internet connections: wired (Ethernet), wireless (WiFi) and PPTP (modems).
+
=== Initialization ===
This section will focus only on wired connections, for wireless configuration read the [[Connecting_to_a_wireless_access_point|Connecting to a wireless access point]] article.
 
  
This section will help to update and configure your network interfaces, please plug your network cable in and then go to the console and run the DNS and interfaces configuration scripts.
+
Gitea just after install does not need many configurations, the daemon service init all the needs, take in consideration that this means:
  
<pre>
+
{| class="wikitable"
<nowiki>
+
|-
cat > /etc/network/interfaces << EOF
+
! Config !! Default
auto lo
+
|-
iface lo inet loopback
+
| Start to use || <nowiki>http://localhost:3000</nowiki>
EOF
+
|-
 
+
| Git repositories || /var/lib/gitea/git
setup-interfaces -a
+
|-
 
+
| Database files || Sqlite at /var/lib/gitea/db/gitea.db
echo -e "\n" | setup-dns 8.8.8.8
+
|-
 
+
| Loggin files || /var/log/gitea
rc-service networking restart
+
|}
</nowiki>
 
</pre>
 
  
{{Note|Due you just install we will assumed you already have network available by wired connection, if you have speciall need respect newtworking please read [[Alpine newbie network and internet connections]] to property setup your internet connection}}
+
For others configurations please check next sections.
  
===== Default root configurations =====
+
==== Controlling and starting gitea ====
  
The ''root'' user are the god of the Linux Alpine system, run only the most deep in task, and must not be used as normal user neither for common task. For common users the last section of this page document will show you all the needs.
+
Gitea binary itselt '''cannot be start alone''', without parameters will put lot of directories and files in the default path, so to start to use must be:
  
When Alpine Linux is first installed by default it comes with the user ''root'' with no password set so the first step after boot into alpine fresh install are set a password to the user ''root'', if during install was run [[Alpine_setup_scripts#setup-alpine|setup-alpine]] to change root password, that will be already set and can be changed with those setup steps described here. More info in the [[Setting up a new user|Setting users]] wiki page.
+
# Start from init script!
 +
# Make enabled the init script!
 +
# Stop from init script
  
 
<pre><nowiki>
 
<pre><nowiki>
cat > /root/.cshrc << EOF
+
rc-update add gitea default
unsetenv DISPLAY || true
 
HISTCONTROL=ignoreboth
 
EOF
 
  
cp /root/.cshrc /root/.profile
+
rc-service gitea restart
 
 
echo "secret_new_root_password" | chpasswd
 
 
</nowiki></pre>
 
</nowiki></pre>
  
Of course you must changed ''"secret_new_root_password"'' by a proper password provided by you.
+
To stop:
 
 
== New users: common needed package to install ==
 
 
 
Packages and programs on alpine are described on [[Alpine_newbie#APK|Alpine_newbie: Packages overall info]].
 
 
 
{{Note|if you do not wired and only have modems or wifi, runs in any case those commands previusly described in network setup, and later after go to specific wiki pages [[Alpine newbie network and internet connections]] for that configurations. '''alpine linux need network internet connection available due still does not distribute a complete media install disc''' only minimal isos due extended isos are only for x86 and x64 machines}}
 
 
 
===== install basic tools =====
 
 
 
As explain in [[Alpine_Linux:Overview|Alpine Linux:Overview]], the system always will be minimalist, so if you expected a behavior like others linux those will be provided a minimal similitude to, runs:
 
 
 
<pre>
 
<nowiki>
 
apk add attr dialog dialog-doc bash bash-doc bash-completion grep grep-doc
 
 
 
apk add util-linux util-linux-doc pciutils usbutils binutils findutils readline
 
 
 
apk add man man-pages lsof lsof-doc less less-doc nano nano-doc curl curl-doc
 
 
 
export PAGER=less
 
</nowiki>
 
</pre>
 
 
 
===== Users creation and defaults =====
 
 
 
'''Only ''root'' can manage users'''. Creating an account allows it to have it's own <code><nowiki>$HOME</nowiki></code> directory and allows you to limit access to the configuration of the operating system for security reasons. So the following commands will first setup root environment login and then assing a new password:
 
  
 
<pre><nowiki>
 
<pre><nowiki>
cat > /root/.cshrc << EOF
+
rc-service gitea stop
unsetenv DISPLAY || true
 
HISTCONTROL=ignoreboth
 
EOF
 
 
 
cp /root/.cshrc /root/.profile
 
 
 
echo "secret_new_root_password" | chpasswd
 
 
</nowiki></pre>
 
</nowiki></pre>
  
The remote management cannot be done with root directly by default, due ssh security, so we need to setup an remote connection account to made "su" once connected.
+
A '''manual start without init script can be done''' but to use the files installed on the system the steps are:
  
The most recommended it's having a access user here named "remote" and normal general usage user here named "general" for convenience, in the next commands we will setup a very hardened limited environment for any new user and created those two users:
+
# stop any running instance
 +
# make a command to run with proper arguments
  
 
<pre><nowiki>
 
<pre><nowiki>
mkdir -p /etc/skel/
+
rc-service gitea stop
  
cat > /etc/skel/.logout << EOF
+
GITEA_WORK_DIR='/var/lib/gitea' /usr/bin/gitea web --config /etc/gitea/app.ini
history -c
+
</nowiki></pre>
/bin/rm -f /opt/remote/.mysql_history
 
/bin/rm -f /opt/remote/.history
 
/bin/rm -f /opt/remote/.bash_history
 
EOF
 
  
cat > /etc/skel/.cshrc << EOF
+
This will use the config files and installed files from the package.
set autologout = 30
 
set prompt = "$ "
 
set history = 0
 
set ignoreeof
 
EOF
 
  
cp /etc/skel/.cshrc /etc/skel/.profile
+
==== Post installation ====
  
adduser -D --home /opt/remote --shell /bin/ash remote
+
'''After install and initialized''' the daemon, you now can just go to <code><nowiki>http://localhost:3000</nowiki></code> and start the post-installation process, '''''if you dont want to change any configuration.. if not check next sections.''''' A starting page will be show.
  
echo "secret_new_remote_user_password" | chpasswd
+
'''The post install page''', only are show when try to use the system, away of the starting page, by example if browse the repositories or try to login. You must not forget to setup that installation.
  
adduser -D --shell /bin/bash general
+
'''Administrator account must be configured''' before push "install gitea", the button at the end of the post-configuration page when you first visit the installation. Provide and username for admin user, take note "admin" are a reserved word so choose another name. after provide passowrd you will continue the installation.
  
echo "secret_new_general_user_password" | chpasswd
+
=== Configuring ===
</nowiki></pre>
 
  
{{Tip|"''general''" and "''remote''" are the names of the users, MUST be only lowercase, no spaces with no symbols}}
+
Gitea can be customized: just '''take same path from <code>/usr/share/webapps/gitea/</code> and put in same manner at <code>/var/lib/gitea/custom/</code> place''', by example to customize default landing page, just take a copy of the <code>/usr/share/webapps/gitea/templates/home.tmpl</code> and put modified one as <code>/var/lib/gitea/custom/templates/home.tmpl</code> as well.
  
Note that those users are created with minimal settings. Of course you must changed ''"secret_new_remote_user_password"'' by a proper password provided by you, also equaly with ''"secret_new_general_user_password"'' too.
 
  
===== Users management and system access =====
+
=== Database configurations ===
  
But this user will not have enough privileges for a desktop made purposes, Alpine comes with high security so administrator (the ''root'' account owner) must perform the management of that user. Take care, for a server made there's no similar procedure!
+
Gitea for data '''database backend''' for storing configurations.. SQLite are the default. But for others database backends alpine packages of MySQL/MariaDB or PostgreSQL are like normal tarball of each one, admins must know what they want.. there's no automatic window-like installation here. So first go to [[MariaDB]] or [[PostgreSQL]] wiki pages and with a user database configure in the <code>/etc/gitea/app.ini</code> and modify the <code>DB_TYPE</code> change from sqlite to postgres or mysql, <code>NAME</code> as the database access where gitea will store the data, <code>USER</code> as the user that will access the database, <code>PASSWORD</code> with the password of the user to access to the database defined. <code>HOST</code> must be with "localhost" value since this wiki assumes local installation.
  
Management of users can be made with the default '''busybox''', but there's some packages that makes the life easy of the admins, lest use the '''libuser''' package now from testing repository:
+
'''Setup the database to MySQL:'''
  
 
<pre><nowiki>
 
<pre><nowiki>
cat > /etc/apk/repositories << EOF
+
service gitea stop
http://mirror.math.princeton.edu/pub/alpinelinux/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
+
</nowiki></pre>
http://mirror.math.princeton.edu/pub/alpinelinux/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
 
http://mirror.math.princeton.edu/pub/alpinelinux/edge/testing/
 
EOF
 
  
apk update
+
Of course you must changed ''"secret_new_root_password"'' by a proper password provided by you.
 
 
apk add libuser
 
 
 
cat > /etc/apk/repositories << EOF
 
http://mirror.math.princeton.edu/pub/alpinelinux/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
 
http://mirror.math.princeton.edu/pub/alpinelinux/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
 
EOF
 
 
 
apk update
 
 
 
touch /etc/login.defs
 
 
 
touch /etc/default/useradd
 
</nowiki></pre>
 
  
Now we can changes some defaults and added to proper groups to access devices or perform connections so, those are the recommended groups where the user must have in:
+
'''Setup the database to PosgreSQL:'''
  
 
<pre><nowiki>
 
<pre><nowiki>
for u in $(ls /home); do for g in disk lp floppy audio cdrom dialout video netdev games users; do addgroup $u $g; done;done
+
service gitea stop
 
</nowiki></pre>
 
</nowiki></pre>
  
* '''disk''':x:6:root,adm  Only if need usage vith virtual machines and access to other partitions over new disks for
+
Of course you must changed ''"secret_new_root_password"'' by a proper password provided by you.
* '''lp''':x:7:lp  IF will need to use printing services and printers management
 
* '''floppy''':x:11:root  Backguard compatible group, use only if need access to external special devices
 
* '''audio''':x:18:  Need for audio listening and management of sound volumes as normal user
 
* '''cdrom''':x:19:  For access to disck writers and mounting DVD, BR or CD rom disk as normal user
 
* '''dialout''':x:20:root  Need for dial private connections and use of modems as normal users
 
* '''tape''':x:26:root  Need have into this if plan to use special devices for backup.. rarelly in no servers
 
* '''video''':x:27:root  For usage of cameras, mor thant one GPU special features, as normal user
 
* '''netdev''':x:28:  For network connections management as normal user
 
* '''kvm''':x:34:kvm Only if as normal user will manage graphically virtual machines.. rarelly on no servers
 
* '''games''':x:35:  Need if you want to play games also specially need if will share score between users
 
* '''cdrw''':x:80:  To write RW-DVD, RW-BR or RW-CD disk on a disk writing device
 
* '''apache''':x:81: Need if you will perfom development as normal user and want to publish locally on web server
 
* '''usb''':x:85: Need to access to special usb devices, deprecated group
 
* '''users''':x:100:games If you plan to used common files for all users, mandatory as desktop usage
 
 
 
Now we have ''libuser'' also '''can change default shell''':
 
 
 
* If you want to change the current user's shell, log in as that user and then inside their terminal session execute:: <pre>lchsh</pre>
 
* If you want to change a different user's shell, run as administration or as '''''root''''': <pre><nowiki>lchsh general</nowiki></pre>
 
 
 
Where "general" was the name of a created user login in previous sections.
 
 
 
== Continue to Desktop ==
 
 
 
Before you continue, you must have at least already done the previously described steps in the section [[Alpine_newbie_apk_packages#New_users:_common_needed_package_to_install|New users: common needed package to install]]!
 
 
 
 
 
{| class="wikitable"
 
|-
 
! Previous required  !! What's next to read
 
|-
 
| [[Alpine newbie install manual]] || [[Alpine newbie desktops]]
 
|}
 
  
 
= Tutorial series =
 
= Tutorial series =

Latest revision as of 14:40, 29 July 2020

gitea is now available from repositories: https://pkgs.alpinelinux.org/packages?name=gitea currently at 2020 still remains in edge brand but this guide does work either if are or not in main.

Clarifications

1. Gitea was created by a group of users and contributors of the self-hosted Git service Gogs. in fact gitea is gogs with steroids! so then It is a fork of Gogs and is written in Go.

2. This guide is for real deploy not for docker deploys.. dockers does not need to setup packages and filesystems configs, for that you must use always docker related configurations.

3. If even though docker always uses Alpine linux as images, and the software is alpine packages, it still has nothing to do with using alpine specific commands.

4. Git is the version control system (VCS) software behind gitea perse, so must be installed first. But repositories on server are not same as in clients.. server repositories are bare repositories.

Pre Requirements

This document will guide noob users, for professional case please visit Production_git_server:_gitea page.

  • CVS command line
    • git
    • git-lfs
  • Database:
    • mysql
    • postgresql
    • sqlite
    • tidb

For database professional setup please refers to the Production_DataBases_:_mysql page or Production_DataBases_:_postgresql page

A hostname is a unique name created to identify a machine on a network, configured in /etc/hostname. To change the computer's hostname edit the /etc/hostname file or execute the following command (make sure to replace myhostname with your desired hostname):

# echo "myhostname" > /etc/hostname

You should also add the hostname to your hosts file (/etc/hosts):

127.0.0.1   localhost.localdomain localhost
127.0.1.1   myhostname.mydomain myhostname
::1         localhost.localdomain localhost

Installation

This guide does work either if are or not in main or edge the gitea package:, take note, do not install any more from edge.. so in fact all gitea dependencies must be listed and installed before gitea and edge brand are activated, so the following process will guide and show you how to do that; first gain root privileges or access ssh to your alpine server and then:

  1. added and update normal repositories
  2. install direct dependences: git, gnupg, make, bash, coreutils and from normal stable repositories
  3. install indirect dependences: manpages, grep, lsof, less, curl, binutils, attr, dialog
  4. alternate edge repositories
  5. install gitea from edge repository
  6. restore normal repository
cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
EOF

apk update

apk add git git-lfs git-doc gnupg gnupg1 make bash bash-doc coreutils

apk add man man-pages grep grep-doc lsof lsof-doc less less-doc curl curl-doc binutils dialog dialog-doc attr

export PAGER=less

cat >> /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
EOF

apk update

apk add gitea

cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
EOF

apk update
Tango-dialog-warning.png
Warning: Take in consideration that the user gitea or "a gitea" system user must be in the system. Check if the gitea package already crated the user, if not, just created but set home to /var/lib/gitea


Configurations

Gitea configurations are defined by the gitea service at /etc/init.d/gitea script:

Artifac Name Path related
Daemon script gitea /etc/init.d/gitea
Daemon user gitea /var/lib/gitea/
Group user www-data /var/www/
Binary program gitea /usr/bin/gitea
Working dir GITEA_WORK_DIR /var/lib/gitea/
Customizing GITEA_CUSTOM /var/lib/gitea/custom/
Config global gitea.ini /etc/gitea/app.ini
Web files STATIC_ROOT_PATH /usr/share/webapps/gitea/
Data files APP_DATA_PATH /var/lib/gitea/data/

Gitea runs as gitea user, and www-data group, so are compatible with any web deploy in system webservers packages of alpine repositories, but not with any other external installation if does not are same as.

Gitea has two configuration files, the system defaults at /var/lib/gitea/conf/app.ini and modifiable package defaults, at /etc/gitea/app.ini. Original files are in /usr/share/webapps/gitea and are defaults non-modifiable. For alterations see next sections where are defined initialization, customization and configurations.

Gitea can be customized: just take same path from /usr/share/webapps/gitea/ and put in same manner at /var/lib/gitea/custom/ place.

Initialization

Gitea just after install does not need many configurations, the daemon service init all the needs, take in consideration that this means:

Config Default
Start to use http://localhost:3000
Git repositories /var/lib/gitea/git
Database files Sqlite at /var/lib/gitea/db/gitea.db
Loggin files /var/log/gitea

For others configurations please check next sections.

Controlling and starting gitea

Gitea binary itselt cannot be start alone, without parameters will put lot of directories and files in the default path, so to start to use must be:

  1. Start from init script!
  2. Make enabled the init script!
  3. Stop from init script
rc-update add gitea default

rc-service gitea restart

To stop:

rc-service gitea stop

A manual start without init script can be done but to use the files installed on the system the steps are:

  1. stop any running instance
  2. make a command to run with proper arguments
rc-service gitea stop

GITEA_WORK_DIR='/var/lib/gitea' /usr/bin/gitea web --config /etc/gitea/app.ini

This will use the config files and installed files from the package.

Post installation

After install and initialized the daemon, you now can just go to http://localhost:3000 and start the post-installation process, if you dont want to change any configuration.. if not check next sections. A starting page will be show.

The post install page, only are show when try to use the system, away of the starting page, by example if browse the repositories or try to login. You must not forget to setup that installation.

Administrator account must be configured before push "install gitea", the button at the end of the post-configuration page when you first visit the installation. Provide and username for admin user, take note "admin" are a reserved word so choose another name. after provide passowrd you will continue the installation.

Configuring

Gitea can be customized: just take same path from /usr/share/webapps/gitea/ and put in same manner at /var/lib/gitea/custom/ place, by example to customize default landing page, just take a copy of the /usr/share/webapps/gitea/templates/home.tmpl and put modified one as /var/lib/gitea/custom/templates/home.tmpl as well.


Database configurations

Gitea for data database backend for storing configurations.. SQLite are the default. But for others database backends alpine packages of MySQL/MariaDB or PostgreSQL are like normal tarball of each one, admins must know what they want.. there's no automatic window-like installation here. So first go to MariaDB or PostgreSQL wiki pages and with a user database configure in the /etc/gitea/app.ini and modify the DB_TYPE change from sqlite to postgres or mysql, NAME as the database access where gitea will store the data, USER as the user that will access the database, PASSWORD with the password of the user to access to the database defined. HOST must be with "localhost" value since this wiki assumes local installation.

Setup the database to MySQL:

service gitea stop

Of course you must changed "secret_new_root_password" by a proper password provided by you.

Setup the database to PosgreSQL:

service gitea stop

Of course you must changed "secret_new_root_password" by a proper password provided by you.

Tutorial series

Previous required What's next to read
Alpine newbie install manual Alpine newbie desktops

See Also