requesty.ai autoreg: Clerk JWT -> HTTP apikey, key farm, OpenAI shim
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
import json, os, subprocess, sys, time
|
||||
BASE=r'C:/Users/User/tmp/requesty'
|
||||
KEY='/c/Users/User/.ssh/id_ed25519'
|
||||
BANK=BASE+'/bank.jsonl'
|
||||
rows=[]
|
||||
for l in open(BANK,encoding='utf-8'):
|
||||
l=l.strip()
|
||||
if not l: continue
|
||||
try: rows.append(json.loads(l))
|
||||
except Exception: pass
|
||||
keys=[]; seen=set()
|
||||
for r in rows:
|
||||
k=r.get('key')
|
||||
if not k or k in seen: continue
|
||||
if r.get('alive') is False: continue
|
||||
seen.add(k); keys.append({'key':k,'email':r.get('email','')})
|
||||
if not keys:
|
||||
print('no keys'); sys.exit(0)
|
||||
tmp=BASE+'/keys_push.json'
|
||||
json.dump(keys, open(tmp,'w'), indent=1)
|
||||
subprocess.run(['scp','-o','BatchMode=yes','-o','StrictHostKeyChecking=no','-i',KEY,tmp,'root@2.27.98.196:/opt/rq-shim/keys.json'],capture_output=True,timeout=90)
|
||||
r=subprocess.run(['ssh','-o','BatchMode=yes','-i',KEY,'root@2.27.98.196','systemctl restart rq-shim; sleep 2; curl -s -m 8 http://127.0.0.1:48120/health'],capture_output=True,timeout=120)
|
||||
print(r.stdout.decode('utf-8','ignore').strip()[:300])
|
||||
Reference in New Issue
Block a user