Skip to content

Commit

Permalink
Fix postinstall in offline context
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Nov 27, 2024
1 parent 8c620a3 commit 2761186
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,15 @@ def app_ssowatconf():

# Will organize apps by portal domain
portal_domains_apps = {domain: {} for domain in portal_domains}
apps_catalog = _load_apps_catalog()["apps"]

# This check is to prevent an issue during postinstall if the catalog cant
# be initialized (because of offline postinstall) and it's not a big deal
# because there's no app yet (this is only used to get the default logo for
# the app
if os.path.exists("/etc/yunohost/installed"):
apps_catalog = _load_apps_catalog()["apps"]
else:
apps_catalog = {}

# New permission system
for perm_name, perm_info in all_permissions.items():
Expand Down
8 changes: 4 additions & 4 deletions src/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ def domain_main_domain(operation_logger, new_main_domain=None):
if os.path.exists("/etc/yunohost/installed"):
regen_conf()

from yunohost.user import _update_admins_group_aliases
from yunohost.user import _update_admins_group_aliases

_update_admins_group_aliases(
old_main_domain=old_main_domain, new_main_domain=new_main_domain
)
_update_admins_group_aliases(
old_main_domain=old_main_domain, new_main_domain=new_main_domain
)

logger.success(m18n.n("main_domain_changed"))

Expand Down
2 changes: 1 addition & 1 deletion src/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def tools_postinstall(
)
from yunohost.domain import domain_main_domain, domain_add
from yunohost.user import user_create, ADMIN_ALIASES
from yunohost.app import _ask_confirmation
from yunohost.app import _ask_confirmation, app_ssowatconf
from yunohost.app_catalog import _update_apps_catalog
from yunohost.firewall import firewall_upnp

Expand Down

0 comments on commit 2761186

Please sign in to comment.