mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-05 23:54:19 +00:00
Fix migration to run
This commit is contained in:
parent
d7fe7097e6
commit
fe86382819
|
@ -1,7 +1,8 @@
|
|||
from selfprivacy_api.utils import ReadUserData
|
||||
from selfprivacy_api.migrations.fix_nixos_config_branch import FixNixosConfigBranch
|
||||
from selfprivacy_api.migrations.create_tokens_json import CreateTokensJson
|
||||
|
||||
migrations = [FixNixosConfigBranch()]
|
||||
migrations = [FixNixosConfigBranch(), CreateTokensJson()]
|
||||
|
||||
|
||||
def run_migrations():
|
||||
|
|
|
@ -35,7 +35,8 @@ class CreateTokensJson(Migration):
|
|||
|
||||
def migrate(self):
|
||||
try:
|
||||
with ReadUserData(USERDATA_FILE) as userdata:
|
||||
print(f"Creating tokens.json file at {TOKENS_FILE}")
|
||||
with ReadUserData() as userdata:
|
||||
token = userdata["api"]["token"]
|
||||
# Touch tokens.json with 0600 permissions
|
||||
Path(TOKENS_FILE).touch(mode=0o600)
|
||||
|
|
Loading…
Reference in a new issue