MCPcopy Create free account
hub / github.com/ambianic/peerfetch / _loadConfig

Function _loadConfig

python/src/peerfetch/proxy.py:104–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 savedPeerId = None
103
104def _loadConfig():
105 logger.info('Loading configuration')
106 global config
107 conf_file = Path(CONFIG_FILE)
108 exists = conf_file.exists()
109 if exists:
110 logger.info(f'Loading config from: {conf_file}')
111 with conf_file.open() as infile:
112 config = yaml.load(infile, Loader=yaml.SafeLoader)
113 else:
114 logger.info(f'Config file not found: {conf_file}')
115 # Set defaults
116 if config is None:
117 config = {}
118 if "signaling_server" not in config.keys():
119 config["signaling_server"] = AMBIANIC_PNP_HOST
120 if "port" not in config.keys():
121 config["port"] = AMBIANIC_PNP_PORT
122 if "secure" not in config.keys():
123 config["secure"] = AMBIANIC_PNP_SECURE
124 if "ice_servers" not in config.keys():
125 config["ice_servers"] = default_ice_servers
126
127 return exists
128
129
130def _saveConfig():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected