Compare commits

...

4 Commits

Author SHA1 Message Date
joeac 51ce3374b9 adds ln module 2026-06-30 09:36:12 +01:00
joeac 16576fd1f6 can have a sub-install.mk 2026-06-30 09:35:32 +01:00
joeac 3ff52465dd Makefile doesn't assume that every service has Makefile and Compose
service
2026-06-30 09:35:18 +01:00
joeac 0e9f8e2dd6 silences which complaining if no arch 2026-06-30 08:51:23 +01:00
5 changed files with 61 additions and 10 deletions
+21 -10
View File
@@ -4,13 +4,19 @@ include config.mk
# VARIABLES # # VARIABLES #
############# #############
CPU_ARCH := $(if $(shell which arch),\ CPU_ARCH := $(if $(shell which arch 2>/dev/null),\
$(shell arch),\ $(shell arch),\
$(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/")) $(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/"))
IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/) IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/)
REGISTRY_DOMAIN := git.joeac.net REGISTRY_DOMAIN := git.joeac.net
REGISTRY_USER := joeac REGISTRY_USER := joeac
MODULES := http gemini smtp vaultwarden etherpad MODULES := http gemini smtp vaultwarden etherpad ln
COMPOSE_SERVICES := $(shell podman-compose config \
| yq ".services | keys" \
| sed "s/[,[\"]//g" \
| sed "s/]//g")
MAKE_MODULES := $(foreach module,$(MODULES),\
$(shell [ -f $(module)/Makefile ] && echo $(module)))
############# #############
@@ -20,6 +26,8 @@ MODULES := http gemini smtp vaultwarden etherpad
container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/joeac.net-$(module) 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 restart_nginx) nginx_module_target = $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf restart_nginx)
dyndns_module_target = $(if $(SUBDOMAIN_$(module)),/etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net) 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")
define build_module_rule = define build_module_rule =
.PHONY: build_$(module) .PHONY: build_$(module)
@@ -46,7 +54,8 @@ endef
define install_module_rule = define install_module_rule =
.PHONY: install_$(module) .PHONY: install_$(module)
install_$(module): ~/.config/rc/init.d/joeac.net ~/.config/rc/init.d/joeac.net.$(module) $(nginx_module_target) $(dyndns_module_target) install_$(module): $(openrc_module_target) $(nginx_module_target) $(dyndns_module_target) $(install_submake_file)
$(if $(install_submake_file),$(MAKE) --makefile=$(install_submake_file)) install
~/.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)
@@ -57,9 +66,11 @@ endef
define uninstall_module_rule = define uninstall_module_rule =
.PHONY: uninstall_$(module) .PHONY: uninstall_$(module)
uninstall_$(module): uninstall_$(module):
rc-service -U joeac.net.$(module) stop $(if $(openrc_module_target),\
rc-update -U del joeac.net.$(module) default rc-service -U joeac.net.$(module) stop \
rm ~/.config/rc/init.d/joeac.net.$(module) rc-update -U del joeac.net.$(module) default \
rm ~/.config/rc/init.d/joeac.net.$(module) \
)
$(if $(SUBDOMAIN_$(module)),\ $(if $(SUBDOMAIN_$(module)),\
sudo rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf; \ sudo rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf; \
sudo rc-service nginx restart; \ sudo rc-service nginx restart; \
@@ -74,9 +85,9 @@ endef
all: $(foreach module,$(MODULES),push_$(module)) all: $(foreach module,$(MODULES),push_$(module))
$(foreach module,$(MODULES),$(eval $(call build_module_rule))) $(foreach module,$(COMPOSE_SERVICES),$(eval $(call build_module_rule)))
$(foreach module,$(MODULES),$(eval $(call push_module_rule))) $(foreach module,$(COMPOSE_SERVICES),$(eval $(call push_module_rule)))
$(foreach module,$(MODULES),$(eval $(call make_module_rule))) $(foreach module,$(MAKE_MODULES),$(eval $(call make_module_rule)))
$(foreach module,$(MODULES),$(eval $(call module_env_rule))) $(foreach module,$(MODULES),$(eval $(call module_env_rule)))
.PHONY: login_registry .PHONY: login_registry
@@ -202,4 +213,4 @@ uninstall_dyndns:
.PHONY: clean .PHONY: clean
clean: clean:
$(foreach module,$(MODULES),$(MAKE) --directory=$(module) clean;) $(foreach module,$(MAKE_MODULES),$(MAKE) --directory=$(module) clean;)
+1
View File
@@ -1,3 +1,4 @@
SUBDOMAIN_http := @ SUBDOMAIN_http := @
SUBDOMAIN_vaultwarden := pwd SUBDOMAIN_vaultwarden := pwd
SUBDOMAIN_etherpad := docs SUBDOMAIN_etherpad := docs
SUBDOMAIN_ln := ln
+13
View File
@@ -0,0 +1,13 @@
LN_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
.PHONY: install
install: /var/ln.joeac.net/public
/var/ln.joeac.net/public: $(LN_DIR)/public
sudo rm -rf /var/ln.joeac.net/public
sudo mkdir -p /var/ln.joeac.net/public
sudo cp -r $(LN_DIR)/public
.PHONY: uninstall
uninstall:
sudo rm -rf /var/ln.joeac.net
+1
View File
@@ -0,0 +1 @@
<meta http-equiv="refresh" content="0" ; url="https://forms.zoho.eu/mejo1/form/MilehousehutJuly2026" />
+25
View File
@@ -0,0 +1,25 @@
server {
server_name ln.joeac.net;
location / {
root /var/ln.joeac.net/public;
try_files $uri $uri.html $uri/index.html =404;
error_page 404 /index.html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ln.joeac.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ln.joeac.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = ln.joeac.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name ln.joeac.net;
listen 80;
return 404; # managed by Certbot
}