Установка Git Server + Gitea на Ubuntu 20.04

В данном примере рассмотрим установку Git Server и Gitea на чистом сервере Ubuntu 20.04.

  1. Настройка Mysql
  2. Установка Gitea
  3. Пример работы с Gitea

Для начала установим основные компоненты:

apt-get install git mysql-server-8.0 mailutils

Для полноценной работы отправки почтовых уведомлений и работы Gitea рекомендуем направить на сервер домен\поддомен.

Настройка Mysql.

Запустите команду чтобы войти в консоль mysql:

mysql

Создадим пользователя и базу данных gitea с паролем 08wefwojweg для дальнейшей установки Gitea:

CREATE USER 'gitea'@'localhost' IDENTIFIED BY '08wefwojweg';

CREATE DATABASE gitea;

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

FLUSH PRIVILEGES;

Запоминаем данные, их надо будет прописать при установке Gitea.

Выйти из консоли mysql можно при помощи сочетаний клавиш Ctrl+D.

Установка Gitea

Далее скачиваем файл установки Gitea:

wget -O gitea https://dl.gitea.io/gitea/1.13.3/gitea-1.13.3-linux-amd64
chmod +x gitea

Более свежие версии можно найти на официальной странице релизов: https://dl.gitea.io/gitea/

Проверяем установлен ли git:

git --version

В нашем случае:

git version 2.25.1

Далее, необходимо создать пользователя для запуска платформы:

adduser --system --shell /bin/bash --gecos 'Git User' -group --disabled-password --home /home/git git

После чего необходимо создать структуру каталогов:

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

Настраиваем рабочий каталог Gitea:

export GITEA_WORK_DIR=/var/lib/gitea/

Копируем файлы платформы в рабочую папку:

cp gitea /usr/local/bin/gitea

Далее, создаём службу Gitea. для этого создайте файл службы:

nano /etc/systemd/system/gitea.service

Содержимое файла можно узнать по ссылке: https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service

Включаем службу:

systemctl enable gitea

И запускаем:

sudo systemctl start gitea

По умолчанию платформа Gitea работает на порту 3000, посмотреть, запущена служба можно с помощью команды:

netstat -tuwnlp | grep 3000

Если служба запущена, вывод команды будет следующим:

tcp6       0      0 :::3000                 :::*                    LISTEN      23312/gitea        

Откройте в браузере ссылку: http://IP_SERVER:300 чтобы увидеть стартовую страницу. Или же, если у Вас есть полноценный домен\поддомен — ссылка будет вида: http://example.com:3000 — где, example.com — Ваш домен.

При открытии Вы увидите стартовую страницу:

Нажмите на кнопку входа вверху справа страницы — мы перейдём на страницу установки:

Заполните пункты раздела «Настройки базы данных», а именно пользователя, базу и пароль. Ниже укажите IP SSH и базовый URL (IP или домен).

Ниже укажите данные к учётной записи администратора:

Так же, в разделе «Сервер и настройки внешних служб» можете установить те, которые необходимы:

Нажмите на кнопку Установка Gitea и дождитесь окончания, после чего Вас направит на главную страницу, с которой потом можно будет залогиниться.

Работа с Gitea

Давайте проверим как работать с данной платформой. Создайте новый открытый репозиторий нажав на «+» вверху меню:

Результат будет примерно таким:

Создадим на локальной машине небольшой проект и загрузим его в созданный репозиторий.
Далее работа выполняется на локальной (другой) машине.
Для начала создадим папку с проектом:

mkdir testgit ; cd testgit

Cоздадим два файла: ping.txt и simple.txt.

touch ping.txt  simple.txt

В первый запишем вывод команды «ping -c4 8.8.8.8»:

ping -c4 8.8.8.8 > ping.txt

Во второй текст:

echo "Hello World!" > simple.txt

Далее в этой же папке создаём структуру репозитория:

git init

Добавляем наш удалённый репозиторий:

git remote add origin  http://gitea.goodhoster.net:3000/goodhoster/test.git

Отслеживаем все файлы в папке с проектом:

git add .

Для примера можем добавить комментарий на файлы:

git commit -m "Test Message" 

Публикуем наши файлы в удалённый репозиторий:

git push -f origin master

При выполнении последней команды нам нужно ввести логин и пароль:

Username for 'http://gitea.goodhoster.net:3000': goodhoster
Password for 'http::3000':

После чего вывод будет таким, что гласит об успешной загрузке:

Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 552 bytes | 552.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://gitea.goodhoster.net:3000/goodhoster/test.git
+ 7c23d34...4ac1373 master -> master (forced update)

Обновите страницу с репозиторием на на платформе Gitea и вы увидите изменения:

Обратите внимание, конфигурационный файл Gitea храниться по пути /etc/gitea/app.ini. В нём прописываются все необходимые настройки, такие как порт, база данных, базовый url, сервисы и т.д.
Больше возможностей можете узнать из официальной документации: https://docs.gitea.io/en-us/

На этом базовая настройка Git server с платформой Gitea на Ubuntu 20.04 завершена.

