Skip to content

Commit f5e74fe

Browse files
committed
update docs
1 parent a620739 commit f5e74fe

File tree

4 files changed

+110
-11
lines changed

4 files changed

+110
-11
lines changed

.dockerignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
.gitignore
2-
.git
3-
.github
4-
.env
5-
docker-compose.yaml
6-
LICENSE
7-
*.md
8-
.venv
1+
!*.py

.github/templates/README.template.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,65 @@ Get the latest version of the `docker-compose.yaml` file:
1010
{ { file.docker-compose.yaml } }
1111
```
1212

13+
### Reverse proxy
14+
15+
Take a look at traefik implementation:
16+
17+
```yaml
18+
{ { file.example/traefik.docker-compose.yaml } }
19+
```
20+
21+
## Setup
22+
23+
Before you can send messages via `secured-signal-api` you must first setup [`signal-api`](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md),
24+
25+
to send messages you have to either:
26+
27+
- register a Signal Account
28+
29+
OR
30+
31+
- link Signal Api to a already registered Signal Device
32+
1333
## Usage
1434

1535
To send a message to `number`: `1234567`:
1636

1737
```bash
18-
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -d '{"message": "Hello World!", "recipients": ["1234567"]}' http://signal-api/v2/send
38+
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -d '{"message": "Hello World!", "recipients": ["1234567"]}' http://signal-api:8880/v2/send
39+
```
40+
41+
### Configuration
42+
43+
Because `secured-signal-api` is just a secure proxy you can use all of the [Signal REST Api](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) endpoints with an Exception of:
44+
45+
```python
46+
DEFAULT_BLOCKED_ENDPOINTS = [
47+
"/v1/about",
48+
"/v1/configuration",
49+
"/v1/devices",
50+
"/v1/register",
51+
"/v1/unregister",
52+
"/v1/qrcodelink",
53+
"/v1/accounts",
54+
"/v1/contacts"
55+
]
56+
```
57+
58+
Which are blocked by default to increase Security, but you these can be modified by setting the `BLOCKED_ENDPOINTS` environment variable as a valid json array
59+
60+
```yaml
61+
environment:
62+
BLOCKED_ENDPOINTS: '[ "/v1/register","/v1/unregister","/v1/qrcodelink","/v1/contacts" ]'
1963
```
2064
2165
## Contributing
2266
67+
Found a bug? Want to change or add something?
68+
Feel free to open up an issue or create a Pull Request!
69+
70+
_This is a small project so don't expect any huge changes in the future_
71+
2372
## License
2473
2574
[MIT](https://choosealicense.com/licenses/mit/)

docker-compose.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
---
22
services:
3-
myservice:
4-
container_name: myservice
3+
signal-api:
4+
image: bbernhard/signal-cli-rest-api
5+
container_name: signal-api
6+
environment:
7+
- MODE=normal
8+
volumes:
9+
- ./data:/home/.local/share/signal-cli
10+
networks:
11+
backend:
12+
aliases:
13+
- signal-api
14+
restart: unless-stopped
15+
16+
secured-signal:
17+
image: ghcr.io/codeshelldev/secured-signal-api
18+
container_name: secured-signal
19+
networks:
20+
backend:
21+
aliases:
22+
- secured-signal-api
23+
environment:
24+
SIGNAL_API_URL: http://signal-api:8080
25+
DEFAULT_RECIPIENTS: '[ "000", "001", "002" ]'
26+
SENDER: 123456789
27+
ports:
28+
- "8880:8880"
29+
restart: unless-stopped
30+
31+
networks:
32+
backend:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
# ...
3+
secured-signal:
4+
image: ghcr.io/codeshelldev/secured-signal-api
5+
container_name: secured-signal
6+
networks:
7+
proxy:
8+
backend:
9+
aliases:
10+
- secured-signal-api
11+
environment:
12+
SIGNAL_API_URL: http://signal-api:8080
13+
DEFAULT_RECIPIENTS: '[ "000", "001", "002" ]'
14+
SENDER: 123456789
15+
labels:
16+
- traefik.enable=true
17+
- traefik.http.routers.signal-api.rule=Host(`signal-api.mydomain.com`)
18+
- traefik.http.routers.signal-api.entrypoints=websecure
19+
- traefik.http.routers.signal-api.tls=true
20+
- traefik.http.routers.signal-api.tls.certresolver=cloudflare
21+
- traefik.http.routers.signal-api.service=signal-api-svc
22+
- traefik.http.services.signal-api-svc.loadbalancer.server.port=8880
23+
- traefik.docker.network=proxy
24+
restart: unless-stopped
25+
26+
networks:
27+
backend:
28+
proxy:
29+
external: true

0 commit comments

Comments
 (0)