Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom .jar file #3

Closed
trueself-belief opened this issue Jan 24, 2021 · 9 comments
Closed

Custom .jar file #3

trueself-belief opened this issue Jan 24, 2021 · 9 comments

Comments

@trueself-belief
Copy link

Hi

Great work on this. Your comment stating that although this repo is 3 years old the script uses latest images was useful in helping me find and use this.

The custom branding.jar file you are able to add within the guacamole/guacamole:latest container /extensions folder seems to delete after restarting the container. There is one .jar file in there currently (guacamole-auth-jdbc-postgresql-1.3.0.jar)
Any ideas on why this is and any potential fixes to allow a custom login page.

@Vad1mo
Copy link
Member

Vad1mo commented Jan 24, 2021

if you want to add a Custom .jar best would be to do it as volume, then you can put whatever you want in there and is stays.

@trueself-belief
Copy link
Author

Thank you so much for the direction, I now have something new to learn!
I wanted to keep this open so I could post the solution for others that use this docker file however my understanding is not there yet.
I am wondering if you could assist a little further please...

  • I have created a new docker volume using 'docker volume create (volume name)'
  • Tried to mount the volume to the container using 'docker run -v (volume name):/root/.guacamole/extensions ubuntu'

however this does not seem to have worked...am i missing something obvious to you here or do i need to spin up a fresh install and add -volume variable to the .yml file?

@Vad1mo
Copy link
Member

Vad1mo commented Feb 2, 2021

This is the correct approach.

Now that you have a volume mounted to ubuntu /root/.guacamole/extensions you can add your JAR to that volume, so that next time when you start a new container that mounts this volume, you'll see that the jar is there.

From there you have to tell guacamole to load that jar somehow, but this is purely guacamole related setup.

however this does not seem to have worked...am i missing something obvious to you here or do i need to spin up a fresh install and add -volume variable to the .yml file?

What you now did on the CLI you need to extend to the compose file. Normally are compose up will do it.

@trueself-belief
Copy link
Author

Ok.

My problem here is that this creates a new container but I want to put the .jar within a container created by your script, so instead of using ubuntu image can i specify the container image name to mount the volume into your container? ie
guacamole/guacamole:latest@sha256:0xxxxxxx

@Vad1mo
Copy link
Member

Vad1mo commented Feb 2, 2021

Try this:

...
    volumes:
      - extensions:/root/.guacamole/extensions
 .. 

Here the full file.

#
# Apache Guacamole with NGIXN reverse proxy and Let's Encrypt.
# For more details see: https://github.com/8gears/containerized-guacamole
# 
version: '3'

services:
  nginx:
    image: jwilder/nginx-proxy:alpine
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-letsencrypt
    restart: unless-stopped
    depends_on:
      - nginx
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro

  init-guac-db:
    image: guacamole/guacamole:latest
    command: ["/bin/sh", "-c", "test -e /init/initdb.sql && echo 'init file already exists' || /opt/guacamole/bin/initdb.sh --postgres > /init/initdb.sql" ]
    volumes:
      - dbinit:/init

  postgres:
    image: postgres:latest
    restart: unless-stopped
    volumes:
      - dbinit:/docker-entrypoint-initdb.d
      - dbdata:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-guacadb}
      POSTGRES_PASSWORD:
    depends_on:
      - init-guac-db

  guacd:
    image: guacamole/guacd:latest
    restart: unless-stopped

  guac:
    image: guacamole/guacamole:latest
    restart: unless-stopped
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_HOSTNAME: postgres
      POSTGRES_DATABASE: ${POSTGRES_USER:-guacadb}
      POSTGRES_USER: ${POSTGRES_USER:-guacadb}
      POSTGRES_PASSWORD:
      LETSENCRYPT_TEST: ${LETSENCRYPT_TEST:-false}
      VIRTUAL_HOST:
      LETSENCRYPT_HOST: ${VIRTUAL_HOST}
      LETSENCRYPT_EMAIL:
    depends_on:
      - postgres
      - guacd
    volumes:
      - extensions:/root/.guacamole/extensions

volumes:
  dbinit:
  dbdata:
  conf:
  vhost:
  html:
  certs:
  extensions:

@trueself-belief
Copy link
Author

I've tested this but appear to be getting a 502 bad gateway error (nginx), odd as the script works without the extension added. I wanted to allow enough time to allow it to fully propagate (24hrs) just in case, cache has been cleared and a simple refresh, firewall disabled and I also set up a new subdomain to run it through but none have worked. I will take this away and do some more testing but does the same happen your side?

At this point i just want to say thank you so much for the guidance you have shared with me, you have helped me step into the next section of learning with the clarification and support you have offered and such quick responses.

@marekschneider
Copy link

I got the same error when using root/.guacamole/extensions as the directory.

However, I found a solution:

volumes:
      - extensions:/opt/guacamole-dockerized/extensions

environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_HOSTNAME: postgres
      POSTGRES_DATABASE: ${POSTGRES_USER:-guacadb}
      POSTGRES_USER: ${POSTGRES_USER:-guacadb}
      POSTGRES_PASSWORD:
      LETSENCRYPT_TEST: ${LETSENCRYPT_TEST:-false}
      VIRTUAL_HOST:
      LETSENCRYPT_HOST: ${VIRTUAL_HOST}
      LETSENCRYPT_EMAIL:
      TOTP_ENABLED: 'true'
      TOTP_ISSUER: Apache Guacamole
      TOTP_DIGITS: 6
      TOTP_PERIOD: 30
      TOTP_MODE: sha1

The full file:

#
# Apache Guacamole with NGIXN reverse proxy and Let's Encrypt.
# For more details see: https://github.com/8gears/containerized-guacamole
# 
version: '3'

services:
  nginx:
    image: jwilder/nginx-proxy:alpine
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-letsencrypt
    restart: unless-stopped
    depends_on:
      - nginx
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro

  init-guac-db:
    image: guacamole/guacamole:latest
    command: ["/bin/sh", "-c", "test -e /init/initdb.sql && echo 'init file already exists' || /opt/guacamole/bin/initdb.sh --postgres > /init/initdb.sql" ]
    volumes:
      - dbinit:/init

  postgres:
    image: postgres:latest
    restart: unless-stopped
    volumes:
      - dbinit:/docker-entrypoint-initdb.d
      - dbdata:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-guacadb}
      POSTGRES_PASSWORD:
    depends_on:
      - init-guac-db

  guacd:
    image: guacamole/guacd:latest
    restart: unless-stopped

  guac:
    image: guacamole/guacamole:latest
    restart: unless-stopped
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_HOSTNAME: postgres
      POSTGRES_DATABASE: ${POSTGRES_USER:-guacadb}
      POSTGRES_USER: ${POSTGRES_USER:-guacadb}
      POSTGRES_PASSWORD:
      LETSENCRYPT_TEST: ${LETSENCRYPT_TEST:-false}
      VIRTUAL_HOST:
      LETSENCRYPT_HOST: ${VIRTUAL_HOST}
      LETSENCRYPT_EMAIL:
      TOTP_ENABLED: 'true'
      TOTP_ISSUER: Apache Guacamole
      TOTP_DIGITS: 6
      TOTP_PERIOD: 30
      TOTP_MODE: sha1
    depends_on:
      - postgres
      - guacd
    volumes:
      - extensions:/opt/guacamole-dockerized/extensions

volumes:
  dbinit:
  dbdata:
  conf:
  vhost:
  html:
  certs:
  extensions:

@Vad1mo
Copy link
Member

Vad1mo commented Oct 1, 2021

Thank you for sharing. I'll reference this on the README

@Vad1mo Vad1mo closed this as completed Dec 15, 2021
@carlostico
Copy link

the branding.jar file dissapears from the volume created as soon as the container is restarted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants