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

Configurable allowed IP / rate limit header #38

Closed
bjarneo opened this issue Oct 2, 2021 · 1 comment
Closed

Configurable allowed IP / rate limit header #38

bjarneo opened this issue Oct 2, 2021 · 1 comment

Comments

@bjarneo
Copy link
Member

bjarneo commented Oct 2, 2021

So, currently the only support for this repository is the "do-connecting-ip" header for digital ocean to fetch the user IP. However, if people self host, they most likely do not have this header.

To do:
Rewrite this part of the code to accept a string from a ENV var injected to the docker container to decide what header to look for. https://github.com/HemmeligOrg/Hemmelig.app/blob/main/src/server/decorators/allowed-ip.js#L15
Set the default header to "do-connecting-ip".

Note, update this code as well: https://github.com/HemmeligOrg/Hemmelig.app/blob/main/src/server/decorators/rate-limit.js#L21

@bjarneo bjarneo changed the title Configurable allowed IP header Configurable allowed IP / rate limit header Oct 2, 2021
@bjarneo
Copy link
Member Author

bjarneo commented Nov 3, 2021

Switch logic for this. Currently it checks an array if the header exists, and if it does, use that header. See connected PR.

@bjarneo bjarneo closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant