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
+87-49Lines changed: 87 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
-
# Secured Signal Api
1
+
# Secured Signal API
2
2
3
-
Secured Signal Api acts as a secure proxy for signal-rest-api.
3
+
Secured Signal API acts as a secure proxy for [Signal rAPI](https://github.com/bbernhard/signal-cli-rest-api).
4
4
5
5
## Installation
6
6
7
7
Get the latest version of the `docker-compose.yaml` file:
8
8
9
-
And set `API_TOKEN` to a long secure string
9
+
And set `API_TOKEN` to a long secure string.
10
+
11
+
> [!IMPORTANT]
12
+
> This Documentation will be using `sec-signal-api:8880` as the service host,
13
+
> this **won't work**, instead use your containers IP + Port.
14
+
> Or a hostname if applicable. See [Reverse Proxy](#reverse-proxy)
10
15
11
16
```yaml
12
17
---
@@ -46,7 +51,7 @@ networks:
46
51
47
52
### Reverse proxy
48
53
49
-
Take a look at traefik implementation:
54
+
Take a look at the [traefik](https://github.com/traefik/traefik) implementation:
50
55
51
56
```yaml
52
57
services:
@@ -83,61 +88,74 @@ networks:
83
88
84
89
## Setup
85
90
86
-
Before you can send messages via `secured-signal-api` you must first setup [`signal-api`](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md),
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)
87
92
88
-
to be able to use the API you have to either:
93
+
To be able to use the API you have to either:
89
94
90
-
- **register a Signal Account**
95
+
- **register with your Signal Account**
91
96
92
97
OR
93
98
94
99
- **link Signal API to an already registered Signal Device**
95
100
96
101
> [!TIP]
97
-
> It is advised to do this by directly accessing `signal-api`
98
-
> As Secured Signal API blocks the `/register` and `/qrcodelink` by default.
99
-
> If you really want to you can do this with Secured Signal API by removing these endpoints from the Blocklist
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).
100
104
101
105
## Usage
102
106
103
-
Secured Signal API implements 3 Ways to Authenticate
107
+
Secured Signal API provides 3 Ways to Authenticate
104
108
105
109
### Bearer
106
110
107
-
To Authenticate with `secured-signal-api` add `Authorization: Bearer TOKEN` to your request Headers
111
+
To Authenticate add `Authorization: Bearer API_TOKEN` to your request Headers
108
112
109
113
### Basic Auth
110
114
111
-
To use Basic Auth as Authorization Method add `Authorization: Basic base64{user:pw}` to your Headers
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_KEY`.
120
+
121
+
example:
122
+
123
+
```bash
124
+
echo "api:API_KEY" | base64
125
+
```
126
+
127
+
=> `YXBpOkFQSV9LRVkK`
112
128
113
129
### Query Auth
114
130
115
131
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
116
-
in this case you should use **Query Auth**.
132
+
in this case you can use **Query Auth**.
117
133
118
134
Here is a simple example:
119
135
120
136
```bash
121
-
curl -X POST http://signal-api:8880/v2/send?@authorization=TOKEN
137
+
curl -X POST http://sec-signal-api:8880/v2/send?@authorization=API_TOKEN
122
138
```
123
139
140
+
Notice the `@` infront of `authorization`. See [Formatting](#format)
In some cases you may not be able to access / modify the Request Body, if that is the case specify needed values in the Requests Query:
183
+
In some cases you may not be able to access / modify the Request Body, in that case specify needed values in the Request Query:
166
184
167
185
```
168
-
http://signal-api:8880/?@key=value
186
+
http://sec-signal-api:8880/?@key=value
169
187
```
170
188
171
-
**Format**
189
+
##### Format
190
+
172
191
In order to differentiate Injection Queries and _regular_ Queries
173
-
you have to add `@` in front of any KeyValue Pair assignment
192
+
you have to add `@` in front of any KeyValue Pair assignment.
174
193
175
194
### Environment Variables
176
195
177
196
#### API Token
178
197
179
198
> [!IMPORTANT]
180
-
> It is highly recommended to set this Environment Variable to a long secure string
199
+
> It is highly recommended to set this Environment Variable
181
200
182
-
_What if I just don't?_
201
+
> _What if I just don't?_
183
202
184
-
Well Secured Signal API will still work, but important Security Features won't be available
185
-
like Blocked Endpoints and anyone with access to your Docker Container will be able to send Messages in your Name
203
+
Well, Secured Signal API will still work, but important Security Features won't be available
204
+
like Blocked Endpoints and any sort of Auth.
186
205
187
206
> [!NOTE]
188
-
> Blocked Endpoints can be reactivated by manually setting them in the environment
207
+
> Blocked Endpoints can be reactivated by manually setting them in the Environment
189
208
190
209
#### Blocked Endpoints
191
210
192
-
Because Secured Signal API is just a secure Proxy you can use all of the [Signal REST API](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) endpoints with an Exception of:
211
+
Because Secured Signal API is just a secure Proxy you can use all of the [Signal REST API](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) endpoints except for...
193
212
194
213
- **/v1/about**
195
214
@@ -207,7 +226,7 @@ Because Secured Signal API is just a secure Proxy you can use all of the [Signal
207
226
208
227
- **/v1/contacts**
209
228
210
-
These Endpoints are blocked by default to Security Risks, but can be modified by setting `BLOCKED_ENDPOINTS` in the environment variable to a valid json array string
229
+
These Endpoints are blocked by default due to Security Risks, but can be modified by setting `BLOCKED_ENDPOINTS` to a valid json array string
211
230
212
231
```yaml
213
232
environment:
@@ -216,12 +235,14 @@ environment:
216
235
217
236
#### Variables
218
237
219
-
By default Secured Signal API provides the following **Placeholders**:
238
+
By default Secured Signal API provides the following Placeholders:
220
239
221
240
-**NUMBER** = _ENV_: `SENDER`
222
241
-**RECIPIENTS** = _ENV_: `DEFAULT_RECIPIENTS`
223
242
224
-
If you are ever missing any **Placeholder** (that isn't built-in) you can add as many as you like to `VARIABLES` inside your environment
243
+
#### Customization
244
+
245
+
Placeholders can be added by setting `VARIABLES` inside your Environment.
225
246
226
247
```yaml
227
248
environment:
@@ -230,32 +251,43 @@ environment:
230
251
231
252
#### Default Recipients
232
253
233
-
Set this environment variable to automatically provide default Recipients:
254
+
Set this Environment Variable to automatically provide default Recipients:
0 commit comments