From e3e530c08b7859dc6771f6cfc3d37bed2dae3b1e Mon Sep 17 00:00:00 2001 From: koalasat Date: Wed, 24 Jul 2024 19:20:13 +0200 Subject: [PATCH] executable sync --- docker-compose.yml | 2 +- docker-tests.yml | 11 ++++++----- docker/strfry/Dockerfile | 1 + docker/strfry/crontab | 2 +- docker/strfry/onion_urls.txt | 4 ++++ docker/strfry/sync.sh | 7 +++---- 6 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 docker/strfry/onion_urls.txt diff --git a/docker-compose.yml b/docker-compose.yml index d2ad509e..18f369b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -232,7 +232,7 @@ services: restart: unless-stopped volumes: - ./docker/strfry/strfry.conf:/etc/strfry.conf:ro - - ./docker/strfry/sync.sh:/app/sync.sh:ro + - ./docker/strfry/onion_urls.txt:/app/onion_urls.txt:ro - ./node/strfry/db:/app/strfry-db:rw network_mode: service:tor diff --git a/docker-tests.yml b/docker-tests.yml index fc6c88be..06dbd939 100644 --- a/docker-tests.yml +++ b/docker-tests.yml @@ -207,13 +207,14 @@ services: # network_mode: service:bitcoind strfry: - image: dockurr/strfry:0.9.6 - container_name: test-strfry + build: ./docker/strfry + container_name: strfry-dev restart: unless-stopped volumes: - - ./tests/strfry/db:/app/strfry-db - - ./tests/strfry/config/strfry.conf:/etc/strfry.conf:r - network_mode: service:bitcoind + - ./test/strfry/strfry.conf:/etc/strfry.conf:ro + - ./test/strfry/onion_urls.txt:/etc/strfry/onion_urls.txt:ro + - ./test/strfry/db:/app/strfry-db:rw + network_mode: service:tor volumes: redisdata: diff --git a/docker/strfry/Dockerfile b/docker/strfry/Dockerfile index 578d0f53..dd0612a8 100644 --- a/docker/strfry/Dockerfile +++ b/docker/strfry/Dockerfile @@ -9,6 +9,7 @@ RUN echo "TorPort 9050" >> /etc/tor/torsocks.conf COPY crontab /tmp/crontab RUN cat /tmp/crontab > /etc/crontabs/root +COPY sync.sh /etc/strfry/sync.sh COPY entrypoint.sh /etc/strfry/entrypoint.sh RUN chmod +x /etc/strfry/entrypoint.sh diff --git a/docker/strfry/crontab b/docker/strfry/crontab index ec45be69..71a96d9a 100644 --- a/docker/strfry/crontab +++ b/docker/strfry/crontab @@ -21,4 +21,4 @@ # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command -*/1 * * * * torsocks /app/sync.sh +*/1 * * * * torsocks /etc/strfry/sync.sh diff --git a/docker/strfry/onion_urls.txt b/docker/strfry/onion_urls.txt new file mode 100644 index 00000000..2c81ddc1 --- /dev/null +++ b/docker/strfry/onion_urls.txt @@ -0,0 +1,4 @@ +testraliar7xkhos2gipv2k65obykofb4jqzl5l4danfryacifi4t7qd.onion +jpp3w5tpxtyg6lifonisdszpriiapszzem4wod2zsdweyfenlsxeoxid.onion +ghbtv7lhoyhomyir4xvxaeyqgx4ylxksia343jaat3njqqlkqpdjqcyd.onion +wsjyhbashc4zrrex6vijpryujggbka5plry2o62dxqoz3pxinblnj4ad.onion \ No newline at end of file diff --git a/docker/strfry/sync.sh b/docker/strfry/sync.sh index d79feb21..338fb53d 100755 --- a/docker/strfry/sync.sh +++ b/docker/strfry/sync.sh @@ -2,7 +2,6 @@ filters='{"kinds":[38383]}' -/app/strfry --config /etc/strfry.conf sync ws://testraliar7xkhos2gipv2k65obykofb4jqzl5l4danfryacifi4t7qd.onion/nostr --filter "$filters" --dir both -/app/strfry --config /etc/strfry.conf sync ws://jpp3w5tpxtyg6lifonisdszpriiapszzem4wod2zsdweyfenlsxeoxid.onion/nostr --filter "$filters" --dir both -/app/strfry --config /etc/strfry.conf sync ws://ghbtv7lhoyhomyir4xvxaeyqgx4ylxksia343jaat3njqqlkqpdjqcyd.onion/nostr --filter "$filters" --dir both -/app/strfry --config /etc/strfry.conf sync ws://wsjyhbashc4zrrex6vijpryujggbka5plry2o62dxqoz3pxinblnj4ad.onion/nostr --filter "$filters" --dir both +while IFS= read -r line; do + /app/strfry --config /etc/strfry.conf sync ws://${line}/nostr --filter "$filters" --dir both +done < /app/onion_urls.txt