Skip to content

[fix] Nginx config location admin/ allowed network list #519

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asmodehn
Copy link

@asmodehn asmodehn commented Jun 4, 2025

Unroll the allowed network list in location admin/, as explicited in nginx docs: https://nginx.org/en/docs/http/ngx_http_access_module.html

Also adds another openwisp2_admin_allowed_networks variable to keep openwisp2_admin_allowed_network for backward compatibility.

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #518, #481.

Description of Changes

This loop unrolls the value of the variable, to pass nginx config parser

  Unroll the allowed network list in location admin/
  as explicited in nginx docs
@asmodehn asmodehn marked this pull request as draft June 4, 2025 16:50
@asmodehn asmodehn marked this pull request as ready for review June 4, 2025 16:55
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @asmodehn, I think openwisp2_admin_allowed_networks need a default value ([], empty list) and needs to be mentioned in the README (we can remove the old variable to encourage new users to use this instead of the old one).

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.

[bug] multiple networks in openwisp2_admin_allowed_network breaks on debian bookworm
2 participants