Goodhoster.NET
Добавить комментарий

  1. Ashleyillek

    Всё подобранно просто супер.

    Ответить
  2. effibsuics

    ospMrU8fbhDCBMTs7nTDGr8PkkpxiAbu
    8jNKuDMTkotf5NhDR7sYWaygx2mE3NCQ
    sS2vb4kGbWsF4Gjpo8T493NRNr4bA6tV
    8GnfAImQlSawRjd39n6haL9IoxXffwfw
    ot5sE2DNx2RCUUQtb2a6CmvtEW79Nmis
    UHJcFYn77Cd9ibO4J0Qwjc8mQuRYalDD
    6E5BJH8Av3pb1nhwupREBlK25OjxoMMM
    bVcA2KVma895eFdmeuo4HgIyNeEDn518

    Ответить
  3. EllisSuime

    WARNING: The project I’m talking about opened in mid-February. It is possible to invest in it now, but read carefully. What is described in the text — it is a scheme of earnings, in which the risk was only with my personal money and the money of a friend!

    Why this project?

    In search of fast money completely by accident I stumbled on a fresh project. In my personal opinion, all signs of a Hyip project (@inTGBlockchain_BOT), but I am not sure about it, perhaps something related to bidding and investment, the full picture I have not managed to uncover, I can only share the results. And communication with bot like this in telegram is new for me.

    About multaccounts

    Probably everyone has played an MMORPG. And everyone was inspired by the idea to create his own bot to gain level, to get more time than other players! That’s how Multi-Accounts were born and they exploited the system mercilessly, increasing the requirements for adequate players.
    Projects similar to the one I’m describing are also famous for multi-accounts, which are created by crafty users. And this is our case. But big brother is watching you, and any ill-considered action can lead to a fatal mistake! Usually, the administration of the project completely demolishes both the leaders of the structures and their accounts. Funds can be considered as lost. But this project is not, at least for now. The authors do not limit the users in investing, and even invented not a few ways to spur the rate of earnings, but about that later.
    The only question is how to simulate the storm of investment activity without attracting the attention of the administration? By identifying the maximum vulnerability, we have developed a whole scheme, involving active and passive ways of income!

    Building the scheme

    For our task were identified such data as: an input of $ 10 per account, scattered on different blocks and ready, expect profits of a minimum of $ 20, and a maximum of $ 80, and all within 1-2 days. Sounds kind of unrealistic even at this stage, doesn’t it?

    Implementation

    The project accepts payment through a huge number of cryptocurrencies, which facilitates the task of replenishment dozens of times! Firstly we already had money on TRX wallets on different exchanges with my buddy. In total we had about 2000$ (little spoiler, now there is already 10 000$ and we continue investing in bot without any fear, because we recouped our investments in 5 times)
    20-30 main telegram accounts. From them we registered in @inTGBlockchain_BOT and were active building our own structure by referral links;
    We registered from 1 to 10 new accounts in @inTGBlockchain_BOT daily, recording our structure in a separate Excel table and saving our referral links there;
    All registrations were made with Tor-browser, we kept separate tables, which account was created under someone, confirmed e-mail and payeer accounts (where we were withdrawing earned money at first, as it turned out, the withdrawal is automatic for any crypto-wallet, which is also very convenient);
    For each new account, we poured $ 10 and distributed by blocks, the blocks were different, you could buy 10 blocks of $ 1, and you could buy 2 for $ 5, or only 1 block for $ 10;
    On behalf of each investor we left referral links on various platforms — the most effective was to spread links on the forums of gamblers and social networks in special communities.
    The initial process took us 1 day, and the first net profit went to 3 days. According to our terms, we gave business 3-4 hours a day, but every day it was a different time. All these activities were aimed only at one thing — as quickly as possible to build up their own structure and start generating revenue.
    The most difficult — it was to invite more and more new investors in the project, but the task is quite achievable, especially since we played for a large, and you can not take the risk and check our strategy for $ 10-20 using 2-3 Telegram accounts.

    The result of our investment

    We had a few rules: we use only sum of $2000, no reinvestments, we withdraw from the most profitable accounts as soon as the withdrawal allows, and we send other accounts for reinvestment and expansion.
    We had 12 teams, each of which had up to 20 pseudo-leaders and 5 times more bots;
    Our scheme has been working successfully for almost a month without any losses, which is actually unbelievable for us! The project continues to grow and attract new contributors, and we already have a net profit of $8000.
    I took my $ 1000 (of the original investment). I bought ether for 500$ and the other part was fixed in profit in USDT, if anyone is interested, I am solving the question about the rest of money now. My buddy decided to send his part to reinvestment, and I’m not used to risk too much. However, his indicators now are better than mine, because the system allows to withdraw money instantly.

    Withdrawal

    The scheme with multi-accounts is quite simple, but you have to follow a certain algorithm. If you approach the process responsibly, then any projects will be a source of semi-passive income for you with a minimum of effort, the main thing is to use affiliate links. The most important thing is that the project @inTGBlockchain_BOT, worked for a month and is not going to close. Good luck with your investments and profitable work on the Internet.

    Ответить
  4. RaymondBurce

    Впервые с начала спецоперации в украинский порт прителепалось иностранное торговое судно под погрузку. По словам министра, уже через две недели планируется выползти на уровень по меньшей мере 3-5 судов в сутки. Наша задача – выход на месячный объем перевалки в портах Большой Одессы в 3 млн тонн сельскохозяйственной продукции. По его словам, на сборе в Сочи президенты обсуждали поставки российского газа в Турцию. В больнице актрисе поведали о работе медицинского центра во время военного положения и передали подарки от малышей. Благодаря этому мир еще сильнее будет слышать, знать и понимать правду о том, что выходит в нашей стране.

    Ответить