Countly / countly-server

Countly is a product analytics platform that helps teams track, analyze and act-on their user actions and behaviour on mobile, web and desktop applications.
https://countly.com
Other
5.58k stars 972 forks source link

Docker: Custom session name (to include __Host-) #3416

Closed letynsoft closed 2 years ago

letynsoft commented 2 years ago

I'm trying to secure the installation of the Countly Docker a little, but when i try the following config, the cookie name becomes [object Object] instead. How do I make the session name to be __Host-connect.sid?

My docker-compose.yml:

version: "3.3"

volumes:
  mongodb_data:

networks:
  countly:

services:
  mongodb:
    image: 'bitnami/mongodb:latest'
    volumes:
      - 'mongodb_data:/bitnami'
    networks:
      countly:

  countly-api:
    image: 'countly/api:latest'
    ports:
      - '8080:3001'
    # Enterprise Edition: image: 'gcr.io/countly-01/api:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbvie$
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
      - COUNTLY_CONFIG__WEB_SESSION_NAME=__Host-connect.sid
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s
    networks:
      countly:
    depends_on:
      - mongodb
  countly-frontend:
    image: 'countly/frontend:latest'
    ports:
      - '8081:6001'
    # Enterprise Edition: image: 'gcr.io/countly-01/frontend:20.11.2'
    environment:
      - COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbvie$
      - COUNTLY_CONFIG__MONGODB_HOST=mongodb
      - COUNTLY_CONFIG__WEB_SESSION_NAME=__Host-connect.sid
    networks:
      countly:
    depends_on:
      - mongodb
    deploy:
      # There is usually no need in multiple frontends, so throttling down resources for it
      mode: global
      resources:
        limits:
          cpus: '0.5'
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 400s

Expected Behavior

The session name should be __Host-connect.sid

Current Behavior

The session name is [object Object]

Steps to Reproduce (for bugs)

Just use the config above, do docker stack deploy --compose-file="docker-compose.yml" countly and wait. Once the website builds, the cookie name should be [object Object]

More Description

As stated above, I'm trying to secure the site as much as possible.

Your Environment

ar2rsawseen commented 2 years ago

Hello There was a bug that will be fixed here: https://github.com/Countly/countly-server/pull/3471 And will be included in next release.

But even with that, it does not create a cookie that starts with double __ So I don't think this will be possible