Skip to content

Commit

Permalink
fix missing collabora online admin id error
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebot committed Dec 15, 2024
1 parent 79d2b8b commit 172a3bc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "smol_k8s_lab"
version = "5.20.1"
version = "5.20.2"
description = "CLI and TUI to quickly install slimmer Kubernetes distros and then manage apps declaratively using Argo CD"
authors = ["Jesse Hitch <[email protected]>",
"Max Roby <[email protected]>"]
Expand Down
25 changes: 22 additions & 3 deletions smol_k8s_lab/k8s_apps/social/nextcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def configure_nextcloud(argocd: ArgoCD,
restore_nextcloud(argocd,
nextcloud_hostname,
collabora_hostname,
collabora_user,
collabora_pass,
nextcloud_namespace,
cfg['argo'],
secrets,
Expand All @@ -218,12 +220,16 @@ def configure_nextcloud(argocd: ArgoCD,
refresh_bweso(argocd,
nextcloud_hostname,
collabora_hostname,
collabora_user,
collabora_pass,
bitwarden)


def restore_nextcloud(argocd: ArgoCD,
nextcloud_hostname: str,
collabora_hostname: str,
collabora_user: str,
collabora_pass: str,
nextcloud_namespace: str,
argo_dict: dict,
secrets: dict,
Expand Down Expand Up @@ -253,6 +259,8 @@ def restore_nextcloud(argocd: ArgoCD,
refresh_bweso(argocd,
nextcloud_hostname,
collabora_hostname,
collabora_user,
collabora_pass,
bitwarden)

# apply the external secrets so we can immediately use them for restores
Expand Down Expand Up @@ -490,6 +498,8 @@ def setup_bitwarden_items(argocd: ArgoCD,
def refresh_bweso(argocd: ArgoCD,
nextcloud_hostname: str,
collabora_hostname: str,
collabora_user: str,
collabora_pass: str,
bitwarden: BwCLI) -> None:
"""
if bitwarden and init are enabled, but app is already installed, make sure
Expand All @@ -505,9 +515,18 @@ def refresh_bweso(argocd: ArgoCD,
f"nextcloud-admin-credentials-{nextcloud_hostname}", False
)[0]['id']

collabora_admin_id = bitwarden.get_item(
f"collabora-admin-credentials-{collabora_hostname}"
)[0]['id']
try:
collabora_admin_id = bitwarden.get_item(
f"collabora-admin-credentials-{collabora_hostname}"
)[0]['id']
except TypeError:
# collabora admin credentials for initial owner user
collabora_admin_id = bitwarden.create_login(
name=f'collabora-admin-credentials-{collabora_hostname}',
item_url=collabora_hostname,
user=collabora_user,
password=collabora_pass
)

smtp_id = bitwarden.get_item(
f"nextcloud-smtp-credentials-{nextcloud_hostname}", False
Expand Down

0 comments on commit 172a3bc

Please sign in to comment.