Gitlab. Almalinux 8. Installation

Материал из Wiki
Перейти к навигации Перейти к поиску

Links

https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-ce-on-centos-7

Install

HTTP

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

reboot

dnf -y install curl policycoreutils openssh-server openssh-clients postfix

dnf -y install epel-release

systemctl start sshd

systemctl start postfix

systemctl enable sshd

systemctl enable postfix

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

dnf -y install gitlab-ce

gitlab-ctl reconfigure

systemctl start firewalld

systemctl enable firewalld

firewall-cmd --permanent --add-service ssh

firewall-cmd --permanent --add-service http

firewall-cmd --permanent --add-service https

firewall-cmd --reload

firewall-cmd --list-all

https://<gitlab_IP>

Login: root

Password: <initial plain password stored here: /etc/gitlab/initial_root_password> // при первом запуске меняем пароль на root

HTTPS

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

reboot

dnf -y install curl policycoreutils openssh-server openssh-clients postfix

dnf -y install epel-release

systemctl start sshd

systemctl start postfix

systemctl enable sshd

systemctl enable postfix

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

dnf -y install gitlab-ce

dnf -y install mod_ssl

dnf -y install openssl

sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/pki/tls/gitlab.domain123.ru.key -out /etc/pki/tls/gitlab.domain123.ru.crt

mkdir -p /etc/gitlab/ssl/

openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048

chmod 600 /etc/gitlab/ssl/*

cd /etc/gitlab/

nano gitlab.rb

...
external_url 'https://gitlab.domain123.ru'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/pki/tls/gitlab.domain123.ru.crt"
nginx['ssl_certificate_key'] = "/etc/pki/tls/gitlab.domain123.ru.key"
nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
...

gitlab-ctl reconfigure

systemctl start firewalld

systemctl enable firewalld

firewall-cmd --permanent --add-service ssh

firewall-cmd --permanent --add-service http

firewall-cmd --permanent --add-service https

firewall-cmd --reload

https://<gitlab_IP>

Login: root

Password: <initial plain password stored here: /etc/gitlab/initial_root_password> // при первом запуске меняем пароль на root

Генерируем ключ SSH и добавляем его в гитлаб через веб-интерфейс

Чтобы пользоваться этим git-репозиторием на другом устройстве (клиенте), необходимо на этом устройстве (клиенте) создать ключ ssh

Generate SSH key

And you will get two keys in ~/.ssh/ directory. 'id_rsa' would be your private key and 'id_rsa.pub' would be your public key. Next, come back to the Web browser, and click on the 'SSH Key' tab. Copy content of 'id_rsa.pub' file and paste to the key box, and click 'Add Key'.

ssh-keygen

По-умолчанию ключи создадутся в /root/.ssh/

Добавляем содержимое /root/.ssh/id_rsa.pub в веб-интерфейсе сервера Gitlab: User settings - SSH key

Далее можем склонировать репозиторий на это устройство (клиент):

git clone git@192.168.199.241:clessalvein/awx.git