fix: the shell runs as the console account of each member of admins, a local account or the user's own POSIX account in the directory, which also signs in with SSH and sudo, instead of one web.shell_user.
Release / release (push) Successful in 28s
Release / release (push) Successful in 28s
This commit is contained in:
1 parent
2e1eb89f52
commit
ec93bc6a2d
12 files changed
+432
-51
No files matched your search
@@ -52,7 +52,8 @@ SCHEMA = {
|
||||
'openvpn': {'enabled': False, 'address_pool': '', 'port': 1194, 'protocol': 'udp'},
|
||||
'docker': {'mode': 'auto', 'exposed_ports': []},
|
||||
'web': {'enabled': True, 'listen': DEFAULT_LISTEN, 'port': 7081, 'database': '', 'trusted_proxies': [],
|
||||
'status_content': 'basic', 'shell': False, 'shell_user': '', 'shell_idle_minutes': 15},
|
||||
'status_content': 'basic', 'shell': False, 'shell_idle_minutes': 15},
|
||||
'ssh': {'ldap_login': False},
|
||||
'https': {'enabled': True, 'email': '', 'web_port': 7444, 'manager_port': 7443, 'caddy_source': 'ubuntu'},
|
||||
'pki': {'root_name': 'VPN Router Root CA', 'root_days': 7300, 'ca_days': 3650, 'key': 'rsa-4096',
|
||||
'crl_days': 7, 'root_crl_days': 180, 'publish': ['http'], 'p2s_name': 'VPN Router P2S CA',
|
||||
@@ -194,9 +195,6 @@ CA_NAME_MAX = 64
|
||||
#: What / and /status of the web service show, web.status_content, from the least to the most.
|
||||
STATUS_CONTENTS = ('basic', 'standard', 'full')
|
||||
|
||||
#: A system user the shell of the web service runs as, web.shell_user; root is refused.
|
||||
SHELL_USER = re.compile(r'^[a-z_][a-z0-9_-]{0,31}$')
|
||||
|
||||
#: The longest web.shell_idle_minutes, a day.
|
||||
SHELL_IDLE_MAX = 1440
|
||||
|
||||
@@ -483,11 +481,6 @@ def validate(cfg):
|
||||
raise ConfigError(
|
||||
f'web.status_content: {status_content!r} is not one of {", ".join(STATUS_CONTENTS)}')
|
||||
|
||||
shell_user = _get(cfg, 'web', 'shell_user')
|
||||
if shell_user and (not SHELL_USER.match(shell_user) or shell_user == 'root'):
|
||||
raise ConfigError(f'web.shell_user: {shell_user!r} is not a system user name other than root')
|
||||
if _get(cfg, 'web', 'shell') and not shell_user:
|
||||
raise ConfigError('web.shell needs web.shell_user, the system user the shell runs as')
|
||||
shell_idle = _get(cfg, 'web', 'shell_idle_minutes')
|
||||
if not 1 <= shell_idle <= SHELL_IDLE_MAX:
|
||||
raise ConfigError(f'web.shell_idle_minutes: {shell_idle} is not between 1 and {SHELL_IDLE_MAX}')
|
||||
|
||||
Reference in new issue
Block a user