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

Database file path incorrect #75

Open
rama31244 opened this issue Dec 24, 2023 · 2 comments
Open

Database file path incorrect #75

rama31244 opened this issue Dec 24, 2023 · 2 comments

Comments

@rama31244
Copy link

Hi, I attempted to install this plugin to my traefik docker container but it can't locate the database since the path is incorrect. I attempted to correct the path but the location of the database on my container seems to be dynamic and changes every restart:

/plugins-storage/sources/gop-**********/src/github.com/nscuro/traefik-plugin-geoblock

The value after gop- seems to be a random 10 digit number that changes when restarting the container. How can I correct this? Can i copy out the database to another static folder on the docker container? Or does this database change periodically?

@nscuro
Copy link
Owner

nscuro commented Jan 13, 2024

Hey @rama31244, this seems to be a somewhat recent behavior change in how plugins are installed by traefik.

I personally install plugins in local mode (see https://plugins.traefik.io/install), which avoids this problem.

Can i copy out the database to another static folder on the docker container?

Yes, you can change the database file path to a location of your choice:

# databaseFilePath: IP2LOCATION-LITE-DB1.IPV6.BIN

Or does this database change periodically?

I try to keep the bundled database updated in with each plugin release. So yes, if you specify a custom database file path, you'd need to keep it updated on your own. This is easily to automate however, perhaps the dbdownload script I'm using can help as inspiration:

https://github.com/nscuro/traefik-plugin-geoblock/blob/main/tools/dbdownload/main.go

@kopaygorodsky
Copy link

Same happened for me today. Installed plugin as via helm chart traefik config

additionalArguments:
- --experimental.plugins.traefik-plugin-geoblock.modulename=github.com/nscuro/traefik-plugin-geoblock
- --experimental.plugins.traefik-plugin-geoblock.version=v0.14.0
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
    name: traefik-plugin-geoblock
spec:
    plugin:
        traefik-plugin-geoblock:
            enabled: true
            allowedCountries: [ "FR" ]
            # Blocklist of countries to block (ISO 3166-1 alpha-2)
            blockedCountries: [ "RU" ]
            defaultAllow: false
            disallowedStatusCode: 400
            databaseFilePath: /plugins-local/src/github.com/nscuro/traefik-plugin-geoblock/IP2LOCATION-LITE-DB1.IPV6.BIN

Same error, no "plugins-local" folder. Maybe it can read database as relative path ?

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

3 participants