MCPcopy Index your code
hub / github.com/masterking32/MasterHttpRelayVPN / main

Function main

setup.py:162–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161
162def main() -> int:
163 print()
164 print(bold("MasterHttpRelayVPN - setup wizard"))
165 print(dim("Answer a few questions and we'll write config.json for you."))
166
167 if CONFIG_PATH.exists():
168 if not prompt_yes_no("config.json already exists. Overwrite?", default=False):
169 print(dim("Nothing changed."))
170 return 0
171
172 cfg = load_base_config()
173
174 suggested_key = random_auth_key()
175 print()
176 print(bold("Shared password (auth_key)"))
177 print(dim(" Must match AUTH_KEY inside apps_script/Code.gs."))
178 cfg["auth_key"] = prompt("auth_key", default=suggested_key)
179
180 cfg = configure_apps_script(cfg)
181 cfg = configure_network(cfg)
182
183 write_config(cfg)
184
185 print()
186 print(green(f"[OK] wrote {CONFIG_PATH.name}"))
187 print()
188 print(bold("Next step:"))
189 print(f" python main.py")
190 print()
191 print(yellow("Reminder: the AUTH_KEY inside apps_script/Code.gs must match the auth_key"))
192 print(yellow("you just entered - otherwise the relay will return 'unauthorized'."))
193 return 0
194
195
196if __name__ == "__main__":

Callers 1

setup.pyFile · 0.70

Calls 11

boldFunction · 0.85
dimFunction · 0.85
prompt_yes_noFunction · 0.85
load_base_configFunction · 0.85
random_auth_keyFunction · 0.85
promptFunction · 0.85
configure_apps_scriptFunction · 0.85
configure_networkFunction · 0.85
write_configFunction · 0.85
greenFunction · 0.85
yellowFunction · 0.85

Tested by

no test coverage detected