GitLab for small site (LV.1)

Reference Architecture

20 RPS หรือ 1000 users

API: 20 RPS, Web: 2 RPS, Git (Pull): 2 RPS, Git (Push): 1 RPS

Architecture: Standalone VM, no HA
CPU: 8 vCPUs
Memory: 16 GB
OS: Ubuntu

Firewall

Port
Protocol

22

TCP

80

HTTP

443

HTTPS

Config firewall on Ubuntu

sudo apt install ufw
sudo systemctl enable --now ufw
sudo ufw default deny
sudo ufw allow http
sudo ufw allow https
sudo ufw limit ssh/tcp
sudo ufw enable
sudo ufw status

Allow Git user to push/pull via SSH

แก้ไขไฟล์ /etc/ssh/sshd_config เพิ่ม config

restart ssh service

Kernel Hardening

สร้างไฟล์ /etc/sysctl.d/99-gitlab-hardening.conf

สั่ง apply ทันที

ติดตั้ง Gitlab

ทำการแก้ไข config gitlab

ตัวอย่าง config ที่แก้ไข

ใช้คำสั่งดังนี้เพื่อเริ่ม config และติดตั้ง

หลังติดตั้ง หา root password ได้จาก

username ที่ใช้ login คือ root

หลังจากนั้น login เข้าไปเพื่อ disable สิทธิ์ในการ sign up

กดปุ่ม Deactivate > เอาติ๊กช่อง Sign-up enabled ออก > กด Save

Last updated

Was this helpful?