Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/development/debezium/configurations/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ curl --fail --output /dev/null --silent --show-error \
"database.password": "'"$POSTGRES_PASSWORD"'",
"database.user": "'"$POSTGRES_USER"'",
"plugin.name": "pgoutput",
"table.include.list": "vibetype.event,vibetype.upload,vibetype_private.notification",
"topic.prefix" : "vibetype"
"table.include.list": "vibetype_private.outbox",
"topic.prefix" : "vibetype",
"transforms": "outbox",
"transforms.outbox.type": "io.debezium.transforms.outbox.EventRouter",
"transforms.outbox.route.by.field": "aggregate_type",
"transforms.outbox.route.topic.replacement": "vibetype.outbox.${routedByValue}",
"transforms.outbox.table.field.event.key": "aggregate_id",
"transforms.outbox.predicate": "isOutbox",
"predicates": "isOutbox",
"predicates.isOutbox.type": "org.apache.kafka.connect.transforms.predicates.TopicNameMatches",
"predicates.isOutbox.pattern": "vibetype\\.vibetype_private\\.outbox"
}'

echo "PostgreSQL connector '$CONNECTOR_NAME' is up to date."
5 changes: 5 additions & 0 deletions src/development/jobber/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ services:
# You cannot access the jobber via a web interface.
environment:
AWS_SHARED_CREDENTIALS_FILE: /run/secrets/jobber-aws-credentials
POSTGRES_DB_FILE: /run/secrets/postgres-db
POSTGRES_HOST: postgres
image: ghcr.io/dargmuesli/jobber-aws-msmtp:1.3.0
secrets:
- source: jobber-aliases
Expand All @@ -29,6 +31,9 @@ services:
target: /home/jobberuser/.aws/config
- source: jobber-msmtprc
target: /etc/msmtprc
- postgres-db
- postgres-role-service-jobber-password
- postgres-role-service-jobber-username
volumes:
- ./configurations/.jobber:/home/jobberuser/.jobber:ro
- ./configurations/sinks:/srv/sinks:ro
Expand Down
9 changes: 9 additions & 0 deletions src/development/jobber/configurations/.jobber
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ jobs:
- type: system-email
notifyOnFailure:
- type: system-email
OutboxPurge:
cmd: PGPASSWORD="$(cat /run/secrets/postgres-role-service-jobber-password)" psql -v ON_ERROR_STOP=1 -h "$POSTGRES_HOST" -U "$(cat /run/secrets/postgres-role-service-jobber-username)" -d "$(cat "$POSTGRES_DB_FILE")" -c "DELETE FROM vibetype_private.outbox WHERE created_at < now() - interval '24 hours'"
time: 0 0 */2 *
notifyOnSuccess:
- type: system-email
notifyOnError:
- type: system-email
notifyOnFailure:
- type: system-email
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

curl "${SENTRY_CRONS_OUTBOX_PURGE}?status=error"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

curl "${SENTRY_CRONS_OUTBOX_PURGE}?status=in_progress"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

curl "${SENTRY_CRONS_OUTBOX_PURGE}?status=ok"
11 changes: 11 additions & 0 deletions src/development/postgres/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ secrets:
postgres-role-service-grafana-username:
# The username of the observation dashboard's database role.
file: ~~/artifacts/secrets/postgres-role-service-grafana-username.secret
postgres-role-service-jobber-password:
# The password of the job scheduler's database role.
file: ~~/artifacts/secrets/postgres-role-service-jobber-password.secret
postgres-role-service-jobber-username:
# The username of the job scheduler's database role.
file: ~~/artifacts/secrets/postgres-role-service-jobber-username.secret
postgres-role-service-postgraphile-password:
# The password of the GraphQL API database wrapper's database role.
file: ~~/artifacts/secrets/postgres-role-service-postgraphile-password.secret
Expand Down Expand Up @@ -90,6 +96,11 @@ x-dargstack:
type: random_string
postgres-role-service-grafana-username:
type: wordlist_word
postgres-role-service-jobber-password:
special_characters: false
type: random_string
postgres-role-service-jobber-username:
type: wordlist_word
postgres-role-service-postgraphile-password:
special_characters: false
type: random_string
Expand Down
2 changes: 2 additions & 0 deletions src/development/sqitch/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:
secrets:
- postgres-role-service-grafana-password
- postgres-role-service-grafana-username
- postgres-role-service-jobber-password
- postgres-role-service-jobber-username
- postgres-role-service-postgraphile-password
- postgres-role-service-postgraphile-username
- postgres-role-service-reccoom-password
Expand Down
1 change: 1 addition & 0 deletions src/production/.env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CLOUDFLARED_TUNNEL_TOKEN=
SENTRY_CRONS=
SENTRY_CRONS_OUTBOX_PURGE=
STACK_DOMAIN=
TRAEFIK_ACME_EMAIL=
TRAEFIK_ACME_PROVIDER=
1 change: 1 addition & 0 deletions src/production/jobber/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
order: stop-first
environment:
SENTRY_CRONS: ${SENTRY_CRONS}
SENTRY_CRONS_OUTBOX_PURGE: ${SENTRY_CRONS_OUTBOX_PURGE}
volumes:
- (( append ))
- postgres-backup-data:/backups/
14 changes: 14 additions & 0 deletions src/production/jobber/configurations/.jobber
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,17 @@ jobs:
notifyOnFailure:
- type: program
path: /srv/sinks/sentry/error.sh
OutboxPurge:
cmd: |
/srv/sinks/sentry-outbox-purge/in-progress.sh
PGPASSWORD="$(cat /run/secrets/postgres-role-service-jobber-password)" psql -v ON_ERROR_STOP=1 -h "$POSTGRES_HOST" -U "$(cat /run/secrets/postgres-role-service-jobber-username)" -d "$(cat "$POSTGRES_DB_FILE")" -c "DELETE FROM vibetype_private.outbox WHERE created_at < now() - interval '24 hours'"
time: 0 0 */2 *
notifyOnSuccess:
- type: program
path: /srv/sinks/sentry-outbox-purge/ok.sh
notifyOnError:
- type: program
path: /srv/sinks/sentry-outbox-purge/error.sh
notifyOnFailure:
- type: program
path: /srv/sinks/sentry-outbox-purge/error.sh
Loading