Gitlab CA

by agracie
17 deployments · 2 still active · last rev. 3 months ago

Compatible with: Debian 9
Includes: App Helper CA
						#!/bin/bash

# Installs Gitlab

# <UDF name="domain" Label="The hostname at which you want to access your GitLab instance and for sending mail through Postfix" example="gitlab.example.com" />
# <UDF name="pubkey" Label="Your SSH public key" default="" />

source <ssinclude StackScriptID="349139">

exec 1> >(tee -a "/var/log/stackscript.log") 2>&1

# Set hostname and update

set_hostname
apt_setup_update
if [[ "$PUBKEY" != "" ]]; then
  add_pubkey
fi

if [[ "$DOMAIN" = "" ]]; then
  DOMAIN=`hostname`
fi

# Install and configure UFW and Fail2ban

ufw_install
ufw allow http
ufw allow https
ufw allow 25
ufw allow 587
ufw allow 110
ufw enable
fail2ban_install

# Pre-seed the postfix options

debconf-set-selections <<< "postfix postfix/mailname string $DOMAIN"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"

# Install postfix

apt-get install curl postfix openssh-server ca-certificates -y

# Add the GitLab package repository

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

# Install the GitLab package.

EXTERNAL_URL="http://$DOMAIN" apt-get install gitlab-ce
stackscript_cleanup