Restrict web admin to local network

Hello,

In another post, @snm wrote

Where can I find documentation for those parameters? What if I don’t want a list of IP addresses but a range? For exemple local network.

You can use the -h parameter to show a help message for a command, e.g.

$ yunohost settings -h
usage: yunohost settings {list,get,set,reset-all,reset} ... [-h]

Manage YunoHost global settings

optional arguments:
  -h, --help            show this help message and exit

actions:
  {list,get,set,reset-all,reset}
    list                list all entries of the settings
    get                 get an entry value in the settings
    set                 set an entry value in the settings
    reset-all           reset all settings to their default value
    reset               set an entry value to its default one

yunohost settings list shows some info for each entry of the settings:

...
security.webadmin.allowlist:                                                                                                                                                                  
  default:                                                                                                                                                                                    
  description: IP adresses allowed to access the webadmin. Comma-separated.                                                                                                                   
  type: string                                                                                                                                                                                
  value: 192.168.61.0/24                                                                                                                                                                      
security.webadmin.allowlist.enabled:                                                                                                                                                          
  default: False                                                                                                                                                                              
  description: Allow only some IPs to access the webadmin.
  type: bool
  value: True
...

To set an address range you can use the CIDR notation, e.g. 192.168.0.0/24 to allow the address range of 192.168.0.0 through 192.168.0.255.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.