Gitea is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.
This is a fast guide how to using our alpine package, for more elaborated and professional, use the server-alpine-gitea-professional.md document.
hostname giteahost
echo 'hostname="giteahost"' > /etc/conf.d/hostname
echo "giteahost" > /etc/hostname
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 bash coreutils grep lsof less curl binutils dialog attr
apk add git git-lfs gnupg gnupg1 sqlite sqlite libs openssl
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 --allow-untrusted
apk add gitea --allow-untrusted
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 --allow-untrusted
Artifac | Name | Defaults or packaged | Customizable |
---|---|---|---|
Binary program | gitea | /usr/bin/gitea |
no |
Daemon script | gitea | /etc/init.d/gitea |
no |
Daemon user | gitea | /var/lib/gitea/ |
no |
Group user | www-data | /var/www/ |
no |
Working dir | GITEA_WORK_DIR | /var/lib/gitea/ |
yes |
Customizing | GITEA_CUSTOM | /var/lib/gitea/custom/ |
yes,depends |
Config global | gitea.ini | /etc/gitea/app.ini |
yes,depends |
Web files | STATIC_ROOT_PATH | /usr/share/webapps/gitea/ |
no |
Data files | APP_DATA_PATH | /var/lib/gitea/data/ |
depends |
Git repositories | GITEA_GIT_DIR | /var/lib/gitea/git |
yes |
Loggin files | internally | /var/log/gitea |
no |
Configuration must depends of the backend database files:
Database | Needs setup | Default Location |
---|---|---|
Sqlite | No | /var/lib/gitea/db/gitea.db |
MySQL | Yes | /run/mysqld/mysqld.sock |
PostgreSQL | Yes | localhost:5232 |
Choose the configuration option now:
sed -i -r 's#PATH =.*.db#PATH = /var/lib/gitea/db/gitea.db#g' /var/lib/gitea/app.ini
service gitea start
rc-update add gitea default
service gitea status
apk add mariadb mariadb-client
sed -i "s|.*skip-networking.*|skip-networking|g" /etc/mysql/my.cnf
sed -i "s|.*skip-networking.*|skip-networking|g" /etc/my.cnf.d/mariadb-server.cnf
/etc/init.d/mariadb setup
/etc/init.d/mariadb start
rc-update add mariadb default
service gitea start
rc-update add gitea default
service gitea status
For information and more deep setup check ../documents/server-alpine-mysql-professional.md
sed -i "s|||g" /var/lib/postgresql/*/data/pg_hba.conf
apk add postgresql postgresql-client
/etc/init.d/postgresql setup
/etc/init.d/postgresql start
rc-update add postgresql default
service gitea start
rc-update add gitea default
service gitea status
After check that is “running” you must setup graphically using a web browser,
poiting to http://localhost:3000
, in the case of this document should be
pointing to http://giteahost.mydomain.com:3000
and a web landing will show.
The post-installation process happends when you visit the url with the browser.
The post install page, will be displayed and only are show when try to use the system for the first time, away of the starting page, by example if browse the repositories or try to login. You must not forgotten to setup that final installation process.
Database configs will be depending of the choice made in the steps avobe, just give the required credentials, only the case of sqlite does not need complications.
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 an username for admin user, take note “admin” are a reserved word so choose another name. after provide passowrd you will continue the installation.
Redirection to landing can be a problem cos after proceed the service of gitea
will try to send to “localhost”, to fix that, just go to the config file
at the key value of ROOT_URL
and check not contains “localhost” in it, change
to the web url of the server in this case document is http://giteahost.mydomain.com:3000
_bot
) and ..number:string
separated format )..http://<url>/admin/hooks
(for global hook) or https://<url>/org/<group>/settings/hooks
and create a new telegram hook
CC BY-NC-SA: the project allows reusers to distribute, remix, adapt, and build upon the material in any medium or format for noncommercial purposes only, and only so long as attribution is given to the creators involved. If you remix, adapt, or build upon the material, you must license the modified material under identical terms, includes the following elements:
For more information check the alpine/copyright.md