Skip to content

Instantly share code, notes, and snippets.

View kerren's full-sized avatar

Kerren Ortlepp kerren

View GitHub Profile
import { TypeOrmModule } from '@nestjs/typeorm';
import { databaseConnections } from './database-connections';
import { Module } from '@nestjs/common';
@Module({
imports: [
...databaseConnections
],
exports: [
TypeOrmModule
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DatabaseModule } from 'modules/database/database.module';
import { User } from 'modules/shared/entities/user.entity';
import { UserService } from './services/user.service';
@Module({
imports: [DatabaseModule, TypeOrmModule.forFeature([User], Config.get.databases.main.name)],
exports: [DatabaseModule, UserService],
providers: [UserService]
@kerren
kerren / haproxy.cfg
Created September 22, 2018 14:59
The HAProxy config on the barebone server
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
@kerren
kerren / hosts
Created September 22, 2018 15:14
The hosts file on the router host
127.0.0.1 localhost
127.0.1.1 router
140.82.58.111 server1
95.179.179.5 server2
199.247.28.183 server3
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
@kerren
kerren / haproxy.cfg
Last active March 1, 2022 11:14
The haproxy.cfg file on the router host
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
@kerren
kerren / default
Created September 22, 2018 15:34
The nginx setup for the www.entroinfo.xyz and entroinfo.xyz site
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name www.entroinfo.xyz entroinfo.xyz;
location / {
proxy_pass http://localhost:3000;
}
}
@kerren
kerren / certbot.sh
Created September 22, 2018 15:36
Install and run certbot for the entroinfo.xyz domain
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python-certbot-nginx -y
certbot --nginx -d entroinfo.xyz -d www.entroinfo.xyz
@kerren
kerren / default
Created September 22, 2018 15:38
The new nginx config for entroinfo.xyz after running certbot
server {
server_name www.entroinfo.xyz entroinfo.xyz;
location / {
proxy_pass http://localhost:3000;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/entroinfo.xyz/fullchain.pem; # managed by Certbot
@kerren
kerren / default
Created September 22, 2018 15:42
The initial nginx setup before running cerbot on sub1.kubehttps.xyz
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name sub1.kubehttps.xyz;
location / {
proxy_pass http://localhost:3000;
}
}
@kerren
kerren / certbot.sh
Created September 22, 2018 15:43
The certbot setup for sub1.kubehttps.xyz
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python-certbot-nginx -y
certbot --nginx -d sub1.kubehttps.xyz