CREATE DATABASE hoopdb;
CREATE USER hoopuser WITH ENCRYPTED PASSWORD 'my-secure-password' CREATEROLE;
-- switch to the created database
\c hoopdb
GRANT ALL PRIVILEGES ON DATABASE hoopdb TO hoopuser;
GRANT ALL PRIVILEGES ON SCHEMA public to hoopuser;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO hoopuser;
This file contains hidden or 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 |
This file contains hidden or 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/pgdata | |
PGUSER=hoopdevuser | |
PGDATABASE=hoopdevdemo | |
PGPASSWORD="1a2b3c4d" | |
docker run -p 5432:5432 -d --rm --name hoopdevpg \ | |
-e POSTGRES_USER=$PGUSER \ | |
-e POSTGRES_DB=$PGDATABASE \ | |
-e POSTGRES_PASSWORD=$PGPASSWORD \ | |
-e PGUSER=$PGUSER \ |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"math/rand" | |
"os" | |
"strings" |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: postgres | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: postgres | |
strategy: |
This file contains hidden or 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
--- | |
# Source: hoop-chart/templates/secret-configs.yaml | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: hoop-config | |
type: Opaque | |
stringData: | |
XTDB_ADDRESS: "http://127.0.0.1:3001" | |
POSTGRES_DB_URI: "postgresql://<user>:<pwd>@<host>:5432/<db>" |
This file contains hidden or 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
# Source: hoop-chart/templates/secret-configs.yaml | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: hoop-config | |
type: Opaque | |
stringData: | |
XTDB_ADDRESS: "http://127.0.0.1:3001" | |
POSTGRES_DB_URI: "postgresql://[PG_USER]:[PG_PASSWORD]@[PG_HOST]:[PG_PORT]/[PG_DB]" | |
API_URL: "[HOOP_GATEWAY_DNS_NAME]" |
This file contains hidden or 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
from flask import Flask, request | |
from svix.webhooks import Webhook, WebhookVerificationError | |
app = Flask(__name__) | |
# obtained in the svix web panel | |
# https://docs.runops.io/docs/webhooks/#receiving-webhooks | |
signing_secret = '' | |
@app.route("/runops", methods=['POST']) |