boschkundendienst / guacamole-docker-compose

Guacamole with docker-compose using PostgreSQL, nginx with SSL (self-signed)
GNU General Public License v3.0
983 stars 410 forks source link

branding.jar #86

Closed q16marvin closed 11 months ago

q16marvin commented 11 months ago

Hi,

thx for your yml file :) it helps me a lot :) i have add ldap variables and also working well. but i dont get branding.jar do change logo, do you know where i need to se this file?

Thx! Erik

derpcfreak commented 11 months ago

OK. This is covered in the official documentation somewhere but I can't remember where. I can remember that it took me a while to get it going. Let me try to remember:

You have to define GUACAMOLE_HOME environment variable to a custom location within the container e.g. /guachome,

Then you have to create a volume (e.g. a local folder) that is put inside the container as /guachome and within /guachome you have to create a subfolder for the extensions e.g. /guachome/extensions.

so partly the guacmole: section of the docker-compose.yml will look like this:

# guacamole
  guacamole:
    container_name: guacamole_compose
    depends_on:
    - guacd
    - postgres
    environment:
    ...
    ...
    ...
      GUACAMOLE_HOME: /guachome
    volumes:
      - ./guachome:/guachome
      - ./extensions:/guachome/extensions
    ...

Then you have to create guachome/guacamole.properties that defines enable-environment-properties to true. That allows you to tell the container that it should use a new Guacamole home dire based on the GUAC_HOME variable.

#guacamole.properties
enable-environment-properties: true

Then I have a subfolder extensions e.g. with branding.jar:

extensions/
extensions/branding.jar

All put together should work. I only have a non productive version lying arround but my docker-compose.yml finally looked like this:

version: '2.0'

networks:
  guacnetwork_compose:
    driver: bridge

services:
  guacd:
    container_name: guacd_compose
    image: guacamole/guacd
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./drive:/drive:rw
    - ./record:/record:rw
  postgres:
    container_name: postgres_guacamole_compose
    environment:
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRES_DB: guacamole_db
      POSTGRES_PASSWORD: 'ChooseYourOwnPasswordHere1234'
      POSTGRES_USER: guacamole_user
    image: postgres:13.4-buster
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./init:/docker-entrypoint-initdb.d:z
    - ./data:/var/lib/postgresql/data:Z

  guacamole:
    container_name: guacamole_compose
    depends_on:
    - guacd
    - postgres
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_DATABASE: guacamole_db
      POSTGRES_HOSTNAME: postgres
      POSTGRES_PASSWORD: 'ChooseYourOwnPasswordHere1234'
      POSTGRES_USER: guacamole_user

      GUACAMOLE_HOME: /guachome
    volumes:
      - ./guachome:/guachome
      - ./extensions:/guachome/extensions
    image: guacamole/guacamole
    links:
    - guacd
    networks:
      guacnetwork_compose:
    ports:
    - 8080/tcp
    restart: always

  nginx:
   container_name: nginx_guacamole_compose
   restart: always
   image: nginx
   volumes:
   - ./nginx/ssl/self.cert:/etc/nginx/ssl/self.cert:ro
   - ./nginx/ssl/self-ssl.key:/etc/nginx/ssl/self-ssl.key:ro
   - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
   - ./nginx/mysite.template:/etc/nginx/conf.d/default.conf:ro
   ports:
   - 8443:443
   links:
   - guacamole
   networks:
     guacnetwork_compose:
   command: /bin/bash -c "nginx -g 'daemon off;'"

local guachome folder

guachome/
guachome/extensions
guachome/guacamole.properties

local extensions folder

extensions/
extensions/branding.jar

I think that could point you in the right direction.

q16marvin commented 11 months ago

environment variable GUACAMOLE_HOME and a volume was enough to work, here my full yml file:

version: '2.0'

# networks
# create a network 'guacnetwork_compose' in mode 'bridged'
networks:
  guacnetwork_compose:
    driver: bridge

# services
services:
  # guacd
  guacd:
    container_name: guacd_compose
    image: guacamole/guacd
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./drive:/drive:rw
    - ./record:/record:rw
  # guacamole
  guacamole:
    container_name: guacamole_compose
    depends_on:
    - guacd
    environment:
      GUACD_HOSTNAME: guacd
      GUACAMOLE_HOME: /opt/guacamole
      MYSQL_HOSTNAME: xxx.xxx.xxx.xxx
      MYSQL_PORT: 3306
      MYSQL_DATABASE: guacamole1
      MYSQL_USER: guacamole
      MYSQL_PASSWORD: blabla
      LDAP_HOSTNAME: xxx.xxx.xxx.xxx
      LDAP_USER_BASE_DN: DC=gut,DC=blabla
      LDAP_PORT: 389
      LDAP_ENCRYPTION_METHOD: none 
      LDAP_USERNAME_ATTRIBUTE: sAMAccountName
      LDAP_SEARCH_BIND_DN: CN=guacamole,CN=Users,DC=gut,DC=blabla
      LDAP_SEARCH_BIND_PASSWORD: blabla
      REMOTE_IP_VALVE_ENABLED: true
      PROXY_IP_HEADER: x-forwarded-for
      PROXY_BY_HEADER: x-forwarded-by
      PROXY_PROTOCOL_HEADER: X-Forwarded-Proto

    image: guacamole/guacamole
    links:
    - guacd
    networks:
      guacnetwork_compose:
    volumes:
    - ./extensions:/opt/guacamole/extensions
    ports:
    - 8086:8080/tcp
    restart: always