Install gen-admin-password alongside vetting
CI / Lint + build + test (push) Failing after 5m16s

proxmox-install.sh + install.sh left operators with no way to
generate the bcrypt hash on the LXC — 'vetting gen-admin-password'
was suggested in the post-install message but the binary has no
subcommands. Cross-build gen-admin-password-linux-amd64 during the
one-liner flow and drop it into /usr/local/bin.
This commit is contained in:
2026-04-17 21:50:54 -04:00
parent 64acb97073
commit 47b4fa35a6
3 changed files with 21 additions and 3 deletions
+4
View File
@@ -32,6 +32,10 @@ agent-linux: ## Cross-build agent for linux-amd64 (consumed by live-image build)
gen-admin-password: ## Build the bcrypt password generator gen-admin-password: ## Build the bcrypt password generator
go build -o bin/gen-admin-password$(if $(filter Windows%,$(UNAME_S)),.exe,) ./tools/gen-admin-password go build -o bin/gen-admin-password$(if $(filter Windows%,$(UNAME_S)),.exe,) ./tools/gen-admin-password
.PHONY: gen-admin-password-linux
gen-admin-password-linux: ## Cross-build the bcrypt password generator for linux-amd64
$(GOOS_LINUX) go build -ldflags="$(LDFLAGS)" -o bin/gen-admin-password-linux-amd64 ./tools/gen-admin-password
.PHONY: tidy .PHONY: tidy
tidy: ## go mod tidy tidy: ## go mod tidy
go mod tidy go mod tidy
+15 -1
View File
@@ -95,6 +95,20 @@ install -d -m 0755 "${CONFIG_DIR}"
echo "==> installing binary" echo "==> installing binary"
install -m 0755 "${BINARY}" /usr/local/bin/vetting install -m 0755 "${BINARY}" /usr/local/bin/vetting
# Install the bcrypt password generator too if we can find it — the
# operator needs it to fill in auth.admin_password_bcrypt.
GEN_PW=""
for cand in \
"${REPO_ROOT}/bin/gen-admin-password-linux-amd64" \
"${REPO_ROOT}/bin/gen-admin-password" \
"${SCRIPT_DIR}/gen-admin-password"; do
if [[ -x "${cand}" ]]; then GEN_PW="${cand}"; break; fi
done
if [[ -n "${GEN_PW}" ]]; then
echo "==> installing gen-admin-password"
install -m 0755 "${GEN_PW}" /usr/local/bin/gen-admin-password
fi
echo "==> installing config and systemd unit" echo "==> installing config and systemd unit"
if [[ ! -f "${CONFIG_DIR}/vetting.yaml" ]]; then if [[ ! -f "${CONFIG_DIR}/vetting.yaml" ]]; then
install -m 0640 -o root -g "${SERVICE_USER}" \ install -m 0640 -o root -g "${SERVICE_USER}" \
@@ -123,7 +137,7 @@ vetting is installed but not yet enabled.
Next steps: Next steps:
1. Edit ${CONFIG_DIR}/vetting.yaml and set: 1. Edit ${CONFIG_DIR}/vetting.yaml and set:
- auth.admin_password_bcrypt (run: vetting gen-admin-password YOURPW) - auth.admin_password_bcrypt (run: gen-admin-password 'YOURPW')
- auth.session_secret_hex (run: openssl rand -hex 32) - auth.session_secret_hex (run: openssl rand -hex 32)
- server.public_url (the URL you'll browse to) - server.public_url (the URL you'll browse to)
- pxe.* if you want PXE boot support - pxe.* if you want PXE boot support
+2 -2
View File
@@ -65,9 +65,9 @@ fi
echo "==> installing templ ${TEMPL_VERSION}" echo "==> installing templ ${TEMPL_VERSION}"
GOBIN=/usr/local/bin go install "github.com/a-h/templ/cmd/templ@${TEMPL_VERSION}" GOBIN=/usr/local/bin go install "github.com/a-h/templ/cmd/templ@${TEMPL_VERSION}"
echo "==> building orchestrator (make orchestrator-linux)" echo "==> building orchestrator + gen-admin-password"
cd "${SRC_DIR}" cd "${SRC_DIR}"
make orchestrator-linux make orchestrator-linux gen-admin-password-linux
echo "==> running deploy/install.sh" echo "==> running deploy/install.sh"
bash deploy/install.sh --binary "bin/vetting-linux-amd64" bash deploy/install.sh --binary "bin/vetting-linux-amd64"