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
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
{ { file.docker-compose.yaml } }
13
18
```
14
19
15
20
### Reverse proxy
16
21
17
-
Take a look at traefik implementation:
22
+
Take a look at the [traefik](https://github.com/traefik/traefik) implementation:
18
23
19
24
```yaml
20
25
{ { file.examples/traefik.docker-compose.yaml } }
21
26
```
22
27
23
28
## Setup
24
29
25
-
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),
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)
26
31
27
-
to be able to use the API you have to either:
32
+
To be able to use the API you have to either:
28
33
29
-
-**register a Signal Account**
34
+
-**register with your Signal Account**
30
35
31
36
OR
32
37
33
38
-**link Signal API to an already registered Signal Device**
34
39
35
40
> [!TIP]
36
-
> It is advised to do this by directly accessing `signal-api`
37
-
> As Secured Signal API blocks the `/register` and `/qrcodelink` by default.
38
-
> If you really want to you can do this with Secured Signal API by removing these endpoints from the Blocklist
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).
39
43
40
44
## Usage
41
45
42
-
Secured Signal API implements 3 Ways to Authenticate
46
+
Secured Signal API provides 3 Ways to Authenticate
43
47
44
48
### Bearer
45
49
46
-
To Authenticate with `secured-signal-api`add `Authorization: Bearer TOKEN` to your request Headers
50
+
To Authenticate add `Authorization: Bearer API_TOKEN` to your request Headers
47
51
48
52
### Basic Auth
49
53
50
-
To use Basic Auth as Authorization Method add `Authorization: Basic base64{user:pw}` to your Headers
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_KEY`.
59
+
60
+
example:
61
+
62
+
```bash
63
+
echo"api:API_KEY"| base64
64
+
```
65
+
66
+
=> `YXBpOkFQSV9LRVkK`
51
67
52
68
### Query Auth
53
69
54
70
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
55
-
in this case you should use **Query Auth**.
71
+
in this case you can use **Query Auth**.
56
72
57
73
Here is a simple example:
58
74
59
75
```bash
60
-
curl -X POST http://signal-api:8880/v2/send?@authorization=TOKEN
76
+
curl -X POST http://sec-signal-api:8880/v2/send?@authorization=API_TOKEN
61
77
```
62
78
79
+
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:
122
+
In some cases you may not be able to access / modify the Request Body, in that case specify needed values in the Request Query:
105
123
106
124
```
107
-
http://signal-api:8880/?@key=value
125
+
http://sec-signal-api:8880/?@key=value
108
126
```
109
127
110
-
**Format**
128
+
##### Format
129
+
111
130
In order to differentiate Injection Queries and _regular_ Queries
112
-
you have to add `@` in front of any KeyValue Pair assignment
131
+
you have to add `@` in front of any KeyValue Pair assignment.
113
132
114
133
### Environment Variables
115
134
116
135
#### API Token
117
136
118
137
> [!IMPORTANT]
119
-
> It is highly recommended to set this Environment Variable to a long secure string
138
+
> It is highly recommended to set this Environment Variable
120
139
121
-
_What if I just don't?_
140
+
> _What if I just don't?_
122
141
123
-
Well Secured Signal API will still work, but important Security Features won't be available
124
-
like Blocked Endpoints and anyone with access to your Docker Container will be able to send Messages in your Name
142
+
Well, Secured Signal API will still work, but important Security Features won't be available
143
+
like Blocked Endpoints and any sort of Auth.
125
144
126
145
> [!NOTE]
127
-
> Blocked Endpoints can be reactivated by manually setting them in the environment
146
+
> Blocked Endpoints can be reactivated by manually setting them in the Environment
128
147
129
148
#### Blocked Endpoints
130
149
131
-
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:
150
+
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...
132
151
133
152
-**/v1/about**
134
153
@@ -146,7 +165,7 @@ Because Secured Signal API is just a secure Proxy you can use all of the [Signal
146
165
147
166
-**/v1/contacts**
148
167
149
-
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
168
+
These Endpoints are blocked by default due to Security Risks, but can be modified by setting `BLOCKED_ENDPOINTS` to a valid json array string
150
169
151
170
```yaml
152
171
environment:
@@ -155,12 +174,14 @@ environment:
155
174
156
175
#### Variables
157
176
158
-
By default Secured Signal API provides the following **Placeholders**:
177
+
By default Secured Signal API provides the following Placeholders:
159
178
160
179
- **NUMBER** = _ENV_: `SENDER`
161
180
- **RECIPIENTS** = _ENV_: `DEFAULT_RECIPIENTS`
162
181
163
-
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
182
+
#### Customization
183
+
184
+
Placeholders can be added by setting `VARIABLES` inside your Environment.
164
185
165
186
```yaml
166
187
environment:
@@ -169,32 +190,43 @@ environment:
169
190
170
191
#### Default Recipients
171
192
172
-
Set this environment variable to automatically provide default Recipients:
193
+
Set this Environment Variable to automatically provide default Recipients:
0 commit comments