However it’s not so simple for docker as we cannot modify systemctl as it’s not a service. I was trying to play with MTA setup and setting a size, but it’s not an option here:
- MTA_SIZE=10048576
I’m just wondering if there is a way to make it. Any help would be appreciated.
I think you can implement the previous solution you referenced by downloading gvmd and adjusting the start_gvmd.sh file, and using that rather than the image hosted on DockerHub:
In order the change the attachment size, command line arguments must be added to the gvmd process, there is a no mechanism within the current docker file to add these. gvmd is started in the container with the following script, /usr/local/bin/start-gvmd. What I do is run a cron job on a regular interval to make sure the new command line arguments are running with gvmd and if not, as in the case of a new pull, I re-apply those settings. Here is my hacky script that I run by cron job. I hope it helps.
#!/bin/bash
# Do not run if openvas processes are running, try again at the next cron interval
if pgrep -f "testing" > /dev/null; then
exit;
fi
# if a this process isn't running perform the following actions
if ! pgrep -f "max-email" > /dev/null; then
mv -f ~/start-gvmd ~/start-gvmd,saveold
# Get original start-gvmd from the container
docker cp greenbone-community-edition-gvmd-1:/usr/local/bin/start-gvmd ~/start-gvmd
# add the command line args needed
cat ~/start-gvmd | sed 's/"--listen-mode=666"/\"--listen-mode=666 --max-email-attachment-size='-1' --max-email-include-size='-1' --max-email-message-size='-1'"/g' > ~/start-gvmd,updated
# copy the start-gvmd back to the container
docker cp ~/start-gvmd,updated greenbone-community-edition-gvmd-1:/usr/local/bin/start-gvmd
# make the start-gvmd executable
docker compose -f ~/greenbone-community-container/docker-compose.yml -p greenbone-community-edition exec gvmd /bin/bash -c "chmod 755 /usr/local/bin/start-gvmd"
# restart the gvmd container
docker compose -f ~/greenbone-community-container/docker-compose.yml -p greenbone-community-edition restart gvmd
fi
Please clarify the processes you are checking “testing” and “max-email”?
apologies if its a dumb question.
I have a cronjob that updates the feeds every few days to keep it current and will revert any changes am thinking this is the testing process you are checking?
Also the max-email is this process run by this script?