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
+77-49Lines changed: 77 additions & 49 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
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)
91
-
92
-
To be able to use the API you have to either:
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)
93
130
94
-
- **register with your Signal Account**
131
+
1. **Register** or **link** a Signal account with `signal-cli-rest-api`
95
132
96
-
OR
133
+
2. Deploy `secured-signal-api` with at least one API token
97
134
98
-
- **link Signal API to an already registered Signal Device**
135
+
3. Confirm you can send a test message (see [Usage](#usage))
99
136
100
137
> [!TIP]
101
-
> It is advised to do Setup directly with Signal rAPI
102
-
> if you try to Setup with Secured Signal API you will be blocked from doing so. See [Blocked Endpoints](#blocked-endpoints).
138
+
> Run setup directly with Signal rAPI.
139
+
> Setup requests via Secured Signal API are blocked. See [Blocked Endpoints](#blocked-endpoints).
103
140
104
141
## Usage
105
142
106
143
Secured Signal API provides 3 Ways to Authenticate
107
144
108
-
### Bearer
109
-
110
-
To Authenticate add `Authorization: Bearer API_TOKEN` to your request Headers
111
-
112
-
### Basic Auth
113
-
114
-
To use Basic Auth as Authorization Method add `Authorization: Basic BASE64_STRING` to your Headers
115
-
116
-
User is `api` (LOWERCASE)
117
-
118
-
Formatting for `BASE64_STRING` = `user:API_TOKEN`.
119
-
120
-
example:
121
-
122
-
```bash
123
-
echo "api:API_TOKEN" | base64
124
-
```
125
-
126
-
=> `YXBpOkFQSV9LRVkK`
127
-
128
-
### Query Auth
129
-
130
-
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
131
-
in this case you can use **Query Auth**.
132
-
133
-
Here is a simple example:
134
-
135
-
```bash
136
-
curl -X POST http://sec-signal-api:8880/v2/send?@authorization=API_TOKEN
137
-
```
145
+
### Auth
138
146
139
-
Notice the `@` infront of `authorization`. See [KeyValue Pair Injection](#keyvalue-pair-injection).
| Query Auth | Append `@authorization=API_TOKEN` to request URL |
140
152
141
153
### Example
142
154
@@ -186,6 +198,13 @@ you have to add `@` in front of any KeyValue Pair assignment.
186
198
187
199
Supported types include **strings**, **ints** and **arrays**. See [Formatting](#string-to-type).
188
200
201
+
## Security: Best Practices
202
+
203
+
- Always use API tokens in production
204
+
- Run behind a TLS-enabled [Reverse Proxy](#reverse-proxy) (Traefik, Nginx, Caddy)
205
+
- Be cautious when overriding Blocked Endpoints
206
+
- Use per-token overrides to enforce least privilege
207
+
189
208
## Configuration
190
209
191
210
There are multiple ways to configure Secured Signal API, you can optionally use `config.yml` aswell as Environment Variables to override the config.
@@ -271,8 +290,7 @@ If you are using Environment Variables as an example you won't be able to specif
271
290
| array(str) | [a,b,c] |
272
291
273
292
> [!NOTE]
274
-
> 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**.
275
-
> **Double Backslashes** do exist but you could just leave them out completly.
293
+
> 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).
276
294
> An **Odd** number of **Backslashes** **escape** the character in front of them and an **Even** number leave the character **as-is**.
277
295
278
296
### API Token(s)
@@ -299,7 +317,7 @@ Since Secured Signal API is just a Proxy you can use all of the [Signal REST API
299
317
| :-------------------- | ------------------ |
300
318
| **/v1/about** | **/v1/unregister** |
301
319
| **/v1/configuration** | **/v1/qrcodelink** |
302
-
| **/v1/devives** | **/v1/contacts** |
320
+
| **/v1/devices** | **/v1/contacts** |
303
321
| **/v1/register** | **/v1/accounts** |
304
322
305
323
These Endpoints are blocked by default due to Security Risks.
@@ -345,7 +363,10 @@ settings:
345
363
346
364
### Message Aliases
347
365
348
-
To improve compatibility with other services Secured Signal API provides aliases for the `message` attribute by default:
366
+
To improve compatibility with other services Secured Signal API provides **Message Aliases** for the `message` attribute.
0 commit comments