Kerya techblog

Most Read Posts

  • Gentoo mail (postfix + postfixadmin + dovecot + amavisd-new + roundcube)
  • Zabbix - no such instance currently exists at this oid
  • LVM cant Boot - ALERT /dev/mapper/ubuntu--vg-root does not exist DROPPING to Shell -
  • liquidsoap-1.1.1 gentoo install
  • Laravel manual user register
  • Gentoo: php 5.6.0 + pecl-memcached 2.2.0 install script
  • Zabbix APC Smart UPS monitoring on FreeBSD with snmp
  • Squid 3.4 debian 7 install script
  • Подключение Foxgate S6224-S2 Ubuntu minicom
  • Abills
  • exim+dovecot+postfixadmin+clamav+spamassassin on FreeBSD
  • Openmeetings 2.1.1 Ubuntu 12.04.2 installation
  • libtool version mismatch pecl gentoo
  • Securing NTP
  • FreeBSD 9 ossec setup errors fix
  • fix for - corrupted record for package (pkgdep line without argument), ignoring
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  • Mikrotik no-ip ddns update script
  • Скопировать права mysql gentoo
  • mysql backup scripts
  1. Вы здесь:  
  2. Home
  • Home
  • Все статьи

Gitlab + letsencrypt automated

Подробности
Автор: Kirill

Written with help of this:

https://stackoverflow.com/questions/34189199/how-do-i-use-let-s-encrypt-with-gitlab

which is based on

https://webnugget.de/setting-up-gitlab-with-free-ssl-certs-from-lets-encrypt-on-ubuntu-14-04/

one more reference:

https://www.digitalocean.com/community/tutorials/how-to-secure-gitlab-with-let-s-encrypt-on-ubuntu-16-04

Done on Ubuntu, assumed gitlab and certbot installed.

- Create the folder /var/www/letsencrypt and use this directory as webroot-path for Let's Encrypt

- Use the webroot authenticator for Let's Encrypt (certbot -a webroot ...)

- Change the following config values in /etc/gitlab/gitlab.rb and run gitlab-ctl reconfigure after that:

nginx['redirect_http_to_https'] = true
nginx['ssl_certificate']= "/etc/letsencrypt/live/gitlab.yourdomain.com/fullchain.pem"
nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/gitlab.yourdomain.com/privkey.pem"
nginx['custom_gitlab_server_config']="location ^~ /.well-known {\n alias /var/www/letsencrypt/.well-known;\n}\n"

If you are using Mattermost which is shipped with the Omnibus package then you can additionally set these options in /etc/gitlab/gitlab.rb:

mattermost_nginx['redirect_http_to_https'] = true
mattermost_nginx['ssl_certificate']= "/etc/letsencrypt/live/gitlab.yourdomain.com/fullchain.pem"
mattermost_nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/gitlab.yourdomain.com/privkey.pem"
mattermost_nginx['custom_gitlab_mattermost_server_config']="location ^~ /.well-known {\n alias /var/www/letsencrypt/.well-known;\n}\n"

After requesting your first certificate remember to change the external_url to https://... and again run gitlab-ctl reconfigure

 P.S

Letsencrypt integration introduced in GitLab version 10.5 and disabled by default. Enabled by default in GitLab version 10.7 and later if external_url is set with the https protocol and no certificates are configured.

 To find out gitlabversion: You should be logged in to access the following page: https://your.domain.name/help

Virtualbox bridged networking on ubuntu host

Подробности
Автор: Kirill

Installing bridge-utils

sudo apt-get update
sudo apt-get -y install bridge-utils
brctl addbr br0
ip link set dev br0 up
sudo ifconfig br0 inet 192.168.99.1
 sudo apt -y install isc-dhcp-server

sudo mcedit /etc/dhcp/dhcpd.conf  add to the end of file :

subnet 192.168.99.0 netmask 255.255.255.0 {
    option routers 192.168.99.1;

    option domain-name-servers 192.168.99.1;
    pool {
        range 192.168.99.8 192.168.99.64;
     }
}

sudo service isc-dhcp-server restart

sudo sysctl net.ipv4.ip_forward=1

sudo mcedit /etc/sysctl.conf

uncomment

net.ipv4.ip_forward=1

Install bind 9:

sudo apt -y install bind9

sudo service bind9 restart

NAT configuration with iptables:

sudo iptables --flush

sudo iptables -t nat --flush

iptables --delete-chain

sudo iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE

sudo iptables -A FORWARD -i br0 -j ACCEPT

Automatically Create the Bridge at Start-up

 /etc/network/interfaces file

auto br0
iface br0 inet static
bridge_stp off
bridge_fd 0
bridge_maxwait 0
address 192.168.99.1
netmask 255.255.255.0

 

Links:

https://help.ubuntu.com/community/NetworkConnectionBridge

PHP bulk upgrade FreeBSD

Подробности
Автор: Kirill

5.6 to 7.2 :

/usr/sbin/pkg info -xo ^php | /usr/bin/awk '{ gsub("56","72",$2); print  " -o "$2" "$1}' | /usr/bin/xargs -L 1 /usr/local/sbin/portupgrade -by

7.2 to 7.3:

pkg info -xo php72 | awk '{ gsub("72","73",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by

 

7.3 to 7.4:

pkg info -xo php73 | awk '{ gsub("73","74",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by

 

7.2 to 8.0:

pkg delete php72-hash php72-json; pkg info -xo ^php ^mod_php | grep php72 | awk '{gsub("72","80",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -DbkycC --batch

Mysqldump backup simple script

Подробности
Автор: Kirill
  • mysql
  • mysqldump
  • backup

#!/bin/sh

_mysqldump="/usr/local/bin/mysqldump"
_gzip="/usr/bin/gzip -9"
_date="/bin/date"
_log="/var/log/mysqlbackup.log"

date=`${_date} +'%d%m%y-%H%M'`
date_log=`${_date} +'%d%m%y %H:%M:%S'`
echo "Backup start ${date_log}" >> ${_log}
${_mysqldump} zabbix | ${_gzip} > /kerya3/backups/mysql/zabbix-${date}.sql.gz
date_log=`${_date} +'%d%m%y %H:%M:%S'`
echo "Backup end ${date_log}" >> ${_log}

  1. LVM cant Boot - ALERT /dev/mapper/ubuntu--vg-root does not exist DROPPING to Shell -
  2. Cpanel tips

Страница 8 из 17

  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

Search

Older Posts

  • Greenbone Vulnerability Manager (GVM) hacks (63)
  • elasticsearch cluster red status fix due to high watermark (61)
  • ubuntu arrow keys misbehaviour fix (72)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (84)
  • Make user superadmin in zabbix (81)
  • dnf Error: unknown option (111)
  • unpack pfx certificate (used for apache or nginx) (116)
  • mysql audit plugin build script (290)
  • mysql dump one row (95)
  • redmine 5 docker-compose (199)
  • gitlab runner dind docker-compose (143)
  • AWS S3 IAM policy to limit to single sub folder (146)
  • logrotate hints (196)
  • bash script to clean files to required percentage (322)
  • Ansible create LVM and mount (732)

Login Form

  • Забыли пароль?
  • Забыли логин?
  • Регистрация