Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7c8a96a57 | |||
| f73512107c | |||
| f8401d00a4 | |||
| b79037c055 | |||
| 8af9a55187 | |||
| 1b200f217b | |||
| c0e6d13a1f | |||
| 2b00e03999 | |||
| bf2dabe3f4 | |||
| d0f549ce22 | |||
| 89165e9d88 | |||
| a601e93d00 |
@@ -5,3 +5,6 @@ indent_size = 2
|
|||||||
|
|
||||||
[*.{md,markdown,mdx}]
|
[*.{md,markdown,mdx}]
|
||||||
max_line_length = 80
|
max_line_length = 80
|
||||||
|
|
||||||
|
[{Makefile,*.mk}]
|
||||||
|
indent_style = tab
|
||||||
|
|||||||
@@ -1,40 +1,10 @@
|
|||||||
include config.mk
|
include make/vars.mk
|
||||||
|
|
||||||
#############
|
|
||||||
# VARIABLES #
|
|
||||||
#############
|
|
||||||
|
|
||||||
CPU_ARCH := $(if $(shell which arch 2>/dev/null),\
|
|
||||||
$(shell arch),\
|
|
||||||
$(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/"))
|
|
||||||
HOSTNAME := $(shell cat /etc/hostname)
|
|
||||||
IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/)
|
|
||||||
REGISTRY_DOMAIN := git.joeac.net
|
|
||||||
REGISTRY_USER := joeac
|
|
||||||
MODULES_pi-broughton := http gemini smtp vaultwarden ln
|
|
||||||
MODULES_blade-canongate := etherpad
|
|
||||||
MASTER_NODE := pi-broughton
|
|
||||||
IS_MASTER_NODE := $(filter $(MASTER_NODE),$(HOSTNAME))
|
|
||||||
MODULES := $(MODULES_$(HOSTNAME))
|
|
||||||
SUBDOMAINS := $(foreach module,$(MODULES),$(SUBDOMAIN_$(module)))
|
|
||||||
COMPOSE_SERVICES := $(shell podman-compose config \
|
|
||||||
| yq ".services | keys" --output-format csv --csv-separator " ")
|
|
||||||
MAKE_MODULES := $(foreach module,$(MODULES),\
|
|
||||||
$(shell [ -f $(module)/Makefile ] && echo $(module)))
|
|
||||||
NGINX_CONFIG_SRC := nginx/nginx.conf
|
|
||||||
NGINX_CONFIG := /etc/nginx/nginx.conf
|
|
||||||
NGINX_CONFIG_BACKUP := /etc/nginx/nginx.joeac.net-backup
|
|
||||||
RESTART_NGINX := sudo rc-service nginx restart
|
|
||||||
|
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# FUNCTIONS #
|
# FUNCTIONS #
|
||||||
#############
|
#############
|
||||||
|
|
||||||
container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/joeac.net-$(module)
|
|
||||||
nginx_module_target = $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
|
|
||||||
dyndns_module_target = $(if $(SUBDOMAIN_$(module)),/etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net)
|
|
||||||
openrc_module_target = $(if $(filter $(COMPOSE_SERVICES),$(module)),~/.config/rc/init.d/joeac.net.$(module))
|
|
||||||
install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk")
|
install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk")
|
||||||
|
|
||||||
define make_module_rule =
|
define make_module_rule =
|
||||||
@@ -50,29 +20,19 @@ endef
|
|||||||
|
|
||||||
define install_module_rule =
|
define install_module_rule =
|
||||||
.PHONY: install_$(module)
|
.PHONY: install_$(module)
|
||||||
install_$(module): install_openrc_$(module) $(nginx_module_target) $(dyndns_module_target) $(install_submake_file)
|
install_$(module): install_openrc_$(module) install_nginx_$(module) install_dyndns_$(module) $(install_submake_file)
|
||||||
$(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) install)
|
$(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) install)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define reinstall_module_rule =
|
define reinstall_module_rule =
|
||||||
.PHONY: reinstall_$(module)
|
.PHONY: reinstall_$(module)
|
||||||
reinstall_$(module): reinstall_openrc_$(module) $(nginx_module_target) $(dyndns_module_target) $(install_submake_file)
|
reinstall_$(module): reinstall_openrc_$(module) reinstall_nginx_$(module) reinstall_dyndns_$(module) $(install_submake_file)
|
||||||
$(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) reinstall)
|
$(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) reinstall)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define uninstall_module_rule =
|
define uninstall_module_rule =
|
||||||
.PHONY: uninstall_$(module)
|
.PHONY: uninstall_$(module)
|
||||||
uninstall_$(module):
|
uninstall_$(module): uninstall_openrc_$(module) uninstall_nginx_$(module) uninstall_dyndns_$(module)
|
||||||
$(if $(openrc_module_target),\
|
|
||||||
rc-service -U joeac.net.$(module) stop \
|
|
||||||
rc-update -U del joeac.net.$(module) default \
|
|
||||||
rm ~/.config/rc/init.d/joeac.net.$(module) \
|
|
||||||
)
|
|
||||||
$(if $(SUBDOMAIN_$(module)),\
|
|
||||||
sudo rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf; \
|
|
||||||
$(RESTART_NGINX); \
|
|
||||||
sudo rm -f /etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net; \
|
|
||||||
)
|
|
||||||
$(if $(install_submake_file),\
|
$(if $(install_submake_file),\
|
||||||
$(MAKE) --makefile=$(notdir (install_submake_file)) --directory $(dir $(install_submake_file)) uninstall
|
$(MAKE) --makefile=$(notdir (install_submake_file)) --directory $(dir $(install_submake_file)) uninstall
|
||||||
)
|
)
|
||||||
@@ -103,18 +63,15 @@ install: $(foreach module,$(MODULES),install_$(module)) install_crontab
|
|||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall: uninstall_nginx uninstall_dyndns uninstall_joeac.net_service $(foreach module,$(MODULES),uninstall_$(module)) uninstall_crontab
|
uninstall: uninstall_nginx uninstall_dyndns uninstall_joeac.net_service $(foreach module,$(MODULES),uninstall_$(module)) uninstall_crontab
|
||||||
|
|
||||||
.PHONY: uninstall_joeac.net_service
|
|
||||||
rm ~/.config/rc/joeac.net
|
|
||||||
|
|
||||||
$(foreach module,$(MODULES),$(eval $(install_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(install_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(reinstall_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(reinstall_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(uninstall_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(uninstall_module_rule)))
|
||||||
|
|
||||||
include container.mk
|
include make/container.mk
|
||||||
include openrc.mk
|
include make/openrc.mk
|
||||||
include nginx.mk
|
include make/nginx.mk
|
||||||
include crontab.mk
|
include make/crontab.mk
|
||||||
include dyndns.mk
|
include make/dyndns.mk
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
gemini:
|
gemini:
|
||||||
image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-gemini
|
image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-gemini
|
||||||
container_name: joeac.net-gemini
|
container_name: joeac.net-gemini
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -9,7 +9,7 @@ services:
|
|||||||
- "${GEMINI_PORT}:1965"
|
- "${GEMINI_PORT}:1965"
|
||||||
|
|
||||||
http:
|
http:
|
||||||
image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-http
|
image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-http
|
||||||
container_name: joeac.net-http
|
container_name: joeac.net-http
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -30,7 +30,7 @@ services:
|
|||||||
- "${HTTP_PORT}:80"
|
- "${HTTP_PORT}:80"
|
||||||
|
|
||||||
etherpad:
|
etherpad:
|
||||||
image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-etherpad
|
image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-etherpad
|
||||||
container_name: joeac.net-etherpad
|
container_name: joeac.net-etherpad
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -48,7 +48,7 @@ services:
|
|||||||
- "${ETHERPAD_PORT}:9001"
|
- "${ETHERPAD_PORT}:9001"
|
||||||
|
|
||||||
smtp:
|
smtp:
|
||||||
image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-smtp
|
image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-smtp
|
||||||
container_name: joeac.net-smtp
|
container_name: joeac.net-smtp
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
SUBDOMAIN_http := @
|
|
||||||
SUBDOMAIN_vaultwarden := pwd
|
|
||||||
SUBDOMAIN_etherpad := docs
|
|
||||||
SUBDOMAIN_ln := ln
|
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
|
CPU_ARCH := $(if $(shell which arch 2>/dev/null),\
|
||||||
|
$(shell arch),\
|
||||||
|
$(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/"))
|
||||||
|
IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/)
|
||||||
|
REGISTRY_DOMAIN := git.joeac.net
|
||||||
|
REGISTRY_USER := joeac
|
||||||
|
|
||||||
|
container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/$(CONTAINER_PREFIX)joeac.net-$(module)
|
||||||
|
|
||||||
define build_module_rule =
|
define build_module_rule =
|
||||||
.PHONY: build_$(module)
|
.PHONY: build_$(module)
|
||||||
build_$(module): make_$(module) $(module).Dockerfile
|
build_$(module): make_$(module) $(module).Dockerfile
|
||||||
podman-compose build $(module)
|
IMAGE_PREFIX="$(IMAGE_PREFIX)" podman-compose build $(module)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define push_module_rule =
|
define push_module_rule =
|
||||||
+28
-12
@@ -1,11 +1,34 @@
|
|||||||
.PHONY: install_dyndns
|
define install_dyndns_module_rule =
|
||||||
install_dyndns: /usr/local/bin/dyndns.sh ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
.PHONY: install_dyndns_$(module)
|
||||||
|
install_dyndns_module_$(module): $(if $(SUBDOMAIN_$(module)),/etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net install_dyndns)
|
||||||
|
endef
|
||||||
|
|
||||||
.PHONY: reinstall_dyndns
|
define reinstall_dyndns_module_rule =
|
||||||
reinstall_dyndns: /usr/local/bin/dyndns.sh ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
.PHONY: reinstall_dyndns_$(module)
|
||||||
|
reinstall_dyndns_$(module): $(if $(SUBDOMAIN_$(module)),/etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net reinstall_dyndns)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define uninstall_dyndns_module_rule =
|
||||||
|
.PHONY: uninstall_dyndns_$(module)
|
||||||
|
uninstall_dyndns_$(module):
|
||||||
|
$(if $(SUBDOMAIN_$(module)), \
|
||||||
|
sudo rm -f /etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach module,$(ALL_MODULES), $(eval $(install_dyndns_module_rule)))
|
||||||
|
$(foreach module,$(ALL_MODULES), $(eval $(reinstall_dyndns_module_rule)))
|
||||||
|
$(foreach module,$(ALL_MODULES), $(eval $(uninstall_dyndns_module_rule)))
|
||||||
|
|
||||||
|
/etc/periodic/daily/dyndns-%joeac.net: /usr/local/bin/dyndns.sh ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
||||||
|
echo "#!/bin/sh" > crontab.tmp
|
||||||
|
echo " /usr/local/bin/dyndns.sh 4 $(*F)joeac.net" >> crontab.tmp
|
||||||
|
echo "CONN_DEVICE_NAME=eth0 /usr/local/bin/dyndns.sh 6 $(*F)joeac.net" >> crontab.tmp
|
||||||
|
sudo mv crontab.tmp $@
|
||||||
|
sudo chmod +x $@
|
||||||
|
|
||||||
.PHONY: uninstall_dyndns
|
.PHONY: uninstall_dyndns
|
||||||
uninstall_dyndns:
|
uninstall_dyndns: $(foreach module,$(ALL_MODULES),$(uninstall_dyndns_$(module)))
|
||||||
sudo rm -rf \
|
sudo rm -rf \
|
||||||
/usr/local/bin/dyndns.sh \
|
/usr/local/bin/dyndns.sh \
|
||||||
/usr/local/bin/get_ip_addr.sh \
|
/usr/local/bin/get_ip_addr.sh \
|
||||||
@@ -29,10 +52,3 @@ uninstall_dyndns:
|
|||||||
mkdir -p ~/.config/dyndns/
|
mkdir -p ~/.config/dyndns/
|
||||||
rm -f ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
rm -f ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
||||||
cp DIGITALOCEAN_TOKEN ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
cp DIGITALOCEAN_TOKEN ~/.config/dyndns/DIGITALOCEAN_TOKEN
|
||||||
|
|
||||||
/etc/periodic/daily/dyndns-%joeac.net: /usr/local/bin/dyndns.sh
|
|
||||||
echo "#!/bin/sh" > crontab.tmp
|
|
||||||
echo " /usr/local/bin/dyndns.sh 4 $(*F)joeac.net" >> crontab.tmp
|
|
||||||
echo "CONN_DEVICE_NAME=eth0 /usr/local/bin/dyndns.sh 6 $(*F)joeac.net" >> crontab.tmp
|
|
||||||
sudo mv crontab.tmp $@
|
|
||||||
sudo chmod +x $@
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
define install_nginx_module_rule =
|
||||||
|
.PHONY: install_nginx_$(module)
|
||||||
|
install_nginx_$(module): $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define reinstall_nginx_module_rule =
|
||||||
|
.PHONY: reinstall_nginx_$(module)
|
||||||
|
reinstall_nginx_$(module): $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define uninstall_nginx_module_rule =
|
||||||
|
.PHONY: uninstall_nginx_$(module)
|
||||||
|
uninstall_nginx_$(module):
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach module,$(MODULES),$(eval $(install_nginx_module_rule)))
|
||||||
|
|
||||||
|
/etc/nginx/http.d/%.joeac.net.conf: nginx/http.d/%.joeac.net.conf /etc/nginx/http.d /etc/nginx/nginx.conf
|
||||||
|
sudo cp $< $@
|
||||||
|
sudo rc-service nginx restart
|
||||||
|
|
||||||
|
/etc/nginx/http.d:
|
||||||
|
sudo mkdir -p /etc/nginx/http.d
|
||||||
|
|
||||||
|
.PHONY: uninstall_nginx
|
||||||
|
uninstall_nginx: $(foreach module,$(MODULES),uninstall_nginx_$(module))
|
||||||
|
ifeq ($(shell test -d /etc/nginx/nginx.joeac.net-backup && echo 1 || echo 0),0)
|
||||||
|
$(warn No nginx backup config detected: doing nothing)
|
||||||
|
else
|
||||||
|
sudo mv /etc/nginx/nginx.joeac.net-backup /etc/nginx/nginx.conf
|
||||||
|
sudo rc-service nginx restart
|
||||||
|
endif
|
||||||
|
|
||||||
|
/etc/nginx/nginx.conf: nginx/nginx.conf /etc/nginx/nginx.joeac.net-backup
|
||||||
|
sudo cp $< $@
|
||||||
|
sudo rc-service nginx restart
|
||||||
|
|
||||||
|
/etc/nginx/nginx.joeac.net-backup:
|
||||||
|
sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.joeac.net-backup
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
|
is_openrc_module = $(filter $(COMPOSE_SERVICES),$(module))
|
||||||
|
openrc_module_target = $(if $(is_openrc_module),~/.config/rc/init.d/joeac.net.$(module))
|
||||||
|
|
||||||
define install_openrc_module_rule =
|
define install_openrc_module_rule =
|
||||||
.PHONY: install_openrc_$(module)
|
.PHONY: install_openrc_$(module)
|
||||||
install_openrc_$(module): $(openrc_module_target) openrc_add_$(module) openrc_start_$(module)
|
install_openrc_$(module): $(if $(is_openrc_module),$(openrc_module_target) openrc_add_$(module) openrc_start_$(module))
|
||||||
|
|
||||||
~/.config/rc/init.d/joeac.net.$(module): ~/.config/rc/init.d/joeac.net ~/.config/rc/runlevels/default
|
~/.config/rc/init.d/joeac.net.$(module): ~/.config/rc/init.d/joeac.net ~/.config/rc/runlevels/default
|
||||||
ln -s $(shell realpath ~)/.config/rc/init.d/joeac.net ~/.config/rc/init.d/joeac.net.$(module)
|
ln -s $(shell realpath ~)/.config/rc/init.d/joeac.net ~/.config/rc/init.d/joeac.net.$(module)
|
||||||
@@ -8,7 +11,17 @@ endef
|
|||||||
|
|
||||||
define reinstall_openrc_module_rule =
|
define reinstall_openrc_module_rule =
|
||||||
.PHONY: reinstall_openrc_$(module)
|
.PHONY: reinstall_openrc_$(module)
|
||||||
reinstall_openrc_$(module): $(if $(openrc_module_target),$(openrc_module_target) openrc_restart_$(module))
|
reinstall_openrc_$(module): $(if $(is_openrc_module),$(openrc_module_target) openrc_restart_$(module))
|
||||||
|
endef
|
||||||
|
|
||||||
|
define uninstall_openrc_module_rule =
|
||||||
|
.PHONY: uninstall_openrc_$(module)
|
||||||
|
uninstall_openrc_$(module):
|
||||||
|
$(if $(is_openrc_module),\
|
||||||
|
rc-service -U joeac.net.$(module) stop; \
|
||||||
|
rc-update -U del joeac.net.$(module) default; \
|
||||||
|
rm ~/.config/rc/init.d/joeac.net.$(module); \
|
||||||
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define openrc_add_rule =
|
define openrc_add_rule =
|
||||||
@@ -31,6 +44,7 @@ endef
|
|||||||
|
|
||||||
$(foreach module,$(MODULES),$(eval $(install_openrc_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(install_openrc_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(reinstall_openrc_module_rule)))
|
$(foreach module,$(MODULES),$(eval $(reinstall_openrc_module_rule)))
|
||||||
|
$(foreach module,$(MODULES),$(eval $(uninstall_openrc_module_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_add_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_add_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_start_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_start_rule)))
|
||||||
$(foreach module,$(MODULES),$(eval $(openrc_restart_rule)))
|
$(foreach module,$(MODULES),$(eval $(openrc_restart_rule)))
|
||||||
@@ -52,3 +66,6 @@ $(foreach module,$(MODULES),$(eval $(openrc_restart_rule)))
|
|||||||
/etc/conf.d/user.$(shell whoami): openrc/conf.d/user.$(shell whoami)
|
/etc/conf.d/user.$(shell whoami): openrc/conf.d/user.$(shell whoami)
|
||||||
sudo cp openrc/conf.d/user.$(shell whoami) /etc/conf.d/user.$(shell whoami)
|
sudo cp openrc/conf.d/user.$(shell whoami) /etc/conf.d/user.$(shell whoami)
|
||||||
sudo rc-update add user.$(shell whoami) default
|
sudo rc-update add user.$(shell whoami) default
|
||||||
|
|
||||||
|
.PHONY: uninstall_joeac.net_service
|
||||||
|
rm ~/.config/rc/joeac.net
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
HOSTNAME := $(shell cat /etc/hostname)
|
||||||
|
HOSTNAMES := pi-broughton blade-canongate
|
||||||
|
MODULES_pi-broughton := http gemini smtp vaultwarden ln
|
||||||
|
MODULES_blade-canongate := etherpad
|
||||||
|
ALL_MODULES := $(sort $(foreach hostname,$(HOSTNAMES),$(MODULES_$(hostname))))
|
||||||
|
MASTER_NODE := pi-broughton
|
||||||
|
IS_MASTER_NODE := $(filter $(MASTER_NODE),$(HOSTNAME))
|
||||||
|
MODULES := $(MODULES_$(HOSTNAME))
|
||||||
|
SUBDOMAINS := $(foreach module,$(MODULES),$(SUBDOMAIN_$(module)))
|
||||||
|
COMPOSE_SERVICES := $(shell podman-compose config \
|
||||||
|
| yq ".services | keys" --output-format csv --csv-separator " ")
|
||||||
|
MAKE_MODULES := $(foreach module,$(MODULES),\
|
||||||
|
$(shell [ -f $(module)/Makefile ] && echo $(module)))
|
||||||
|
SUBDOMAIN_http := @
|
||||||
|
SUBDOMAIN_vaultwarden := pwd
|
||||||
|
SUBDOMAIN_etherpad := docs
|
||||||
|
SUBDOMAIN_ln := ln
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
.PHONY: install_nginx
|
|
||||||
install_nginx: $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG)
|
|
||||||
|
|
||||||
.PHONY: reinstall_nginx
|
|
||||||
reinstall_nginx: $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG)
|
|
||||||
|
|
||||||
.PHONY: uninstall_nginx
|
|
||||||
uninstall_nginx: uninstall_dyndns
|
|
||||||
ifeq ($(shell test -d $(NGINX_CONFIG_BACKUP) && echo 1 || echo 0),0)
|
|
||||||
$(warn No nginx backup config detected: doing nothing)
|
|
||||||
else
|
|
||||||
sudo mv $(NGINX_CONFIG_BACKUP) $(NGINX_CONFIG)
|
|
||||||
$(RESTART_NGINX)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(NGINX_CONFIG_BACKUP):
|
|
||||||
sudo mv $(NGINX_CONFIG) $(NGINX_CONFIG_BACKUP)
|
|
||||||
|
|
||||||
$(NGINX_CONFIG): $(NGINX_CONFIG_SRC) $(NGINX_CONFIG_BACKUP)
|
|
||||||
sudo cp $< $@
|
|
||||||
$(RESTART_NGINX)
|
|
||||||
|
|
||||||
/etc/nginx/http.d/%joeac.net.conf: nginx/http.d/%joeac.net.conf /etc/nginx/http.d $(NGINX_CONFIG)
|
|
||||||
sudo cp $< $@
|
|
||||||
$(RESTART_NGINX)
|
|
||||||
|
|
||||||
/etc/nginx/http.d:
|
|
||||||
sudo mkdir -p /etc/nginx/http.d
|
|
||||||
Reference in New Issue
Block a user