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: .github/templates/README.template.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
@@ -13,11 +52,10 @@ Get the latest version of the `docker-compose.yaml` file:
13
52
And add secure Token(s) to `api.tokens`. See [API TOKENs](#api-tokens).
14
53
15
54
> [!IMPORTANT]
16
-
> This Documentation will be using `sec-signal-api:8880` as the service host,
17
-
> this **is just for simplicty**, instead use your containers or hosts IP + Port.
18
-
> Or a hostname if applicable. See [Reverse Proxy](#reverse-proxy)
55
+
> In this documentation, we use `sec-signal-api:8880` as the host for simplicity.
56
+
> Replace it with your actual container/host IP, port, or hostname.
19
57
20
-
### Reverse proxy
58
+
### Reverse Proxy
21
59
22
60
Take a look at the [traefik](https://github.com/traefik/traefik) implementation:
23
61
@@ -27,7 +65,7 @@ Take a look at the [traefik](https://github.com/traefik/traefik) implementation:
27
65
28
66
## Setup
29
67
30
-
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)
68
+
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)
31
69
32
70
To be able to use the API you have to either:
33
71
@@ -37,46 +75,27 @@ OR
37
75
38
76
-**link Signal API to an already registered Signal Device**
39
77
40
-
> [!TIP]
41
-
> It is advised to do Setup directly with Signal rAPI
42
-
> if you try to Setup with Secured Signal API you will be blocked from doing so. See [Blocked Endpoints](#blocked-endpoints).
43
-
44
-
## Usage
45
-
46
-
Secured Signal API provides 3 Ways to Authenticate
47
-
48
-
### Bearer
49
-
50
-
To Authenticate add `Authorization: Bearer API_TOKEN` to your request Headers
51
-
52
-
### Basic Auth
53
-
54
-
To use Basic Auth as Authorization Method add `Authorization: Basic BASE64_STRING` to your Headers
55
-
56
-
User is `api` (LOWERCASE)
57
-
58
-
Formatting for `BASE64_STRING` = `user:API_TOKEN`.
78
+
1.**Register** or **link** a Signal account with `signal-cli-rest-api`
59
79
60
-
example:
80
+
2. Deploy `secured-signal-api` with at least one API token
61
81
62
-
```bash
63
-
echo"api:API_TOKEN"| base64
64
-
```
65
-
66
-
=> `YXBpOkFQSV9LRVkK`
82
+
3. Confirm you can send a test message (see [Usage](#usage))
67
83
68
-
### Query Auth
84
+
> [!TIP]
85
+
> Run setup directly with Signal rAPI.
86
+
> Setup requests via Secured Signal API are blocked. See [Blocked Endpoints](#blocked-endpoints).
69
87
70
-
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
71
-
in this case you can use **Query Auth**.
88
+
## Usage
72
89
73
-
Here is a simple example:
90
+
Secured Signal API provides 3 Ways to Authenticate
74
91
75
-
```bash
76
-
curl -X POST http://sec-signal-api:8880/v2/send?@authorization=API_TOKEN
77
-
```
92
+
### Auth
78
93
79
-
Notice the `@` infront of `authorization`. See [KeyValue Pair Injection](#keyvalue-pair-injection).
| Query Auth | Append `@authorization=API_TOKEN` to request URL |
80
99
81
100
### Example
82
101
@@ -126,6 +145,13 @@ you have to add `@` in front of any KeyValue Pair assignment.
126
145
127
146
Supported types include **strings**, **ints** and **arrays**. See [Formatting](#string-to-type).
128
147
148
+
## Security: Best Practices
149
+
150
+
- Always use API tokens in production
151
+
- Run behind a TLS-enabled [Reverse Proxy](#reverse-proxy) (Traefik, Nginx, Caddy)
152
+
- Be cautious when overriding Blocked Endpoints
153
+
- Use per-token overrides to enforce least privilege
154
+
129
155
## Configuration
130
156
131
157
There are multiple ways to configure Secured Signal API, you can optionally use `config.yml` aswell as Environment Variables to override the config.
@@ -186,8 +212,7 @@ If you are using Environment Variables as an example you won't be able to specif
186
212
| array(str) | [a,b,c] |
187
213
188
214
> [!NOTE]
189
-
> 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**.
190
-
> **Double Backslashes** do exist but you could just leave them out completly.
215
+
> 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).
191
216
> An **Odd** number of **Backslashes** **escape** the character in front of them and an **Even** number leave the character **as-is**.
192
217
193
218
### API Token(s)
@@ -214,7 +239,7 @@ Since Secured Signal API is just a Proxy you can use all of the [Signal REST API
214
239
| :-------------------- | ------------------ |
215
240
| **/v1/about** | **/v1/unregister** |
216
241
| **/v1/configuration** | **/v1/qrcodelink** |
217
-
| **/v1/devives** | **/v1/contacts** |
242
+
| **/v1/devices** | **/v1/contacts** |
218
243
| **/v1/register** | **/v1/accounts** |
219
244
220
245
These Endpoints are blocked by default due to Security Risks.
@@ -260,7 +285,10 @@ settings:
260
285
261
286
### Message Aliases
262
287
263
-
To improve compatibility with other services Secured Signal API provides aliases for the `message` attribute by default:
288
+
To improve compatibility with other services Secured Signal API provides **Message Aliases** for the `message` attribute.
0 commit comments