diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-12 17:21:13 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-12 17:21:13 +0100 |
| commit | 4c3a68b72fd91a85a332161b9cf181566cef9289 (patch) | |
| tree | 0397c48e8825fdd3320899698e0d5a611b09afbe | |
| parent | 4f8d16ebcb16811d6a7a95d659be7e138d2713ef (diff) | |
remove remaining make stuff
| -rw-r--r-- | Makefile | 63 | ||||
| -rw-r--r-- | compose.yml | 12 | ||||
| -rw-r--r-- | gemini.Dockerfile | 19 | ||||
| -rw-r--r-- | make/container.mk | 28 | ||||
| -rw-r--r-- | make/crontab.mk | 13 | ||||
| -rw-r--r-- | make/openrc.mk | 74 | ||||
| -rw-r--r-- | make/vars.mk | 58 | ||||
| -rw-r--r-- | openrc/conf.d/user.template | 15 | ||||
| -rwxr-xr-x | openrc/init.d/joeac.net.template | 65 |
9 files changed, 0 insertions, 347 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 8707dce..0000000 --- a/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -include make/vars.mk - -submake_file = $(shell [ -f "$(module)/Makefile" ] && echo "$(module)/Makefile") -install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk") - -define make_module_rule = -.PHONY: make_$(module) -make_$(module): $(module)/.env - $(if $(submake_file),\ - $(MAKE) --makefile=$(notdir $(submake_file)) --directory=$(module)) -endef - -define module_env_rule = -$(module)/.env: .env - cp .env $(module)/.env -endef - -define install_module_rule = -.PHONY: install_$(module) -install_$(module): install_openrc_$(module) $(install_submake_file) - $(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) install) -endef - -define reinstall_module_rule = -.PHONY: reinstall_$(module) -reinstall_$(module): reinstall_openrc_$(module) $(install_submake_file) - $(if $(install_submake_file),$(MAKE) --makefile=$(notdir $(install_submake_file)) --directory=$(dir $(install_submake_file)) reinstall) -endef - -define uninstall_module_rule = -.PHONY: uninstall_$(module) -uninstall_$(module): uninstall_openrc_$(module) - $(if $(install_submake_file),\ - $(MAKE) --makefile=$(notdir $(install_submake_file)) --directory $(dir $(install_submake_file)) uninstall - ) -endef - -.PHONY: all -all: $(ENV_RULES) $(MAKE_RULES) $(BUILD_RULES) $(PUSH_RULES) - -$(foreach module,$(ALL_MODULES),$(eval $(call make_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(call module_env_rule))) - -.PHONY: install -install: $(ENV_RULES) $(INSTALL_RULES) install_crontab - -.PHONY: reinstall -reinstall: $(ENV_RULES) $(REINSTALL_RULES) reinstall_crontab - -.PHONY: uninstall -uninstall: uninstall_joeac.net_service $(UNINSTALL_RULES) uninstall_crontab - -$(foreach module,$(ALL_MODULES),$(eval $(install_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(reinstall_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(uninstall_module_rule))) - -.PHONY: clean -clean: - $(foreach module,$(MAKE_MODULES),$(MAKE) --directory=$(module) clean;) - -include make/container.mk -include make/openrc.mk -include make/crontab.mk diff --git a/compose.yml b/compose.yml deleted file mode 100644 index c9fde11..0000000 --- a/compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -services: - gemini: - image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-gemini - container_name: joeac.net-gemini - build: - context: . - dockerfile: gemini.Dockerfile - ports: - - "${GEMINI_PORT}:1965" - volumes: - - ${GEMINI_CERTIFICATES_DIR}:/var/app/.certificates - - ${GEMINI_COMITIUM_DATA_DIR}:/var/app/comitium-data diff --git a/gemini.Dockerfile b/gemini.Dockerfile deleted file mode 100644 index 933df29..0000000 --- a/gemini.Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.joeac.net/joeac/${IMAGE_PREFIX}agate:3.3.20-alpine3.23 AS agate -FROM git.joeac.net/joeac/${IMAGE_PREFIX}comitium:1.8.2-alpine3.23 AS comitium -FROM git.joeac.net/joeac/${IMAGE_PREFIX}crond:1.37.0-r30-alpine3.23 AS final -RUN apk --no-cache add gcc # dependency for agate -COPY --from=agate /root/.cargo/bin/agate /usr/local/bin/agate -COPY --from=comitium /usr/local/bin/comitium /usr/local/bin/comitium - -RUN mkdir -p /var/app/content -WORKDIR /var/app -RUN crontab -l > crontab.tmp \ - && echo "0 */6 * * * /usr/local/bin/comitium refresh --data /var/app/comitium-data" >> crontab.tmp \ - && crontab crontab.tmp \ - && rm crontab.tmp - -COPY gemini/run.sh /var/app/ -COPY gemini/content /var/app/content -COPY common /var/common - -CMD ./run.sh diff --git a/make/container.mk b/make/container.mk deleted file mode 100644 index 4c6702a..0000000 --- a/make/container.mk +++ /dev/null @@ -1,28 +0,0 @@ -REGISTRY_DOMAIN := git.joeac.net -REGISTRY_USER := joeac - -container_image_name = $(shell $(COMPOSE_CMD) config | yq ".services.$(module).image") -is_containerised = $(filter $(COMPOSE_SERVICES),$(module)) -is_own_image = $(filter git.joeac.net/%,$(container_image_name)) -has_dockerfile = $(shell test -f $(module).Dockerfile) - -define build_module_rule = -.PHONY: build_$(module) -build_$(module): $(if $(is_containerised),make_$(module) $(if $(has_dockerfile),$(module).Dockerfile)) - $(if $(is_containerised),\ - $(COMPOSE_CMD) build $(module)) -endef - -define push_module_rule = -.PHONY: push_$(module) -push_$(module): $(if $(is_containerised),login_registry) - $(if $(is_containerised),$(if $(is_own_image),\ - podman push $(container_image_name))) -endef - -$(foreach module,$(MODULES),$(eval $(call build_module_rule))) -$(foreach module,$(MODULES),$(eval $(call push_module_rule))) - -.PHONY: login_registry -login_registry: - podman login $(REGISTRY_DOMAIN) diff --git a/make/crontab.mk b/make/crontab.mk deleted file mode 100644 index 8d801a9..0000000 --- a/make/crontab.mk +++ /dev/null @@ -1,13 +0,0 @@ -.PHONY: install_crontab -install_crontab: /etc/periodic/daily/joeac.net - -.PHONY: reinstall_crontab -reinstall_crontab: /etc/periodic/daily/joeac.net - -.PHONY: uninstall_crontab -uninstall_crontab: - sudo rm -f /etc/periodic/daily/joeac.net - -/etc/periodic/daily/joeac.net: update.sh - sudo cp update.sh /etc/periodic/daily/joeac.net - sudo chmod +x /etc/periodic/daily/joeac.net diff --git a/make/openrc.mk b/make/openrc.mk deleted file mode 100644 index 207c71b..0000000 --- a/make/openrc.mk +++ /dev/null @@ -1,74 +0,0 @@ -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 = -.PHONY: install_openrc_$(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 - rm -f ~/.config/rc/init.d/joeac.net.$(module) - ln -s $(shell realpath ~)/.config/rc/init.d/joeac.net ~/.config/rc/init.d/joeac.net.$(module) -endef - -define reinstall_openrc_module_rule = -.PHONY: reinstall_openrc_$(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 -f ~/.config/rc/init.d/joeac.net.$(module); \ - ) -endef - -define openrc_add_rule = -.PHONY: openrc_add_$(module) -openrc_add_$(module): - rc-update -U add joeac.net.$(module) default -endef - -define openrc_start_rule = -.PHONY: openrc_start_$(module) -openrc_start_$(module): - rc-service -U joeac.net.$(module) start -endef - -define openrc_restart_rule = -.PHONY: openrc_restart_$(module) -openrc_restart_$(module): - rc-service -U joeac.net.$(module) restart -endef - -$(foreach module,$(ALL_MODULES),$(eval $(install_openrc_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(reinstall_openrc_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(uninstall_openrc_module_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(openrc_add_rule))) -$(foreach module,$(ALL_MODULES),$(eval $(openrc_start_rule))) -$(foreach module,$(MODULES),$(eval $(openrc_restart_rule))) - -~/.config/rc/init.d/joeac.net: openrc/init.d/joeac.net.template ~/.config/rc/init.d ~/.config/rc/runlevels/default /etc/init.d/user.$(USER) /etc/conf.d/user.$(USER) - rm -f ~/.config/rc/init.d/joeac.net; \ - mkdir -p ~/.config/rc/init.d; \ - COMPOSECMD="$(COMPOSE_CMD)" envsubst -i openrc/init.d/joeac.net.template -o ~/.config/rc/init.d/joeac.net - chmod +x ~/.config/rc/init.d/joeac.net - -~/.config/rc/init.d: - mkdir -p ~/.config/rc/init.d - -~/.config/rc/runlevels/default: - mkdir -p ~/.config/rc/runlevels/default - -/etc/init.d/user.$(USER): - sudo ln -s /etc/init.d/user /etc/init.d/user.$(USER) - -/etc/conf.d/user.$(USER): openrc/conf.d/user.template - USER=$(USER) envsubst -i openrc/conf.d/user.template -o openrc/conf.d/user.$(USER) - sudo mv openrc/conf.d/user.$(USER) /etc/conf.d/user.$(USER) - sudo rc-update add user.$(USER) default - -.PHONY: uninstall_joeac.net_service - rm ~/.config/rc/joeac.net diff --git a/make/vars.mk b/make/vars.mk deleted file mode 100644 index f09ffd7..0000000 --- a/make/vars.mk +++ /dev/null @@ -1,58 +0,0 @@ -capitalise = $(shell echo "$(1)" | tr '[:lower:]' '[:upper:]') - -USER := $(shell whoami) -HOSTNAME := $(shell cat /etc/hostname) -HOSTNAMES := pi-broughton blade-canongate -IP_ADDR_pi-broughton := 192.168.178.91 -IP_ADDR_blade-canongate := 192.168.178.75 -MASTER_NODE := blade-canongate -IS_MASTER_NODE := $(filter $(MASTER_NODE),$(HOSTNAME)) -MODULES_pi-broughton := -MODULES_blade-canongate := gemini -ALL_NGINX_MODULES := -NGINX_MODULES := $(if $(IS_MASTER_NODE),$(ALL_NGINX_MODULES)) -MODULES := $(MODULES_$(HOSTNAME)) -ALL_MODULES := $(sort $(foreach hostname,$(HOSTNAMES),$(MODULES_$(hostname)))) -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_actualbudget := budget - -PORT_gemini := 1965 -PORT_smtp := 2500 - -export GEMINI_CERTIFICATES_DIR := /var/joeac.net-gemini/certificates -export GEMINI_COMITIUM_DATA_DIR := /var/joeac.net-gemini/comitium-data - -ALPINE_VERSION := 3.23 - -$(foreach module,$(ALL_MODULES),$(if $(PORT_$(module)),$(eval \ - export $(call capitalise,$(module))_PORT := $(PORT_$(module))))) -$(foreach hostname,$(HOSTNAMES),$(foreach module,$(MODULES_$(hostname)),$(eval \ - export HOST_$(module) := $(if $(filter $(HOSTNAME),$(hostname)),127.0.0.1,$(IP_ADDR_$(hostname)))))) - -ALL_SUBDOMAINS := $(foreach module,$(ALL_MODULES),$(SUBDOMAIN_$(module))) -SUBDOMAINS := $(if $(IS_MASTER_NODE),$(ALL_SUBDOMAINS)) - -ENV_RULES := $(foreach module,$(MODULES),$(if $(shell test -d $(module) && echo 1),$(module)/.env)) -MAKE_RULES := $(foreach module,$(MAKE_MODULES),make_$(module)) -BUILD_RULES := $(foreach module,$(filter $(COMPOSE_SERVICES),$(MODULES)),build_$(module)) -PUSH_RULES := $(foreach module,$(filter $(COMPOSE_SERVICES),$(MODULES)),push_$(module)) -INSTALL_RULES := $(foreach module,$(MODULES),install_$(module)) -REINSTALL_RULES := $(foreach module,$(MODULES),reinstall_$(module)) -UNINSTALL_RULES := $(foreach module,$(MODULES),uninstall_$(module)) - -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/) -COMPOSE_CMD := \ - ACTUALBUDGET_DATA_DIR="$(ACTUALBUDGET_DATA_DIR)" \ - ALPINE_VERSION="$(ALPINE_VERSION)" \ - IMAGE_PREFIX="$(IMAGE_PREFIX)" \ - GEMINI_CERTIFICATES_DIR="$(GEMINI_CERTIFICATES_DIR)" \ - GEMINI_COMITIUM_DATA_DIR="$(GEMINI_COMITIUM_DATA_DIR)" \ - $(foreach module,$(ALL_MODULES),$(call capitalise,$(module))_PORT=$(PORT_$(module))) \ - podman-compose diff --git a/openrc/conf.d/user.template b/openrc/conf.d/user.template deleted file mode 100644 index 2bf637b..0000000 --- a/openrc/conf.d/user.template +++ /dev/null @@ -1,15 +0,0 @@ -UID="$$(id -u ${USER})" -if test -z "$${XDG_RUNTIME_DIR}"; then - export XDG_RUNTIME_DIR=/tmp/xdg/"$${UID}"-xdg-runtime-dir - if ! test -d "$${XDG_RUNTIME_DIR}"; then - mkdir -p "$${XDG_RUNTIME_DIR}" - chown -R ${USER}:${USER} "$${XDG_RUNTIME_DIR}" - chmod -R 0700 "$${XDG_RUNTIME_DIR}" - fi -fi -if ! test -f "$${XDG_RUNTIME_DIR}/openrc/softlevel"; then - mkdir -p "$${XDG_RUNTIME_DIR}/openrc" - touch "$${XDG_RUNTIME_DIR}/openrc/softlevel" - chown -R ${USER}:${USER} "$${XDG_RUNTIME_DIR}" - chmod -R 0700 "$${XDG_RUNTIME_DIR}" -fi diff --git a/openrc/init.d/joeac.net.template b/openrc/init.d/joeac.net.template deleted file mode 100755 index 53763fa..0000000 --- a/openrc/init.d/joeac.net.template +++ /dev/null @@ -1,65 +0,0 @@ -#!/sbin/openrc-run -# credits: -# https://gist.github.com/itzwam/2069e935385193207f7e5bea7156e21d -# https://github.com/0x17de/dockerservice-openrc - -: $${HOME:=/home/joeac.net} -: $${MODULENAME:=$${RC_SVCNAME##*.}} -: $${SRCDIR:=$$HOME/joeac.net} -DOCKER_COMPOSE_UP_ARGS=$${DOCKER_COMPOSE_UP_ARGS-"--no-build --no-recreate --no-deps"} - -[ -z "$${MODULENAME}" ] && exit 1 -: $${COMPOSEFILE:="$${SRCDIR}/compose.yml"} -: $${MAKEFILE:="$${SRCDIR}/Makefile"} -export COMPOSE_HTTP_TIMEOUT=300 - -description="Manage dockerservices defined in $${COMPOSEFILE}" -extra_commands="configtest" -description_configtest="Check configuration via \"podman-compose -f $${COMPOSEFILE} config\"" - -configtest() { - if ! [ -f "$${COMPOSEFILE}" ]; then - eerror "The docker-compose file $${COMPOSEFILE} does not exist!" - return 1 - fi - if ${COMPOSECMD} -f "$${COMPOSEFILE}" config >&/dev/null; then - einfo "config: ok" - else - eerror "config: error" - return 1 - fi -} - -start() { - configtest || return 1 - ebegin "Starting $${MODULENAME}" - ${COMPOSECMD} -f "$${COMPOSEFILE}" up -d $${DOCKER_COMPOSE_UP_ARGS} $${MODULENAME} - eend $$? -} - -stop() { - ebegin "Stopping $${MODULENAME}" - ${COMPOSECMD} -f "$${COMPOSEFILE}" down --timeout=5 $${MODULENAME} - eend $$? -} - -status() { - pods=0 - started=0 - while read pod; do - pod_service="$$(podman inspect $$pod | jq .[0].Config.Labels.[\"com.docker.compose.service\"])" - if ! [ "$$pod_service" = "\"$${MODULENAME}\"" ]; then - continue - fi - pods=$$(($$pods+1)) - if podman top $$pod &>/dev/null; then - einfo "status: [$$pod] started" - exit 0 - else - einfo "status: [$$pod] stopped" - exit 3 - fi - done < <(${COMPOSECMD} -f "$${COMPOSEFILE}" ps --quiet) - einfo "status: no container found for $${MODULENAME}" - exit 3 -} |
