The officially official Devuan Forum!

You are not logged in.

#1 Documentation » [HowTo] Install Gitea on Devuan 5 » 2024-05-21 01:17:19

joser
Replies: 0

Kernel version: 6.1.0-18-amd64
Binary file: gitea-1.21.11-linux-amd64
Partition scheme: / 12%, swap 12%, /home -1
Does these matters? I don't know but I have tried this steps only on systems having exactly the same specs like above, so if you get any error message related for example to swap memory and you have only 1GB for swap then I won't know what to tell you but, increase the size for your swap partition and try again.

Update repository

sudo apt -y update

Install git, curl, bash-completion and nano(optional) editor

sudo apt -y install git curl bash-completion nano

Create user for git

sudo adduser \--system \-shell /bin/bash \--gecos 'Git Version Control' \--group \--disabled-password \--home /home/git \git

   
Install mariadb-server

sudo apt -y install mariadb-server

To secure database execute the command below and (1. skip the root password
but 2. remove anonymous users=Y, and 3. disallow root login remotely=Y,
4. remove test databases=Y and 5. reload privilege tables=Y, done.

sudo mysql_secure_installation

Create database for gitea, change the StrOngPassw0rd value and please
save/write down/remember this password since you will need it to
configure the Gitea server via web.

sudo mysql -u root -p
CREATE DATABASE gitea;
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY "StrOngPassw0rd";
FLUSH PRIVILEGES;
QUIT;

Download gitea linux binary

curl -s  https://api.github.com/repos/go-gitea/gitea/releases/latest |grep browser_download_url  |  cut -d '"' -f 4  | grep '\linux-amd64$' | wget -i -

Change mode to executable and move to destination folder

chmod +x gitea-*-linux-amd64
sudo mv gitea-*-linux-amd64 /usr/local/bin/gitea

Confirm gitea it's installed properly execute

gitea --version

Create directories for gitea setup, yes, I use -R to create new folders also

sudo mkdir -p /etc/gitea /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown -R git:git /var/lib/gitea/{custom,data,indexers,log}
sudo chmod -R 750 /var/lib/gitea/{custom,data,indexers,log}
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea

Download gitea service file and nginx config file
https://drive.proton.me/urls/WPHKAVNY6C#bojwayYgFzWF

Extract gitea service file and nginx conf file

tar -xf gitea-install-devuan5-files.tar.gz

At this point you can and always should inspect the extracted files before to use them

cat gitea.service
cat gitea.conf

You can change the domain name and port for your gitea server on gitea.conf
change listen and server_name values to whatever you want.

Create service for gitea

sudo mv gitea.service /etc/init.d/gitea

Make it executable

sudo chmod +x /etc/init.d/gitea

Update inid.d services

sudo update-rc.d gitea defaults

Start gitea service

sudo service gitea start

Verify that gitea service is running,
valid options: start, stop, status, restart

sudo service gitea status

Install nginx web server

sudo apt -y install nginx

If and only if ufw it's enabled, then:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Create nginx config file for gitea

sudo mv gitea.conf /etc/nginx/conf.d/

Restart nginx service

sudo service nginx restart

Final steps:
1. Open http(s)://localhost on your web browser
2. Type the same password as when you changed it from StrOngPassw0rd to whateveryou changed it to.
3. Change the "Site Title" to whatever you want to name your repository server.
4. Set the email server if you have one, or leave it empty if not.
5. Set the options for Server and Third-Party Service Settings.
6. Set your Administrator Account Settings.
7. Click "Install Gitea".
8. The tea cup animation with the text "Loading..." is displayed, wait.
9. Viola, all done, Gitea Server ready.

Credits to https://computingforgeeks.com/install-g … on-debian/
Adapted to work on Devuan 5 by joser for dev1galaxy.org

Board footer

Forum Software