2026-07-24 10:39:10 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
if [[ ${EUID} -ne 0 ]]; then
|
|
|
|
|
echo "run as root" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
|
install_root=/opt/guanghu/lake-lamp-authz
|
|
|
|
|
|
|
|
|
|
install -d -m 0755 "$install_root"
|
2026-08-02 23:41:48 +08:00
|
|
|
for file in server.js workorder-manager.js map-gate.js smtp-mailer.js action-client.js architecture-provision-broker.js deployment-event.js deployment-event-worker.js deployment-source-policy.js hololake-session.js hololake-capabilities.js ghdr-authorizer.js ghdr-controller-broker.js ghdr-controllers.json; do
|
2026-07-24 10:39:10 +08:00
|
|
|
install -m 0644 "$script_dir/$file" "$install_root/$file"
|
|
|
|
|
done
|
2026-08-02 23:41:48 +08:00
|
|
|
install -d -m 0755 "$install_root/navigation-maps"
|
|
|
|
|
install -m 0644 "$script_dir/navigation-maps/GH-CVM-MAIN-PROD-01.json" "$install_root/navigation-maps/GH-CVM-MAIN-PROD-01.json"
|
2026-07-24 10:39:10 +08:00
|
|
|
install -m 0644 "$script_dir/lake-lamp-architecture-provision.service" /etc/systemd/system/lake-lamp-architecture-provision.service
|
2026-07-27 15:05:46 +08:00
|
|
|
install -m 0644 "$script_dir/lake-lamp-deployment-event-worker.service" /etc/systemd/system/lake-lamp-deployment-event-worker.service
|
2026-07-24 10:39:10 +08:00
|
|
|
install -d -m 0700 /var/lib/guanghu/architecture-provision
|
2026-07-27 15:05:46 +08:00
|
|
|
install -d -m 0750 /var/lib/guanghu/deployment-events
|
|
|
|
|
install -d -m 0700 /var/lib/guanghu/deployment-events/receipts
|
2026-07-24 10:39:10 +08:00
|
|
|
install -d -m 0755 /opt/guanghu/architecture-releases
|
2026-07-27 15:05:46 +08:00
|
|
|
install -d -m 0755 /etc/guanghu/lake-lamp
|
|
|
|
|
if [[ ! -e /etc/guanghu/lake-lamp/deployment-repositories.json ]]; then
|
|
|
|
|
install -m 0644 "$script_dir/deployment-repositories.example.json" /etc/guanghu/lake-lamp/deployment-repositories.json
|
|
|
|
|
fi
|
2026-07-24 10:39:10 +08:00
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
systemctl enable --now lake-lamp-architecture-provision.service
|
|
|
|
|
systemctl restart lake-lamp-authz.service
|
2026-07-27 15:05:46 +08:00
|
|
|
systemctl enable --now lake-lamp-deployment-event-worker.service
|
2026-07-24 10:39:10 +08:00
|
|
|
systemctl is-active --quiet lake-lamp-architecture-provision.service
|
|
|
|
|
systemctl is-active --quiet lake-lamp-authz.service
|
2026-07-27 15:05:46 +08:00
|
|
|
systemctl is-active --quiet lake-lamp-deployment-event-worker.service
|
2026-07-24 10:39:10 +08:00
|
|
|
echo ARCHITECTURE_PROVISIONER_INSTALLED
|