Skip to content

Commit

Permalink
fix(jans-linux-setup): post setup (#4325)
Browse files Browse the repository at this point in the history
* fix(jans-cli-tui): post install setup

* feat(jans-linux-setup): install config-api plugin in post-setup
  • Loading branch information
devrimyatar authored Mar 27, 2023
1 parent a069890 commit b3ae222
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
21 changes: 12 additions & 9 deletions jans-linux-setup/jans_setup/setup_app/installers/config_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,26 @@ def install(self):
jettyServiceWebapps = os.path.join(self.jetty_base, self.service_name, 'webapps')
self.copyFile(self.source_files[0][0], jettyServiceWebapps)

self.copyFile(self.source_files[3][0], self.libDir)
user_mgt_plugin_path = os.path.join(self.libDir, os.path.basename(self.source_files[3][0]))
self.add_extra_class(user_mgt_plugin_path)
self.install_plugin('user-mgt-plugin')

if Config.install_scim_server:
self.copyFile(self.source_files[2][0], self.libDir)
scim_plugin_path = os.path.join(self.libDir, os.path.basename(self.source_files[2][0]))
self.add_extra_class(scim_plugin_path)
self.install_plugin('scim-plugin')

if Config.installFido2:
self.copyFile(self.source_files[4][0], self.libDir)
fido2_plugin_path = os.path.join(self.libDir, os.path.basename(self.source_files[4][0]))
self.add_extra_class(fido2_plugin_path)
self.install_plugin('fido2-plugin')

self.enable()


def install_plugin(self, plugin):
for source_file in self.source_files:
if plugin in source_file[0]:
self.logIt("Installing Jans Config Api Plugin {}".format(plugin))
self.copyFile(source_file[0], self.libDir)
plugin_path = os.path.join(self.libDir, os.path.basename(source_file[0]))
self.add_extra_class(plugin_path)
break

def extract_files(self):
base.extract_file(base.current_app.jans_zip, 'jans-config-api/server/src/main/resources/log4j2.xml', self.custom_config_dir)
base.extract_file(base.current_app.jans_zip, 'jans-config-api/docs/jans-config-api-swagger.yaml', Config.data_dir)
Expand Down
4 changes: 4 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/installers/fido.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def install(self):
self.logIt("Copying fido.war into jetty webapps folder...")
jettyServiceWebapps = os.path.join(self.jetty_base, self.service_name, 'webapps')
self.copyFile(self.source_files[0][0], jettyServiceWebapps)

if Config.installed_instance and Config.install_config_api:
base.current_app.ConfigApiInstaller.install_plugin('fido2-plugin')

self.enable()

def render_import_templates(self):
Expand Down
4 changes: 4 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/installers/scim.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def install(self):
self.installJettyService(self.jetty_app_configuration[self.service_name], True)
jettyServiceWebapps = os.path.join(self.jetty_base, self.service_name, 'webapps')
self.copyFile(self.source_files[0][0], jettyServiceWebapps)

if Config.installed_instance and Config.install_config_api:
base.current_app.ConfigApiInstaller.install_plugin('scim-plugin')

self.enable()


Expand Down
19 changes: 11 additions & 8 deletions jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ def prompt_for_rdbm(self):


def prompt_for_backend(self):
if Config.installed_instance:
return

print('Chose Backend Type:')

backend_types = [
Expand Down Expand Up @@ -918,16 +921,16 @@ def promptForProperties(self):
Config.jans_max_mem = self.getPrompt("Enter maximum RAM for applications in MB", str(Config.jans_max_mem))


admin_password = Config.ldapPass or Config.cb_password or Config.rdbm_password or self.getPW(special='.*=!%&+/-')
admin_password = Config.ldapPass or Config.cb_password or Config.rdbm_password or self.getPW(special='.*=!%&+/-')

while True:
adminPass = self.getPrompt("Enter Password for Admin User", admin_password)
if len(adminPass) > 3:
break
else:
print("Admin password should be at least four characters in length.")
while True:
adminPass = self.getPrompt("Enter Password for Admin User", admin_password)
if len(adminPass) > 3:
break
else:
print("Admin password should be at least four characters in length.")

Config.admin_password = adminPass
Config.admin_password = adminPass

if Config.profile == 'openbanking':
self.openbanking_properties()
Expand Down

0 comments on commit b3ae222

Please sign in to comment.