Browse Source

Fix for trusted origins

Ben 3 months ago
parent
commit
be8d5e67ef
4 changed files with 80 additions and 63 deletions
  1. 11 59
      cloudbeaver-ce/docker-compose.yaml
  2. 6 1
      grafana/docker-compose.yaml
  3. 11 0
      grafana/prometheus.yml
  4. 52 3
      hue/hue.ini

+ 11 - 59
cloudbeaver-ce/docker-compose.yaml

@@ -1,64 +1,16 @@
 services:
-  web-proxy:
+   cloudbeaver:
+    hostname: cloudbeaver
+    container_name: cloudbeaver
+    image: dbeaver/cloudbeaver:latest
     restart: unless-stopped
-    image: ${IMAGE_SOURCE:-dbeaver}/cloudbeaver-${PROXY_TYPE:-nginx}:${CLOUDBEAVER_VERSION_TAG}
     ports:
-      - 8078:8080
-      # - 443:8443
-    environment:
-      - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-dbeaver}
-      - CLOUDBEAVER_WEB_SERVER_PORT=${CLOUDBEAVER_WEB_SERVER_PORT:-8978}
-    networks:
-      - cloudbeaver-private-net
-    volumes:
-      - nginx_conf_data:/etc/${PROXY_TYPE:-nginx}/product-conf/
-      - nginx_ssl_data:/etc/${PROXY_TYPE:-nginx}/ssl/
-    depends_on:
-      - cloudbeaver
+      - "8978:8978" # Host_Port:Container_Port
     labels:
-      "com.helios.target": "http://localhost:8078"
-
-  cloudbeaver:
-    restart: unless-stopped
-    hostname: cloudbeaver
-    image: ${IMAGE_SOURCE:-dbeaver}/cloudbeaver-ee:${CLOUDBEAVER_VERSION_TAG}
-    volumes:
-      - cloudbeaver:/opt/cloudbeaver/workspace
-      - cloudbeaver_certs:/opt/cloudbeaver/conf/certificates/
-      - trusted_cacerts:/opt/cloudbeaver/workspace/.data/custom/
-      - api_tokens:/opt/cloudbeaver/conf/keys/
-    environment:
-      - CLOUDBEAVER_DB_DRIVER=${CLOUDBEAVER_DB_DRIVER}
-      - CLOUDBEAVER_DB_URL=${CLOUDBEAVER_DB_URL}
-      - CLOUDBEAVER_DB_USER=${CLOUDBEAVER_DB_USER}
-      - CLOUDBEAVER_DB_PASSWORD=${CLOUDBEAVER_DB_PASSWORD}
-      - CLOUDBEAVER_DB_SCHEMA=${CLOUDBEAVER_DB_SCHEMA}
-      - CLOUDBEAVER_QM_DB_DRIVER=${CLOUDBEAVER_QM_DB_DRIVER}
-      - CLOUDBEAVER_QM_DB_URL=${CLOUDBEAVER_QM_DB_URL}
-      - CLOUDBEAVER_QM_DB_USER=${CLOUDBEAVER_QM_DB_USER}
-      - CLOUDBEAVER_QM_DB_PASSWORD=${CLOUDBEAVER_QM_DB_PASSWORD}
-      - CLOUDBEAVER_QM_DB_SCHEMA=${CLOUDBEAVER_QM_DB_SCHEMA}
-    expose:
-      - ${CLOUDBEAVER_WEB_SERVER_PORT:-8978}
-    depends_on:
-      - postgres
-    networks:
-      - cloudbeaver-private-net
-
-  postgres:
-    restart: unless-stopped
-    hostname: postgres
-    image: ${IMAGE_SOURCE:-dbeaver}/cloudbeaver-postgres:16
-    volumes:
-      - postgres_data:/var/lib/postgresql/data
+      "com.helios.target": "http://localhost:8978"
     environment:
-      - POSTGRES_DB=cloudbeaver
-      - POSTGRES_USER=${CLOUDBEAVER_DB_USER}
-      - POSTGRES_PASSWORD=${CLOUDBEAVER_DB_PASSWORD}
-    expose:
-      - 5432
-    networks:
-      - cloudbeaver-private-net
-
-networks:
-  cloudbeaver-private-net:
+      # Optional: Configure the initial admin user
+      CB_ADMIN_NAME: cbadmin
+      CB_ADMIN_PASSWORD: Abcd1234 # Change this to a secure password
+      CB_SERVER_NAME: "Test Server"
+      CB_SERVER_URL: "cloudbeaver.devlocal.site"

+ 6 - 1
grafana/docker-compose.yaml

@@ -24,10 +24,15 @@ services:
       - GF_SECURITY_ADMIN_USER=admin
       - GF_SECURITY_ADMIN_PASSWORD=admin
       - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
+      - GF_SERVER_DOMAIN=grafana.devlocal.site
+      - GF_SERVER_ROOT_URL=https://grafana.devlocal.site/
+      - GF_SERVER_PROTOCOL=https
+      - GF_LIVE_ALLOWED_ORIGINS=grafana.devlocal.site
+      - GF_SECURITY_CSRF_TRUSTED_ORIGINS=grafana.devlocal.site
     networks:
       - monitoring_network
     labels:
-      "com.helios.target": "http://localhost:3000"
+      "com.helios.target": "https://localhost:3000"
   prometheus:
     image: prom/prometheus
     container_name: prometheus

+ 11 - 0
grafana/prometheus.yml

@@ -0,0 +1,11 @@
+global:
+  scrape_interval: 15s
+
+scrape_configs:
+  - job_name: 'prometheus'
+    static_configs:
+      - targets: ['localhost:9090']
+
+  - job_name: 'node-exporter'
+    static_configs:
+      - targets: ['node-exporter:9100']

+ 52 - 3
hue/hue.ini

@@ -1,4 +1,53 @@
+# Lightweight Hue configuration file
+# ==================================
+
 [desktop]
-# Set to false to disable all CSRF protection. Default is True.
-# Note: Disabling CSRF protection can expose your application to security risks. Use with caution.
-csrf_protection_enabled=false
+
+# Set this to a random string, the longer the better.
+secret_key=kasdlfjknasdfl3hbaksk3bwkasdfkasdfba23asdf
+
+# Webserver listens on this address and port
+http_host=0.0.0.0
+http_port=8888
+
+secure_proxy_ssl_header=true
+use_x_forwarded_host=true
+# external_host=hue.devlocal.site
+use_proxy_headers=true
+# cors_enabled=false
+# Enable or disable Cross-Origin Resource Sharing (CORS). Defaults to True.Default: True
+# cors_allow_credentials=false
+# cors_allowed_origins="hue.devlocal.site,localhost"
+
+# Time zone name
+time_zone=America/Los_Angeles
+
+# Enable or disable debug mode.
+django_debug_mode=true
+
+# Enable or disable backtrace for server error
+http_500_debug_mode=false
+
+app_blacklist=search,hbase,security
+
+# Use gunicorn or not
+use_cherrypy_server=false
+
+# Gunicorn work class: gevent or evenlet, gthread or sync.
+gunicorn_work_class=sync
+gunicorn_number_of_workers=1
+
+[[session]]
+# The name of the cookie to use for sessions.
+# This can have any value that is not used by the other cookie names in your application.
+## cookie_name=sessionid
+
+# The cookie containing the users' session ID will expire after this amount of time in seconds.
+# Default is 2 weeks.
+## ttl=1209600
+secure=true
+trusted_origins="hue.devlocal.site"
+
+# Configuration options for specifying the Desktop Database. For more info,
+# see http://docs.djangoproject.com/en/1.11/ref/settings/#database-engine
+# ------------------------------------------------------------------------