generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the jar plugin as encrypted file inside the module image. The plugin is decrypted when the cluster has a valid subscription. Subscribe also to subscription-change event to adapt the environment.
- Loading branch information
1 parent
7700a11
commit e259e9b
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# | ||
# Copyright (C) 2025 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
import agent | ||
import subprocess | ||
|
||
rdb = agent.redis_connect(privileged=False) | ||
|
||
subscription = rdb.hgetall('cluster/subscription') | ||
|
||
with open('subscription.env', 'w') as env: | ||
if subscription: | ||
env.write(f'VALID_SUBSCRIPTION=true\n') | ||
env.write("TMCE_PLUGIN=--volume=./webtop-tmceplugins.jar:/usr/local/tomcat/webapps/webtop/WEB-INF/lib/webtop-tmceplugins.jar:z\n") | ||
subprocess.run(['gpg', '--batch', '--yes', '--passphrase', 'subscription', '-d', '-o', 'webtop-tmceplugins.jar', '../plugins/webtop-tmceplugins.jar.gpg']) | ||
else: | ||
env.write(f'VALID_SUBSCRIPTION=false\n') | ||
env.write(f"TMCE_PLUGIN=--volume=../plugins/webtop-tmceplugins.jar.gpg:/usr/local/tomcat/webapps/webtop/WEB-INF/lib/webtop-tmceplugins.jar.gpg:z\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../actions/configure-module/30subscription |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2025 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
systemctl --user restart webapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters