Fourth, the Raspberry Pi 4, buster installation gitlab, gitea

 

Machine: Raspberry Pi 4 4GB memory version.

gitlab:12.04ce

Operation: 500 often is not recommended.

To get the raspberry pie, my first thought is to give yourself to build a code hosting server to play with, although I already have github. But still want to get yourself a then built gitlab, but the operation is not really optimistic, page views five times, three times appeared 500, gitlab just up and running, will take up 2GB of memory, and then the next you want to visit directly soared to 3GB, find a lot of optimization of the post, are nothing effect, gitlab official said at least 4GB of memory, the official is true bully me too! Then give up. Steering lightweight gitea.

gitlab not presented here installation procedure, anyway, do not get the recommended raspberry pie, a lot of online installation guide, and, as long as the version of debian deb package to download directly after installation without brain. Nothing thing.

Introduced to the installation of the gitea presented here under, I installed the 1.9.5 version does not support the latest Raspberry Pi kernel! not support! not support! Therefore you install a small partner, do not sudo apt-get update sudo apt- get upgrade, I can be installed on 4.19.57 kernel, this version does not seem to be too high.

First hold mysql:

Need to say here under, Raspberry Pi is supported above mariadb, can be installed directly:

sudo apt-get install mariadb-server

Run   mysql_secure_installation   tools:

sudo mysql_secure_installation

After running a few questions, and then press the Y or N is set:

The first is the "  Enter the root of the current password:  " and press Enter to;

The second whether you want to "  set the root password? ", This input   Y   and press   the Enter . Set password to ensure data security. Then you will be asked to enter a new password;

If the third to "  delete anonymous users? ", Type   Y   and press   the Enter .

The fourth Are "  Prevent remote root login? ", Type   Y or N  and press   Enter; see their set, I here set to N.

The fifth is to "  remove test database and access it? ", Type   Y   and press   the Enter .

Access mysql:

mysql -u root -p

Enter the password previously set, and then create gitea database:

CREATE DATABASE gitea;

User who created the database:

GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY 'PASSWORD';

Refresh privilege table, exit:

FLUSH PRIVILEGES;
exit

Create a user and switch to the user's directory:

sudo adduser --disabled-login --gecos 'Gitea' git
sudo su git
cd ~

Create a folder, and download the gitea:

mkdir gitea
cd gitea
wget https://dl.gitea.io/gitea/1.9.5/gitea-1.9.5-linux-arm-6 -O gitea

Authorization:

chmod +x gitea

To run gitea Upon completion, the default port 3000;

./getea web

Under the same router, the browser above to access http: 192.168.XX: 3000, you can come in raspberry access to the gitea.

First normal register an account, the first account is the root user, and then fill in your gitea database, the database is set up above, password;

 

Then set all the way down, point at the bottom of the installation install, wait just fine.

Set service from the start:

New Service:

sudo nano /etc/systemd/system/gitea.service

As follows: then 3000 is the port, the port can be replaced you want to set: 

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
 
[Service]
# Modify these two values ​​and uncomment them if you have
# repos with lots of files and get to HTTP error 500 because of that
###
# LimitMEMLOCK=infinity
# LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/home/git/gitea
ExecStart=/home/git/gitea/gitea web -p 3000
Restart=always
Environment=USER=git 
HOME=/home/git
 
[Install]
WantedBy=multi-user.target

Set to start:

sudo systemctl enable gitea.service
sudo systemctl start gitea.service

Under Raspberry Pi can restart it goes into effect.

Settings, the external network can be accessed by ddns. Submit code anywhere.

If you have to modify the configuration, you can directly like this:

sudo nano /home/git/gitea/custom/conf/app.ini

Well, gitea completed, could happily submit code.

Published 22 original articles · won praise 1 · views 6910

Guess you like

Origin blog.csdn.net/soulman1234/article/details/102987466