-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
516 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
POSTGRES_DB=codera | ||
POSTGRES_USER=codera-user | ||
POSTGRES_USER=codera-log | ||
POSTGRES_PASSWORD=codera12345! |
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
backend/nocode-standalone-instance/monitoring/grafana/.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Grafana Admin Credentials | ||
GF_SECURITY_ADMIN_USER=codera | ||
GF_SECURITY_ADMIN_PASSWORD=codera12345! | ||
|
||
# Grafana Server Configuration | ||
GF_SERVER_HTTP_PORT=3000 | ||
# GF_SERVER_ROOT_URL=https://hospital.temashare.com/grafana | ||
GF_SERVER_ROOT_URL=http://localhost:3000/grafana | ||
GF_SECURITY_ALLOW_EMBEDDING=true | ||
GF_CORS_ALLOW_ORIGINS=* | ||
GF_CORS_ALLOW_CREDENTIALS=true | ||
|
||
# Grafana JWT Authentication Configuration | ||
GF_AUTH_JWT_ENABLED=true | ||
GF_AUTH_JWT_HEADER_NAME=Authorization | ||
GF_AUTH_JWT_AUTO_SIGN_UP=true | ||
GF_AUTH_JWT_URL_LOGIN=true | ||
GF_AUTH_JWT_USERNAME_CLAIM=userID | ||
GF_AUTH_JWT_DEFAULT_ROLE=Viewer | ||
GF_AUTH_JWT_KEY_FILE=/etc/grafana/grafana_public_key.pem |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
backend/nocode-standalone-instance/monitoring/grafana/grafana_public_key.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmC3IGmGxedZ1udJM6yQc | ||
hG5s56vNCJXLLxmZ59mU9rh9lDWGTV1J3IkHOdpYq5ruR49Y2A21Kl8+gPnfMpTA | ||
G0As1ATHBsHIP9QyBiCOed2r71DEO/qYariIb2jQEdB8N3t7S4DwKOU1/y9R3xgs | ||
Cqh27dviSZGOvhYX5fdAJPqh+pwy5jjmjeUdmme9I5JQ4U/4BkQwUWADS2Lz7Vgg | ||
8uWsM602/joJ5ZcasFrc2n3w3koeSi41NELHQEdk/TYiQ+tb7lrUHQtVINniDmgE | ||
qNWWeyYd2cHNMuMw6EHr5Dre1VgHzAgVdEiGc7/QjflqWM6zeNIWvp0EaIvxR0HC | ||
LwIDAQAB | ||
-----END PUBLIC KEY----- |
28 changes: 28 additions & 0 deletions
28
backend/nocode-standalone-instance/monitoring/grafana/private.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |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||
FSvryscldAg58lNMGNutXJkaCwPyeu3U04fWqrj35bpJ94tXau5/da4LFe0Foz33 | ||
kvIcUE95WSVEj/a/zRbthJqGVH+778HwTm9n5zSdqffcw2/e2vxNKigEoIyS2p1o | ||
GlbQ27CgswKBgBKYyYIh3eh4CSl+kMrOg6+20BaGQUOosE7ElBH/Ed6Hy1b9V7po | ||
ikNTUzuoQrVCDa7rD95+TKbqMDnBd8mNPCJeBm4dLAksYU4Gz2+fRubPBBjIYoPm | ||
WPMUSmjbQXpQTlvFyjz7P4MjrSxJzq56pNHEF95Hn0yi6WmlBIjT2slBAoGBAJov | ||
RrLfcGKynp7hTlTPs6xkgdlYoGWK4OAn4f+/BxjN9o8hsZZ6NLNZOk5JZ+rd1hT9 | ||
G3a+sx7zll/LZyKqCl5m0UW/Ap6SiLiwKcSAIuucIfHBZfAlchnF55be3jNVeKFr | ||
WhOb2fjIGt6Vb6msAzuNkk6lRc7NP8tALNFZ5sK/AoGAa642meCj5kospmTWjGY7 | ||
ysY3AIs95teK0HdUq4g06a5G+eUcgi5lah77h7UJ41z9+7wTqXVFA/s0LPXNkZKD | ||
vXXcGbdGk7lRthKi2bMBiOsvGNqjjrb9V7H3fU20nRzjihL3Mhpb61kRT75X9THQ | ||
608O4LOCwMqM6+oUlx8vI4M= | ||
-----END PRIVATE KEY----- |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
backend/monitoring/influx/Dockerfile → ...one-instance/monitoring/influx/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
STORAGE_TSDB_RETENTION_TIME=7d |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# 运行 docker-compose build | ||
# docker-compose -f ./docker-compose-dev.yml --profile standalone build | ||
# if [ $? -ne 0 ]; then | ||
# echo "构建过程中出现错误,退出脚本。" | ||
# exit 1 | ||
# fi | ||
|
||
# 备份原始文件 | ||
cp ./docker-compose-dev.yml ./docker-compose-dev.yml.bak | ||
|
||
# 使用 sed 注释掉 build 和 context 部分 | ||
sed -i '' '/build:/,/^[[:space:]]*context:/{ | ||
# 注释掉 build 和 context 部分 | ||
s/^\(.*\)/# &/ | ||
}' ./docker-compose-dev.yml | ||
|
||
# 使用 sed 添加 image 字段(从 container_name 提取并添加),保留 container_name | ||
sed -i '' '/container_name:/{ | ||
# 提取 container_name 后面的值并添加 image 字段,同时保留 container_name | ||
s/^.*container_name: \(.*\)/ image: \1\n container_name: \1/ | ||
}' ./docker-compose-dev.yml | ||
|
||
echo "docker-compose-dev.yml 文件已更新, build 和 context 部分已注释,并添加了 image 字段,同时保留了 container_name。" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# 配置密钥目录和文件名 | ||
KEY_DIR="./backend/nocode-standalone-instance/monitoring/grafana" | ||
PRIVATE_KEY_FILE="$KEY_DIR/private.pem" | ||
PUBLIC_KEY_FILE="$KEY_DIR/grafana_public_key.pem" | ||
|
||
# 检查密钥目录是否存在,不存在则创建 | ||
if [ ! -d "$KEY_DIR" ]; then | ||
echo "Creating directory for JWT keys: $KEY_DIR" | ||
mkdir -p "$KEY_DIR" | ||
fi | ||
|
||
# 检查是否已有密钥对,避免重复生成 | ||
if [ -f "$PRIVATE_KEY_FILE" ] && [ -f "$PUBLIC_KEY_FILE" ]; then | ||
echo "Keys already exist:" | ||
echo "Private Key: $PRIVATE_KEY_FILE" | ||
echo "Public Key: $PUBLIC_KEY_FILE" | ||
exit 0 | ||
fi | ||
|
||
# 生成 RSA 私钥 | ||
echo "Generating RSA private key..." | ||
openssl genrsa -out "$PRIVATE_KEY_FILE" 2048 | ||
|
||
# 提取公钥 | ||
echo "Extracting public key from private key..." | ||
openssl rsa -in "$PRIVATE_KEY_FILE" -pubout -out "$PUBLIC_KEY_FILE" | ||
|
||
# 设置权限 | ||
echo "Setting permissions for keys..." | ||
chmod 400 "$PRIVATE_KEY_FILE" | ||
chmod 444 "$PUBLIC_KEY_FILE" | ||
|
||
echo "Key generation complete." | ||
echo "Private Key: $PRIVATE_KEY_FILE" | ||
echo "Public Key: $PUBLIC_KEY_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,149 @@ | ||
# version: '3.8' | ||
|
||
# services: | ||
# auth: | ||
# build: | ||
# context: ./services/auth | ||
# ports: | ||
# - "8080:8080" | ||
# environment: | ||
# - DB_URL=jdbc:postgresql://db:5432/auth_db | ||
# depends_on: | ||
# - db | ||
|
||
# order: | ||
# build: | ||
# context: ./services/order | ||
# ports: | ||
# - "8081:8081" | ||
# environment: | ||
# - DB_URL=jdbc:postgresql://db:5432/order_db | ||
# depends_on: | ||
# - db | ||
|
||
# payment: | ||
# build: | ||
# context: ./services/payment | ||
# ports: | ||
# - "8082:8082" | ||
# environment: | ||
# - DB_URL=jdbc:postgresql://db:5432/payment_db | ||
# depends_on: | ||
# - db | ||
|
||
# user: | ||
# build: | ||
# context: ./services/user | ||
# ports: | ||
# - "8083:8083" | ||
# environment: | ||
# - DB_URL=jdbc:postgresql://db:5432/user_db | ||
# depends_on: | ||
# - db | ||
|
||
# db: | ||
# image: postgres:13 | ||
# env_file: | ||
# - ./influxDB/.env | ||
# ports: | ||
# - "5432:5432" | ||
|
||
version: '3.9' | ||
services: | ||
maindb: | ||
build: | ||
context: ./backend/nocode-standalone-instance/db/main-db | ||
container_name: ecm-maindb | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/db/main-db/.env | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ecm-main-db-data-dev:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U codera-user -h localhost"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
restart: always | ||
|
||
redis: | ||
build: | ||
context: ./backend/nocode-standalone-instance/db/redis | ||
container_name: ecm-redis | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/db/redis/.env | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- ecm-redis-data-dev:/data | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 30s | ||
restart: always | ||
|
||
kafka: | ||
build: | ||
context: ./backend/nocode-standalone-instance/kafka | ||
container_name: ecm-kafka | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/kafka/.env | ||
ports: | ||
- "9092:9092" | ||
volumes: | ||
- ecm-kafka-data-dev:/?? | ||
healthcheck: | ||
test: [] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 30s | ||
restart: always | ||
|
||
grafana: | ||
build: | ||
context: ./backend/nocode-standalone-instance/monitoring/grafana/ | ||
container_name: ecm-grafana | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/monitoring/grafana/.env | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- ./backend/nocode-standalone-instance/monitoring/grafana/grafana_public_key.pem:/etc/grafana/grafana_public_key.pem | ||
- ecm-grafana-data-dev:/var/lib/grafana | ||
- ./backend/nocode-standalone-instance/monitoring/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml | ||
healthcheck: | ||
test: ["CMD-SHELL", "nc -z localhost 3000 || exit 1"] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
|
||
influx: | ||
build: | ||
context: ./backend/nocode-standalone-instance/monitoring/influx | ||
container_name: ecm-influx | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/monitoring/influx/.env | ||
ports: | ||
- "8086:8086" | ||
volumes: | ||
- ecm-influx-metadata-dev:/root/.influxdbv2 | ||
- ecm-influx-data-dev:/var/lib/influxdb2 | ||
- ./backend/nocode-standalone-instance/monitoring/influx:/etc/influxdb2 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -f http://localhost:8086/health"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 10s | ||
|
||
|
||
prometheus: | ||
build: | ||
context: ./backend/nocode-standalone-instance/monitoring/prometheus | ||
container_name: ecm-prometheus | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/monitoring/prometheus/.env | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./backend/nocode-standalone-instance/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml | ||
healthcheck: | ||
test: ["CMD-SHELL", "nc -z localhost 9090 || exit 1"] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
|
||
log: | ||
build: | ||
context: ./backend/nocode-standalone-instance/log | ||
container_name: ecm-log | ||
profiles: | ||
- standalone | ||
env_file: | ||
- ./backend/nocode-standalone-instance/log/.env | ||
ports: | ||
- "5438:5432" | ||
volumes: | ||
- ecm-log-data-dev:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U codera-log -h localhost"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
restart: always | ||
|
||
volumes: | ||
ecm-main-db-data-dev: | ||
ecm-redis-data-dev: | ||
ecm-kafka-data-dev: | ||
ecm-grafana-data-dev: | ||
ecm-influx-data-dev: | ||
ecm-influx-metadata-dev: | ||
ecm-log-data-dev: |
Oops, something went wrong.