Created
July 2, 2024 15:11
-
-
Save sandromello/903ebdea51b620e890ab36c5161bfec7 to your computer and use it in GitHub Desktop.
install-gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /opt/hoop/migrations | |
curl https://hoopartifacts.s3.amazonaws.com/release/1.22.22/hoopgateway_1.22.22-Linux_amd64.tar.gz -o hoopgateway.tar.gz && \ | |
rm -rf /opt/hoop/migrations | |
tar --extract --file hoopgateway.tar.gz -C / --strip 1 && rm -f hoopgateway.tar.gz | |
chown -R root: /opt/hoop | |
mkdir -p /etc/hoopgateway.d | |
cat - > /etc/hoopgateway.d/config <<EOF | |
PLUGIN_AUDIT_PATH=/opt/hoop/sessions | |
PLUGIN_INDEX_PATH=/opt/hoop/sessions/indexes | |
STATIC_UI_PATH=/opt/hoop/webapp/public | |
MIGRATION_PATH_FILES=/opt/hoop/migrations | |
LOG_LEVEL=info | |
LOG_ENCODING=json | |
POSTGRES_DB_URI=postgres://hoopdevuser:[email protected]:5432/hoopdevdemo?sslmode=disable | |
API_URL=http://localhost:8009 | |
GRPC_URL=http://127.0.0.1:8010 | |
IDP_CLIENT_ID= | |
IDP_CLIENT_SECRET= | |
IDP_ISSUER= | |
ADMIN_USERNAME=admin | |
EOF | |
chmod 0400 /etc/hoopgateway.d/config | |
cat - > /lib/systemd/system/hoopgateway.service <<EOF | |
[Unit] | |
Description=Hoop Gateway | |
After=network.target | |
[Service] | |
ExecStart=/opt/hoop/bin/hoop start gateway | |
Environment=PATH=/opt/hoop/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
EnvironmentFile=/etc/hoopgateway.d/config | |
Restart=on-failure | |
RestartSec=20s | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
cat - > /lib/systemd/system/hoopagent.service <<EOF | |
[Unit] | |
Description=Hoop System Agent | |
After=network.target | |
[Service] | |
ExecStart=/opt/hoop/bin/run_system_agent.sh | |
EnvironmentFile=/etc/hoopgateway.d/config | |
Restart=on-failure | |
RestartSec=15s | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
systemctl enable hoopgateway | |
systemctl start hoopgateway |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment