From 766b7edcdd4021c17c8099a4ce244e8272c7ff6d Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 13 Jun 2026 21:03:43 +0200 Subject: [PATCH] Derive WEBROOT_USER from WEBROOT, remove from env --- .env.example | 1 - Makefile | 2 +- scripts/server-install.sh | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 1463f23..e3429ad 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,5 @@ SERVER=user@example.com WEBROOT=/home/example.com/public_html -WEBROOT_USER=example.com USER_REPO=https://gitea.example.com/user/natascha-rieter.nl-user.git GITEA_HOST=gitea.example.com diff --git a/Makefile b/Makefile index 7fba698..1beed04 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ content-pull: # Remote remote-install: - ssh $(SERVER) "WEBROOT=$(WEBROOT) WEBROOT_USER=$(WEBROOT_USER) USER_REPO=$(USER_REPO) GITEA_HOST=$(GITEA_HOST) GITEA_USER=$(GITEA_USER) GITEA_TOKEN=$(GITEA_TOKEN) bash -s" < scripts/server-install.sh + ssh $(SERVER) "WEBROOT=$(WEBROOT) USER_REPO=$(USER_REPO) GITEA_HOST=$(GITEA_HOST) GITEA_USER=$(GITEA_USER) GITEA_TOKEN=$(GITEA_TOKEN) bash -s" < scripts/server-install.sh remote-install-plugins: ssh $(SERVER) "cd $(WEBROOT) && php bin/gpm install $(shell cat plugins.txt | tr '\n' ' ') -y" diff --git a/scripts/server-install.sh b/scripts/server-install.sh index 57455da..cbe0b07 100755 --- a/scripts/server-install.sh +++ b/scripts/server-install.sh @@ -2,8 +2,9 @@ set -e : "${WEBROOT:?WEBROOT is not set}" -: "${WEBROOT_USER:?WEBROOT_USER is not set}" : "${USER_REPO:?USER_REPO is not set}" + +WEBROOT_USER=$(echo "$WEBROOT" | cut -d'/' -f3) : "${GITEA_HOST:?GITEA_HOST is not set}" : "${GITEA_USER:?GITEA_USER is not set}" : "${GITEA_TOKEN:?GITEA_TOKEN is not set}"