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

Feature: Support proxy in entrypoint for freshclam #19

Open
asteel-gsa opened this issue May 9, 2023 · 1 comment
Open

Feature: Support proxy in entrypoint for freshclam #19

asteel-gsa opened this issue May 9, 2023 · 1 comment

Comments

@asteel-gsa
Copy link

asteel-gsa commented May 9, 2023

Referencing an open item we would like to modify the entrypoint.sh to pass proxy information into freshclam.conf

Files to modify:
entrypoint.sh

Description:
Following the pattern present in entrypoint.sh we would like to add a conditional to support an environment variable being set of $PROXY_SERVER. If the environment variables are set for $PROXY_PORT that can also be set, along with $PROXY_USERNAME and $PROXY_PASSWORD for the following items in freshclam.conf:

#HTTPProxyServer https://proxy.example.com
#HTTPProxyPort 1234
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass
if [ -n "$PROXY_SERVER" ]; then
    sed -i 's~^#HTTPProxyServer .*~HTTPProxyServer '"$PROXY_SERVER"'~g' /etc/clamav/freshclam.conf

    # It's not required, but if they also provided a port, then configure it
    if [ -n "$PROXY_PORT" ]; then
        sed -i 's/^#HTTPProxyPort .*$/HTTPProxyPort '"$PROXY_PORT"'/g' /etc/clamav/freshclam.conf
    fi

    # It's not required, but if they also provided a username, then configure both the username and password
    if [ -n "$PROXY_USERNAME" ]; then
        sed -i 's/^#HTTPProxyUsername .*$/HTTPProxyUsername '"$PROXY_USERNAME"'/g' /etc/clamav/freshclam.conf
        sed -i 's~^#HTTPProxyPassword .*~HTTPProxyPassword '"$PROXY_PASSWORD"'~g' /etc/clamav/freshclam.conf
    fi
fi
@mogul
Copy link

mogul commented May 10, 2023

@rhermanek if you're available to review/merge the PR, we'd appreciate it! We'd rather not maintain a fork of the image if we can help it.

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

2 participants