Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-linux-setup): post setup #4325

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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