feat(nodes): exclude small XrayR hosts and use registered credential fields
This commit is contained in:
1 parent
4d667f37b2
commit
d331f45b0e
9 files changed
+117
-3
No files matched your search
@@ -19,6 +19,15 @@ def private_json(path):
|
||||
|
||||
|
||||
def credentials(spec):
|
||||
if spec.get('credential_format') == 'gemdocs-resource':
|
||||
import importlib.util,sys
|
||||
root=Path('/Users/hellcat/Documents/GemDocs/AI版')
|
||||
resource=spec.get('credential_resource','')
|
||||
if not re.fullmatch(r'VPS-[0-9]{3}',resource):raise ValueError('Exact GemDocs VPS resource required')
|
||||
if str(root/'tools') not in sys.path:sys.path.insert(0,str(root/'tools'))
|
||||
module_spec=importlib.util.spec_from_file_location('gemdocs_credentials',root/'tools/credentials.py')
|
||||
module=importlib.util.module_from_spec(module_spec);module_spec.loader.exec_module(module)
|
||||
return {'password':module.get_field(root,resource,'password')}
|
||||
if not spec.get('credential_ref'):return {}
|
||||
if spec.get('credential_format','json')=='json':return private_json(spec['credential_ref'])
|
||||
if spec['credential_format']=='codocs-password':
|
||||
|
||||
Reference in new issue
Block a user