Your own git server, not Microsoft's
As you know github is sold to MS. If you don't want to use it anymore for various reasons, this repo will help you to create your own git server and migrate your repositories from github under 30 mins with a 1 Euro VPS provider. At the end of this, you will have an Let's Encrypt SSL Certified git service which runs with Nginx Web Server, Go Language and based on Gitea.
sudo apt update && sudo apt upgrade
.sudo adduser git
than sudo adduser git sudo
.sudo - git
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install nginx
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64
and be sure that you are in /home/git
directory.chmod +x gitea
sudo nano /etc/nginx/sites-available/gitserver
and paste the following lines with editing <ip_or_domain>
(domain adress or public ip adress)server {
listen 80;
server_name <ip_or_domain>;
location / {
proxy_pass <ip_or_domain>:3000;
}
}
sudo ln -s /etc/nginx/sites-available/gitserver /etc/nginx/sites-enabled/
sudo nginx -t
.sudo nano /etc/systemd/system/gitea.service
paste the following configuration:[Unit]
Description=Gitea
After=syslog.target
After=network.target
[Service]
Type=simple
User=git
WorkingDirectory=/home/git/
ExecStart=/home/git/./gitea web
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl restart nginx
than enable your gitea service by following command: sudo systemctl enable gitea.service
and finally sudo systemctl start gitea.service
.sudo -u postgres psql -c "CREATE USER <yourpostgresusername> WITH PASSWORD '<yourpass>';"
sudo -i -u postgres
createdb -O <yourpostgresusername> <yourdbname>
exit
<yourpostgresusername> <yourdbname> <yourpass>
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d <your_domain_or_ip>
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
your_ip:3000
over a web browser. It will redirect you to your git server installation page, select Postgresql as Database Type in Database Settings, enter necessity informations <yourpostgresusername> <yourdbname> <yourpass>
.your_ip:3000
.sudo nano /home/git/custom/conf/app.ini
sudo systemctl restart gitea.service
<yourip:3000_or_yourdomain>/api/swagger
BTC > 1HvMriWTMaf1pY3Sak2i1vy5QmEcGMcEgK
ETH > 0xBCa591260D9b0d25eD87dc9B4330980DA44DbB18