По директориям раскидал
This commit is contained in:
@ -1,341 +1,341 @@
|
|||||||
Here’s a step-by-step guide to setting up a **RabbitMQ cluster with replication** correctly:
|
Here’s a step-by-step guide to setting up a **RabbitMQ cluster with replication** correctly:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 1: Prepare the Servers**
|
## **Step 1: Prepare the Servers**
|
||||||
|
|
||||||
Ensure you have at least **three** nodes (recommended for HA) with:
|
Ensure you have at least **three** nodes (recommended for HA) with:
|
||||||
|
|
||||||
- Ubuntu 22.04 (or a supported OS)
|
- Ubuntu 22.04 (or a supported OS)
|
||||||
- Sufficient CPU/RAM based on workload
|
- Sufficient CPU/RAM based on workload
|
||||||
- Open necessary firewall ports (**5672, 15672, 25672**)
|
- Open necessary firewall ports (**5672, 15672, 25672**)
|
||||||
|
|
||||||
Set hostnames for clarity:
|
Set hostnames for clarity:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo hostnamectl set-hostname rabbitmq-node1 # Change for each node
|
sudo hostnamectl set-hostname rabbitmq-node1 # Change for each node
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 2: Install Erlang and RabbitMQ**
|
## **Step 2: Install Erlang and RabbitMQ**
|
||||||
|
|
||||||
Run the following on **all nodes**:
|
Run the following on **all nodes**:
|
||||||
|
|
||||||
### **1. Add the RabbitMQ Repository**
|
### **1. Add the RabbitMQ Repository**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y curl gnupg
|
sudo apt install -y curl gnupg
|
||||||
curl -fsSL https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey | sudo tee /usr/share/keyrings/rabbitmq-key.asc
|
curl -fsSL https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey | sudo tee /usr/share/keyrings/rabbitmq-key.asc
|
||||||
echo "deb [signed-by=/usr/share/keyrings/rabbitmq-key.asc] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
|
echo "deb [signed-by=/usr/share/keyrings/rabbitmq-key.asc] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
|
||||||
```
|
```
|
||||||
|
|
||||||
### **2. Install Erlang and RabbitMQ**
|
### **2. Install Erlang and RabbitMQ**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y rabbitmq-server
|
sudo apt install -y rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
### **3. Enable RabbitMQ**
|
### **3. Enable RabbitMQ**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl enable --now rabbitmq-server
|
sudo systemctl enable --now rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 3: Configure Clustering**
|
## **Step 3: Configure Clustering**
|
||||||
|
|
||||||
### **1. Stop RabbitMQ on All Nodes**
|
### **1. Stop RabbitMQ on All Nodes**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl stop rabbitmq-server
|
sudo systemctl stop rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
### **2. Configure Cookie for Clustering**
|
### **2. Configure Cookie for Clustering**
|
||||||
|
|
||||||
Run on **all nodes** (same cookie ensures clustering works):
|
Run on **all nodes** (same cookie ensures clustering works):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo "MY_CLUSTER_COOKIE" | sudo tee /var/lib/rabbitmq/.erlang.cookie
|
echo "MY_CLUSTER_COOKIE" | sudo tee /var/lib/rabbitmq/.erlang.cookie
|
||||||
sudo chmod 600 /var/lib/rabbitmq/.erlang.cookie
|
sudo chmod 600 /var/lib/rabbitmq/.erlang.cookie
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `"MY_CLUSTER_COOKIE"` with a strong, identical value on all nodes.
|
Replace `"MY_CLUSTER_COOKIE"` with a strong, identical value on all nodes.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 4: Join Nodes to the Cluster**
|
## **Step 4: Join Nodes to the Cluster**
|
||||||
|
|
||||||
Perform this on **nodes 2 and 3**, joining them to **node1**:
|
Perform this on **nodes 2 and 3**, joining them to **node1**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rabbitmqctl stop_app
|
sudo rabbitmqctl stop_app
|
||||||
sudo rabbitmqctl join_cluster rabbit@rabbitmq-node1
|
sudo rabbitmqctl join_cluster rabbit@rabbitmq-node1
|
||||||
sudo rabbitmqctl start_app
|
sudo rabbitmqctl start_app
|
||||||
```
|
```
|
||||||
|
|
||||||
Check cluster status:
|
Check cluster status:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rabbitmqctl cluster_status
|
sudo rabbitmqctl cluster_status
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 5: Enable High Availability (HA) Mirroring**
|
## **Step 5: Enable High Availability (HA) Mirroring**
|
||||||
|
|
||||||
To replicate all queues, run on **any one node**:
|
To replicate all queues, run on **any one node**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl set_policy ha-all "^.*" '{"ha-mode":"all","ha-sync-mode":"automatic"}'
|
rabbitmqctl set_policy ha-all "^.*" '{"ha-mode":"all","ha-sync-mode":"automatic"}'
|
||||||
```
|
```
|
||||||
|
|
||||||
This ensures all queues are **replicated across all nodes**.
|
This ensures all queues are **replicated across all nodes**.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 6: Enable Management UI**
|
## **Step 6: Enable Management UI**
|
||||||
|
|
||||||
Run on **each node** to enable the web interface:
|
Run on **each node** to enable the web interface:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rabbitmq-plugins enable rabbitmq_management
|
sudo rabbitmq-plugins enable rabbitmq_management
|
||||||
```
|
```
|
||||||
|
|
||||||
Access at:
|
Access at:
|
||||||
**http://[NODE_IP]:15672**
|
**http://[NODE_IP]:15672**
|
||||||
(Default login: `guest/guest`, change this for security.)
|
(Default login: `guest/guest`, change this for security.)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 7: Test the Cluster**
|
## **Step 7: Test the Cluster**
|
||||||
|
|
||||||
Run on **each node**:
|
Run on **each node**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl list_queues
|
rabbitmqctl list_queues
|
||||||
```
|
```
|
||||||
|
|
||||||
Queues should be visible and synchronized.
|
Queues should be visible and synchronized.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 8: Enable Auto-Recovery** (Optional)
|
## **Step 8: Enable Auto-Recovery** (Optional)
|
||||||
|
|
||||||
Edit `/etc/rabbitmq/rabbitmq.conf` on **each node** and add:
|
Edit `/etc/rabbitmq/rabbitmq.conf` on **each node** and add:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
cluster_formation.peer_discovery_backend = classic_config
|
cluster_formation.peer_discovery_backend = classic_config
|
||||||
cluster_formation.classic_config.nodes.1 = rabbit@rabbitmq-node1
|
cluster_formation.classic_config.nodes.1 = rabbit@rabbitmq-node1
|
||||||
cluster_formation.classic_config.nodes.2 = rabbit@rabbitmq-node2
|
cluster_formation.classic_config.nodes.2 = rabbit@rabbitmq-node2
|
||||||
cluster_formation.classic_config.nodes.3 = rabbit@rabbitmq-node3
|
cluster_formation.classic_config.nodes.3 = rabbit@rabbitmq-node3
|
||||||
```
|
```
|
||||||
|
|
||||||
Then restart RabbitMQ:
|
Then restart RabbitMQ:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart rabbitmq-server
|
sudo systemctl restart rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 9: Secure the Cluster** (Recommended)
|
## **Step 9: Secure the Cluster** (Recommended)
|
||||||
|
|
||||||
### **1. Create an Admin User**
|
### **1. Create an Admin User**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl add_user admin StrongPassword123!
|
rabbitmqctl add_user admin StrongPassword123!
|
||||||
rabbitmqctl set_user_tags admin administrator
|
rabbitmqctl set_user_tags admin administrator
|
||||||
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
|
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then **disable the guest account**:
|
Then **disable the guest account**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl delete_user guest
|
rabbitmqctl delete_user guest
|
||||||
```
|
```
|
||||||
|
|
||||||
### **2. Enable TLS (Optional)**
|
### **2. Enable TLS (Optional)**
|
||||||
|
|
||||||
For security, configure TLS in `/etc/rabbitmq/rabbitmq.conf`. Refer to RabbitMQ’s [TLS guide](https://www.rabbitmq.com/ssl.html).
|
For security, configure TLS in `/etc/rabbitmq/rabbitmq.conf`. Refer to RabbitMQ’s [TLS guide](https://www.rabbitmq.com/ssl.html).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Step 10: Setup Monitoring (Optional)**
|
## **Step 10: Setup Monitoring (Optional)**
|
||||||
|
|
||||||
Install **Prometheus & Grafana** or use **RabbitMQ Prometheus plugin**:
|
Install **Prometheus & Grafana** or use **RabbitMQ Prometheus plugin**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rabbitmq-plugins enable rabbitmq_prometheus
|
sudo rabbitmq-plugins enable rabbitmq_prometheus
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Now your RabbitMQ cluster is fully set up with **replication and high availability**! 🚀
|
Now your RabbitMQ cluster is fully set up with **replication and high availability**! 🚀
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
# Instructions to fix **unexpected** configuration errors
|
# Instructions to fix **unexpected** configuration errors
|
||||||
|
|
||||||
If you can't find the RabbitMQ config file under `/etc/rabbitmq`, it may not exist by default. You need to **create it manually**. Here's how:
|
If you can't find the RabbitMQ config file under `/etc/rabbitmq`, it may not exist by default. You need to **create it manually**. Here's how:
|
||||||
|
|
||||||
## **1️⃣ Create the Configuration File**
|
## **1️⃣ Create the Configuration File**
|
||||||
|
|
||||||
RabbitMQ uses either a **`.conf` file** (modern format) or a **`.config` file** (legacy format). The recommended format is `.conf`.
|
RabbitMQ uses either a **`.conf` file** (modern format) or a **`.config` file** (legacy format). The recommended format is `.conf`.
|
||||||
|
|
||||||
Create the file if it doesn't exist:
|
Create the file if it doesn't exist:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nano /etc/rabbitmq/rabbitmq.conf
|
sudo nano /etc/rabbitmq/rabbitmq.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
Then add the following cluster configuration:
|
Then add the following cluster configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
cluster_formation.peer_discovery_backend = classic_config
|
cluster_formation.peer_discovery_backend = classic_config
|
||||||
cluster_formation.classic_config.nodes.1 = rabbit@rabbitmq-main
|
cluster_formation.classic_config.nodes.1 = rabbit@rabbitmq-main
|
||||||
cluster_formation.classic_config.nodes.2 = rabbit@rabbitmq-replica
|
cluster_formation.classic_config.nodes.2 = rabbit@rabbitmq-replica
|
||||||
```
|
```
|
||||||
|
|
||||||
Save and exit (`CTRL+X`, then `Y`, then `Enter`).
|
Save and exit (`CTRL+X`, then `Y`, then `Enter`).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **2️⃣ Set Correct Permissions**
|
## **2️⃣ Set Correct Permissions**
|
||||||
|
|
||||||
Ensure the RabbitMQ user can read it:
|
Ensure the RabbitMQ user can read it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.conf
|
sudo chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.conf
|
||||||
sudo chmod 644 /etc/rabbitmq/rabbitmq.conf
|
sudo chmod 644 /etc/rabbitmq/rabbitmq.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **3️⃣ Restart RabbitMQ**
|
## **3️⃣ Restart RabbitMQ**
|
||||||
|
|
||||||
After modifying the configuration, restart the RabbitMQ service:
|
After modifying the configuration, restart the RabbitMQ service:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart rabbitmq-server
|
sudo systemctl restart rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the status:
|
Check the status:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl status rabbitmq-server
|
sudo systemctl status rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **4️⃣ Verify the Cluster Configuration**
|
## **4️⃣ Verify the Cluster Configuration**
|
||||||
|
|
||||||
After restarting, verify that clustering is working:
|
After restarting, verify that clustering is working:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl cluster_status
|
rabbitmqctl cluster_status
|
||||||
```
|
```
|
||||||
|
|
||||||
If the nodes are listed correctly, your setup is working.
|
If the nodes are listed correctly, your setup is working.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **5️⃣ If Using the Legacy `.config` Format**
|
## **5️⃣ If Using the Legacy `.config` Format**
|
||||||
|
|
||||||
Some older installations use an **Erlang-based configuration file** (`rabbitmq.config`). If you prefer that, create:
|
Some older installations use an **Erlang-based configuration file** (`rabbitmq.config`). If you prefer that, create:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nano /etc/rabbitmq/rabbitmq.config
|
sudo nano /etc/rabbitmq/rabbitmq.config
|
||||||
```
|
```
|
||||||
|
|
||||||
Add this:
|
Add this:
|
||||||
|
|
||||||
```erlang
|
```erlang
|
||||||
[
|
[
|
||||||
{rabbit, [
|
{rabbit, [
|
||||||
{cluster_formation, [
|
{cluster_formation, [
|
||||||
{peer_discovery_backend, classic_config},
|
{peer_discovery_backend, classic_config},
|
||||||
{classic_config, [
|
{classic_config, [
|
||||||
{nodes, ['rabbit@rabbitmq-main', 'rabbit@rabbitmq-replica']}
|
{nodes, ['rabbit@rabbitmq-main', 'rabbit@rabbitmq-replica']}
|
||||||
]}
|
]}
|
||||||
]}
|
]}
|
||||||
]}
|
]}
|
||||||
].
|
].
|
||||||
```
|
```
|
||||||
|
|
||||||
Then restart RabbitMQ:
|
Then restart RabbitMQ:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart rabbitmq-server
|
sudo systemctl restart rabbitmq-server
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### **🔍 Troubleshooting**
|
### **🔍 Troubleshooting**
|
||||||
|
|
||||||
❌ **RabbitMQ doesn't restart?**
|
❌ **RabbitMQ doesn't restart?**
|
||||||
Check logs for errors:
|
Check logs for errors:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo journalctl -u rabbitmq-server --no-pager | tail -50
|
sudo journalctl -u rabbitmq-server --no-pager | tail -50
|
||||||
```
|
```
|
||||||
|
|
||||||
❌ **Cluster not forming?**
|
❌ **Cluster not forming?**
|
||||||
Try forcing a node to join manually:
|
Try forcing a node to join manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl stop_app
|
rabbitmqctl stop_app
|
||||||
rabbitmqctl join_cluster rabbit@rabbitmq-main
|
rabbitmqctl join_cluster rabbit@rabbitmq-main
|
||||||
rabbitmqctl start_app
|
rabbitmqctl start_app
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
# Instructions to fix **unexpected** management UI authentication errors
|
# Instructions to fix **unexpected** management UI authentication errors
|
||||||
|
|
||||||
stackoverflow answer [link](https://stackoverflow.com/a/40845332/27251837)
|
stackoverflow answer [link](https://stackoverflow.com/a/40845332/27251837)
|
||||||
|
|
||||||
## Answer
|
## Answer
|
||||||
|
|
||||||
### ❌ **Cannot login with guest/guest credentials**
|
### ❌ **Cannot login with guest/guest credentials**
|
||||||
|
|
||||||
I had the same Problem..
|
I had the same Problem..
|
||||||
|
|
||||||
I installed RabbitMQ and Enabled Web Interface also but still couldn't sign in with any user i newly created, this is because you need to be administrator to access this.
|
I installed RabbitMQ and Enabled Web Interface also but still couldn't sign in with any user i newly created, this is because you need to be administrator to access this.
|
||||||
|
|
||||||
Do not create any config file and mess with it..
|
Do not create any config file and mess with it..
|
||||||
|
|
||||||
This is what i did then,
|
This is what i did then,
|
||||||
|
|
||||||
1. Add a new/fresh user, say user test and password test:
|
1. Add a new/fresh user, say user test and password test:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl add_user test test
|
rabbitmqctl add_user test test
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Give administrative access to the new user:
|
2. Give administrative access to the new user:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl set_user_tags test administrator
|
rabbitmqctl set_user_tags test administrator
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Set permission to newly created user:
|
3. Set permission to newly created user:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
|
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
|
||||||
```
|
```
|
||||||
|
|
||||||
That's it, enjoy :)
|
That's it, enjoy :)
|
||||||
@ -1,138 +1,139 @@
|
|||||||
# 📌 Установка Gotify в Docker на Ubuntu 24.04
|
# 📌 Установка Gotify в Docker на Ubuntu 24.04
|
||||||
|
|
||||||
## 1. Установка Docker и Docker Compose
|
## 1. Установка Docker и Docker Compose
|
||||||
Если Docker не установлен, установим его:
|
Если Docker не установлен, установим его:
|
||||||
```sh
|
```sh
|
||||||
sudo apt update && sudo apt upgrade -y
|
sudo apt update && sudo apt upgrade -y
|
||||||
sudo apt install -y docker.io docker-compose
|
sudo apt install -y docker.io docker-compose
|
||||||
sudo systemctl enable --now docker
|
sudo systemctl enable --now docker
|
||||||
```
|
```
|
||||||
Проверим версию:
|
Проверим версию:
|
||||||
```sh
|
```sh
|
||||||
docker --version
|
docker --version
|
||||||
docker-compose --version
|
docker-compose --version
|
||||||
```
|
```
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
## 2. Создание директории для Gotify
|
## 2. Создание директории для Gotify
|
||||||
Лучшее место для сторонних сервисов — `/opt`:
|
Лучшее место для сторонних сервисов — `/opt`:
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir -p /opt/gotify
|
sudo mkdir -p /opt/gotify
|
||||||
cd /opt/gotify
|
cd /opt/gotify
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. Создаём самоподписанный сертификат
|
## 3. Создаём самоподписанный сертификат
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir -p /opt/gotify/certs && cd /opt/gotify/certs
|
sudo mkdir -p /opt/gotify/certs && cd /opt/gotify/certs
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout gotify.key -out gotify.crt -days 365 -nodes -subj "/CN=your.domain.com"
|
openssl req -x509 -newkey rsa:4096 -keyout gotify.key -out gotify.crt -days 365 -nodes -subj "/CN=your.domain.com"
|
||||||
```
|
```
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
## 3. Создание `docker-compose.yml`
|
## 3. Создание `docker-compose.yml`
|
||||||
Создадим конфигурацию:
|
Создадим конфигурацию:
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /opt/gotify/docker-compose.yml
|
sudo mcedit /opt/gotify/docker-compose.yml
|
||||||
```
|
```
|
||||||
Добавляем:
|
Добавляем:
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
gotify:
|
gotify:
|
||||||
image: gotify/server
|
image: gotify/server
|
||||||
container_name: gotify
|
container_name: gotify
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- "./certs:/certs"
|
- "./certs:/certs"
|
||||||
- "./data:/app/data"
|
- "./data:/app/data"
|
||||||
ports:
|
ports:
|
||||||
- "8080:443" # HTTPS
|
- "8080:443" # HTTPS
|
||||||
environment:
|
environment:
|
||||||
- GOTIFY_DEFAULTUSER_NAME=admin
|
- GOTIFY_DEFAULTUSER_NAME=admin
|
||||||
- GOTIFY_DEFAULTUSER_PASS=s23uBXreliGIAVOohXhW
|
- GOTIFY_DEFAULTUSER_PASS=s23uBXreliGIAVOohXhW
|
||||||
- TZ=Asia/Almaty
|
- TZ=Asia/Almaty
|
||||||
- GOTIFY_SERVER_SSL_ENABLED=true
|
- GOTIFY_SERVER_SSL_ENABLED=true
|
||||||
- GOTIFY_SERVER_SSL_CERTFILE=/certs/gotify.crt
|
- GOTIFY_SERVER_SSL_CERTFILE=/certs/gotify.crt
|
||||||
- GOTIFY_SERVER_SSL_CERTKEY=/certs/gotify.key
|
- GOTIFY_SERVER_SSL_CERTKEY=/certs/gotify.key
|
||||||
networks:
|
- GIN_MODE=debug
|
||||||
- gotify-net
|
networks:
|
||||||
|
- gotify-net
|
||||||
networks:
|
|
||||||
gotify-net:
|
networks:
|
||||||
driver: bridge
|
gotify-net:
|
||||||
```
|
driver: bridge
|
||||||
💡 **Что здесь важно?**
|
```
|
||||||
- **`security_opt: - no-new-privileges:true`** → запрещает повышать привилегии в контейнере.
|
💡 **Что здесь важно?**
|
||||||
- **`volumes: ./data:/app/data`** → сохраняет данные вне контейнера.
|
- **`security_opt: - no-new-privileges:true`** → запрещает повышать привилегии в контейнере.
|
||||||
- **`restart: unless-stopped`** → перезапускает Gotify, если он внезапно упадёт.
|
- **`volumes: ./data:/app/data`** → сохраняет данные вне контейнера.
|
||||||
- **`ports: - "8080:80"`** → Gotify будет доступен на порту `8080`.
|
- **`restart: unless-stopped`** → перезапускает Gotify, если он внезапно упадёт.
|
||||||
|
- **`ports: - "8080:80"`** → Gotify будет доступен на порту `8080`.
|
||||||
🔑 **Замените пароль** (`supersecretpassword`) на свой!
|
|
||||||
|
🔑 **Замените пароль** (`supersecretpassword`) на свой!
|
||||||
---
|
|
||||||
|
---
|
||||||
## 4. Запуск Gotify
|
|
||||||
Запускаем контейнер:
|
## 4. Запуск Gotify
|
||||||
```sh
|
Запускаем контейнер:
|
||||||
cd /opt/gotify
|
```sh
|
||||||
sudo docker compose down
|
cd /opt/gotify
|
||||||
sudo docker-compose up -d
|
sudo docker compose down
|
||||||
```
|
sudo docker-compose up -d
|
||||||
Проверяем статус:
|
```
|
||||||
```sh
|
Проверяем статус:
|
||||||
sudo docker ps
|
```sh
|
||||||
```
|
sudo docker ps
|
||||||
Вы должны увидеть работающий контейнер `gotify`.
|
```
|
||||||
|
Вы должны увидеть работающий контейнер `gotify`.
|
||||||
---
|
|
||||||
|
---
|
||||||
## 5. Проверка работы
|
|
||||||
Открываем браузер и переходим:
|
## 5. Проверка работы
|
||||||
👉 **https://192.168.200.84:8080**
|
Открываем браузер и переходим:
|
||||||
👉 **https://gotify.locust.kz:8443**
|
👉 **https://192.168.200.84:8080**
|
||||||
|
👉 **https://gotify.locust.kz:8443**
|
||||||
Логинимся:
|
|
||||||
- **Имя**: `admin`
|
Логинимся:
|
||||||
- **Пароль**: тот, что указан в `GOTIFY_DEFAULTUSER_PASS`
|
- **Имя**: `admin`
|
||||||
|
- **Пароль**: тот, что указан в `GOTIFY_DEFAULTUSER_PASS`
|
||||||
---
|
|
||||||
|
---
|
||||||
## 6. Автоматический запуск при загрузке
|
|
||||||
Docker уже настроен на автозапуск, но проверим:
|
## 6. Автоматический запуск при загрузке
|
||||||
```sh
|
Docker уже настроен на автозапуск, но проверим:
|
||||||
sudo systemctl enable --now docker
|
```sh
|
||||||
```
|
sudo systemctl enable --now docker
|
||||||
Чтобы Gotify запускался автоматически:
|
```
|
||||||
```sh
|
Чтобы Gotify запускался автоматически:
|
||||||
cd /opt/gotify
|
```sh
|
||||||
sudo docker-compose restart
|
cd /opt/gotify
|
||||||
```
|
sudo docker-compose restart
|
||||||
|
```
|
||||||
---
|
|
||||||
|
---
|
||||||
## 7. Логи и управление
|
|
||||||
Просмотр логов:
|
## 7. Логи и управление
|
||||||
```sh
|
Просмотр логов:
|
||||||
sudo docker-compose logs -f
|
```sh
|
||||||
```
|
sudo docker-compose logs -f
|
||||||
Перезапуск контейнера:
|
```
|
||||||
```sh
|
Перезапуск контейнера:
|
||||||
sudo docker-compose restart
|
```sh
|
||||||
```
|
sudo docker-compose restart
|
||||||
Остановка:
|
```
|
||||||
```sh
|
Остановка:
|
||||||
sudo docker-compose down
|
```sh
|
||||||
```
|
sudo docker-compose down
|
||||||
|
```
|
||||||
---
|
|
||||||
|
---
|
||||||
## 8. Удаление Gotify (если потребуется)
|
|
||||||
```sh
|
## 8. Удаление Gotify (если потребуется)
|
||||||
cd /opt/gotify
|
```sh
|
||||||
sudo docker-compose down
|
cd /opt/gotify
|
||||||
sudo rm -rf /opt/gotify
|
sudo docker-compose down
|
||||||
```
|
sudo rm -rf /opt/gotify
|
||||||
|
```
|
||||||
---
|
|
||||||
|
---
|
||||||
## ✅ Готово!
|
|
||||||
Теперь Gotify работает на порту `80` с безопасными настройками (`no-new-privileges:true`). 🚀
|
## ✅ Готово!
|
||||||
|
Теперь Gotify работает на порту `80` с безопасными настройками (`no-new-privileges:true`). 🚀
|
||||||
@ -1,38 +1,38 @@
|
|||||||
Открываю нужный сервер
|
Открываю нужный сервер
|
||||||
```sh
|
```sh
|
||||||
wsl
|
wsl
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -sSX POST https://istt-kz.zulipchat.com/api/v1/fetch_api_key \
|
curl -sSX POST https://istt-kz.zulipchat.com/api/v1/fetch_api_key \
|
||||||
--data-urlencode username=ivanov.i@istt.kz \
|
--data-urlencode username=ivanov.i@istt.kz \
|
||||||
--data-urlencode password=fsUHb3hf3QCdpBLsKyhL
|
--data-urlencode password=fsUHb3hf3QCdpBLsKyhL
|
||||||
```
|
```
|
||||||
Выдало:
|
Выдало:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"result":"success",
|
"result":"success",
|
||||||
"msg":"",
|
"msg":"",
|
||||||
"api_key":"91kQqr13HCwFP2HeARWPHxrfksYPH82p",
|
"api_key":"91kQqr13HCwFP2HeARWPHxrfksYPH82p",
|
||||||
"email":"ivanov.i@istt.kz",
|
"email":"ivanov.i@istt.kz",
|
||||||
"user_id":880555
|
"user_id":880555
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -X POST https://istt-kz.zulipchat.com/api/v1/messages \
|
curl -X POST https://istt-kz.zulipchat.com/api/v1/messages \
|
||||||
-u "ivanov.i@istt.kz:91kQqr13HCwFP2HeARWPHxrfksYPH82p" \
|
-u "ivanov.i@istt.kz:91kQqr13HCwFP2HeARWPHxrfksYPH82p" \
|
||||||
-d "type=stream" \
|
-d "type=stream" \
|
||||||
-d "to=general" \
|
-d "to=general" \
|
||||||
-d "topic=Тест5" \
|
-d "topic=Тест5" \
|
||||||
-d "content=Привет из консоли!"
|
-d "content=Привет из консоли!"
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -X POST https://istt-kz.zulipchat.com/api/v1/messages \
|
curl -X POST https://istt-kz.zulipchat.com/api/v1/messages \
|
||||||
-u "ivanov.i@istt.kz:91kQqr13HCwFP2HeARWPHxrfksYPH82p" \
|
-u "ivanov.i@istt.kz:91kQqr13HCwFP2HeARWPHxrfksYPH82p" \
|
||||||
-d "type=private" \
|
-d "type=private" \
|
||||||
-d "to=ivanov.i@istt.kz" \
|
-d "to=ivanov.i@istt.kz" \
|
||||||
-d "topic=Тест5" \
|
-d "topic=Тест5" \
|
||||||
-d "content=Привет из консоли!"
|
-d "content=Привет из консоли!"
|
||||||
```
|
```
|
||||||
@ -206,7 +206,8 @@ sudo pdnsutil add-record locust.ge @ NS 3600 ns2.geovizor.top
|
|||||||
|
|
||||||
For deleting record please run command:
|
For deleting record please run command:
|
||||||
```sh
|
```sh
|
||||||
pdnsutil delete-rrset locust.ge locust.ge.locust.ge NS
|
sudo pdnsutil delete-rrset locust.ge locust.ge.locust.ge NS
|
||||||
|
sudo pdnsutil delete-rrset geovizor.top gotify A
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ Minimum = 3600 (1 час)
|
|||||||
Проверим список зон
|
Проверим список зон
|
||||||
```sh
|
```sh
|
||||||
sudo pdnsutil list-all-zones &&
|
sudo pdnsutil list-all-zones &&
|
||||||
sudo pdnsutil list-zone locust.kz
|
sudo pdnsutil list-zone geovizor.top
|
||||||
```
|
```
|
||||||
Проверяем отвечалет ли:
|
Проверяем отвечалет ли:
|
||||||
```sh
|
```sh
|
||||||
@ -364,7 +365,7 @@ journalctl -u pdns-recursor --no-pager | tail -n 50
|
|||||||
```
|
```
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
## ********** По идее отключать не нужно так как systemd-resolved использует другой IP: 127.0.0.54:53 (Отключаю systemd-resolved иначе он будет конфликтовать с PowerDNS) **********
|
## ********** По идее systemd-resolved отключать не нужно так как он использует другой IP: 127.0.0.54:53 **********
|
||||||
|
|
||||||
Редактирую /etc/netplan/ для того чтобы прописать поднятый DNS сервер на 127.0.0.1 (не знаю сработает ли так как отключу systemd-resolved)
|
Редактирую /etc/netplan/ для того чтобы прописать поднятый DNS сервер на 127.0.0.1 (не знаю сработает ли так как отключу systemd-resolved)
|
||||||
```sh
|
```sh
|
||||||
@ -613,7 +614,7 @@ open http://192.168.200.85:9191/login
|
|||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
Настраиваем запус на постоянную работу через Gunicorn и systemd
|
Настраиваем запуск на постоянную работу через Gunicorn и systemd
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd /opt/web/powerdns-admin &&
|
cd /opt/web/powerdns-admin &&
|
||||||
|
|||||||
52
DNS/Ubuntu_config.md
Normal file
52
DNS/Ubuntu_config.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
Чтобы в Ubuntu все домены с маской *.local отправлялись на DNS-сервер 192.168.200.85 (где работает PowerDNS на порту 53), тебе нужно настроить DNS-резолвинг так, чтобы:
|
||||||
|
|
||||||
|
Все запросы к доменам, оканчивающимся на .local, отправлялись на указанный DNS.
|
||||||
|
|
||||||
|
Остальные домены резолвились через системный DNS как обычно.
|
||||||
|
|
||||||
|
✅ Способ 1: Использовать systemd-resolved (рекомендуется для Ubuntu 18.04+, особенно 20.04 и 22.04)
|
||||||
|
Ubuntu по умолчанию использует systemd-resolved, который поддерживает пер-доменное направление DNS-запросов.
|
||||||
|
|
||||||
|
Шаги:
|
||||||
|
Создай файл в /etc/systemd/resolved.conf.d/:
|
||||||
|
```sh
|
||||||
|
ssh igor@192.168.200.84 -p 22
|
||||||
|
```
|
||||||
|
|
||||||
|
Создаю директорию
|
||||||
|
```sh
|
||||||
|
sudo mkdir -p /etc/systemd/resolved.conf.d &&
|
||||||
|
sudo mcedit /etc/systemd/resolved.conf.d/local-dns.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Прописываю содержимое:
|
||||||
|
```conf
|
||||||
|
[Resolve]
|
||||||
|
DNS=192.168.200.85
|
||||||
|
Domains=~local
|
||||||
|
```
|
||||||
|
|
||||||
|
Перезапускаю
|
||||||
|
```sh
|
||||||
|
sudo systemctl restart systemd-resolved &&
|
||||||
|
```
|
||||||
|
|
||||||
|
Проверяю настройки
|
||||||
|
```sh
|
||||||
|
resolvectl status
|
||||||
|
```
|
||||||
|
|
||||||
|
Проверяем
|
||||||
|
```sh
|
||||||
|
ping gotify.local
|
||||||
|
```
|
||||||
|
Проверяем сертификат:
|
||||||
|
```sh
|
||||||
|
curl https://gotify.local
|
||||||
|
```
|
||||||
|
|
||||||
|
Добавляем корневой сертификат для домена local.
|
||||||
|
```sh
|
||||||
|
sudo cp rootCA.crt /usr/local/share/ca-certificates/rootCA.crt &&
|
||||||
|
sudo update-ca-certificates
|
||||||
|
```
|
||||||
@ -1,94 +1,94 @@
|
|||||||
```sh
|
```sh
|
||||||
sudo apt update &&
|
sudo apt update &&
|
||||||
sudo apt install unbound -y &&
|
sudo apt install unbound -y &&
|
||||||
unbound -V
|
unbound -V
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl start unbound &&
|
sudo systemctl start unbound &&
|
||||||
sudo systemctl enable unbound &&
|
sudo systemctl enable unbound &&
|
||||||
sudo systemctl status unbound
|
sudo systemctl status unbound
|
||||||
```
|
```
|
||||||
On Windows configuration is:
|
On Windows configuration is:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
server:
|
server:
|
||||||
verbosity: 4
|
verbosity: 4
|
||||||
qname-minimisation: no
|
qname-minimisation: no
|
||||||
interface: 127.0.0.1
|
interface: 127.0.0.1
|
||||||
do-ip6: no
|
do-ip6: no
|
||||||
do-ip4: yes
|
do-ip4: yes
|
||||||
logfile: "C:\unbound.log"
|
logfile: "C:\unbound.log"
|
||||||
domain-insecure: "test."
|
domain-insecure: "test."
|
||||||
domain-insecure: "local."
|
domain-insecure: "local."
|
||||||
domain-insecure: "pizza."
|
domain-insecure: "pizza."
|
||||||
auto-trust-anchor-file: "C:\Program Files\Unbound\root.key"
|
auto-trust-anchor-file: "C:\Program Files\Unbound\root.key"
|
||||||
private-address: ::/0
|
private-address: ::/0
|
||||||
harden-dnssec-stripped: no
|
harden-dnssec-stripped: no
|
||||||
harden-referral-path: no
|
harden-referral-path: no
|
||||||
|
|
||||||
# Явно указываем, что зона "test." не локальная
|
# Явно указываем, что зона "test." не локальная
|
||||||
local-zone: "test." transparent
|
local-zone: "test." transparent
|
||||||
|
|
||||||
forward-zone:
|
forward-zone:
|
||||||
name: "test."
|
name: "test."
|
||||||
forward-addr: 192.168.200.85@5300
|
forward-addr: 192.168.200.85@5300
|
||||||
|
|
||||||
forward-zone:
|
forward-zone:
|
||||||
name: "local."
|
name: "local."
|
||||||
forward-addr: 192.168.200.85@5300
|
forward-addr: 192.168.200.85@5300
|
||||||
|
|
||||||
forward-zone:
|
forward-zone:
|
||||||
name: "pizza."
|
name: "pizza."
|
||||||
forward-addr: 10.101.1.31@53
|
forward-addr: 10.101.1.31@53
|
||||||
|
|
||||||
forward-zone:
|
forward-zone:
|
||||||
name: "srv."
|
name: "srv."
|
||||||
forward-addr: 10.101.1.31@53
|
forward-addr: 10.101.1.31@53
|
||||||
|
|
||||||
remote-control:
|
remote-control:
|
||||||
control-enable: yes
|
control-enable: yes
|
||||||
control-interface: 127.0.0.1
|
control-interface: 127.0.0.1
|
||||||
control-use-cert: no
|
control-use-cert: no
|
||||||
```
|
```
|
||||||
|
|
||||||
On Linux conf file devide on anoter files
|
On Linux conf file devide on anoter files
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /etc/unbound/unbound.conf
|
sudo mcedit /etc/unbound/unbound.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd /etc/unbound/ &&
|
cd /etc/unbound/ &&
|
||||||
sudo mc
|
sudo mc
|
||||||
```
|
```
|
||||||
|
|
||||||
Получить полный список локальных зон можно так: unbound-control
|
Получить полный список локальных зон можно так: unbound-control
|
||||||
```sh
|
```sh
|
||||||
unbound-control list_local_zones
|
unbound-control list_local_zones
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl restart unbound
|
sudo systemctl restart unbound
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl status unbound.service
|
sudo systemctl status unbound.service
|
||||||
```
|
```
|
||||||
```sh
|
```sh
|
||||||
sudo journalctl -xeu unbound.service
|
sudo journalctl -xeu unbound.service
|
||||||
```
|
```
|
||||||
|
|
||||||
Check on errors:
|
Check on errors:
|
||||||
```sh
|
```sh
|
||||||
sudo unbound-checkconf /etc/unbound/unbound.conf
|
sudo unbound-checkconf /etc/unbound/unbound.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Прописываем для определенного интерфейса:
|
Прописываем для определенного интерфейса:
|
||||||
```sh
|
```sh
|
||||||
sudo resolvectl dns wlp14s0 127.0.0.1
|
sudo resolvectl dns wlp14s0 127.0.0.1
|
||||||
```
|
```
|
||||||
Проверяем что стоит в качестве NDS резольвера
|
Проверяем что стоит в качестве NDS резольвера
|
||||||
```sh
|
```sh
|
||||||
resolvectl status
|
resolvectl status
|
||||||
```
|
```
|
||||||
171
Logs/Vector_dev_install.md
Normal file
171
Logs/Vector_dev_install.md
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
# Настройка Vector для отправки логов в Gotify
|
||||||
|
|
||||||
|
Эта инструкция описывает, как установить Vector, настроить его для чтения JSON-логов из файла `/opt/org_ccalm_main/logs/ccalm.log`, фильтрации строк с уровнем `ERROR` и отправки уведомлений в Gotify.
|
||||||
|
|
||||||
|
---
|
||||||
|
## 0. ✅ Подключаемся к инфраструктуре
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh igor@ccalm.org -p 2200
|
||||||
|
```
|
||||||
|
|
||||||
|
## Предварительные требования
|
||||||
|
- ОС: Ubuntu/Debian (для других ОС уточните, чтобы адаптировать команды).
|
||||||
|
- Файл логов: `/opt/org_ccalm_main/logs/ccalm.log` с JSON-строками (поля `level` и `message`).
|
||||||
|
- Gotify: Доступный сервер Gotify с URL и токеном (например, `https://gotify.example.com/message?token=<your-token>`).
|
||||||
|
- Доступ к терминалу с правами `sudo`.
|
||||||
|
|
||||||
|
|
||||||
|
## Шаг 1: Установка Vector
|
||||||
|
|
||||||
|
Пробуем скачать deb пакет с сайта
|
||||||
|
```sh
|
||||||
|
curl -L https://packages.timber.io/vector/0.43.1/vector_0.43.1-1_amd64.deb -o vector_0.43.1-1_amd64.deb &&
|
||||||
|
sudo dpkg -i vector_0.43.1-1_amd64.deb &&
|
||||||
|
sudo apt-get install -f &&
|
||||||
|
vector --version
|
||||||
|
```
|
||||||
|
|
||||||
|
## Шаг 2: Создание конфигурации Vector
|
||||||
|
Vector использует YAML для конфигурации. Настроим чтение логов, фильтрацию `ERROR` и отправку в Gotify.
|
||||||
|
|
||||||
|
1. Создайте файл конфигурации `/etc/vector/vector.yaml`:
|
||||||
|
```sh
|
||||||
|
cd /etc/vector &&
|
||||||
|
sudo tee vector.yaml > /dev/null <<'EOF'
|
||||||
|
data_dir: "/var/lib/vector"
|
||||||
|
|
||||||
|
sources:
|
||||||
|
ccalm_logs:
|
||||||
|
type: file
|
||||||
|
include:
|
||||||
|
- /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
read_from: beginning
|
||||||
|
|
||||||
|
transforms:
|
||||||
|
parse_json:
|
||||||
|
type: remap
|
||||||
|
inputs:
|
||||||
|
- ccalm_logs
|
||||||
|
source: |
|
||||||
|
structured, err = parse_json(.message)
|
||||||
|
if err != null {
|
||||||
|
abort
|
||||||
|
}
|
||||||
|
merged, err = merge(., structured)
|
||||||
|
if err != null {
|
||||||
|
abort
|
||||||
|
}
|
||||||
|
. = merged
|
||||||
|
|
||||||
|
filter_errors:
|
||||||
|
type: filter
|
||||||
|
inputs:
|
||||||
|
- parse_json
|
||||||
|
condition: '.level == "ERROR"'
|
||||||
|
|
||||||
|
format_telegram_json:
|
||||||
|
type: remap
|
||||||
|
inputs:
|
||||||
|
- filter_errors
|
||||||
|
source: |
|
||||||
|
msg, err = string(.message)
|
||||||
|
if err != null {
|
||||||
|
msg = "Unable to parse message"
|
||||||
|
}
|
||||||
|
.message = "{\"title\":\"CCALM Main Error Log\",\"message\":\"ERROR: " + msg + "\"}"
|
||||||
|
|
||||||
|
|
||||||
|
sinks:
|
||||||
|
gotify:
|
||||||
|
type: http
|
||||||
|
inputs:
|
||||||
|
- filter_errors
|
||||||
|
uri: "https://gotify.geovizor.top:8443/message?token=AYmcpr43YtPKDmZ"
|
||||||
|
method: post
|
||||||
|
encoding:
|
||||||
|
codec: json
|
||||||
|
template: '{"title":"CCALM Main Error Log","message":"Test message 00","priority":5}'
|
||||||
|
request:
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
Host: "gotify.geovizor.top"
|
||||||
|
Content-Length: "{{ content_length }}"
|
||||||
|
tls:
|
||||||
|
verify_certificate: false
|
||||||
|
verify_hostname: false
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
Пробую отправку через curl
|
||||||
|
```sh
|
||||||
|
curl -X POST -k "https://gotify.geovizor.top:8443/message?token=AYmcpr43YtPKDmZ" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"message": "Test message", "priority": 5}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Проверяем что gotify работает:
|
||||||
|
```sh
|
||||||
|
curl -k -X POST -H "Content-Type: application/json" -H "Host: gotify.geovizor.top" -d '{"message":"Test message 00","priority":5}' --http1.1 https://gotify.geovizor.top:8443/message?token=AYmcpr43YtPKDmZ -v
|
||||||
|
```
|
||||||
|
|
||||||
|
### Объяснение конфигурации
|
||||||
|
- **Source (`ccalm_logs`)**: Читает логи из файла, парсит JSON, поддерживает многострочные логи.
|
||||||
|
- **Transform (`filter_errors`)**: Фильтрует логи с `level: "ERROR"`.
|
||||||
|
- **Sink (`gotify`)**: Отправляет отфильтрованные логи в Gotify через HTTP POST.
|
||||||
|
|
||||||
|
## Шаг 3: Проверка конфигурации
|
||||||
|
Проверьте корректность YAML:
|
||||||
|
```sh
|
||||||
|
vector --config /etc/vector/vector.yaml validate
|
||||||
|
```
|
||||||
|
Ожидаемый вывод: `Configuration is valid`.
|
||||||
|
|
||||||
|
## Шаг 4: Запуск Vector
|
||||||
|
### Тестовый запуск (для отладки)
|
||||||
|
```sh
|
||||||
|
sudo vector --config /etc/vector/vector.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Запуск как сервиса
|
||||||
|
1. Включите и запустите сервис:
|
||||||
|
```sh
|
||||||
|
sudo systemctl enable vector
|
||||||
|
sudo systemctl start vector
|
||||||
|
```
|
||||||
|
2. Проверьте статус:
|
||||||
|
```sh
|
||||||
|
sudo systemctl status vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Шаг 5: Проверка отправки в Gotify
|
||||||
|
1. Убедитесь, что Gotify доступен по указанному URL.
|
||||||
|
2. Добавьте тестовую строку лога в `/opt/org_ccalm_main/logs/ccalm.log`:
|
||||||
|
```sh
|
||||||
|
echo '{"level": "ERROR", "message": "Database connection failed", "timestamp": "2025-05-18T12:28:00Z"}' | sudo tee -a /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
```
|
||||||
|
3. Проверьте Gotify (веб-интерфейс или приложение) — должно прийти уведомление с заголовком "CCALM Log Error" и сообщением "Database connection failed".
|
||||||
|
|
||||||
|
## Шаг 6: Отладка
|
||||||
|
- Логи Vector: `/var/log/vector/vector.log` или stdout (в тестовом режиме).
|
||||||
|
- Проверьте логи при проблемах:
|
||||||
|
```sh
|
||||||
|
cat /var/log/vector/vector.log
|
||||||
|
```
|
||||||
|
|
||||||
|
## Дополнительные настройки
|
||||||
|
- **Права доступа к файлу логов**:
|
||||||
|
```sh
|
||||||
|
sudo chown vector:vector /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
sudo chmod 644 /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
```
|
||||||
|
- **Если JSON-формат отличается**: Если поле `level` называется иначе (например, `log_level`), замените `.level` на `.log_level` в `condition`.
|
||||||
|
- **HTTP вместо HTTPS**: Если Gotify использует HTTP, замените `https://` на `http://` в `uri`.
|
||||||
|
|
||||||
|
## Примечания
|
||||||
|
- Убедитесь, что Gotify настроен и токен действителен.
|
||||||
|
- Если логи не отправляются, проверьте сетевую доступность Gotify и правильность URL/токена.
|
||||||
|
- Для чтения только новых логов удалите `read_from: beginning` в конфигурации.
|
||||||
197
Logs/Vector_dev_install_telegram.md
Normal file
197
Logs/Vector_dev_install_telegram.md
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
Шаг 1: Создание Telegram-бота
|
||||||
|
Зарегистрируйте бота через BotFather:
|
||||||
|
|
||||||
|
Откройте Telegram и найдите @BotFather.
|
||||||
|
Отправьте команду /start.
|
||||||
|
Отправьте /newbot, чтобы создать нового бота.
|
||||||
|
Следуйте инструкциям:
|
||||||
|
Укажите имя бота (например, MyLogBot).
|
||||||
|
Укажите username бота, заканчивающийся на bot (например, @MyLogAllBot).
|
||||||
|
После создания вы получите токен (например, 8007457609:AAGnrXOSaoxODMSh4yCzUEIp0uxfH3Hk8ws). Сохраните его, он понадобится для API.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Настройка Vector для отправки логов в Gotify
|
||||||
|
|
||||||
|
Эта инструкция описывает, как установить Vector, настроить его для чтения JSON-логов из файла `/opt/org_ccalm_main/logs/ccalm.log`, фильтрации строк с уровнем `ERROR` и отправки уведомлений в Gotify.
|
||||||
|
|
||||||
|
---
|
||||||
|
## 0. ✅ Подключаемся к инфраструктуре
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh igor@ccalm.org -p 2200
|
||||||
|
```
|
||||||
|
|
||||||
|
## Предварительные требования
|
||||||
|
- ОС: Ubuntu/Debian (для других ОС уточните, чтобы адаптировать команды).
|
||||||
|
- Файл логов: `/opt/org_ccalm_main/logs/ccalm.log` с JSON-строками (поля `level` и `message`).
|
||||||
|
- Gotify: Доступный сервер Gotify с URL и токеном (например, `https://gotify.example.com/message?token=<your-token>`).
|
||||||
|
- Доступ к терминалу с правами `sudo`.
|
||||||
|
|
||||||
|
|
||||||
|
## Шаг 1: Установка Vector
|
||||||
|
|
||||||
|
Пробуем скачать deb пакет с сайта
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L https://packages.timber.io/vector/0.46.X/vector_0.46.1-1_amd64.deb -o vector_0.46.1-1_amd64.deb &&
|
||||||
|
sudo dpkg -i vector_0.46.1-1_amd64.deb &&
|
||||||
|
sudo apt-get install -f &&
|
||||||
|
vector --version
|
||||||
|
```
|
||||||
|
|
||||||
|
That make deleting:
|
||||||
|
```sh
|
||||||
|
sudo apt remove --purge vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Шаг 2: Создание конфигурации Vector
|
||||||
|
Vector использует YAML для конфигурации. Настроим чтение логов, фильтрацию `ERROR` и отправку в Gotify.
|
||||||
|
|
||||||
|
1. Создайте файл конфигурации `/etc/vector/vector.yaml`:
|
||||||
|
```sh
|
||||||
|
cd /etc/vector &&
|
||||||
|
sudo tee vector.yaml > /dev/null <<'EOF'
|
||||||
|
data_dir: "/var/lib/vector"
|
||||||
|
|
||||||
|
sources:
|
||||||
|
ccalm_logs:
|
||||||
|
type: file
|
||||||
|
include:
|
||||||
|
- /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
read_from: beginning
|
||||||
|
|
||||||
|
transforms:
|
||||||
|
parse_json:
|
||||||
|
type: remap
|
||||||
|
inputs:
|
||||||
|
- ccalm_logs
|
||||||
|
source: |
|
||||||
|
structured, err = parse_json(.message)
|
||||||
|
if err != null {
|
||||||
|
abort
|
||||||
|
}
|
||||||
|
merged, err = merge(., structured)
|
||||||
|
if err != null {
|
||||||
|
abort
|
||||||
|
}
|
||||||
|
. = merged
|
||||||
|
|
||||||
|
filter_errors:
|
||||||
|
type: filter
|
||||||
|
inputs:
|
||||||
|
- parse_json
|
||||||
|
condition: '.level == "ERROR"'
|
||||||
|
|
||||||
|
format_telegram_json:
|
||||||
|
type: remap
|
||||||
|
inputs:
|
||||||
|
- filter_errors
|
||||||
|
source: |
|
||||||
|
msg, err = string(.message)
|
||||||
|
if err != null {
|
||||||
|
msg = "Unable to parse message"
|
||||||
|
}
|
||||||
|
.message = "{\"chat_id\":\"307675888\",\"text\":\"ERROR: " + msg + "\"}"
|
||||||
|
|
||||||
|
sinks:
|
||||||
|
telegram:
|
||||||
|
type: http
|
||||||
|
inputs:
|
||||||
|
- format_telegram_json
|
||||||
|
uri: "https://api.telegram.org/bot8007457609:AAGnrXOSaoxODMSh4yCzUEIp0uxfH3Hk8ws/sendMessage"
|
||||||
|
method: post
|
||||||
|
encoding:
|
||||||
|
codec: text
|
||||||
|
request:
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
batch:
|
||||||
|
max_events: 1
|
||||||
|
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
curl https://api.telegram.org/bot8007457609:AAGnrXOSaoxODMSh4yCzUEIp0uxfH3Hk8ws/getUpdates
|
||||||
|
|
||||||
|
|
||||||
|
Пробую отправку через curl
|
||||||
|
```sh
|
||||||
|
curl -X POST -k "https://gotify.geovizor.top:8443/message?token=AYmcpr43YtPKDmZ" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"message": "Test message", "priority": 5}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Проверяем что gotify работает:
|
||||||
|
```sh
|
||||||
|
curl -k -X POST -H "Content-Type: application/json" -H "Host: gotify.geovizor.top" -d '{"message":"Test message 00","priority":5}' --http1.1 https://gotify.geovizor.top:8443/message?token=AYmcpr43YtPKDmZ -v
|
||||||
|
```
|
||||||
|
|
||||||
|
### Объяснение конфигурации
|
||||||
|
- **Source (`ccalm_logs`)**: Читает логи из файла, парсит JSON, поддерживает многострочные логи.
|
||||||
|
- **Transform (`filter_errors`)**: Фильтрует логи с `level: "ERROR"`.
|
||||||
|
- **Sink (`gotify`)**: Отправляет отфильтрованные логи в Gotify через HTTP POST.
|
||||||
|
|
||||||
|
## Шаг 3: Проверка конфигурации
|
||||||
|
Проверьте корректность YAML:
|
||||||
|
```sh
|
||||||
|
vector --config /etc/vector/vector.yaml validate
|
||||||
|
```
|
||||||
|
Ожидаемый вывод: `Configuration is valid`.
|
||||||
|
|
||||||
|
## Шаг 4: Запуск Vector
|
||||||
|
### Тестовый запуск (для отладки)
|
||||||
|
```sh
|
||||||
|
sudo vector --config /etc/vector/vector.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Запуск как сервиса
|
||||||
|
1. Включите и запустите сервис:
|
||||||
|
```sh
|
||||||
|
sudo systemctl enable vector
|
||||||
|
sudo systemctl start vector
|
||||||
|
```
|
||||||
|
2. Проверьте статус:
|
||||||
|
```sh
|
||||||
|
sudo systemctl status vector
|
||||||
|
```
|
||||||
|
```sh
|
||||||
|
sudo systemctl stop vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Шаг 5: Проверка отправки в Gotify
|
||||||
|
1. Убедитесь, что Gotify доступен по указанному URL.
|
||||||
|
2. Добавьте тестовую строку лога в `/opt/org_ccalm_main/logs/ccalm.log`:
|
||||||
|
```sh
|
||||||
|
echo '{"level": "ERROR", "message": "Database connection failed", "timestamp": "2025-05-18T12:28:00Z"}' | sudo tee -a /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
```
|
||||||
|
3. Проверьте Gotify (веб-интерфейс или приложение) — должно прийти уведомление с заголовком "CCALM Log Error" и сообщением "Database connection failed".
|
||||||
|
|
||||||
|
## Шаг 6: Отладка
|
||||||
|
- Логи Vector: `/var/log/vector/vector.log` или stdout (в тестовом режиме).
|
||||||
|
- Проверьте логи при проблемах:
|
||||||
|
```sh
|
||||||
|
cat /var/log/vector/vector.log
|
||||||
|
```
|
||||||
|
|
||||||
|
## Дополнительные настройки
|
||||||
|
- **Права доступа к файлу логов**:
|
||||||
|
```sh
|
||||||
|
sudo chown vector:vector /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
sudo chmod 644 /opt/org_ccalm_main/logs/ccalm.log
|
||||||
|
```
|
||||||
|
- **Если JSON-формат отличается**: Если поле `level` называется иначе (например, `log_level`), замените `.level` на `.log_level` в `condition`.
|
||||||
|
- **HTTP вместо HTTPS**: Если Gotify использует HTTP, замените `https://` на `http://` в `uri`.
|
||||||
|
|
||||||
|
## Примечания
|
||||||
|
- Убедитесь, что Gotify настроен и токен действителен.
|
||||||
|
- Если логи не отправляются, проверьте сетевую доступность Gotify и правильность URL/токена.
|
||||||
|
- Для чтения только новых логов удалите `read_from: beginning` в конфигурации.
|
||||||
@ -19,27 +19,33 @@ sudo apt-get install nginx -y
|
|||||||
```
|
```
|
||||||
Самой важной строкой является Common Name (введите FQDN или свое имя). Как правило, в эту строку вносят доменное имя, с которым нужно связать сервер. В случае если доменного имени нет, внесите в эту строку IP-адрес сервера.
|
Самой важной строкой является Common Name (введите FQDN или свое имя). Как правило, в эту строку вносят доменное имя, с которым нужно связать сервер. В случае если доменного имени нет, внесите в эту строку IP-адрес сервера.
|
||||||
```sh
|
```sh
|
||||||
sudo openssl dhparam -out /etc/nginx/dhparam.pem 4096
|
sudo openssl dhparam -out /etc/nginx/dhparam.pem 2048
|
||||||
```
|
```
|
||||||
|
|
||||||
И вписываем в него:
|
И вписываем в него:
|
||||||
```sh
|
```sh
|
||||||
cd /etc/nginx/sites-available/ &&
|
cd /etc/nginx/sites-available/ &&
|
||||||
sudo tee ccalm.org > /dev/null <<'EOF'
|
sudo tee ccalm.org > /dev/null <<'EOF'
|
||||||
server {
|
server {
|
||||||
listen 8081 ssl http2;
|
listen 8081;
|
||||||
listen [::]:8081 ssl http2;
|
listen [::]:8081;
|
||||||
|
|
||||||
server_name ccalm.org;
|
|
||||||
|
|
||||||
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
|
|
||||||
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
|
||||||
ssl_dhparam /etc/nginx/dhparam.pem;
|
|
||||||
|
|
||||||
root /opt/www/org_ccalm;
|
root /opt/www/org_ccalm;
|
||||||
index index.html index.htm;
|
index index.html;
|
||||||
|
|
||||||
|
server_name ccalm.org www.ccalm.org;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ =404; # Попытка найти файл или возвращение 404
|
try_files $uri $uri/ =404;
|
||||||
|
|
||||||
|
# Оптимизация для быстрой отдачи статики
|
||||||
|
sendfile on; # Использует sendfile() ядра Linux для ускорения
|
||||||
|
tcp_nopush off; # Отключает задержку Nagle (если нужна мгновенная отправка)
|
||||||
|
}
|
||||||
|
location ~ /index\.html$ {
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
@ -50,8 +56,6 @@ EOF
|
|||||||
sudo ln -s /etc/nginx/sites-available/ccalm.org /etc/nginx/sites-enabled/
|
sudo ln -s /etc/nginx/sites-available/ccalm.org /etc/nginx/sites-enabled/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl restart nginx
|
sudo systemctl restart nginx
|
||||||
```
|
```
|
||||||
@ -79,17 +83,17 @@ journalctl -u nginx.service -n 50
|
|||||||
cd /etc/nginx/sites-available/ &&
|
cd /etc/nginx/sites-available/ &&
|
||||||
sudo tee geovizor.top > /dev/null <<'EOF'
|
sudo tee geovizor.top > /dev/null <<'EOF'
|
||||||
server {
|
server {
|
||||||
listen 8081;
|
listen 8081;
|
||||||
listen [::]:8081;
|
listen [::]:8081;
|
||||||
|
|
||||||
root /opt/www/istransit.kz;
|
root /opt/www/istransit.kz;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
server_name istransit.kz www.istransit.kz;
|
server_name istransit.kz www.istransit.kz;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
location ~ /index\.html$ {
|
location ~ /index\.html$ {
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
||||||
add_header Pragma "no-cache";
|
add_header Pragma "no-cache";
|
||||||
|
|||||||
@ -1,66 +1,68 @@
|
|||||||
# Установка Uptime Kuma в Ubuntu 24.04 с помощью Docker Compose
|
# Установка Uptime Kuma в Ubuntu 24.04 с помощью Docker Compose
|
||||||
|
|
||||||
## 1. Установка необходимых пакетов
|
## 1. Установка необходимых пакетов
|
||||||
Обновите систему и установите Docker и Docker Compose:
|
Обновите систему и установите Docker и Docker Compose:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt update && sudo apt upgrade -y
|
sudo apt update && sudo apt upgrade -y
|
||||||
sudo apt install -y docker.io docker-compose
|
sudo apt install -y docker.io docker-compose
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. Создание директории для Uptime Kuma
|
## 2. Создание директории для Uptime Kuma
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir -p /opt/uptime-kuma
|
sudo mkdir -p /opt/uptime-kuma
|
||||||
cd /opt/uptime-kuma
|
cd /opt/uptime-kuma
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. Создание `docker-compose.yml`
|
## 3. Создание `docker-compose.yml`
|
||||||
Создайте файл `docker-compose.yml`:
|
Создайте файл `docker-compose.yml`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /opt/uptime-kuma/docker-compose.yml
|
sudo mcedit /opt/uptime-kuma/docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Вставьте следующий конфигурационный файл:
|
Вставьте следующий конфигурационный файл:
|
||||||
|
В кодфиге прописан корневой сертификат чтобы node.js ему доверял
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
uptime-kuma:
|
uptime-kuma:
|
||||||
image: louislam/uptime-kuma:latest
|
image: louislam/uptime-kuma:latest
|
||||||
container_name: uptime-kuma
|
container_name: uptime-kuma
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3001:3001"
|
- "3001:3001"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
```
|
- /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro
|
||||||
|
environment:
|
||||||
## 4. Запуск контейнера
|
- NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/rootCA.crt
|
||||||
```sh
|
```
|
||||||
sudo docker-compose up -d
|
|
||||||
```
|
## 4. Запуск контейнера
|
||||||
|
```sh
|
||||||
## 5. Проверка работы Uptime Kuma
|
sudo docker-compose up -d
|
||||||
Откройте браузер и перейдите по адресу:
|
```
|
||||||
|
|
||||||
```sh
|
## 5. Проверка работы Uptime Kuma
|
||||||
start http://192.168.200.84:3001
|
Откройте браузер и перейдите по адресу:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
## 6. Управление контейнером
|
start http://192.168.200.84:3001
|
||||||
- **Остановить Uptime Kuma:**
|
```
|
||||||
```sh
|
|
||||||
sudo docker-compose down
|
## 6. Управление контейнером
|
||||||
```
|
- **Остановить Uptime Kuma:**
|
||||||
- **Перезапустить контейнер:**
|
```sh
|
||||||
```sh
|
sudo docker-compose down
|
||||||
sudo docker-compose restart
|
```
|
||||||
```
|
- **Перезапустить контейнер:**
|
||||||
- **Просмотреть логи:**
|
```sh
|
||||||
|
sudo docker-compose restart
|
||||||
```sh
|
```
|
||||||
sudo docker-compose logs -f
|
- **Просмотреть логи:**
|
||||||
```
|
|
||||||
|
```sh
|
||||||
Готово! Uptime Kuma установлен и запущен в Docker на Ubuntu 24.04. 🚀
|
sudo docker-compose logs -f
|
||||||
|
```
|
||||||
|
|
||||||
|
Готово! Uptime Kuma установлен и запущен в Docker на Ubuntu 24.04. 🚀
|
||||||
@ -1,260 +1,260 @@
|
|||||||
# 📌 Установка HAProxy на Ubuntu 20.04
|
# 📌 Установка HAProxy на Ubuntu 20.04
|
||||||
****************************************************************************************************
|
****************************************************************************************************
|
||||||
На основе инструкции из https://itsecforu.ru/2019/07/15/⏳-настройка-балансировщика-нагрузки-h/
|
На основе инструкции из https://itsecforu.ru/2019/07/15/⏳-настройка-балансировщика-нагрузки-h/
|
||||||
|
|
||||||
Connect to the required server:
|
Connect to the required server:
|
||||||
```sh
|
```sh
|
||||||
ssh administrator@10.101.1.3 -p 22
|
ssh administrator@10.101.1.3 -p 22
|
||||||
```
|
```
|
||||||
Connect to CCALM Turkish infrastructure:
|
Connect to CCALM Turkish infrastructure:
|
||||||
```sh
|
```sh
|
||||||
ssh igor@88.218.94.134 -p 2200
|
ssh igor@88.218.94.134 -p 2200
|
||||||
```
|
```
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
## Install haproxy
|
## Install haproxy
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get update && sudo apt-get install haproxy -y
|
sudo apt-get update && sudo apt-get install haproxy -y
|
||||||
````
|
````
|
||||||
Создаём резервную копию файла:
|
Создаём резервную копию файла:
|
||||||
```sh
|
```sh
|
||||||
sudo cp /etc/haproxy/haproxy.cfg{,.bak}
|
sudo cp /etc/haproxy/haproxy.cfg{,.bak}
|
||||||
````
|
````
|
||||||
Редактируем конфигурацию (Описание конфигурационного файла HAProxy https://habr.com/ru/sandbox/34354/)
|
Редактируем конфигурацию (Описание конфигурационного файла HAProxy https://habr.com/ru/sandbox/34354/)
|
||||||
```sh
|
```sh
|
||||||
mcedit /etc/haproxy/haproxy.cfg
|
mcedit /etc/haproxy/haproxy.cfg
|
||||||
```
|
```
|
||||||
В конец файла добавляем пока только для перенаправления (для балансироки больше IP адресов):
|
В конец файла добавляем пока только для перенаправления (для балансироки больше IP адресов):
|
||||||
```conf
|
```conf
|
||||||
frontend frontend-http
|
frontend frontend-http
|
||||||
bind *:80
|
bind *:80
|
||||||
mode http
|
mode http
|
||||||
|
|
||||||
# ACL для определения запросов на проверку Let's Encrypt
|
# ACL для определения запросов на проверку Let's Encrypt
|
||||||
acl is_certbot path_beg /.well-known/acme-challenge/
|
acl is_certbot path_beg /.well-known/acme-challenge/
|
||||||
|
|
||||||
# Если это не запрос Let's Encrypt, перенаправляем на HTTPS
|
# Если это не запрос Let's Encrypt, перенаправляем на HTTPS
|
||||||
http-request redirect scheme https code 301 unless is_certbot
|
http-request redirect scheme https code 301 unless is_certbot
|
||||||
|
|
||||||
# Отправляем запросы Let's Encrypt на backend-certbot
|
# Отправляем запросы Let's Encrypt на backend-certbot
|
||||||
use_backend backend-certbot if is_certbot
|
use_backend backend-certbot if is_certbot
|
||||||
|
|
||||||
frontend LOADBALANCER-01
|
frontend LOADBALANCER-01
|
||||||
bind *:80
|
bind *:80
|
||||||
bind *:443 ssl crt /etc/haproxy/ssl/mqtt.kz.pem crt /etc/ssl/certs/bigfoottrade_kz.pem
|
bind *:443 ssl crt /etc/haproxy/ssl/mqtt.kz.pem crt /etc/ssl/certs/bigfoottrade_kz.pem
|
||||||
mode http #режим работы HAProxy, в http режиме происходит анализ Layer 7 трафика
|
mode http #режим работы HAProxy, в http режиме происходит анализ Layer 7 трафика
|
||||||
option httpclose #Закрывает пассивные соединения
|
option httpclose #Закрывает пассивные соединения
|
||||||
|
|
||||||
http-request set-header x-Forwarded-for %[src]
|
http-request set-header x-Forwarded-for %[src]
|
||||||
http-request set-header x-Forwarded-uri %[url]
|
http-request set-header x-Forwarded-uri %[url]
|
||||||
|
|
||||||
acl v_geoserver2 hdr(host) -i geoserver2.ccalm.org
|
acl v_geoserver2 hdr(host) -i geoserver2.ccalm.org
|
||||||
use_backend geoserver2_ccalm_org if v_geoserver2
|
use_backend geoserver2_ccalm_org if v_geoserver2
|
||||||
|
|
||||||
#Если различные нестандартные порты то так
|
#Если различные нестандартные порты то так
|
||||||
acl v_locust_kz hdr_reg(host) -i ^locust\.kz(:.*)?$
|
acl v_locust_kz hdr_reg(host) -i ^locust\.kz(:.*)?$
|
||||||
use_backend b_locust_kz if v_locust_kz
|
use_backend b_locust_kz if v_locust_kz
|
||||||
|
|
||||||
#Перенаправление одной страницы по адресу http://geoserver2.ccalm.org/data/ на другой backend
|
#Перенаправление одной страницы по адресу http://geoserver2.ccalm.org/data/ на другой backend
|
||||||
acl v_geo_data hdr(host) -i geoserver2.ccalm.org/data
|
acl v_geo_data hdr(host) -i geoserver2.ccalm.org/data
|
||||||
use_backend WEBSERVERS-01 if v_geo_data
|
use_backend WEBSERVERS-01 if v_geo_data
|
||||||
|
|
||||||
default_backend WEBSERVER
|
default_backend WEBSERVER
|
||||||
|
|
||||||
backend WEBSERVER
|
backend WEBSERVER
|
||||||
balance roundrobin
|
balance roundrobin
|
||||||
server web1 127.0.0.1:8080 check inter 5s ssl verify none
|
server web1 127.0.0.1:8080 check inter 5s ssl verify none
|
||||||
option httpchk GET /index.html
|
option httpchk GET /index.html
|
||||||
|
|
||||||
|
|
||||||
backend geoserver2_ccalm_org
|
backend geoserver2_ccalm_org
|
||||||
balance roundrobin
|
balance roundrobin
|
||||||
server web1 192.168.0.90:80 check
|
server web1 192.168.0.90:80 check
|
||||||
option httpchk
|
option httpchk
|
||||||
|
|
||||||
listen stats
|
listen stats
|
||||||
bind *:8989
|
bind *:8989
|
||||||
stats enable
|
stats enable
|
||||||
stats uri /
|
stats uri /
|
||||||
stats realm Haproxy\ Statistics
|
stats realm Haproxy\ Statistics
|
||||||
stats auth igor:i123456
|
stats auth igor:i123456
|
||||||
|
|
||||||
frontend f-RabbitMQ
|
frontend f-RabbitMQ
|
||||||
mode tcp
|
mode tcp
|
||||||
bind 10.1.7.73:21000
|
bind 10.1.7.73:21000
|
||||||
default_backend b-RabbitMQ
|
default_backend b-RabbitMQ
|
||||||
|
|
||||||
backend b-RabbitMQ
|
backend b-RabbitMQ
|
||||||
mode tcp
|
mode tcp
|
||||||
server srv1 10.10.16.21:20000
|
server srv1 10.10.16.21:20000
|
||||||
```
|
```
|
||||||
Для перенаправления незащищённого HTTP трафика можно: xxxxxxxxxxxxxxx
|
Для перенаправления незащищённого HTTP трафика можно: xxxxxxxxxxxxxxx
|
||||||
|
|
||||||
Для использования SSL и перенаправляние по обычному сокету для начала нужно настроить pem файл объеденив crt и key (и незабыть изменить порт Apache с 433)
|
Для использования SSL и перенаправляние по обычному сокету для начала нужно настроить pem файл объеденив crt и key (и незабыть изменить порт Apache с 433)
|
||||||
cat /etc/ssl/certs/bigfoottrade_kz.crt /etc/ssl/certs/bigfoottrade_kz_ca.crt /etc/ssl/private/bigfoottrade_kz.key > /etc/haproxy/ssl/bigfoottrade_kz.pem
|
cat /etc/ssl/certs/bigfoottrade_kz.crt /etc/ssl/certs/bigfoottrade_kz_ca.crt /etc/ssl/private/bigfoottrade_kz.key > /etc/haproxy/ssl/bigfoottrade_kz.pem
|
||||||
cat AAA_Certificate_Services.crt GoGetSSL_RSA_DV_CA.crt istransit_kz.crt istransit_kz.key > istransit_kz.pem
|
cat AAA_Certificate_Services.crt GoGetSSL_RSA_DV_CA.crt istransit_kz.crt istransit_kz.key > istransit_kz.pem
|
||||||
|
|
||||||
SSLCertificateFile
|
SSLCertificateFile
|
||||||
SSLCertificateKeyFile
|
SSLCertificateKeyFile
|
||||||
|
|
||||||
Для включения WEB статистики на 9000 порту добавить в конец конфигурации:
|
Для включения WEB статистики на 9000 порту добавить в конец конфигурации:
|
||||||
listen stats
|
listen stats
|
||||||
bind *:8989
|
bind *:8989
|
||||||
stats enable
|
stats enable
|
||||||
stats uri /stats
|
stats uri /stats
|
||||||
stats realm Haproxy\ Statistics
|
stats realm Haproxy\ Statistics
|
||||||
stats auth igor:i123456
|
stats auth igor:i123456
|
||||||
Тестирую файл конфигурации:
|
Тестирую файл конфигурации:
|
||||||
```sh
|
```sh
|
||||||
haproxy -f /etc/haproxy/haproxy.cfg -c
|
haproxy -f /etc/haproxy/haproxy.cfg -c
|
||||||
````
|
````
|
||||||
Также можно в журнале посмотреть что написал HAProxy:
|
Также можно в журнале посмотреть что написал HAProxy:
|
||||||
```sh
|
```sh
|
||||||
sudo journalctl -u haproxy --no-pager | tail -n 50
|
sudo journalctl -u haproxy --no-pager -n 50 -f
|
||||||
````
|
````
|
||||||
Перезагружаем:
|
Перезагружаем:
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl restart haproxy
|
sudo systemctl restart haproxy
|
||||||
````
|
````
|
||||||
|
|
||||||
Посмотреть что в журнале можно так:
|
Посмотреть что в журнале можно так:
|
||||||
Посмотреть что в журнале можно так:
|
Посмотреть что в журнале можно так:
|
||||||
```sh
|
```sh
|
||||||
journalctl -u haproxy --since "1 minutes ago"
|
journalctl -u haproxy --since "1 minutes ago"
|
||||||
journalctl -u haproxy --since "30 minutes ago" | grep "backend"
|
journalctl -u haproxy --since "30 minutes ago" | grep "backend"
|
||||||
tail -f /var/log/haproxy.log
|
tail -f /var/log/haproxy.log
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
administrator@app:~$ journalctl -u haproxy --since "30 minutes ago" | grep "backend"
|
administrator@app:~$ journalctl -u haproxy --since "30 minutes ago" | grep "backend"
|
||||||
backend 'transit_acquiring_v01_kz' has no server available!
|
backend 'transit_acquiring_v01_kz' has no server available!
|
||||||
backend 'transit_translation_v02_kz' has no server available!
|
backend 'transit_translation_v02_kz' has no server available!
|
||||||
backend 'transit_mobile_kz' has no server available!
|
backend 'transit_mobile_kz' has no server available!
|
||||||
backend 'transit_manager_kz' has no server available!
|
backend 'transit_manager_kz' has no server available!
|
||||||
backend 'transit_warehouse_kz' has no server available!
|
backend 'transit_warehouse_kz' has no server available!
|
||||||
backend 'transit_kgd_kz' has no server available!
|
backend 'transit_kgd_kz' has no server available!
|
||||||
backend 'transit_monitoring_kz' has no server available!
|
backend 'transit_monitoring_kz' has no server available!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
И теперь должно открываться но адресу: http://data.ccalm.org:8989/
|
И теперь должно открываться но адресу: http://data.ccalm.org:8989/
|
||||||
Обязательно проверить как установился SSL чекером: https://www.leaderssl.ru/tools/ssl_checker
|
Обязательно проверить как установился SSL чекером: https://www.leaderssl.ru/tools/ssl_checker
|
||||||
|
|
||||||
|
|
||||||
# 📌 Бесплатный SSL сертификат Let’s Encrypt для HAPROXY
|
# 📌 Бесплатный SSL сертификат Let’s Encrypt для HAPROXY
|
||||||
****************************************************************************************************
|
****************************************************************************************************
|
||||||
Бесплатный SSL сертификат Let’s Encrypt для HAPROXY https://serversforhackers.com/c/letsencrypt-with-haproxy
|
Бесплатный SSL сертификат Let’s Encrypt для HAPROXY https://serversforhackers.com/c/letsencrypt-with-haproxy
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install certbot -y
|
sudo apt-get install certbot -y
|
||||||
````
|
````
|
||||||
Для удаления PPA нужно выполнить:
|
Для удаления PPA нужно выполнить:
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get remove certbot
|
sudo apt-get remove certbot
|
||||||
sudo add-apt-repository --remove ppa:certbot/certbot
|
sudo add-apt-repository --remove ppa:certbot/certbot
|
||||||
apt-get install -f
|
apt-get install -f
|
||||||
apt autoremove
|
apt autoremove
|
||||||
```
|
```
|
||||||
Если включён файрволл то разрешаем порт:
|
Если включён файрволл то разрешаем порт:
|
||||||
```sh
|
```sh
|
||||||
sudo ufw allow 9080/tcp
|
sudo ufw allow 9080/tcp
|
||||||
```
|
```
|
||||||
Проверяем что автообновление в certbot работает для этого выполняем команду:
|
Проверяем что автообновление в certbot работает для этого выполняем команду:
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl status certbot.timer
|
sudo systemctl status certbot.timer
|
||||||
```
|
```
|
||||||
Затем пытаемся выполнить пробный прогон при помощи команды:
|
Затем пытаемся выполнить пробный прогон при помощи команды:
|
||||||
```sh
|
```sh
|
||||||
sudo certbot renew --dry-run
|
sudo certbot renew --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
Согласно инструкции модифицируем конфигурационный файл haproxy добавив во frontend это:
|
Согласно инструкции модифицируем конфигурационный файл haproxy добавив во frontend это:
|
||||||
```
|
```
|
||||||
# ACL for detecting Let's Encrypt validtion requests
|
# ACL for detecting Let's Encrypt validtion requests
|
||||||
acl is_certbot path_beg /.well-known/acme-challenge/
|
acl is_certbot path_beg /.well-known/acme-challenge/
|
||||||
use_backend backend-certbot if is_certbot
|
use_backend backend-certbot if is_certbot
|
||||||
```
|
```
|
||||||
А также ещё один backend:
|
А также ещё один backend:
|
||||||
```
|
```
|
||||||
# Certbot backend
|
# Certbot backend
|
||||||
# Contains certbot stand-alone webserver
|
# Contains certbot stand-alone webserver
|
||||||
backend backend-certbot
|
backend backend-certbot
|
||||||
mode http
|
mode http
|
||||||
server certbot 127.0.0.1:9080
|
server certbot 127.0.0.1:9080
|
||||||
```
|
```
|
||||||
Перезагрузить и выполнить команду:
|
Перезагрузить и выполнить команду:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d powerdns.geovizor.top --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d powerdns.geovizor.top --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geovizor.top --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geovizor.top --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d gotify.locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d gotify.locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d git.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d git.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d ru.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d ru.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d rug.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d rug.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d kz.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d kz.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d kzg.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d kzg.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d locust.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d test.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d test.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d data.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d data.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geoserver2.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geoserver2.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geoserver.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geoserver.ccalm.org --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d stations.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d stations.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d uspdmanager.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d uspdmanager.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d tourist.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d tourist.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d monitoring.infracos.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d monitoring.infracos.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d aistransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d aistransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d test.istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d test.istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d main.istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d main.istransit.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d transit.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d transit.istt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
|
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geovizor.com --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d geovizor.com --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d mqtt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d mqtt.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d observer.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d observer.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d rigor.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d rigor.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d pal.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d pal.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d elektronnaya-ochered.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d elektronnaya-ochered.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d mcp.kz --email irigm@mail.ru --agree-tos --non-interactive
|
certbot certonly --rsa-key-size 2048 --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 -d mcp.kz --email irigm@mail.ru --agree-tos --non-interactive
|
||||||
```
|
```
|
||||||
|
|
||||||
После генерации файлы будут в:
|
После генерации файлы будут в:
|
||||||
/etc/letsencrypt/live/geoserver2.ccalm.org/fullchain.pem
|
/etc/letsencrypt/live/geoserver2.ccalm.org/fullchain.pem
|
||||||
/etc/letsencrypt/live/geoserver2.ccalm.org/privkey.pem
|
/etc/letsencrypt/live/geoserver2.ccalm.org/privkey.pem
|
||||||
|
|
||||||
Для обновления создаём файл /etc/letsencrypt/renew.sh (по моему этот скрипт не нужен так как рабтает сервис certbot.timer):
|
Для обновления создаём файл /etc/letsencrypt/renew.sh (по моему этот скрипт не нужен так как рабтает сервис certbot.timer):
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
certbot renew --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 --post-hook "/etc/haproxy/prepare.sh" --quiet
|
certbot renew --standalone --preferred-challenges http --http-01-address 127.0.0.1 --http-01-port 9080 --post-hook "/etc/haproxy/prepare.sh" --quiet
|
||||||
|
|
||||||
Но для HAProxy нужно чтобы 2 файла были объединены поэтому добавляю спец скрипт /etc/haproxy/prepare.sh:
|
Но для HAProxy нужно чтобы 2 файла были объединены поэтому добавляю спец скрипт /etc/haproxy/prepare.sh:
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Loop through all Let's Encrypt certificates
|
# Loop through all Let's Encrypt certificates
|
||||||
for CERTIFICATE in `find /etc/letsencrypt/live/* -type d`; do
|
for CERTIFICATE in `find /etc/letsencrypt/live/* -type d`; do
|
||||||
|
|
||||||
CERTIFICATE=`basename $CERTIFICATE`
|
CERTIFICATE=`basename $CERTIFICATE`
|
||||||
|
|
||||||
# Combine certificate and private key to single file
|
# Combine certificate and private key to single file
|
||||||
cat /etc/letsencrypt/live/$CERTIFICATE/fullchain.pem /etc/letsencrypt/live/$CERTIFICATE/privkey.pem > /etc/haproxy/ssl/$CERTIFICATE.pem
|
cat /etc/letsencrypt/live/$CERTIFICATE/fullchain.pem /etc/letsencrypt/live/$CERTIFICATE/privkey.pem > /etc/haproxy/ssl/$CERTIFICATE.pem
|
||||||
|
|
||||||
done
|
done
|
||||||
systemctl reload haproxy.service
|
systemctl reload haproxy.service
|
||||||
|
|
||||||
Обновляем конфигурацию HAProxy добавив в frontend:
|
Обновляем конфигурацию HAProxy добавив в frontend:
|
||||||
bind *:443 ssl crt /etc/haproxy/ssl/mqtt.kz.pem
|
bind *:443 ssl crt /etc/haproxy/ssl/mqtt.kz.pem
|
||||||
|
|
||||||
Устанавливаем права
|
Устанавливаем права
|
||||||
chmod +x /etc/haproxy/renew.sh
|
chmod +x /etc/haproxy/renew.sh
|
||||||
chmod +x /etc/haproxy/prepare.sh
|
chmod +x /etc/haproxy/prepare.sh
|
||||||
И добавляем задание в cron "crontab -e" ниже текст это раз в 24 часа в 00:00:00 ночи:
|
И добавляем задание в cron "crontab -e" ниже текст это раз в 24 часа в 00:00:00 ночи:
|
||||||
0 0 * * * /bin/sh /etc/letsencrypt/renew.sh
|
0 0 * * * /bin/sh /etc/letsencrypt/renew.sh
|
||||||
@ -1,8 +1,10 @@
|
|||||||
|
С внешки во внутрянную инфраструктуру подключаемся через HAProxy а уже внутри использую Traefik
|
||||||
|
|
||||||
Открываю нужный сервер
|
Открываю нужный сервер
|
||||||
```sh
|
```sh
|
||||||
wsl
|
wsl
|
||||||
```
|
```
|
||||||
Или такой:
|
Открывает traefik на 192.168.200.85:
|
||||||
```sh
|
```sh
|
||||||
ssh igor@192.168.200.85 -p 22
|
ssh igor@192.168.200.85 -p 22
|
||||||
```
|
```
|
||||||
@ -155,6 +157,13 @@ http:
|
|||||||
service: local_powerdns
|
service: local_powerdns
|
||||||
tls: {}
|
tls: {}
|
||||||
|
|
||||||
|
gotify:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
rule: "Host(`gotify.local`)"
|
||||||
|
service: local_gotify
|
||||||
|
tls: {}
|
||||||
|
|
||||||
middlewares:
|
middlewares:
|
||||||
strip-auth-prefix:
|
strip-auth-prefix:
|
||||||
stripPrefix:
|
stripPrefix:
|
||||||
@ -180,6 +189,16 @@ http:
|
|||||||
path: "/"
|
path: "/"
|
||||||
interval: "5s"
|
interval: "5s"
|
||||||
|
|
||||||
|
# Бэкенд для local_gotify
|
||||||
|
local_gotify:
|
||||||
|
loadBalancer:
|
||||||
|
servers:
|
||||||
|
- url: "https://192.168.200.84:8080"
|
||||||
|
serversTransport: insecureTransport
|
||||||
|
healthCheck:
|
||||||
|
path: "/"
|
||||||
|
interval: "5s"
|
||||||
|
|
||||||
# Бэкенд для org_ccalm_api_authorization_v02 (HTTPS с отключенной проверкой SSL)
|
# Бэкенд для org_ccalm_api_authorization_v02 (HTTPS с отключенной проверкой SSL)
|
||||||
org_ccalm_api_authorization_v02:
|
org_ccalm_api_authorization_v02:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
@ -243,6 +262,8 @@ tls:
|
|||||||
keyFile: "/etc/traefik/certs/ccalm.test.key"
|
keyFile: "/etc/traefik/certs/ccalm.test.key"
|
||||||
- certFile: "/etc/traefik/certs/powerdns.local.crt"
|
- certFile: "/etc/traefik/certs/powerdns.local.crt"
|
||||||
keyFile: "/etc/traefik/certs/powerdns.local.key"
|
keyFile: "/etc/traefik/certs/powerdns.local.key"
|
||||||
|
- certFile: "/etc/traefik/certs/gotify.local.crt"
|
||||||
|
keyFile: "/etc/traefik/certs/gotify.local.key"
|
||||||
- certFile: "/etc/traefik/certs/wildcard.local.crt"
|
- certFile: "/etc/traefik/certs/wildcard.local.crt"
|
||||||
keyFile: "/etc/traefik/certs/wildcard.local.key"
|
keyFile: "/etc/traefik/certs/wildcard.local.key"
|
||||||
- certFile: "/etc/traefik/certs/wildcard.test.crt"
|
- certFile: "/etc/traefik/certs/wildcard.test.crt"
|
||||||
@ -79,6 +79,17 @@ openssl x509 -in powerdns.local.crt -text -noout
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Создаём и подписываем одной группой команд:
|
||||||
|
```sh
|
||||||
|
openssl version &&
|
||||||
|
openssl genrsa -out gotify.local.key 2048 &&
|
||||||
|
openssl req -new -key gotify.local.key -out gotify.local.csr -subj "/CN=gotify.local" -addext "subjectAltName=DNS:gotify.local" &&
|
||||||
|
openssl x509 -req -in gotify.local.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out gotify.local.crt -days 365 -sha256 -copy_extensions copy &&
|
||||||
|
openssl x509 -in gotify.local.crt -text -noout &&
|
||||||
|
cat gotify.local.crt gotify.local.key > gotify.local.pem
|
||||||
|
```
|
||||||
|
Теперь можно устанавливать в HAProxy этот gotify.local.pem сертификат
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Подписать корневым CA:
|
Подписать корневым CA:
|
||||||
@ -1,361 +1,361 @@
|
|||||||
# Установка HashiCorp Vault на Ubuntu
|
# Установка HashiCorp Vault на Ubuntu
|
||||||
|
|
||||||
Vault — это инструмент от HashiCorp для безопасного хранения секретов и управления ими.
|
Vault — это инструмент от HashiCorp для безопасного хранения секретов и управления ими.
|
||||||
|
|
||||||
## 1. Установка Vault
|
## 1. Установка Vault
|
||||||
|
|
||||||
Открываю нужный сервер
|
Открываю нужный сервер
|
||||||
```sh
|
```sh
|
||||||
wsl
|
wsl
|
||||||
```
|
```
|
||||||
Похоже vault из Москвы недоступен:
|
Похоже vault из Москвы недоступен:
|
||||||
```sh
|
```sh
|
||||||
ssh root@45.144.64.218 -p 2200
|
ssh root@45.144.64.218 -p 2200
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.1. Добавление репозитория HashiCorp
|
### 1.1. Добавление репозитория HashiCorp
|
||||||
|
|
||||||
1. Установите необходимые пакеты:
|
1. Установите необходимые пакеты:
|
||||||
```sh
|
```sh
|
||||||
sudo apt update && sudo apt install -y gnupg software-properties-common curl
|
sudo apt update && sudo apt install -y gnupg software-properties-common curl
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Добавьте официальный GPG-ключ HashiCorp:
|
2. Добавьте официальный GPG-ключ HashiCorp:
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Добавьте репозиторий HashiCorp в систему:
|
3. Добавьте репозиторий HashiCorp в систему:
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /etc/apt/sources.list.d/hashicorp.list
|
sudo mcedit /etc/apt/sources.list.d/hashicorp.list
|
||||||
```
|
```
|
||||||
|
|
||||||
Заменяем на:
|
Заменяем на:
|
||||||
```text
|
```text
|
||||||
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com noble main
|
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com noble main
|
||||||
```
|
```
|
||||||
Где noble это кодовое имя Ubuntu 24.04
|
Где noble это кодовое имя Ubuntu 24.04
|
||||||
|
|
||||||
|
|
||||||
4. Обновите списки пакетов:
|
4. Обновите списки пакетов:
|
||||||
```sh
|
```sh
|
||||||
sudo apt update
|
sudo apt update
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Установите Vault:
|
5. Установите Vault:
|
||||||
```sh
|
```sh
|
||||||
sudo apt install -y vault
|
sudo apt install -y vault
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Проверьте, что Vault установлен правильно:
|
6. Проверьте, что Vault установлен правильно:
|
||||||
```sh
|
```sh
|
||||||
vault --version
|
vault --version
|
||||||
```
|
```
|
||||||
Выдало: Vault v1.18.5 (2cb3755273dbd63f5b0f8ec50089b57ffd3fa330), built 2025-02-24T09:40:28Z
|
Выдало: Vault v1.18.5 (2cb3755273dbd63f5b0f8ec50089b57ffd3fa330), built 2025-02-24T09:40:28Z
|
||||||
|
|
||||||
|
|
||||||
## 2. Запуск Vault
|
## 2. Запуск Vault
|
||||||
|
|
||||||
### 2.1. Запуск в Dev-режиме (только для тестирования)
|
### 2.1. Запуск в Dev-режиме (только для тестирования)
|
||||||
|
|
||||||
If work stop it:
|
If work stop it:
|
||||||
```sh
|
```sh
|
||||||
sudo pkill vault
|
sudo pkill vault
|
||||||
```
|
```
|
||||||
If need delete old data:
|
If need delete old data:
|
||||||
```sh
|
```sh
|
||||||
sudo rm -rf ~/.vault-token ~/.vault/
|
sudo rm -rf ~/.vault-token ~/.vault/
|
||||||
```
|
```
|
||||||
For find where stored data read file:
|
For find where stored data read file:
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /etc/vault/config.hcl
|
sudo mcedit /etc/vault/config.hcl
|
||||||
```
|
```
|
||||||
In config file find this path: /opt/vault/data
|
In config file find this path: /opt/vault/data
|
||||||
|
|
||||||
После удаления базы нужно инициализировать Vault заново:
|
После удаления базы нужно инициализировать Vault заново:
|
||||||
```sh
|
```sh
|
||||||
sudo vault operator init
|
sudo vault operator init
|
||||||
```
|
```
|
||||||
|
|
||||||
Run in developer mode (in dev mode data stored in RAM):
|
Run in developer mode (in dev mode data stored in RAM):
|
||||||
```sh
|
```sh
|
||||||
vault server -dev
|
vault server -dev
|
||||||
```
|
```
|
||||||
|
|
||||||
```text
|
```text
|
||||||
WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
|
WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
|
||||||
and starts unsealed with a single unseal key. The root token is already
|
and starts unsealed with a single unseal key. The root token is already
|
||||||
authenticated to the CLI, so you can immediately begin using Vault.
|
authenticated to the CLI, so you can immediately begin using Vault.
|
||||||
|
|
||||||
You may need to set the following environment variables:
|
You may need to set the following environment variables:
|
||||||
|
|
||||||
$ export VAULT_ADDR='http://127.0.0.1:8200'
|
$ export VAULT_ADDR='http://127.0.0.1:8200'
|
||||||
|
|
||||||
The unseal key and root token are displayed below in case you want to
|
The unseal key and root token are displayed below in case you want to
|
||||||
seal/unseal the Vault or re-authenticate.
|
seal/unseal the Vault or re-authenticate.
|
||||||
|
|
||||||
Unseal Key: TMb6A3QI3wJ9kaEeTYo5wEviP23lugJ3Asek2la6V4s=
|
Unseal Key: TMb6A3QI3wJ9kaEeTYo5wEviP23lugJ3Asek2la6V4s=
|
||||||
Root Token: hvs.GsWHRR7ne7gMTZhuPgZdh91w
|
Root Token: hvs.GsWHRR7ne7gMTZhuPgZdh91w
|
||||||
|
|
||||||
Development mode should NOT be used in production installations!
|
Development mode should NOT be used in production installations!
|
||||||
```
|
```
|
||||||
|
|
||||||
Теперь Vault работает по адресу:
|
Теперь Vault работает по адресу:
|
||||||
```sh
|
```sh
|
||||||
start http://127.0.0.1:8200
|
start http://127.0.0.1:8200
|
||||||
```
|
```
|
||||||
Останавливаю нажатием Ctrl + C
|
Останавливаю нажатием Ctrl + C
|
||||||
|
|
||||||
|
|
||||||
### 2.2. Настройка Vault в режиме сервера
|
### 2.2. Настройка Vault в режиме сервера
|
||||||
|
|
||||||
1. Создайте конфигурационный файл:
|
1. Создайте конфигурационный файл:
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir -p /etc/vault &&
|
sudo mkdir -p /etc/vault &&
|
||||||
sudo mcedit /etc/vault/config.hcl
|
sudo mcedit /etc/vault/config.hcl
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Добавьте следующий конфиг:
|
2. Добавьте следующий конфиг:
|
||||||
```text
|
```text
|
||||||
storage "file" {
|
storage "file" {
|
||||||
path = "/opt/vault/data"
|
path = "/opt/vault/data"
|
||||||
}
|
}
|
||||||
|
|
||||||
listener "tcp" {
|
listener "tcp" {
|
||||||
address = "127.0.0.1:8200"
|
address = "127.0.0.1:8200"
|
||||||
tls_disable = 1
|
tls_disable = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_mlock = true
|
disable_mlock = true
|
||||||
ui = true
|
ui = true
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Создайте папку для хранения данных:
|
3. Создайте папку для хранения данных:
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir -p /opt/vault/data &&
|
sudo mkdir -p /opt/vault/data &&
|
||||||
sudo chown vault:vault /opt/vault/data
|
sudo chown vault:vault /opt/vault/data
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Создайте systemd-сервис для Vault:
|
4. Создайте systemd-сервис для Vault:
|
||||||
```sh
|
```sh
|
||||||
sudo tee /etc/systemd/system/vault.service > /dev/null <<'EOF'
|
sudo tee /etc/systemd/system/vault.service > /dev/null <<'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=HashiCorp Vault
|
Description=HashiCorp Vault
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Requires=network-online.target
|
Requires=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=vault
|
User=vault
|
||||||
Group=vault
|
Group=vault
|
||||||
ExecStart=/usr/bin/vault server -config=/etc/vault/config.hcl
|
ExecStart=/usr/bin/vault server -config=/etc/vault/config.hcl
|
||||||
ExecReload=/bin/kill --signal HUP \$MAINPID
|
ExecReload=/bin/kill --signal HUP \$MAINPID
|
||||||
KillSignal=SIGTERM
|
KillSignal=SIGTERM
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
LimitMEMLOCK=infinity
|
LimitMEMLOCK=infinity
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
CapabilityBoundingSet=CAP_IPC_LOCK CAP_SETGID CAP_SETUID CAP_SYSLOG CAP_CHOWN
|
CapabilityBoundingSet=CAP_IPC_LOCK CAP_SETGID CAP_SETUID CAP_SYSLOG CAP_CHOWN
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
Проверяем всё ли записалось:
|
Проверяем всё ли записалось:
|
||||||
```sh
|
```sh
|
||||||
sudo mcedit /etc/systemd/system/vault.service
|
sudo mcedit /etc/systemd/system/vault.service
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Перезапустите systemd и включите Vault:
|
5. Перезапустите systemd и включите Vault:
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl daemon-reload &&
|
sudo systemctl daemon-reload &&
|
||||||
sudo systemctl enable vault &&
|
sudo systemctl enable vault &&
|
||||||
sudo systemctl start vault
|
sudo systemctl start vault
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Проверьте статус:
|
7. Проверьте статус:
|
||||||
```sh
|
```sh
|
||||||
sudo systemctl status vault
|
sudo systemctl status vault
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. Инициализация и разлочка Vault
|
## 3. Инициализация и разлочка Vault
|
||||||
|
|
||||||
1. Экспортируйте переменную окружения:
|
1. Экспортируйте переменную окружения:
|
||||||
```sh
|
```sh
|
||||||
export VAULT_ADDR='http://127.0.0.1:8200'
|
export VAULT_ADDR='http://127.0.0.1:8200'
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Инициализируйте хранилище (сохраните ключи!):
|
2. Инициализируйте хранилище (сохраните ключи!):
|
||||||
```sh
|
```sh
|
||||||
vault operator init
|
vault operator init
|
||||||
```
|
```
|
||||||
|
|
||||||
Выдало:
|
Выдало:
|
||||||
```text
|
```text
|
||||||
Unseal Key 1: lQlJsb9RI8rSzLrc5iPnx1qJkWZbbXIkrEgnQGe5R6uO
|
Unseal Key 1: lQlJsb9RI8rSzLrc5iPnx1qJkWZbbXIkrEgnQGe5R6uO
|
||||||
Unseal Key 2: 0qJJXRo570jlH/0Qs/wodXHNI2SF5VgL4jE04JawSPSB
|
Unseal Key 2: 0qJJXRo570jlH/0Qs/wodXHNI2SF5VgL4jE04JawSPSB
|
||||||
Unseal Key 3: VuYkOkQ8qmwofDmjqsTRQoMqGAH3Jv+nqQylL7Uibbtp
|
Unseal Key 3: VuYkOkQ8qmwofDmjqsTRQoMqGAH3Jv+nqQylL7Uibbtp
|
||||||
Unseal Key 4: JJJ8Nqj00qzS9u5wNtTtExL/jWlJF9fgaBsiuaf0kFxC
|
Unseal Key 4: JJJ8Nqj00qzS9u5wNtTtExL/jWlJF9fgaBsiuaf0kFxC
|
||||||
Unseal Key 5: L6lZMp/l7s24EZJAFnWS4Py5jsWOuMioC41g5LhUJKWL
|
Unseal Key 5: L6lZMp/l7s24EZJAFnWS4Py5jsWOuMioC41g5LhUJKWL
|
||||||
|
|
||||||
Initial Root Token: hvs.o07DY7tnSPcufxk60pjCXDzn
|
Initial Root Token: hvs.o07DY7tnSPcufxk60pjCXDzn
|
||||||
|
|
||||||
Vault initialized with 5 key shares and a key threshold of 3. Please securely
|
Vault initialized with 5 key shares and a key threshold of 3. Please securely
|
||||||
distribute the key shares printed above. When the Vault is re-sealed,
|
distribute the key shares printed above. When the Vault is re-sealed,
|
||||||
restarted, or stopped, you must supply at least 3 of these keys to unseal it
|
restarted, or stopped, you must supply at least 3 of these keys to unseal it
|
||||||
before it can start servicing requests.
|
before it can start servicing requests.
|
||||||
|
|
||||||
Vault does not store the generated root key. Without at least 3 keys to
|
Vault does not store the generated root key. Without at least 3 keys to
|
||||||
reconstruct the root key, Vault will remain permanently sealed!
|
reconstruct the root key, Vault will remain permanently sealed!
|
||||||
|
|
||||||
It is possible to generate new unseal keys, provided you have a quorum of
|
It is possible to generate new unseal keys, provided you have a quorum of
|
||||||
existing unseal keys shares. See "vault operator rekey" for more information.
|
existing unseal keys shares. See "vault operator rekey" for more information.
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Разблокируйте Vault, используя один из ключей (потом ещё 3 раза выполнить эту команду):
|
3. Разблокируйте Vault, используя один из ключей (потом ещё 3 раза выполнить эту команду):
|
||||||
```sh
|
```sh
|
||||||
vault operator unseal
|
vault operator unseal
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Авторизуйтесь с root-токеном:
|
4. Авторизуйтесь с root-токеном:
|
||||||
```sh
|
```sh
|
||||||
vault login hvs.MTFV72PjKXCVh5ZL6yCVE3Yw
|
vault login hvs.MTFV72PjKXCVh5ZL6yCVE3Yw
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Создаём(включаем) новое хранилище ключ-значение через ssh
|
5. Создаём(включаем) новое хранилище ключ-значение через ssh
|
||||||
```sh
|
```sh
|
||||||
vault secrets enable -path=org-ccalm kv-v2
|
vault secrets enable -path=org-ccalm kv-v2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
5. Writing to the kv storage (добавил префикс vault. чтобы значения самому подставлять в нужные места в spring)
|
5. Writing to the kv storage (добавил префикс vault. чтобы значения самому подставлять в нужные места в spring)
|
||||||
|
|
||||||
Заменит(создаст) значение:
|
Заменит(создаст) значение:
|
||||||
```sh
|
```sh
|
||||||
vault kv put org-ccalm/jwt vault.server.ssl.key-store-password=MFNX344yh4
|
vault kv put org-ccalm/jwt vault.server.ssl.key-store-password=MFNX344yh4
|
||||||
```
|
```
|
||||||
Добавит (обновит):
|
Добавит (обновит):
|
||||||
```sh
|
```sh
|
||||||
vault kv patch org-ccalm/jwt vault.test=test2
|
vault kv patch org-ccalm/jwt vault.test=test2
|
||||||
```
|
```
|
||||||
```sh
|
```sh
|
||||||
vault kv put org-ccalm/public vault.personal_data.key=7dd2Nek1
|
vault kv put org-ccalm/public vault.personal_data.key=7dd2Nek1
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Read data from the kv
|
6. Read data from the kv
|
||||||
```sh
|
```sh
|
||||||
vault kv get org-ccalm/jwt
|
vault kv get org-ccalm/jwt
|
||||||
```
|
```
|
||||||
|
|
||||||
Должно вывести:
|
Должно вывести:
|
||||||
```text
|
```text
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
server.ssl.key-store-password M4yh4
|
server.ssl.key-store-password M4yh4
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Включаем AppRole для доступа из приложения
|
6. Включаем AppRole для доступа из приложения
|
||||||
```sh
|
```sh
|
||||||
vault auth enable approle
|
vault auth enable approle
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Добавляем политики потом создаём ключ для этой политикиполитики
|
7. Добавляем политики потом создаём ключ для этой политикиполитики
|
||||||
|
|
||||||
Создаю файл политик
|
Создаю файл политик
|
||||||
```sh
|
```sh
|
||||||
cd ~ &&
|
cd ~ &&
|
||||||
sudo tee jwt-policy.hcl > /dev/null <<'EOF'
|
sudo tee jwt-policy.hcl > /dev/null <<'EOF'
|
||||||
path "org-ccalm/data/jwt" {
|
path "org-ccalm/data/jwt" {
|
||||||
capabilities = ["create", "read", "update", "delete", "list"]
|
capabilities = ["create", "read", "update", "delete", "list"]
|
||||||
}
|
}
|
||||||
path "org-ccalm/data/public" {
|
path "org-ccalm/data/public" {
|
||||||
capabilities = ["read", "list"]
|
capabilities = ["read", "list"]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
Apply and delete configiration file:
|
Apply and delete configiration file:
|
||||||
```sh
|
```sh
|
||||||
vault policy write jwt-policy ~/jwt-policy.hcl &&
|
vault policy write jwt-policy ~/jwt-policy.hcl &&
|
||||||
rm -f jwt-policy.hcl
|
rm -f jwt-policy.hcl
|
||||||
```
|
```
|
||||||
|
|
||||||
Создаём AppRole (на 10 лет)
|
Создаём AppRole (на 10 лет)
|
||||||
```sh
|
```sh
|
||||||
vault write auth/approle/role/org-ccalm-jwt \
|
vault write auth/approle/role/org-ccalm-jwt \
|
||||||
secret_id_ttl=0 \
|
secret_id_ttl=0 \
|
||||||
token_ttl=87600h \
|
token_ttl=87600h \
|
||||||
token_max_ttl=87600h \
|
token_max_ttl=87600h \
|
||||||
policies="jwt-policy,another-policy,third-policy"
|
policies="jwt-policy,another-policy,third-policy"
|
||||||
```
|
```
|
||||||
|
|
||||||
Получаем role_id и secret_id
|
Получаем role_id и secret_id
|
||||||
```sh
|
```sh
|
||||||
vault read auth/approle/role/org-ccalm-jwt/role-id
|
vault read auth/approle/role/org-ccalm-jwt/role-id
|
||||||
```
|
```
|
||||||
Выдало
|
Выдало
|
||||||
```text
|
```text
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
role_id c0064fe2-8f0e-b317-7fe7-66f7405b45a1
|
role_id c0064fe2-8f0e-b317-7fe7-66f7405b45a1
|
||||||
```
|
```
|
||||||
На команду
|
На команду
|
||||||
```sh
|
```sh
|
||||||
vault write -f auth/approle/role/org-ccalm-jwt/secret-id
|
vault write -f auth/approle/role/org-ccalm-jwt/secret-id
|
||||||
```
|
```
|
||||||
Выдало:
|
Выдало:
|
||||||
```text
|
```text
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
secret_id 24f31c88-7185-0d93-9a51-e221c2925265
|
secret_id 24f31c88-7185-0d93-9a51-e221c2925265
|
||||||
secret_id_accessor 22fa68e3-fc73-2008-0a34-3506630b6693
|
secret_id_accessor 22fa68e3-fc73-2008-0a34-3506630b6693
|
||||||
secret_id_num_uses 0
|
secret_id_num_uses 0
|
||||||
secret_id_ttl 0s
|
secret_id_ttl 0s
|
||||||
```
|
```
|
||||||
Сохрани role_id и secret_id, они понадобятся Spring Boot.
|
Сохрани role_id и secret_id, они понадобятся Spring Boot.
|
||||||
|
|
||||||
Хранить ключи лучьше в переменных окружения
|
Хранить ключи лучьше в переменных окружения
|
||||||
```sh
|
```sh
|
||||||
export VAULT_ROLE_ID="your-role-id" &&
|
export VAULT_ROLE_ID="your-role-id" &&
|
||||||
export VAULT_SECRET_ID="your-secret-id"
|
export VAULT_SECRET_ID="your-secret-id"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Проверяем не больше какого значения можно задать время жизни кокена:
|
Проверяем не больше какого значения можно задать время жизни кокена:
|
||||||
```sh
|
```sh
|
||||||
vault read sys/mounts/auth/token/tune
|
vault read sys/mounts/auth/token/tune
|
||||||
```
|
```
|
||||||
По умолчанию max_lease_ttl равен 32 дня!
|
По умолчанию max_lease_ttl равен 32 дня!
|
||||||
|
|
||||||
На год можно увеличить так:
|
На год можно увеличить так:
|
||||||
```sh
|
```sh
|
||||||
vault write sys/mounts/auth/token/tune max_lease_ttl=8760h
|
vault write sys/mounts/auth/token/tune max_lease_ttl=8760h
|
||||||
```
|
```
|
||||||
|
|
||||||
Create data access token with set politics:
|
Create data access token with set politics:
|
||||||
```sh
|
```sh
|
||||||
vault token create -policy=jwt-policy -ttl=0
|
vault token create -policy=jwt-policy -ttl=0
|
||||||
```
|
```
|
||||||
|
|
||||||
Продлевать токен можно так:
|
Продлевать токен можно так:
|
||||||
```sh
|
```sh
|
||||||
vault token renew <твой-токен>
|
vault token renew <твой-токен>
|
||||||
```
|
```
|
||||||
|
|
||||||
Проверяем зранятся ли токены в хранилище а не в памяти
|
Проверяем зранятся ли токены в хранилище а не в памяти
|
||||||
```sh
|
```sh
|
||||||
vault read sys/auth/token/tune
|
vault read sys/auth/token/tune
|
||||||
```
|
```
|
||||||
token_type = default-service, значит Vault не хранит токены
|
token_type = default-service, значит Vault не хранит токены
|
||||||
|
|
||||||
Включаем хранение токенов:
|
Включаем хранение токенов:
|
||||||
```sh
|
```sh
|
||||||
vault write sys/auth/token/tune token_type=service
|
vault write sys/auth/token/tune token_type=service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
Теперь HashiCorp Vault установлен и готов к использованию! 🚀
|
Теперь HashiCorp Vault установлен и готов к использованию! 🚀
|
||||||
|
|
||||||
@ -1,136 +1,136 @@
|
|||||||
|
|
||||||
Загрузить в HashiCorp Vault настройки можно так:
|
Загрузить в HashiCorp Vault настройки можно так:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
vault kv put secret/org-ccalm-jwt \
|
vault kv put secret/org-ccalm-jwt \
|
||||||
jwt.secret=my-secret-value \
|
jwt.secret=my-secret-value \
|
||||||
db.user=admin \
|
db.user=admin \
|
||||||
db.pass=123456
|
db.pass=123456
|
||||||
```
|
```
|
||||||
|
|
||||||
Разбор параметров:
|
Разбор параметров:
|
||||||
1. vault kv put – команда для записи ключей и значений в KV-хранилище Vault.
|
1. vault kv put – команда для записи ключей и значений в KV-хранилище Vault.
|
||||||
2. secret/org-ccalm-jwt – путь к секрету.
|
2. secret/org-ccalm-jwt – путь к секрету.
|
||||||
* secret/ – это backend-хранилище (оно должно быть включено в Vault).
|
* secret/ – это backend-хранилище (оно должно быть включено в Vault).
|
||||||
* org-ccalm-jwt – имя секрета, под которым сохраняются параметры.
|
* org-ccalm-jwt – имя секрета, под которым сохраняются параметры.
|
||||||
3. jwt.secret=my-secret-value – ключ jwt.secret со значением my-secret-value.
|
3. jwt.secret=my-secret-value – ключ jwt.secret со значением my-secret-value.
|
||||||
4. db.user=admin – ключ db.user со значением admin.
|
4. db.user=admin – ключ db.user со значением admin.
|
||||||
5. db.pass=123456 – ключ db.pass со значением 123456.
|
5. db.pass=123456 – ключ db.pass со значением 123456.
|
||||||
|
|
||||||
|
|
||||||
# 🚀 Установка и настройка HashiCorp Vault на Windows
|
# 🚀 Установка и настройка HashiCorp Vault на Windows
|
||||||
|
|
||||||
## 📌 1. Установка HashiCorp Vault
|
## 📌 1. Установка HashiCorp Vault
|
||||||
|
|
||||||
1. **Скачайте Vault CLI** с официального сайта:
|
1. **Скачайте Vault CLI** с официального сайта:
|
||||||
🔗 [https://developer.hashicorp.com/vault/downloads](https://developer.hashicorp.com/vault/downloads)
|
🔗 [https://developer.hashicorp.com/vault/downloads](https://developer.hashicorp.com/vault/downloads)
|
||||||
2. Распакуйте архив и **добавьте путь к `vault.exe` в `PATH`**:
|
2. Распакуйте архив и **добавьте путь к `vault.exe` в `PATH`**:
|
||||||
- Кликните **ПКМ → Этот компьютер → Свойства → Дополнительные параметры системы**.
|
- Кликните **ПКМ → Этот компьютер → Свойства → Дополнительные параметры системы**.
|
||||||
- В **Переменные среды** добавьте путь к папке с `vault.exe`.
|
- В **Переменные среды** добавьте путь к папке с `vault.exe`.
|
||||||
3. Откройте **cmd** или **PowerShell** и проверьте установку командой:
|
3. Откройте **cmd** или **PowerShell** и проверьте установку командой:
|
||||||
```sh
|
```sh
|
||||||
vault --version
|
vault --version
|
||||||
```
|
```
|
||||||
Если всё ОК, увидите версию Vault. Примерно такую: Vault v1.18.4 (503be623a3697e8c10c254dc87d26492c46753e1), built 2025-01-29T13:57:54Z
|
Если всё ОК, увидите версию Vault. Примерно такую: Vault v1.18.4 (503be623a3697e8c10c254dc87d26492c46753e1), built 2025-01-29T13:57:54Z
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📌 2. Запуск Vault-сервера (разработческий режим)
|
## 📌 2. Запуск Vault-сервера (разработческий режим)
|
||||||
|
|
||||||
Чтобы локально запустить Vault в **dev-режиме** (без авторизации), выполните:
|
Чтобы локально запустить Vault в **dev-режиме** (без авторизации), выполните:
|
||||||
```sh
|
```sh
|
||||||
vault server -dev
|
vault server -dev
|
||||||
```
|
```
|
||||||
После запуска он покажет **root-токен** (сохраните его!):
|
После запуска он покажет **root-токен** (сохраните его!):
|
||||||
```plaintext
|
```plaintext
|
||||||
Unseal Key: x1jUXpLJREI6M1+Qm6m/h3NLEhaEmBageqw0v+dSSKo=
|
Unseal Key: x1jUXpLJREI6M1+Qm6m/h3NLEhaEmBageqw0v+dSSKo=
|
||||||
Root Token: hvs.V7Rc8uJ8YJ0AASKZfep6oYNe
|
Root Token: hvs.V7Rc8uJ8YJ0AASKZfep6oYNe
|
||||||
```
|
```
|
||||||
|
|
||||||
Теперь Vault работает по адресу:
|
Теперь Vault работает по адресу:
|
||||||
```sh
|
```sh
|
||||||
start http://127.0.0.1:8200
|
start http://127.0.0.1:8200
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📌 3. Экспорт токена (чтобы не вводить каждый раз)
|
## 📌 3. Экспорт токена (чтобы не вводить каждый раз)
|
||||||
|
|
||||||
Откройте **PowerShell** и выполните:
|
Откройте **PowerShell** и выполните:
|
||||||
```sh
|
```sh
|
||||||
$env:VAULT_ADDR="http://127.0.0.1:8200"
|
$env:VAULT_ADDR="http://127.0.0.1:8200"
|
||||||
$env:VAULT_TOKEN="hvs.JDIyKgDMagA0WyIhLFQ4mAjZ"
|
$env:VAULT_TOKEN="hvs.JDIyKgDMagA0WyIhLFQ4mAjZ"
|
||||||
```
|
```
|
||||||
(Замените `hvs.JDIyKgDMagA0WyIhLFQ4mAjZ` на свой токен.)
|
(Замените `hvs.JDIyKgDMagA0WyIhLFQ4mAjZ` на свой токен.)
|
||||||
|
|
||||||
Теперь можно работать с Vault без ввода токена каждый раз.
|
Теперь можно работать с Vault без ввода токена каждый раз.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📌 4. Запись значений в Vault на Windows
|
## 📌 4. Запись значений в Vault на Windows
|
||||||
|
|
||||||
Значения разделенные пробелами можно записать в вольт так:
|
Значения разделенные пробелами можно записать в вольт так:
|
||||||
```sh
|
```sh
|
||||||
vault kv put secret/kz-istransit-jwt server.ssl.key-store-password=MFNX344yh4
|
vault kv put secret/kz-istransit-jwt server.ssl.key-store-password=MFNX344yh4
|
||||||
```
|
```
|
||||||
Выдаст примерно такое:
|
Выдаст примерно такое:
|
||||||
======== Secret Path ========
|
======== Secret Path ========
|
||||||
secret/data/kz-istransit-jwt
|
secret/data/kz-istransit-jwt
|
||||||
|
|
||||||
======= Metadata =======
|
======= Metadata =======
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
created_time 2025-02-24T12:49:45.7630328Z
|
created_time 2025-02-24T12:49:45.7630328Z
|
||||||
custom_metadata <nil>
|
custom_metadata <nil>
|
||||||
deletion_time n/a
|
deletion_time n/a
|
||||||
destroyed false
|
destroyed false
|
||||||
version 1
|
version 1
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📌 5. Проверка сохранённых данных
|
## 📌 5. Проверка сохранённых данных
|
||||||
|
|
||||||
Чтобы посмотреть, что записано в Vault:
|
Чтобы посмотреть, что записано в Vault:
|
||||||
```sh
|
```sh
|
||||||
vault kv get secret/kz-istransit-jwt
|
vault kv get secret/kz-istransit-jwt
|
||||||
```
|
```
|
||||||
Если всё настроено правильно, вы увидите примерно такой вывод:
|
Если всё настроено правильно, вы увидите примерно такой вывод:
|
||||||
```plaintext
|
```plaintext
|
||||||
====== Metadata ======
|
====== Metadata ======
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
created_time 2025-02-24T12:00:00Z
|
created_time 2025-02-24T12:00:00Z
|
||||||
version 1
|
version 1
|
||||||
|
|
||||||
====== Data ======
|
====== Data ======
|
||||||
Key Value
|
Key Value
|
||||||
--- -----
|
--- -----
|
||||||
db.pass 123456
|
db.pass 123456
|
||||||
db.user admin
|
db.user admin
|
||||||
jwt.secret my-secret-value
|
jwt.secret my-secret-value
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📌 6. Удаление данных из Vault
|
## 📌 6. Удаление данных из Vault
|
||||||
|
|
||||||
Удаление данных:
|
Удаление данных:
|
||||||
```sh
|
```sh
|
||||||
vault kv delete secret/org-ccalm-jwt
|
vault kv delete secret/org-ccalm-jwt
|
||||||
```
|
```
|
||||||
Полное уничтожение (без возможности восстановления):
|
Полное уничтожение (без возможности восстановления):
|
||||||
```sh
|
```sh
|
||||||
vault kv destroy -versions=1 secret/org-ccalm-jwt
|
vault kv destroy -versions=1 secret/org-ccalm-jwt
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🎯 Итог
|
## 🎯 Итог
|
||||||
✅ Установили Vault CLI
|
✅ Установили Vault CLI
|
||||||
✅ Запустили Vault сервер (`vault server -dev`)
|
✅ Запустили Vault сервер (`vault server -dev`)
|
||||||
✅ Экспортировали `VAULT_ADDR` и `VAULT_TOKEN`
|
✅ Экспортировали `VAULT_ADDR` и `VAULT_TOKEN`
|
||||||
✅ Записали настройки в Vault
|
✅ Записали настройки в Vault
|
||||||
✅ Проверили данные
|
✅ Проверили данные
|
||||||
|
|
||||||
Теперь можно интегрировать Vault в Spring Boot 🚀
|
Теперь можно интегрировать Vault в Spring Boot 🚀
|
||||||
|
|
||||||
Reference in New Issue
Block a user