-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement replacement of encrypted room metadata & fix database… (
#37)
- Loading branch information
Showing
11 changed files
with
265 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
services: | ||
denostr: | ||
build: . | ||
container_name: denostr | ||
environment: | ||
RELAY_PORT: 8008 | ||
NOSTR_CONFIG_DIR: /app/.nostr | ||
MONGO_URI: "mongodb://denostr-db:27017/denostr?replicaSet=rs0" | ||
MONGO_MIN_POOL_SIZE: 4 | ||
MONGO_MAX_POOL_SIZE: 16 | ||
DEBUG: "*" | ||
user: deno:deno | ||
volumes: | ||
- ${PWD}/.nostr:/app/.nostr | ||
ports: | ||
- 8008:8008 | ||
depends_on: | ||
denostr-db: | ||
condition: service_healthy | ||
denostr-db-rs-init: | ||
condition: service_completed_successfully | ||
restart: on-failure | ||
networks: | ||
default: | ||
denostr-db: | ||
image: mongo:5.0 | ||
container_name: denostr-db | ||
networks: | ||
default: | ||
restart: always | ||
ports: | ||
- '27017:27017' | ||
volumes: | ||
- db:/data/db | ||
entrypoint: ["mongod", "--bind_ip_all", "--replSet", "rs0"] | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo --host 127.0.0.1 --port 27017 --quiet 1 | ||
interval: 5s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 5s | ||
denostr-db-rs-init: | ||
image: mongo:5.0 | ||
container_name: denostr-db-rs-init | ||
environment: | ||
MONGO_URI: mongodb://denostr-db:27017/ | ||
command: bash /data/mongo-rs-init.sh | ||
volumes: | ||
- ${PWD}/mongo-rs-init.local.sh:/data/mongo-rs-init.sh | ||
networks: | ||
default: | ||
depends_on: | ||
denostr-db: | ||
condition: service_healthy | ||
denostr-db-express: | ||
image: mongo-express:latest | ||
container_name: denostr-db-express | ||
environment: | ||
ME_CONFIG_OPTIONS_EDITORTHEME: ambiance | ||
ME_CONFIG_MONGODB_SERVER: denostr-db | ||
ME_CONFIG_MONGODB_PORT: 27017 | ||
restart: always | ||
ports: | ||
- '8081:8081' | ||
networks: | ||
default: | ||
depends_on: | ||
denostr-db: | ||
condition: service_healthy | ||
denostr-db-rs-init: | ||
condition: service_completed_successfully | ||
|
||
networks: | ||
default: | ||
name: denostr | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 10.10.10.0/24 | ||
|
||
volumes: | ||
db: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
services: | ||
denostr: | ||
image: ghcr.io/guakamoli/denostr:v0.0.8-worker | ||
container_name: denostr | ||
environment: | ||
RELAY_PORT: 8008 | ||
NOSTR_CONFIG_DIR: /app/.nostr | ||
WORKER_TYPE: worker | ||
MONGO_URI: "mongodb://denostr-db0:27017,denostr-db1:27017/denostr?authSource=admin&replicaSet=rs0" | ||
MONGO_READ_REPLICA_ENABLED: true | ||
MONGO_MIN_POOL_SIZE: 16 | ||
MONGO_MAX_POOL_SIZE: 32 | ||
DEBUG: "*" | ||
user: deno:deno | ||
volumes: | ||
- ${PWD}/.nostr/settings.yaml:/app/.nostr/settings.yaml | ||
ports: | ||
- 8008:8008 | ||
depends_on: | ||
denostr-db0: | ||
condition: service_healthy | ||
denostr-db1: | ||
condition: service_healthy | ||
denostr-db-rs-init: | ||
condition: service_completed_successfully | ||
restart: on-failure | ||
networks: | ||
default: | ||
denostr-db0: | ||
image: mongo:5.0 | ||
container_name: denostr-db0 | ||
networks: | ||
default: | ||
restart: always | ||
ports: | ||
- '27017:27017' | ||
volumes: | ||
- db0:/data/db | ||
entrypoint: ["mongod", "--bind_ip_all", "--replSet", "rs0"] | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo --host 127.0.0.1 --port 27017 --quiet 1 | ||
interval: 5s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 5s | ||
denostr-db1: | ||
image: mongo:5.0 | ||
container_name: denostr-db1 | ||
networks: | ||
default: | ||
restart: always | ||
ports: | ||
- '27018:27017' | ||
volumes: | ||
- db1:/data/db | ||
entrypoint: ["mongod", "--bind_ip_all", "--replSet", "rs0"] | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo --host 127.0.0.1 --port 27017 --quiet 1 | ||
interval: 5s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 5s | ||
denostr-db-rs-init: | ||
image: mongo:5.0 | ||
container_name: denostr-db-rs-init | ||
environment: | ||
MONGO_URI: mongodb://denostr-db0:27017,denostr-db1:27017 | ||
command: bash /data/mongo-rs-init.sh | ||
volumes: | ||
- ${PWD}/mongo-rs-init.sh:/data/mongo-rs-init.sh | ||
networks: | ||
default: | ||
depends_on: | ||
denostr-db0: | ||
condition: service_healthy | ||
denostr-db1: | ||
condition: service_healthy | ||
|
||
networks: | ||
default: | ||
name: denostr | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 10.10.10.0/24 | ||
|
||
volumes: | ||
db0: | ||
db1: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
mongo --quiet $MONGO_URI <<EOF | ||
var config = { | ||
"_id": "rs0", | ||
"version": 1, | ||
"members": [ | ||
{ | ||
"_id": 1, | ||
"host": "denostr-db:27017", | ||
"priority": 1 | ||
}, | ||
] | ||
}; | ||
rs.initiate(config, { force: true }); | ||
rs.status(); | ||
EOF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
mongo --quiet $MONGO_URI <<EOF | ||
var config = { | ||
"_id": "rs0", | ||
"version": 1, | ||
"members": [ | ||
{ | ||
"_id": 1, | ||
"host": "denostr-db0:27017", | ||
"priority": 10 | ||
}, | ||
{ | ||
"_id": 2, | ||
"host": "denostr-db1:27017", | ||
"priority": 1 | ||
} | ||
] | ||
}; | ||
rs.initiate(config, { force: true }); | ||
rs.status(); | ||
EOF |
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
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
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
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
Oops, something went wrong.