Merge pull request 'main' (#1) from colin-admin/server-config:main into main
Reviewed-on: #1
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
nginx-reverse-proxy/ssl
|
||||
bitwarden/data
|
||||
vaultwarden/data
|
||||
web/**
|
||||
!web/blog
|
||||
web/blog/**
|
||||
|
||||
7
README.md
Normal file
7
README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Steps to reinstall
|
||||
- Clone this repo onto new server
|
||||
- Run light-install.sh
|
||||
- Update the hosts file as mentioned in the output of the light-install
|
||||
- Run start.sh
|
||||
|
||||
That should do it.
|
||||
@@ -7,7 +7,7 @@ networks:
|
||||
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:1.13.6
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
version: '3'
|
||||
services:
|
||||
homeassistant:
|
||||
image: homeassistant/raspberrypi4-homeassistant:stable
|
||||
container_name: homeassistant
|
||||
restart: unless-stopped
|
||||
expose:
|
||||
- '8123'
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ./config:/config
|
||||
networks:
|
||||
- homeassistant
|
||||
|
||||
networks:
|
||||
homeassistant:
|
||||
external:
|
||||
name: homeassistant
|
||||
@@ -23,9 +23,8 @@ echo ">>Done"
|
||||
|
||||
echo "Don't forget to edit /etc/hosts to add the new sites
|
||||
172.31.30.78 blog
|
||||
172.31.30.78 bitwarden
|
||||
172.31.30.78 vaultwarden
|
||||
172.31.30.78 gitea
|
||||
172.31.30.78 motioneye
|
||||
172.31.30.78 homeassistant"
|
||||
echo "Also, get the blog code deployed to the git instance and pull it back down here to get the blog running."
|
||||
echo "The blog is tricky, because it needs the theme to work, don't forget to clone that as well."
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
version: "3.5"
|
||||
services:
|
||||
motioneye:
|
||||
image: ccrisan/motioneye:master-armhf
|
||||
container_name: motioneye
|
||||
networks:
|
||||
- motioneye
|
||||
expose:
|
||||
- "8081"
|
||||
- "8765"
|
||||
volumes:
|
||||
- etc_motioneye:/etc/motioneye
|
||||
- var_lib_motioneye:/var/lib/motioneye
|
||||
|
||||
volumes:
|
||||
etc_motioneye:
|
||||
var_lib_motioneye:
|
||||
|
||||
networks:
|
||||
motioneye:
|
||||
external:
|
||||
name: motioneye
|
||||
8
my_services.service
Normal file
8
my_services.service
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Launch Service for my self-hosted services.
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/ubuntu/start.sh &
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -2,5 +2,6 @@
|
||||
<head><title>Proxy Backend Not Found</title></head>
|
||||
<body >
|
||||
<h2>Proxy Backend Not Found</h2>
|
||||
<p>This is a test.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -30,7 +30,7 @@ include /etc/nginx/includes/ssl.conf;
|
||||
|
||||
location / {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_pass http://bitwarden;
|
||||
proxy_pass http://vaultwarden;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/bitwarden-access.log combined;
|
||||
@@ -55,18 +55,18 @@ error_log /var/log/nginx/gitea-error.log error;
|
||||
}
|
||||
|
||||
# Motioneye config
|
||||
server {
|
||||
listen 80;
|
||||
server_name eye.colindiem.com;
|
||||
# server {
|
||||
# listen 80;
|
||||
# server_name eye.colindiem.com;
|
||||
|
||||
location / {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_pass http://motioneye:8765;
|
||||
}
|
||||
# location / {
|
||||
# include /etc/nginx/includes/proxy.conf;
|
||||
# proxy_pass http://motioneye:8765;
|
||||
# }
|
||||
|
||||
access_log /var/log/nginx/motioneye-access.log combined;
|
||||
error_log /var/log/nginx/motioneye-error.log error;
|
||||
}
|
||||
# access_log /var/log/nginx/motioneye-access.log combined;
|
||||
# error_log /var/log/nginx/motioneye-error.log error;
|
||||
# }
|
||||
|
||||
# Nextcloud config
|
||||
server {
|
||||
@@ -102,20 +102,75 @@ server {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_pass http://homeassistant:8123;
|
||||
proxy_pass http://192.168.1.204:8123;
|
||||
}
|
||||
|
||||
location /api/websocket {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_pass http://homeassistant:8123/api/websocket;
|
||||
proxy_pass http://192.168.1.204:8123/api/websocket;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/ha-access.log;
|
||||
error_log /var/log/nginx/ha-error.log;
|
||||
}
|
||||
|
||||
# Foundry config
|
||||
server {
|
||||
listen 80;
|
||||
listen 443;
|
||||
server_name foundry.colindiem.com;
|
||||
|
||||
location / {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_pass http://192.168.1.249:40001;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/foundry-access.log combined;
|
||||
error_log /var/log/nginx/foundry-error.log error;
|
||||
}
|
||||
|
||||
# Bookstack config
|
||||
server {
|
||||
listen 80;
|
||||
listen 443;
|
||||
server_name wiki.colindiem.com;
|
||||
|
||||
location / {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_pass http://192.168.1.204:2665;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/wikiaccess.log combined;
|
||||
error_log /var/log/nginx/wiki-error.log error;
|
||||
|
||||
}
|
||||
|
||||
# Minecraft server config
|
||||
server {
|
||||
listen 80;
|
||||
listen 443;
|
||||
server_name mc.colindiem.com;
|
||||
|
||||
location / {
|
||||
include /etc/nginx/includes/proxy.conf;
|
||||
proxy_pass http://192.168.1.249:25565;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/minecraft_access.log combined;
|
||||
error_log /var/log/nginx/minecraft_error.log error;
|
||||
}
|
||||
|
||||
# Default
|
||||
server {
|
||||
listen 80 default_server;
|
||||
|
||||
@@ -2,10 +2,11 @@ version: '2'
|
||||
services:
|
||||
proxy:
|
||||
container_name: rev-proxy
|
||||
restart: unless-stopped
|
||||
build: ./
|
||||
networks:
|
||||
- blog
|
||||
- bitwarden
|
||||
- vaultwarden
|
||||
- gitea
|
||||
- motioneye
|
||||
- homeassistant
|
||||
@@ -17,9 +18,9 @@ networks:
|
||||
blog:
|
||||
external:
|
||||
name: blog_default
|
||||
bitwarden:
|
||||
vaultwarden:
|
||||
external:
|
||||
name: bitwarden_default
|
||||
name: vaultwarden_default
|
||||
gitea:
|
||||
external:
|
||||
name: gitea
|
||||
@@ -28,4 +29,4 @@ networks:
|
||||
name: motioneye
|
||||
homeassistant:
|
||||
external:
|
||||
name: homeassistant
|
||||
name: homeassistant
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
|
||||
19
reboot.sh
Normal file
19
reboot.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
cd /home/ubuntu/
|
||||
|
||||
cd vaultwarden/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
|
||||
cd gitea/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
|
||||
cd web/blog/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
|
||||
cd nginx-reverse-proxy/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
16
start.sh
16
start.sh
@@ -7,8 +7,8 @@ cd nginx-reverse-proxy/
|
||||
docker-compose build
|
||||
cd /home/ubuntu/
|
||||
|
||||
echo "Starting Bitwarden..."
|
||||
cd bitwarden/
|
||||
echo "Starting Vaultwarden..."
|
||||
cd vaultwarden/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
echo "Done"
|
||||
@@ -19,24 +19,12 @@ docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
echo "Done"
|
||||
|
||||
echo "Starting MotionEye..."
|
||||
cd motioneye/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
echo "Done"
|
||||
|
||||
echo "Starting blog..."
|
||||
cd web/blog/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
echo "Done"
|
||||
|
||||
echo "Starting Home Assistant..."
|
||||
cd homeassistant/
|
||||
docker-compose up -d
|
||||
cd /home/ubuntu/
|
||||
echo "Done"
|
||||
|
||||
echo "Starting reverse proxy..."
|
||||
cd nginx-reverse-proxy/
|
||||
docker-compose up -d
|
||||
|
||||
2
stop.sh
2
stop.sh
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
echo "Stopping all of the containers"
|
||||
docker stop bitwarden motioneye gitea gitea_db_1 blog homeassistant rev-proxy
|
||||
docker stop vaultwarden gitea gitea_db_1 blog rev-proxy
|
||||
@@ -1,13 +1,13 @@
|
||||
version: '3'
|
||||
services:
|
||||
bitwarden:
|
||||
container_name: bitwarden
|
||||
image: bitwardenrs/server
|
||||
vaultwarden:
|
||||
container_name: vaultwarden
|
||||
image: vaultwarden/server
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/data
|
||||
expose:
|
||||
- '80'
|
||||
- 80
|
||||
environment:
|
||||
WEBSOCKET_ENABLED: 'true'
|
||||
SIGNUPS_ALLOWED: 'true'
|
||||
@@ -3,6 +3,7 @@ version: "3.3"
|
||||
services:
|
||||
blog:
|
||||
container_name: blog
|
||||
restart: unless-stopped
|
||||
image: nginx:1.16.0-alpine
|
||||
volumes:
|
||||
- "./public:/usr/share/nginx/html/"
|
||||
|
||||
Reference in New Issue
Block a user