mirror of
https://github.com/Cameri/nostream.git
synced 2025-09-17 08:58:33 +02:00
chore: add start/stop scripts
This commit is contained in:
33
README.md
33
README.md
@@ -87,42 +87,25 @@ Clone repository and enter directory:
|
|||||||
cd nostr-ts-relay
|
cd nostr-ts-relay
|
||||||
```
|
```
|
||||||
|
|
||||||
Start with:
|
Start:
|
||||||
```
|
```
|
||||||
npm run docker:compose:start -- --detach
|
./scripts/start
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```
|
||||||
|
./scripts/start_with_tor
|
||||||
```
|
```
|
||||||
|
|
||||||
Stop the server with:
|
Stop the server with:
|
||||||
```
|
```
|
||||||
npm run docker:compose:stop
|
./scripts/stop
|
||||||
```
|
|
||||||
|
|
||||||
## Quick Start (over Tor)
|
|
||||||
`Docker` `Tor`
|
|
||||||
|
|
||||||
Install Docker following the [official guide](https://docs.docker.com/engine/install/).
|
|
||||||
You may have to uninstall Docker if you installed it using a different guide.
|
|
||||||
|
|
||||||
Clone repository and enter directory:
|
|
||||||
```
|
|
||||||
git clone git@github.com:Cameri/nostr-ts-relay.git
|
|
||||||
cd nostr-ts-relay
|
|
||||||
```
|
|
||||||
|
|
||||||
Start with:
|
|
||||||
```
|
|
||||||
npm run tor:docker:compose:start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Print the Tor hostname:
|
Print the Tor hostname:
|
||||||
```
|
```
|
||||||
npm run tor:hostname
|
./scripts/print_tor_hostname
|
||||||
```
|
```
|
||||||
|
|
||||||
Stop the server with:
|
|
||||||
```
|
|
||||||
npm run tor:docker:compose:stop
|
|
||||||
```
|
|
||||||
|
|
||||||
## Quick Start (Standalone)
|
## Quick Start (Standalone)
|
||||||
|
|
||||||
|
14
package.json
14
package.json
@@ -37,14 +37,12 @@
|
|||||||
"pretest:integration": "mkdir -p .test-reports/integration",
|
"pretest:integration": "mkdir -p .test-reports/integration",
|
||||||
"test:integration": "cucumber-js",
|
"test:integration": "cucumber-js",
|
||||||
"cover:integration": "nyc --report-dir .coverage/integration npm run test:integration -- -p cover",
|
"cover:integration": "nyc --report-dir .coverage/integration npm run test:integration -- -p cover",
|
||||||
"predocker:compose:start": "[ -d \"$PWD/.nostr\" ] || mkdir -p $PWD/.nostr",
|
"docker:compose:start": "./scripts/start",
|
||||||
"docker:compose:start": "docker compose up --build --remove-orphans",
|
"docker:compose:stop": "./scripts/stop",
|
||||||
"docker:compose:stop": "docker compose down",
|
"docker:compose:clean": "./scripts/clean",
|
||||||
"docker:compose:clean": "docker compose rm",
|
"tor:docker:compose:start": "./scripts/start_with_tor",
|
||||||
"pretor:docker:compose:start": "mkdir -p $PWD/.nostr/tor/data",
|
"tor:hostname": "./scripts/print_tor_hostname",
|
||||||
"tor:docker:compose:start": "docker compose -f docker-compose.yml -f docker-compose.tor.yml up --build --remove-orphans",
|
"tor:docker:compose:stop": "./scripts/stop",
|
||||||
"tor:hostname": "cat $PWD/.nostr/tor/data/nostr-ts-relay/hostname",
|
|
||||||
"tor:docker:compose:stop": "docker compose -f docker-compose.yml -f docker-compose.tor.yml down",
|
|
||||||
"docker:integration:run": "docker compose -f ./test/integration/docker-compose.yml run --rm tests",
|
"docker:integration:run": "docker compose -f ./test/integration/docker-compose.yml run --rm tests",
|
||||||
"docker:test:integration": "npm run docker:integration:run -- npm run test:integration",
|
"docker:test:integration": "npm run docker:integration:run -- npm run test:integration",
|
||||||
"docker:cover:integration": "npm run docker:integration:run -- npm run cover:integration",
|
"docker:cover:integration": "npm run docker:integration:run -- npm run cover:integration",
|
||||||
|
8
scripts/clean
Executable file
8
scripts/clean
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
||||||
|
|
||||||
|
$PROJECT_ROOT/scripts/stop_docker
|
||||||
|
|
||||||
|
docker system prune
|
||||||
|
|
||||||
|
docker volume prune
|
4
scripts/print_tor_hostname
Executable file
4
scripts/print_tor_hostname
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
||||||
|
cat $PROJECT_ROOT/.nostr/tor/data/nostr-ts-relay/hostname
|
7
scripts/start
Executable file
7
scripts/start
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
||||||
|
DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml"
|
||||||
|
|
||||||
|
docker compose \
|
||||||
|
-f $DOCKER_COMPOSE_FILE \
|
||||||
|
up --build --remove-orphans $@
|
9
scripts/start_with_tor
Executable file
9
scripts/start_with_tor
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
||||||
|
DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml"
|
||||||
|
DOCKER_COMPOSE_TOR_FILE="${PROJECT_ROOT}/docker-compose.tor.yml"
|
||||||
|
|
||||||
|
docker compose \
|
||||||
|
-f $DOCKER_COMPOSE_FILE \
|
||||||
|
-f $DOCKER_COMPOSE_TOR_FILE \
|
||||||
|
up --build --remove-orphans $@
|
9
scripts/stop
Executable file
9
scripts/stop
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
||||||
|
DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml"
|
||||||
|
DOCKER_COMPOSE_TOR_FILE="${PROJECT_ROOT}/docker-compose.tor.yml"
|
||||||
|
|
||||||
|
docker compose \
|
||||||
|
-f $DOCKER_COMPOSE_FILE \
|
||||||
|
-f $DOCKER_COMPOSE_TOR_FILE \
|
||||||
|
down $@
|
Reference in New Issue
Block a user