add inspector and gradido node routes to nginx

This commit is contained in:
einhornimmond 2025-10-01 16:44:36 +02:00
parent 48744c02bf
commit 08735a2296
5 changed files with 72 additions and 1 deletions

3
.gitmodules vendored
View File

@ -1 +1,4 @@
[submodule "inspector"]
path = inspector
url = https://github.com/gradido/inspector.git

View File

@ -86,8 +86,9 @@ FEDERATION_COMMUNITY_APIS=1_0
GDT_ACTIVE=false
# DLT-Connector (still in develop)
DLT_CONNECTOR=false
DLT_CONNECTOR=true
DLT_CONNECTOR_PORT=6010
NODE_SERVER_URL=http://localhost:8340/api
# used for combining a newsletter on klicktipp with this gradido community
# if used, user will be subscribed on register and can unsubscribe in his account

View File

@ -101,6 +101,22 @@ server {
error_log $GRADIDO_LOG_PATH/nginx-error.backend.log warn;
}
# Gradido-Node
location /dlt {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8340/api/;
proxy_redirect off;
access_log $GRADIDO_LOG_PATH/nginx-access.dlt.log gradido_log;
error_log $GRADIDO_LOG_PATH/nginx-error.dlt.log warn;
}
# Backend webhooks
location /hook {
limit_req zone=backend burst=20 nodelay;
@ -196,6 +212,37 @@ server {
access_log $GRADIDO_LOG_PATH/nginx-access.admin.log gradido_log;
error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn;
}
# Admin Frontend
location /inspector {
limit_req zone=frontend burst=30 nodelay;
limit_conn addr 20;
alias $PROJECT_ROOT/inspector/build/;
index index.html;
# caching rules for assets
# static assets
location ~* \.(?:woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ {
# keep assets for a week
add_header Cache-Control "public, max-age=604800";
try_files $uri =404;
}
# hashed assets
location ~* \.(?:js|css|json)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
try_files $uri $uri/ /index.html = 404;
# don't cache index.html
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires 0;
access_log $GRADIDO_LOG_PATH/nginx-access.inspector.log gradido_log;
error_log $GRADIDO_LOG_PATH/nginx-error.inspector.log warn;
}
# Federation
$FEDERATION_NGINX_CONF

View File

@ -287,6 +287,17 @@ bun install
log_step 'build all modules'
turbo build --env-mode=loose --concurrency=$(nproc)
# build inspector and dlt-connector
log_step 'build inspector'
cd $PROJECT_ROOT/inspector
bun install
bun run build
log_step 'build dlt-connector'
cd $PROJECT_ROOT/dlt-connector
bun install
bun run build
# database
log_step 'Updating database'
if [ "$DEPLOY_SEED_DATA" = "true" ]; then
@ -306,6 +317,14 @@ pm2 start --name gradido-backend \
-l $GRADIDO_LOG_PATH/pm2.backend.$TODAY.log \
--log-date-format 'YYYY-MM-DD HH:mm:ss.SSS'
if [ "$DLT_CONNECTOR" = true ] ; then
pm2 start --name dlt-connector \
"env TZ=UTC NODE_ENV=production bun ./build/index.js" \
--cwd $PROJECT_ROOT/dlt-connector \
-l $GRADIDO_LOG_PATH/pm2.dlt-connector.$TODAY.log \
--log-date-format 'YYYY-MM-DD HH:mm:ss.SSS'
fi
pm2 save
if [ ! -z $FEDERATION_DHT_TOPIC ]; then
pm2 start --name gradido-dht-node \

1
inspector Submodule

@ -0,0 +1 @@
Subproject commit ab1fcc03546a1e98e4f236243d6cef1ae4a566d6