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 send messages 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
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
+
35
44
## Usage
36
45
37
-
Secured Signal API implements 3 Ways to Authenticate
46
+
Secured Signal API provides 3 Ways to Authenticate
38
47
39
48
### Bearer
40
49
41
-
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
42
51
43
52
### Basic Auth
44
53
45
-
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`
46
67
47
68
### Query Auth
48
69
49
70
If you are working with a limited Application you may **not** be able to modify Headers or the Request Body
50
-
in this case you should use **Query Auth**.
71
+
in this case you can use **Query Auth**.
51
72
52
73
Here is a simple example:
53
74
54
75
```bash
55
-
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
56
77
```
57
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:
100
123
101
124
```
102
-
http://signal-api:8880/?@key=value
125
+
http://sec-signal-api:8880/?@key=value
103
126
```
104
127
105
-
**Format**
128
+
##### Format
129
+
106
130
In order to differentiate Injection Queries and _regular_ Queries
107
-
you have to add `@` in front of any KeyValue Pair assignment
131
+
you have to add `@` in front of any KeyValue Pair assignment.
108
132
109
133
### Environment Variables
110
134
111
135
#### API Token
112
136
113
137
> [!IMPORTANT]
114
-
> It is highly recommended to set this Environment Variable to a long secure string
138
+
> It is highly recommended to set this Environment Variable
115
139
116
-
_What if I just don't?_
140
+
> _What if I just don't?_
117
141
118
-
Well Secured Signal API will still work, but important Security Features won't be available
119
-
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.
120
144
121
145
> [!NOTE]
122
-
> 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
123
147
124
148
#### Blocked Endpoints
125
149
126
-
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...
127
151
128
152
-**/v1/about**
129
153
@@ -141,7 +165,7 @@ Because Secured Signal API is just a secure Proxy you can use all of the [Signal
141
165
142
166
-**/v1/contacts**
143
167
144
-
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
145
169
146
170
```yaml
147
171
environment:
@@ -150,46 +174,56 @@ environment:
150
174
151
175
#### Variables
152
176
153
-
By default Secured Signal API provides the following **Placeholders**:
177
+
By default Secured Signal API provides the following Placeholders:
178
+
179
+
- **NUMBER** = _ENV_: `NUMBER`
180
+
- **RECIPIENTS** = _ENV_: `RECIPIENTS`
154
181
155
-
- **NUMBER** = _ENV_: `SENDER`
156
-
- **RECIPIENTS** = _ENV_: `DEFAULT_RECIPIENTS`
182
+
#### Customization
157
183
158
-
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
184
+
Placeholders can be added by setting `VARIABLES` inside your Environment.
0 commit comments