You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-43Lines changed: 73 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,48 @@
1
1
<imgalign="center"width="1048"height="512"alt="Secure Proxy for Signal REST API"src="https://github.com/CodeShellDev/secured-signal-api/raw/refs/heads/main/logo/landscape" />
2
2
3
-
<h5align="center">Secure Proxy for <ahref="https://github.com/bbernhard/signal-cli-rest-api">Signal Messenger REST API</a></h5>
3
+
<h3align="center">Secure Proxy for <ahref="https://github.com/bbernhard/signal-cli-rest-api">Signal Messenger REST API</a></h3>
4
+
5
+
<palign="center">
6
+
adding token-based authentication,
7
+
endpoint restrictions, placeholders, and flexible configuration.
8
+
</p>
9
+
10
+
<palign="center">
11
+
⭐️ Secure · 🔒 Configurable · 🚀 Easy to Deploy with Docker
> **Prerequisites**: You need Docker and Docker Compose installed.
45
+
7
46
Get the latest version of the `docker-compose.yaml` file:
8
47
9
48
```yaml
@@ -45,11 +84,10 @@ networks:
45
84
And add secure Token(s) to `api.tokens`. See [API TOKENs](#api-tokens).
46
85
47
86
> [!IMPORTANT]
48
-
> This Documentation will be using `sec-signal-api:8880` as the service host,
49
-
> this **is just for simplicty**, instead use your containers or hosts IP + Port.
50
-
> Or a hostname if applicable. See [Reverse Proxy](#reverse-proxy)
87
+
> In this documentation, we use `sec-signal-api:8880` as the host for simplicity.
88
+
> Replace it with your actual container/host IP, port, or hostname.
51
89
52
-
### Reverse proxy
90
+
### Reverse Proxy
53
91
54
92
Take a look at the [traefik](https://github.com/traefik/traefik) implementation:
55
93
@@ -88,7 +126,7 @@ networks:
88
126
89
127
## Setup
90
128
91
-
Before you can send messages via Secured Signal API you must first setup [Signal rAPI](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md)
129
+
Before you can send messages via Secured Signal API you must first set up [Signal rAPI](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md)
92
130
93
131
To be able to use the API you have to either:
94
132
@@ -98,46 +136,27 @@ OR
98
136
99
137
- **link Signal API to an already registered Signal Device**
100
138
101
-
> [!TIP]
102
-
> It is advised to do Setup directly with Signal rAPI
103
-
> if you try to Setup with Secured Signal API you will be blocked from doing so. See [Blocked Endpoints](#blocked-endpoints).
104
-
105
-
## Usage
106
-
107
-
Secured Signal API provides 3 Ways to Authenticate
108
-
109
-
### Bearer
110
-
111
-
To Authenticate add `Authorization: Bearer API_TOKEN` to your request Headers
112
-
113
-
### Basic Auth
114
-
115
-
To use Basic Auth as Authorization Method add `Authorization: Basic BASE64_STRING` to your Headers
116
-
117
-
User is `api` (LOWERCASE)
118
-
119
-
Formatting for `BASE64_STRING` = `user:API_TOKEN`.
139
+
1. **Register** or **link** a Signal account with `signal-cli-rest-api`
120
140
121
-
example:
141
+
2. Deploy `secured-signal-api` with at least one API token
122
142
123
-
```bash
124
-
echo "api:API_TOKEN" | base64
125
-
```
126
-
127
-
=> `YXBpOkFQSV9LRVkK`
143
+
3. Confirm you can send a test message (see [Usage](#usage))
128
144
129
-
### Query Auth
145
+
> [!TIP]
146
+
> Run setup directly with Signal rAPI.
147
+
> Setup requests via Secured Signal API are blocked. See [Blocked Endpoints](#blocked-endpoints).
130
148
131
-
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
132
-
in this case you can use **Query Auth**.
149
+
## Usage
133
150
134
-
Here is a simple example:
151
+
Secured Signal API provides 3 Ways to Authenticate
135
152
136
-
```bash
137
-
curl -X POST http://sec-signal-api:8880/v2/send?@authorization=API_TOKEN
138
-
```
153
+
### Auth
139
154
140
-
Notice the `@` infront of `authorization`. See [KeyValue Pair Injection](#keyvalue-pair-injection).
| Query Auth | Append `@authorization=API_TOKEN` to request URL |
141
160
142
161
### Example
143
162
@@ -187,6 +206,13 @@ you have to add `@` in front of any KeyValue Pair assignment.
187
206
188
207
Supported types include **strings**, **ints** and **arrays**. See [Formatting](#string-to-type).
189
208
209
+
## Security: Best Practices
210
+
211
+
- Always use API tokens in production
212
+
- Run behind a TLS-enabled [Reverse Proxy](#reverse-proxy) (Traefik, Nginx, Caddy)
213
+
- Be cautious when overriding Blocked Endpoints
214
+
- Use per-token overrides to enforce least privilege
215
+
190
216
## Configuration
191
217
192
218
There are multiple ways to configure Secured Signal API, you can optionally use `config.yml` aswell as Environment Variables to override the config.
@@ -272,8 +298,7 @@ If you are using Environment Variables as an example you won't be able to specif
272
298
| array(str) | [a,b,c] |
273
299
274
300
> [!NOTE]
275
-
> If you have a string that should not be turned into any other type, then you will need to escape all Type Denotations, `[]` or `{}` (also `-`) with a `\` **Backslash**.
276
-
> **Double Backslashes** do exist but you could just leave them out completly.
301
+
> If you have a string that should not be turned into any other type, then you will need to escape all Type Denotations, `[]` or `{}` (also `-`) with a `\` **Backslash** (or Double Backslash).
277
302
> An **Odd** number of **Backslashes** **escape** the character in front of them and an **Even** number leave the character **as-is**.
278
303
279
304
### API Token(s)
@@ -300,7 +325,7 @@ Since Secured Signal API is just a Proxy you can use all of the [Signal REST API
300
325
| :-------------------- | ------------------ |
301
326
| **/v1/about** | **/v1/unregister** |
302
327
| **/v1/configuration** | **/v1/qrcodelink** |
303
-
| **/v1/devives** | **/v1/contacts** |
328
+
| **/v1/devices** | **/v1/contacts** |
304
329
| **/v1/register** | **/v1/accounts** |
305
330
306
331
These Endpoints are blocked by default due to Security Risks.
@@ -346,7 +371,10 @@ settings:
346
371
347
372
### Message Aliases
348
373
349
-
To improve compatibility with other services Secured Signal API provides aliases for the `message` attribute by default:
374
+
To improve compatibility with other services Secured Signal API provides **Message Aliases** for the `message` attribute.
0 commit comments