Skip to content

Instantly share code, notes, and snippets.

@aursu
aursu / nginx-status.conf
Last active July 30, 2018 16:52
GitLab Omnibus distribution | Nginx nginx.conf: include /var/opt/gitlab/nginx/conf/nginx-status.conf;
server {
listen *:8060;
server_name localhost;
location /nginx_status {
stub_status on;
server_tokens off;
access_log off;
allow 127.0.0.1;
deny all;
}
@aursu
aursu / gitlab-http.conf
Last active July 30, 2018 16:53
GitLab Omnibus distribution | Nginx nginx.conf: include /var/opt/gitlab/nginx/conf/gitlab-http.conf;
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
## GitLab
## Modified from https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl & https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab
##
## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
##
@aursu
aursu / nginx.conf
Last active June 28, 2018 22:45
GitLab embedded nginx config
# root 10516 0.0 0.0 37940 3128 ? Ss Jun07 0:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
user gitlab-www gitlab-www;
worker_processes 8;
error_log stderr;
pid nginx.pid;
@aursu
aursu / vpn-ns.sh
Created June 11, 2018 09:38
Run Cisco AnyConnect VPN connection inside network namespace [DRAFT]
#!/bin/bash
cookie="$1"
vpnsettings=vpn-login
[ -f "$vpnsettings" ] && . $vpnsettings
# NOTE: works well with virbr0 from libvirtd
if [ ! -e /var/run/netns/vpn0 ]; then
@aursu
aursu / gitlab.rb
Created June 11, 2018 03:40
GitLab: disable included monitoring
logrotate['enable'] = false
alertmanager['enable'] = false
prometheus_monitoring['enable'] = false
@aursu
aursu / run-curl.sh
Created June 11, 2018 03:00
Connect to Cisco AnyConnect VPN
#!/bin/bash
loginscript=vpn-login
[ -f $loginscript ] && . $loginscript
VPNCOOKIE=$(curl -s -k "https://${VPNGATEWAY}/+webvpn+/index.html" \
-H 'Cookie: webvpnlogin=1' \
--data 'group_list=DefaultWEBVPNGroup' \
--data "username=${VPNLOGIN}" \
@aursu
aursu / gitlab-postun.sh
Created June 7, 2018 11:47
GitLab postuninstall scriptlet (using /bin/sh):
#!/bin/sh
# WARNING: REQUIRES /bin/sh
#
# - must run on /bin/sh on solaris 9
# - must run on /bin/sh on AIX 6.x
# - if you think you are a bash wizard, you probably do not understand
# this programming language. do not touch.
# - if you are under 40, get peer review from your elders.
is_smartos() {
@aursu
aursu / gitlab-post.sh
Created June 7, 2018 11:46
GitLab postinstall scriptlet (using /bin/sh):
#!/bin/sh
#
# Perform necessary gitlab setup steps
# after package is installed.
#
DEST_DIR=/opt/gitlab
notify()
{
echo "gitlab: $1"
@aursu
aursu / gitlab-pre.sh
Created June 7, 2018 11:40
GitLab preinstall scriptlet (using /bin/sh):
#!/bin/sh
# GitLab pre-install script
DEST_DIR=/opt/gitlab
NEW_MAJOR_VERSION=10
NEW_MINOR_VERSION=10.8
mkdir -p /var/log/gitlab/reconfigure
skip_migrations_file=/etc/gitlab/skip-auto-migrations
[gitlab_gitlab-ee]
name=gitlab_gitlab-ee
baseurl=https://packages.gitlab.com/gitlab/gitlab-ee/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt