Hi, I’m trying to change the timeout on the GSA web portal container. Is there any way to be able to pass environment variables into the containers? If so, is there a list of valid environment variables posted anywhere? I don’t see anything in the documentation. Thanks.
Hello deeemmbee, and welcome to the Greenbone Community Forum.
You don’t need to pass an environment variable to the GSA container to change the timeout. You can simply add an argument that speicifies the timeout when starting the gsad.service:
- Open a root shell in the gsa container (i.e.
docker exec -ti <ContainerID> bash
) - Change your directory to
/lib/systemd/system
(cd /lib/systemd/system
) - You may need to install an editor like nano or vim (
apt update && apt install nano
) - In the gsad.service file, append
--timeout=<TimeoutMinutes>
to the line that starts withExecStart
- Save and exit the file
- Restart the gsad service or the whole container, whatever is more convenient to you
More detailed information about the web frontend timeout can be found here.
EDIT: In case you want to see all the available options for the gsad service, you can simply run gsad --help
in the GSA container.
Thanks for the tip. The only issue I have with this method is that, every time I pull an updated container from the Docker repository, the changes will be overwritten an I’ll need to go and do this process again. I was hoping there might be a way to pass the variable in so that, when the container is updated, it doesn’t lose its configuration.
Unfortunately, I don’t know of any environment variable that GSA uses to set the timeout. It’s very much possible that I’m missing something here, so if any more experienced people read this, feel free to correct me.
Maybe you can configure your Docker setup so the gsad.service file will be stored in a persistent location?
If you are using our community containers including the compose file you can’t use or change the service file to adjust the gsad start parameters. Instead you can adjust the compose file to run a different command for starting gsad.
Bingo! That did it. I created a volume that I mounted to the container with a modified startup file in it. My gsa section now looks like this and it seems to be working just as expected. Thanks!
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 80:80
command:
- /persistent_data/start-gsad
volumes:
- gvmd_socket_vol:/run/gvmd
- /var/lib/docker/volumes/gce-persistent_data:/persistent_data
depends_on:
- gvmd
I would just like to add, that the correct way to accomplish this is to use the environment docker compose dirrective as so:
environment:
- GSAD_ARGS=--http-only --timeout=60
The method of doing so is a bit unfortunate though; once you use the GSAD_ARGS you automatically need to setup https (which I don’t want to do, since I am using nginx reverse proxy for SSL). So in order to force GSAD not to all of a sudden forcce https you need to add a second parametr “–http-only”.
Hope someone finds this useful. I’ve just spend 3+ hours searching for the info and debugging my setup. The Greenbone documentation is unfortunately not very helpful… So I had to piece the information together.
Could you explain what’s missing?
Because if you are looking at the source of the container image (gsad/.docker at main · greenbone/gsad · GitHub) you can easily find that at gsad/.docker/start-gsad.sh at main · greenbone/gsad · GitHub