Browse Source

Add migration script for backends prior to 1.3.3

tags/1.3.3
Leonie 5 months ago
parent
commit
b87e3ba99b
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      migrate.py

+ 13
- 0
migrate.py View File

@@ -0,0 +1,13 @@
#!/usr/bin/python3
import os
import redis

files = os.listdir("authtokens/")
r = redis.StrictRedis(host='localhost', port=6379, db=0)

for f in files:
os.rename("authtokens/"+f, "authtokens/"+f.replace(".secret", ".koyu.space.secret"))
uuid = str(r.get("nordcast/uuids/" + f.replace(".secret", ""))).replace("b'", "").replace("'", "")
r.set("nordcast/uuids/" + f.replace(".secret", "") + "$$koyu.space", uuid)
podlist = str(r.get("nordcast/podlist/" + f.replace(".secret", ""))).replace("b'", "").replace("'", "")
r.set("nordcast/podlist/" + f.replace(".secret", "") + "$$koyu.space", podlist)

Loading…
Cancel
Save