MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / run_settings_menu

Function run_settings_menu

Scripts/Settings.py:7960–7971  ·  view source on GitHub ↗

Main settings menu that uses the current menu style

()

Source from the content-addressed store, hash-verified

7958 for candidate in get_jobs(include_closed=True):
7959 if candidate.get('running') and candidate.get('program_id') == entry['id'] and int(candidate.get('web_port') or 0) == port:
7960 existing = candidate; break
7961 if existing is None:
7962 raise RuntimeError('Port %d is already in use by another process. Stop it or change the app port before launching %s.' % (port, entry['name']))
7963 if existing is not None: return existing
7964 service_secret = secrets.token_urlsafe(18)
7965 auth_mode = str(entry.get('browser_auth') or 'loopback-only')
7966 command = str(shell_command).replace('{DEDSEC_PASSWORD}', shlex.quote(service_secret)).replace('{DEDSEC_TOKEN}', service_secret)
7967 web_url = str(entry.get('web_url') or ''); web_username = str(entry.get('web_username') or '')
7968 if auth_mode == 'query-token' and web_url:
7969 web_url += ('&' if '?' in web_url else '?') + 'token=' + urllib.parse.quote(service_secret, safe='')
7970 elif auth_mode == 'basic' and web_url:
7971 parsed = urllib.parse.urlsplit(web_url); user = urllib.parse.quote(web_username or 'dedsec', safe=''); password = urllib.parse.quote(service_secret, safe=''); host = parsed.hostname or '127.0.0.1'
7972 if parsed.port: host += ':' + str(parsed.port)
7973 web_url = urllib.parse.urlunsplit((parsed.scheme, user + ':' + password + '@' + host, parsed.path, parsed.query, parsed.fragment))
7974 job = launch_job(label='Web app: ' + entry['name'], shell_command=command, cwd=HOME_DIR, kind='web-service', prefer_termux=False)

Callers 1

mainFunction · 0.70

Calls 4

get_current_menu_styleFunction · 0.70
run_settings_grid_menuFunction · 0.70
run_settings_number_menuFunction · 0.70
run_settings_list_menuFunction · 0.70

Tested by

no test coverage detected