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
> We are slowly moving away from this README and instead are trying to make the [**Official Documentation**](https://codeshelldev.github.io/secured-signal-api) the only source of truth
And add secure tokens to `api.tokens`. See [API Tokens](#api-tokens).
94
-
95
-
> [!IMPORTANT]
96
-
> Here we'll use `sec-signal-api:8880` as the host,
97
-
> but replace it with your actual container/host IP, port, or hostname
98
-
99
-
## Setup
100
-
101
-
Before you can send messages via Secured Signal API you must first set up [Signal CLI REST API](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md)
102
-
103
-
1.**Register** or **link** a Signal account with `signal-cli-rest-api`
104
-
105
-
2. Deploy `secured-signal-api` with at least one API token
106
-
107
-
3. Confirm you can send a test message (See [Usage](#usage))
108
-
109
-
> [!IMPORTANT]
110
-
> Run setup directly with Signal CLI REST API.
111
-
> Setup requests via Secured Signal API [are blocked by default](#endpoints)
90
+
Once you have installed **Secured Signal API** you can [register or link a signal account](https://codeshelldev.github.io/secured-signal-api/docs/getting-started/setup).
112
91
113
92
## Usage
114
93
115
-
Secured Signal API provides 5 ways to authenticate
| Body Auth |`auth: "API_TOKEN"` (request body field) |
126
-
127
-
> [!WARNING]
128
-
> **Query** and **Path** auth are disabled by default and [must be enabled in the config](https://codeshelldev.github.io/secured-signal-api/docs/configuration/auth)
You can also override the `config.yml` file for each individual token by adding configs under `TOKENS_PATH` (default: `config/tokens/`)
208
-
209
-
Here is an example:
210
-
211
-
```yaml
212
-
{{{ #://docs/configuration/examples/token.yml }}}
213
-
```
214
-
215
-
### API Tokens
216
-
217
-
During authentication Secured Signal API will try to match the given token against the list of tokens inside of the `api.tokens` (or [`api.auth.tokens`](https://codeshelldev.github.io/secured-signal-api/docs/configuration/auth)) attribute.
218
-
219
-
```yaml
220
-
api:
221
-
tokens: [token1, token2, token3]
222
-
```
223
-
224
-
> [!IMPORTANT]
225
-
> Using API tokens is highly recommended, but not mandatory.
226
-
> Some important security features won't be available (for example the [default blocked endpoints](#endpoints))
227
-
228
-
> [!NOTE]
229
-
> Blocked endpoints can be reactivated by manually configuring them
230
-
231
-
### Endpoints
232
-
233
-
Because Secured Signal API also acts as a proxy you can use all the [Signal CLI REST API](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) endpoints except for…
234
-
235
-
| Endpoint | |
236
-
| :-------------------- | ------------------ |
237
-
| **/v1/configuration** | **/v1/unregister** |
238
-
| **/v1/devices** | **/v1/contacts** |
239
-
| **/v1/register** | **/v1/accounts** |
240
-
| **/v1/qrcodelink** | |
241
-
242
-
These endpoints are blocked by default due to security risks.
243
-
244
-
> [!IMPORTANT]
245
-
>
246
-
> 1. Matching uses [regex](https://regex101.com)
247
-
> 2. On compile error exact match is used instead
248
-
249
-
> [!WARNING]
250
-
> Remember that some symbols have special meanings in regex, a good rule of thumb is:
251
-
>
252
-
> - If it is a special character, it probably needs to be escaped (`/`) if you are not looking to use regex
253
-
> - Otherwise test your pattern on a [regex testing site](https://regex101.com)
254
-
255
-
You can modify endpoints by configuring `access.endpoints` in your config:
256
-
257
-
```yaml
258
-
settings:
259
-
access:
260
-
endpoints:
261
-
- "!/v1/receive"
262
-
- /v2/send
263
-
```
264
-
265
-
By default adding an endpoint explicitly allows access to it, use `!` to block it instead.
266
-
267
-
> [!IMPORTANT]
268
-
> When using `!` to block you must enclose the endpoint with quotes, like in the example above
0 commit comments