mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/opsec-blogposts.git
synced 2025-07-02 06:36:40 +00:00
deploy and run fixes
This commit is contained in:
parent
f004327a72
commit
f685ed25b6
1 changed files with 9 additions and 34 deletions
|
@ -230,7 +230,7 @@ The release page can be accessed through your web browser or you can download th
|
||||||
Run your client in server mode:
|
Run your client in server mode:
|
||||||
|
|
||||||
|
|
||||||
[user@devnode:~]$ simplex-chat -d clientDB -p 1337 -x
|
[user@devnode:~]$ simplex-chat -d chatDB
|
||||||
No user profiles found, it will be created now.
|
No user profiles found, it will be created now.
|
||||||
Please choose your display name.
|
Please choose your display name.
|
||||||
It will be sent to your contacts when you connect.
|
It will be sent to your contacts when you connect.
|
||||||
|
@ -242,8 +242,8 @@ Run your client in server mode:
|
||||||
This command will:
|
This command will:
|
||||||
- create two databases that your client uses for reconnecting to groups and interacting with the simpleX Network
|
- create two databases that your client uses for reconnecting to groups and interacting with the simpleX Network
|
||||||
- set this client display name (what you will see in your groups when receiving alerts)
|
- set this client display name (what you will see in your groups when receiving alerts)
|
||||||
- open a websocket port that the alerter will use on 127.0.0.1:1337
|
|
||||||
|
|
||||||
|
Ctrl-C once it is finished.
|
||||||
|
|
||||||
|
|
||||||
## Grafana-Simplex-alerter
|
## Grafana-Simplex-alerter
|
||||||
|
@ -285,7 +285,7 @@ You will then be able to run simplex-alerter:
|
||||||
|
|
||||||
|
|
||||||
[user@devnode:~]$ simplex-alerter --help
|
[user@devnode:~]$ simplex-alerter --help
|
||||||
usage: simplex-alerter [-h] [-a ADDR] [-m PROMETHEUS_CONFIG] [-o OTEL_SERVER] [-f PYROSCOPE_SERVER] [-b BIND_ADDR] [-d] [-c CONFIG] [-g] [-e ENDPOINT]
|
usage: simplex-alerter [-h] [-a ADDR] [-m PROMETHEUS_CONFIG] [-o OTEL_SERVER] [-f PYROSCOPE_SERVER] [-b BIND_ADDR] [-d] [-c CONFIG] [-e ENDPOINT]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
|
@ -297,21 +297,15 @@ You will then be able to run simplex-alerter:
|
||||||
host:port to run the app on
|
host:port to run the app on
|
||||||
-d, --debug enable debug mode, increases pyroscope sampling rate if configured
|
-d, --debug enable debug mode, increases pyroscope sampling rate if configured
|
||||||
-c, --config CONFIG config file
|
-c, --config CONFIG config file
|
||||||
-g, --generate-config
|
|
||||||
generate config file with placeholder values
|
|
||||||
-e, --endpoint ENDPOINT
|
-e, --endpoint ENDPOINT
|
||||||
simplex endpoint
|
simplex endpoint
|
||||||
|
|
||||||
|
|
||||||
#### With Docker
|
#### With Docker
|
||||||
|
|
||||||
|
To build using docker please use the instructions in the repository README.md
|
||||||
[user@devnode:~]$ git clone https://github.com/MulliganSecurity/grafana-simplex-alerter.git
|
|
||||||
cd grafana-simplex-alerter
|
|
||||||
docker build . -t simplex-alerter
|
|
||||||
|
|
||||||
|
|
||||||
For the rest of the tutorial I will show the docker commands. If you installed the alerter using nix, simply replace "docker run simplex-alerter" with simplex-alerter.
|
|
||||||
Do take note of the following:
|
Do take note of the following:
|
||||||
|
|
||||||
- In docker run the "--rm" parameter will be used to automatically destroy the container after it's run. If using from nix you can disregard it.
|
- In docker run the "--rm" parameter will be used to automatically destroy the container after it's run. If using from nix you can disregard it.
|
||||||
|
@ -339,10 +333,10 @@ I will now need to create an invite link so the alert can send messages there:
|
||||||
|
|
||||||
#### Generate a basic config file
|
#### Generate a basic config file
|
||||||
|
|
||||||
To get started we need a basic config file to fill out with our alerter information:
|
To get started we need a basic config file: please use the template provided (example_config.yml) in the repository
|
||||||
|
|
||||||
|
|
||||||
[user@devnode:~]$ docker run --rm simplex-alerter -g > config.yml
|
[user@devnode:~]$ cp example_config.yml config.yml
|
||||||
[user@devnode:~]$ cat config.yml
|
[user@devnode:~]$ cat config.yml
|
||||||
alert_groups:
|
alert_groups:
|
||||||
- invite_link: https://simplex.chat/contact#/?v=2-7&sm...
|
- invite_link: https://simplex.chat/contact#/?v=2-7&sm...
|
||||||
|
@ -352,12 +346,9 @@ To get started we need a basic config file to fill out with our alerter informat
|
||||||
##### Configure the alerter
|
##### Configure the alerter
|
||||||
|
|
||||||
|
|
||||||
Update your config file with the invite link you created earler and set the name to your group name
|
Update your config file with the invite link you created earlier and set the name to your group name
|
||||||
|
|
||||||
[user@devnode:~]$ vi config.yml
|
[user@devnode:~]$ vi config.yml
|
||||||
|
|
||||||
so it looks like this:
|
|
||||||
|
|
||||||
[user@devnode:~]$ cat config.yml
|
[user@devnode:~]$ cat config.yml
|
||||||
alert_groups:
|
alert_groups:
|
||||||
- invite_link: https://simplex.chat/contact#/?v=2-7&smp=smp%3A%2F%2FUkMFNAXLXeAAe0beCa4w6X_zp18PwxSaSjY17BKUGXQ%3D%40smp12.simplex.im%2FlOgzQT8ZxfF3TV_x00c0mNLMFBDkl6gj%23%2F%3Fv%3D1-4%26dh%3DMCowBQYDK2VuAyEAypkpAgfmsShNThQBGvPXxjBk8O03vKe1x0311UHhK3I%253D%26q%3Dc%26srv%3Die42b5weq7zdkghocs3mgxdjeuycheeqqmksntj57rmejagmg4eor5yd.onion&data=%7B%22groupLinkId%22%3A%22EfuyLGxGhsc0iWkqr9NYvQ%3D%3D%22%7D
|
- invite_link: https://simplex.chat/contact#/?v=2-7&smp=smp%3A%2F%2FUkMFNAXLXeAAe0beCa4w6X_zp18PwxSaSjY17BKUGXQ%3D%40smp12.simplex.im%2FlOgzQT8ZxfF3TV_x00c0mNLMFBDkl6gj%23%2F%3Fv%3D1-4%26dh%3DMCowBQYDK2VuAyEAypkpAgfmsShNThQBGvPXxjBk8O03vKe1x0311UHhK3I%253D%26q%3Dc%26srv%3Die42b5weq7zdkghocs3mgxdjeuycheeqqmksntj57rmejagmg4eor5yd.onion&data=%7B%22groupLinkId%22%3A%22EfuyLGxGhsc0iWkqr9NYvQ%3D%3D%22%7D
|
||||||
|
@ -367,7 +358,7 @@ so it looks like this:
|
||||||
|
|
||||||
Run the container
|
Run the container
|
||||||
|
|
||||||
sudo docker run -v $(pwd):/config --network="host" --rm simplex-alerter -c /config/config.yml -e 127.0.0.1:1337
|
sudo docker run -v $(pwd):/simplex -v $(pwd):/alerterconfig -p 127.0.0.1:7898:7898 --rm simplex-alerter
|
||||||
|
|
||||||
It will connect to the simplex-chat client we started earlier. You can check the metrics to make sure it's running by checking the metrics page
|
It will connect to the simplex-chat client we started earlier. You can check the metrics to make sure it's running by checking the metrics page
|
||||||
|
|
||||||
|
@ -501,20 +492,6 @@ And here's the alert:
|
||||||
|
|
||||||
To turn the simplex-chat and the alerter into systemd services, you only need to create two files:
|
To turn the simplex-chat and the alerter into systemd services, you only need to create two files:
|
||||||
|
|
||||||
## /etc/systemd/system/simplex-chat.service
|
|
||||||
```text
|
|
||||||
vim /etc/systemd/system/simplex-chat.service
|
|
||||||
cat /etc/systemd/system/simplex-chat.service
|
|
||||||
```
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Requires=tor.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=simplex-chat -d /etc/alerter_clientDB -p 1337 -x
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
|
||||||
## /etc/systemd/system/alerter.service
|
## /etc/systemd/system/alerter.service
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
@ -524,10 +501,9 @@ cat /etc/systemd/system/xxx
|
||||||
|
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Requires=simplex-chat.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=docker run --rm simplex-alerter -c /etc/alerter-config.yaml -e 127.0.0.1:1337
|
ExecStart=docker run -p 127.0.0.1:7898:7898 -v /my/alerter/data:/alerterconfig -v /my/alerter/data:/simplex --rm simplex-alerter
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=simplex-chat.service
|
WantedBy=simplex-chat.service
|
||||||
|
@ -536,7 +512,6 @@ cat /etc/systemd/system/xxx
|
||||||
Now enable the services
|
Now enable the services
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now simplex-chat.service
|
|
||||||
sudo systemctl enable --now alerter.service
|
sudo systemctl enable --now alerter.service
|
||||||
|
|
||||||
# Conclusion
|
# Conclusion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue