mirror of
https://github.com/akpall/akpella.git
synced 2026-02-21 08:36:59 +00:00
Compare commits
5 Commits
2e70874bfc
...
2cd9174d81
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cd9174d81 | |||
| 80a9b8c3d6 | |||
| 85cee95a50 | |||
| 37a1a4384c | |||
| 1571a4b6c4 |
26
Makefile
26
Makefile
@@ -1,8 +1,29 @@
|
|||||||
config.json: config.yaml
|
FILES := $(wildcard files/*)
|
||||||
|
|
||||||
|
default:
|
||||||
|
$(MAKE) .generate-files-list
|
||||||
|
$(MAKE) config.json
|
||||||
|
.PHONY: default
|
||||||
|
|
||||||
|
reset:
|
||||||
|
$(MAKE) default
|
||||||
|
$(MAKE) .reset
|
||||||
|
.PHONY: reset
|
||||||
|
|
||||||
|
.generate-files-list: $(FILES)
|
||||||
|
if ! echo $(FILES) | diff -q .files-list - >/dev/null 2>&1; then \
|
||||||
|
echo $(FILES) > .files-list; \
|
||||||
|
fi
|
||||||
|
.PHONY: .generate-files-list
|
||||||
|
|
||||||
|
config.json: config.yaml .files-list $(FILES)
|
||||||
docker run --rm -i \
|
docker run --rm -i \
|
||||||
|
--volume ${PWD}:/pwd \
|
||||||
|
--workdir /pwd \
|
||||||
quay.io/coreos/butane:latest \
|
quay.io/coreos/butane:latest \
|
||||||
--strict \
|
--strict \
|
||||||
--pretty \
|
--pretty \
|
||||||
|
--files-dir files \
|
||||||
< config.yaml > config.json
|
< config.yaml > config.json
|
||||||
|
|
||||||
.reset: config.json
|
.reset: config.json
|
||||||
@@ -20,9 +41,6 @@ config.json: config.yaml
|
|||||||
ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r -O exit akpella;
|
ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r -O exit akpella;
|
||||||
touch .reset
|
touch .reset
|
||||||
|
|
||||||
reset: .reset
|
|
||||||
.PHONY: reset
|
|
||||||
|
|
||||||
update:
|
update:
|
||||||
VER=$$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2) && \
|
VER=$$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2) && \
|
||||||
echo $${VER} && \
|
echo $${VER} && \
|
||||||
|
|||||||
100
config.yaml
100
config.yaml
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
variant: flatcar
|
variant: flatcar
|
||||||
version: 1.0.0
|
version: 1.1.0
|
||||||
|
|
||||||
passwd:
|
passwd:
|
||||||
users:
|
users:
|
||||||
@@ -26,42 +26,15 @@ storage:
|
|||||||
# network
|
# network
|
||||||
- path: /etc/systemd/network/00-eth0.network
|
- path: /etc/systemd/network/00-eth0.network
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
local: etc/systemd/network/00-eth0.network
|
||||||
[Match]
|
|
||||||
Name=eth0
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
DNS=1.1.1.1
|
|
||||||
Address=193.40.103.107/24
|
|
||||||
Gateway=193.40.103.1
|
|
||||||
- path: /etc/hosts
|
- path: /etc/hosts
|
||||||
overwrite: true
|
overwrite: true
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
local: etc/hosts
|
||||||
127.0.0.1 localhost akpella.fst.ee
|
|
||||||
::1 localhost akpella.fst.ee
|
|
||||||
- path: /opt/caddy/etc/caddy/Caddyfile
|
- path: /opt/caddy/etc/caddy/Caddyfile
|
||||||
overwrite: true
|
overwrite: true
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
local: opt/caddy/etc/caddy/Caddyfile
|
||||||
{
|
|
||||||
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
|
|
||||||
email akpall+akpella@fst.ee
|
|
||||||
}
|
|
||||||
|
|
||||||
fst.ee {
|
|
||||||
root * /var/www/html
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
|
|
||||||
fst.ee:8448 {
|
|
||||||
reverse_proxy /_matrix/* matrixdotorg-synapse:8008
|
|
||||||
}
|
|
||||||
|
|
||||||
matrix.fst.ee {
|
|
||||||
reverse_proxy /_matrix/* matrixdotorg-synapse:8008
|
|
||||||
reverse_proxy /_synapse/client/* matrixdotorg-synapse:8008
|
|
||||||
}
|
|
||||||
- path: /opt/caddy/var/www/html/index.html
|
- path: /opt/caddy/var/www/html/index.html
|
||||||
overwrite: true
|
overwrite: true
|
||||||
contents:
|
contents:
|
||||||
@@ -72,69 +45,10 @@ systemd:
|
|||||||
units:
|
units:
|
||||||
- name: docker-network-setup.service
|
- name: docker-network-setup.service
|
||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents_local: docker-network-setup.service
|
||||||
[Unit]
|
|
||||||
Description=Create docker network: caddy-network
|
|
||||||
After=docker.service
|
|
||||||
Requires=docker.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
RemainAfterExit=yes
|
|
||||||
ExecStart=/usr/bin/docker network create caddy-network
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
- name: docker-matrixdotorg-synapse.service
|
- name: docker-matrixdotorg-synapse.service
|
||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents_local: docker-matrixdotorg-synapse.service
|
||||||
[Unit]
|
|
||||||
Description=Synapse: Matrix homeserver written in Python/Twisted + Rust
|
|
||||||
After=docker.service \
|
|
||||||
docker-network-setup
|
|
||||||
Requires=docker.service \
|
|
||||||
docker-network-setup
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStartPre=/usr/bin/docker run \
|
|
||||||
--name=matrixdotorg-synapse \
|
|
||||||
--network=caddy-network \
|
|
||||||
--rm \
|
|
||||||
--mount type=bind,src=/opt/matrixdotorg-synapse/data,dst=/data \
|
|
||||||
-e SYNAPSE_SERVER_NAME=matrix.fst.ee \
|
|
||||||
-e SYNAPSE_REPORT_STATS=yes \
|
|
||||||
matrixdotorg/synapse:latest generate
|
|
||||||
ExecStart=docker run \
|
|
||||||
--name=matrixdotorg-synapse \
|
|
||||||
--network=caddy-network \
|
|
||||||
--rm \
|
|
||||||
--mount type=bind,src=/opt/matrixdotorg-synapse/data,dst=/data \
|
|
||||||
matrixdotorg/synapse:latest
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
- name: docker-caddy.service
|
- name: docker-caddy.service
|
||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents_local: docker-caddy.service
|
||||||
[Unit]
|
|
||||||
Description=Caddy 2 is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.
|
|
||||||
After=docker.service \
|
|
||||||
docker-network-setup
|
|
||||||
Requires=docker.service \
|
|
||||||
docker-network-setup
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=docker run \
|
|
||||||
--name=caddy \
|
|
||||||
--network=caddy-network \
|
|
||||||
--rm \
|
|
||||||
--mount type=bind,src=/opt/caddy/etc/caddy,dst=/etc/caddy \
|
|
||||||
--mount type=bind,src=/opt/caddy/var/www/html,dst=/var/www/html \
|
|
||||||
--mount type=bind,src=/opt/caddy/data,dst=/data \
|
|
||||||
-p 80:80 \
|
|
||||||
-p 443:443 \
|
|
||||||
-p 8448:8448 \
|
|
||||||
caddy:latest
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
|||||||
0
files/.gitkeep
Normal file
0
files/.gitkeep
Normal file
22
files/docker-caddy.service
Normal file
22
files/docker-caddy.service
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Caddy 2 is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.
|
||||||
|
After=docker.service \
|
||||||
|
docker-network-setup
|
||||||
|
Requires=docker.service \
|
||||||
|
docker-network-setup
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=docker run \
|
||||||
|
--name=caddy \
|
||||||
|
--network=caddy-network \
|
||||||
|
--rm \
|
||||||
|
--mount type=bind,src=/opt/caddy/etc/caddy,dst=/etc/caddy \
|
||||||
|
--mount type=bind,src=/opt/caddy/var/www/html,dst=/var/www/html \
|
||||||
|
--mount type=bind,src=/opt/caddy/data,dst=/data \
|
||||||
|
-p 80:80 \
|
||||||
|
-p 443:443 \
|
||||||
|
-p 8448:8448 \
|
||||||
|
caddy:latest
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
25
files/docker-matrixdotorg-synapse.service
Normal file
25
files/docker-matrixdotorg-synapse.service
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Synapse: Matrix homeserver written in Python/Twisted + Rust
|
||||||
|
After=docker.service \
|
||||||
|
docker-network-setup
|
||||||
|
Requires=docker.service \
|
||||||
|
docker-network-setup
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=/usr/bin/docker run \
|
||||||
|
--name=matrixdotorg-synapse \
|
||||||
|
--network=caddy-network \
|
||||||
|
--rm \
|
||||||
|
--mount type=bind,src=/opt/matrixdotorg-synapse/data,dst=/data \
|
||||||
|
-e SYNAPSE_SERVER_NAME=matrix.fst.ee \
|
||||||
|
-e SYNAPSE_REPORT_STATS=yes \
|
||||||
|
matrixdotorg/synapse:latest generate
|
||||||
|
ExecStart=docker run \
|
||||||
|
--name=matrixdotorg-synapse \
|
||||||
|
--network=caddy-network \
|
||||||
|
--rm \
|
||||||
|
--mount type=bind,src=/opt/matrixdotorg-synapse/data,dst=/data \
|
||||||
|
matrixdotorg/synapse:latest
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
12
files/docker-network-setup.service
Normal file
12
files/docker-network-setup.service
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Create docker network: caddy-network
|
||||||
|
After=docker.service
|
||||||
|
Requires=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/usr/bin/docker network create caddy-network
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
2
files/etc/hosts
Normal file
2
files/etc/hosts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
127.0.0.1 localhost akpella.fst.ee
|
||||||
|
::1 localhost akpella.fst.ee
|
||||||
7
files/etc/systemd/network/00-eth0.network
Normal file
7
files/etc/systemd/network/00-eth0.network
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[Match]
|
||||||
|
Name=eth0
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
DNS=1.1.1.1
|
||||||
|
Address=193.40.103.107/24
|
||||||
|
Gateway=193.40.103.1
|
||||||
18
files/opt/caddy/etc/caddy/Caddyfile
Normal file
18
files/opt/caddy/etc/caddy/Caddyfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
email akpall+akpella@fst.ee
|
||||||
|
}
|
||||||
|
|
||||||
|
fst.ee {
|
||||||
|
root * /var/www/html
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
|
||||||
|
fst.ee:8448 {
|
||||||
|
reverse_proxy /_matrix/* matrixdotorg-synapse:8008
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix.fst.ee {
|
||||||
|
reverse_proxy /_matrix/* matrixdotorg-synapse:8008
|
||||||
|
reverse_proxy /_synapse/client/* matrixdotorg-synapse:8008
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user