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
Lastly add your `cert.key` and `cert.crt` into your `certs/` folder and mount it to `/etc/nginx/ssl`.
224
-
225
80
## Setup
226
81
227
82
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)
@@ -295,14 +150,7 @@ In some cases you may not be able to access / modify the Request Body, in that c
295
150
In order to differentiate Injection Queries and _regular_ Queries
296
151
you have to add `@` in front of any KeyValue Pair assignment.
297
152
298
-
Supported types include **strings**, **ints**, **arrays** and **json dictionaries**. See [Formatting](#string-to-type).
299
-
300
-
## Best Practices
301
-
302
-
- Always use API tokens in production
303
-
- Run behind a TLS-enabled [Reverse Proxy](#reverse-proxy) (Traefik, Nginx, Caddy)
304
-
- Be cautious when overriding Blocked Endpoints
305
-
- Use per-token overrides to enforce least privilege
153
+
Supported types include **strings**, **ints**, **arrays** and **json dictionaries**. See [Formatting](https://codeshelldev.github.io/secured-signal-api/docs/usage/formatting).
306
154
307
155
## Configuration
308
156
@@ -317,34 +165,7 @@ To change the internal config file location set `CONFIG_PATH` in your **Environm
317
165
This example config shows all of the individual settings that can be applied:
318
166
319
167
```yaml
320
-
# Example Config (all configurations shown)
321
-
service:
322
-
port: 8880
323
-
324
-
api:
325
-
url: http://signal-api:8080
326
-
tokens: [token1, token2]
327
-
328
-
logLevel: info
329
-
330
-
settings:
331
-
messageTemplate: |
332
-
You've got a Notification:
333
-
{{@message}}
334
-
At {{@data.timestamp}} on {{@data.date}}.
335
-
Send using {{.NUMBER}}.
336
-
337
-
variables:
338
-
number: "+123400001"
339
-
recipients: ["+123400002", "group.id", "user.id"]
340
-
341
-
dataAliases:
342
-
"@message": [{ alias: "msg", score: 100 }]
343
-
344
-
blockedEndpoints:
345
-
- /v1/about
346
-
allowedEndpoints:
347
-
- /v2/send
168
+
file not found: /home/runner/work/secured-signal-api/secured-signal-api/docs-src/configuration/examples/config.yml
348
169
```
349
170
350
171
#### Token Configs
@@ -356,50 +177,9 @@ This way you can permission tokens by further restricting or adding [Endpoints](
356
177
Here is an example:
357
178
358
179
```yaml
359
-
tokens: [LOOOONG_STRING]
360
-
361
-
overrides:
362
-
variables: # Disable Placeholder
363
-
blockedEndpoints: # Disable Sending
364
-
- /v2/send
365
-
dataAliases: # Disable Aliases
366
-
```
367
-
368
-
### Environment
369
-
370
-
Suppose you want to set a new [Placeholder](#placeholders) `NUMBER` in your Environment...
371
-
372
-
```yaml
373
-
environment:
374
-
SETTINGS__VARIABLES__NUMBER: "+123400001"
180
+
file not found: /home/runner/work/secured-signal-api/secured-signal-api/docs-src/configuration/examples/token.yml
375
181
```
376
182
377
-
This would internally be converted into `settings.variables.number` matching the config formatting.
378
-
379
-
> [!IMPORTANT]
380
-
> Underscores `_` are removed during Conversion, Double Underscores `__` on the other hand convert the Variable into a nested Object (`__` replaced by `.`)
381
-
382
-
### String To Type
383
-
384
-
> [!TIP]
385
-
> This formatting applies to almost every situation where the only (allowed) Input Type is a string and other Output Types are needed.
386
-
387
-
If you are using Environment Variables as an example you won't be able to specify an Array or a Dictionary of items, in that case you can provide a specifically formatted string which will be translated into the correct type...
388
-
389
-
| type | example |
390
-
| :--------- | :---------------- |
391
-
| string | abc |
392
-
| string | +123 |
393
-
| int | 123 |
394
-
| int | -123 |
395
-
| json | {"a":"b","c":"d"} |
396
-
| array(int) | [1,2,3] |
397
-
| array(str) | [a,b,c] |
398
-
399
-
> [!NOTE]
400
-
> 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).
401
-
> An **Odd** number of **Backslashes** **escape** the character in front of them and an **Even** number leave the character **as-is**.
402
-
403
183
### Templating
404
184
405
185
Secured Signal API uses Golang's [Standard Templating Library](https://pkg.go.dev/text/template).
@@ -413,35 +193,10 @@ Go's templating library is used in the following features:
413
193
This makes advanced [Message Templates](#message-templates) like this one possible:
414
194
415
195
```yaml
416
-
settings:
417
-
messageTemplate: |
418
-
{{- $greeting := "Hello" -}}
419
-
{{ $greeting }}, {{ @name }}!
420
-
{{ if @age -}}
421
-
You are {{ @age }} years old.
422
-
{{- else -}}
423
-
Age unknown.
424
-
{{- end }}
425
-
Your friends:
426
-
{{- range @friends }}
427
-
- {{ . }}
428
-
{{- else }}
429
-
You have no friends.
430
-
{{- end }}
431
-
Profile details:
432
-
{{- range $key, $value := @profile }}
433
-
- {{ $key }}: {{ $value }}
434
-
{{- end }}
435
-
{{ define "footer" -}}
436
-
This is the footer for {{ @name }}.
437
-
{{- end }}
438
-
{{ template "footer" . -}}
439
-
------------------------------------
440
-
Content-Type: {{ #Content_Type }}
441
-
Redacted Auth Header: {{ #Authorization }}
196
+
file not found: /home/runner/work/secured-signal-api/secured-signal-api/docs-src/configuration/examples/message-template.yml
442
197
```
443
198
444
-
### API Token(s)
199
+
### API Tokens
445
200
446
201
During Authentication Secured Signal API will try to match the given Token against the list of Tokens inside of these Variables.
447
202
@@ -562,28 +317,6 @@ settings:
562
317
563
318
Use `@` for aliasing Body Keys and `.` for aliasing Variables.
564
319
565
-
### Port
566
-
567
-
To change the Port which Secured Signal API uses, you need to set `service.port` in your config. (default: `8880`)
568
-
569
-
### Log Level
570
-
571
-
To change the Log Level set `logLevel` to: (default: `info`)
0 commit comments