countly-server icon indicating copy to clipboard operation
countly-server copied to clipboard

Docker: Custom session name (to include __Host-)

Open letynsoft opened this issue 2 years ago • 0 comments

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

  • Operating System and version: Ubuntu 18.04, 5.4.0-1081-aws #88~18.04.1-Ubuntu SMP Thu Jun 23 16:29:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Any changes you have made to your instance: The network is modified, as we have an apache running on the host, doing the reverse proxy (so the nginx is commented out). I have also changed the version of the file as the docker we have did not like the 3.7. And the two-factor-authentication plugin is enabled.

letynsoft avatar Aug 09 '22 10:08 letynsoft