update
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
TAPM_LISTEN_ADDR=:8080
|
TAPM_LISTEN_ADDR=127.0.0.1:8080
|
||||||
TAPM_PUBLIC_URL=https://tapm.scity.us
|
TAPM_PUBLIC_URL=https://tapm.scity.us
|
||||||
TAPM_DATABASE_DSN=tapm:change-me@tcp(galera.example.internal:3306)/tapm_broker?parseTime=true&charset=utf8mb4&collation=utf8mb4_unicode_ci&multiStatements=true&time_zone=%27%2B00%3A00%27
|
TAPM_DATABASE_DSN=tapm:change-me@tcp(127.0.0.1:3306)/tapm_broker?parseTime=true&charset=utf8mb4&collation=utf8mb4_unicode_ci&multiStatements=true&time_zone=%27%2B00%3A00%27
|
||||||
TAPM_GITEA_URL=https://git.scity.us
|
TAPM_GITEA_URL=https://git.scity.us
|
||||||
TAPM_GITEA_CLIENT_ID=replace-me
|
TAPM_GITEA_CLIENT_ID=replace-me
|
||||||
TAPM_GITEA_CLIENT_SECRET=replace-me
|
TAPM_GITEA_CLIENT_SECRET=replace-me
|
||||||
|
|||||||
+2
-2
@@ -4,12 +4,14 @@ services:
|
|||||||
image: tai/tapm-deployment-broker:local
|
image: tai/tapm-deployment-broker:local
|
||||||
entrypoint: ["/usr/local/bin/tapm-migrate"]
|
entrypoint: ["/usr/local/bin/tapm-migrate"]
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
network_mode: host
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
broker:
|
broker:
|
||||||
build: .
|
build: .
|
||||||
image: tai/tapm-deployment-broker:local
|
image: tai/tapm-deployment-broker:local
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
network_mode: host
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
init: true
|
init: true
|
||||||
read_only: true
|
read_only: true
|
||||||
@@ -19,8 +21,6 @@ services:
|
|||||||
- ALL
|
- ALL
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /tmp:size=16m,mode=1777
|
- /tmp:size=16m,mode=1777
|
||||||
ports:
|
|
||||||
- "127.0.0.1:8080:8080"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/health/ready"]
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/health/ready"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
+18
-10
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
This service is intended to run on both webserver VMs, with only the active
|
This service is intended to run on both webserver VMs, with only the active
|
||||||
webserver's broker container started. Both installations use the same MariaDB
|
webserver's broker container started. Both installations use the same MariaDB
|
||||||
Galera database, Gitea application, package registry, and secrets.
|
Galera database, Gitea application, package registry, and secrets. The
|
||||||
|
containers use Linux host networking so `127.0.0.1:3306` reaches each
|
||||||
|
webserver's local HAProxy listener.
|
||||||
|
|
||||||
## 1. DNS and TLS
|
## 1. DNS and TLS
|
||||||
|
|
||||||
@@ -16,21 +18,27 @@ Adjust only the certificate paths if the local convention differs.
|
|||||||
|
|
||||||
## 2. MariaDB Galera
|
## 2. MariaDB Galera
|
||||||
|
|
||||||
Create a dedicated database and least-privilege application user. Run this once
|
Create a dedicated database and application users limited to the two webserver
|
||||||
against the cluster as a database administrator:
|
addresses. Run this once against the cluster as a database administrator,
|
||||||
|
replacing the password with the same locally generated value in both accounts:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE DATABASE tapm_broker
|
CREATE DATABASE tapm_broker
|
||||||
CHARACTER SET utf8mb4
|
CHARACTER SET utf8mb4
|
||||||
COLLATE utf8mb4_unicode_ci;
|
COLLATE utf8mb4_unicode_ci;
|
||||||
CREATE USER 'tapm'@'10.%' IDENTIFIED BY 'replace-with-a-random-password';
|
CREATE USER 'tapm'@'10.10.1.121' IDENTIFIED BY 'replace-with-a-random-password';
|
||||||
|
CREATE USER 'tapm'@'10.10.1.122' IDENTIFIED BY 'replace-with-a-random-password';
|
||||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, REFERENCES
|
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, REFERENCES
|
||||||
ON tapm_broker.* TO 'tapm'@'10.%';
|
ON tapm_broker.* TO 'tapm'@'10.10.1.121';
|
||||||
|
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, REFERENCES
|
||||||
|
ON tapm_broker.* TO 'tapm'@'10.10.1.122';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
```
|
```
|
||||||
|
|
||||||
Restrict the host pattern further if the two webserver addresses are known.
|
The Keepalived address `10.10.1.120` is not included because outbound HAProxy
|
||||||
The application does not need global privileges.
|
connections normally originate from the physical webserver address. Add a
|
||||||
|
third account for `10.10.1.120` only if a connection test or the HAProxy
|
||||||
|
configuration proves that it explicitly uses the virtual address as its source.
|
||||||
|
|
||||||
## 3. Gitea accounts and OAuth
|
## 3. Gitea accounts and OAuth
|
||||||
|
|
||||||
@@ -66,9 +74,9 @@ openssl rand -base64 48
|
|||||||
```
|
```
|
||||||
|
|
||||||
The database DSN must retain `parseTime=true`, `multiStatements=true`, and the
|
The database DSN must retain `parseTime=true`, `multiStatements=true`, and the
|
||||||
encoded UTC `time_zone` setting from `.env.example`.
|
encoded UTC `time_zone` setting from `.env.example`. Its address remains
|
||||||
Set the Galera address to an existing database VIP or load-balanced endpoint,
|
`127.0.0.1:3306`, which uses the local HAProxy frontend rather than selecting a
|
||||||
not a single cluster member.
|
single Galera member.
|
||||||
|
|
||||||
## 5. Build and migrate
|
## 5. Build and migrate
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user