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

Add allowed_networks config array #17

Merged
merged 2 commits into from
May 14, 2024

Conversation

NickBonet
Copy link
Contributor

Hi there,

I noticed while trying to use WebDeck on a device in a separate VLAN (192.168.20.x), it could not connect as the check_local_network function explicitly only allows remote IPs from the the local network that WebDeck is located on. (192.168.1.x)

I modified check_local_network such that it checks if the remote IP matches any networks in the allowed_networks array located in the config JSON. It is an optional config array (left it empty in config_default.json), but if it exists, the check function will see if the remote IP matches any of the allowed network entries in the array before returning a 403 on requests.

This allowed me to access WebDeck from my device in the VLAN mentioned above, once I added the VLAN network to the allowed_networks array. Example of the array's usage:

    "allowed_networks": [
        "192.168.20.0/24"
    ]

@Lenochxd
Copy link
Owner

Really cool! I will add a setting in the settings to add IPs easily in the next update. Thanks!

@Lenochxd Lenochxd merged commit df3f211 into Lenochxd:master May 14, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants