mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Move resets before controller is instanciated.
This commit is contained in:
parent
3f3595acb4
commit
c8b8468030
19
main.py
19
main.py
@ -140,6 +140,14 @@ if __name__ == "__main__":
|
||||
installer.default_settings()
|
||||
else:
|
||||
Console.debug("Existing install detected")
|
||||
Console.info("Checking for reset secret flag")
|
||||
if helper.get_setting("reset_secrets_on_next_boot"):
|
||||
Console.info("Found Reset")
|
||||
management_helper.set_secret_api_key(str(helper.random_string_generator(64)))
|
||||
management_helper.set_cookie_secret(str(helper.random_string_generator(32)))
|
||||
helper.set_setting("reset_secrets_on_next_boot", False)
|
||||
else:
|
||||
Console.info("No flag found. Secrets are staying")
|
||||
file_helper = FileHelpers(helper)
|
||||
import_helper = ImportHelpers(helper, file_helper)
|
||||
# now the tables are created, we can load the tasks_manager and server controller
|
||||
@ -148,17 +156,6 @@ if __name__ == "__main__":
|
||||
controller.get_config_diff()
|
||||
Console.info("Remote change complete.")
|
||||
|
||||
Console.info("Checking for reset secret flag")
|
||||
if helper.get_setting("reset_secrets_on_next_boot"):
|
||||
Console.info("Found Reset")
|
||||
controller.management.set_crafty_api_key(
|
||||
str(helper.random_string_generator(64))
|
||||
)
|
||||
controller.management.set_cookie_secret(str(helper.random_string_generator(32)))
|
||||
helper.set_setting("reset_secrets_on_next_boot", False)
|
||||
else:
|
||||
Console.info("No flag found. Secrets are staying")
|
||||
|
||||
import3 = Import3(helper, controller)
|
||||
tasks_manager = TasksManager(helper, controller)
|
||||
tasks_manager.start_webserver()
|
||||
|
Loading…
Reference in New Issue
Block a user