diff --git a/jans-linux-setup/install.py b/jans-linux-setup/install.py index a560b1377cd..89cb8f7f993 100644 --- a/jans-linux-setup/install.py +++ b/jans-linux-setup/install.py @@ -24,8 +24,6 @@ "JYTHON_VERSION": "2.7.3", "OPENDJ_VERSION": "4.4.12", "SETUP_BRANCH": "main", - "ADMIN_UI_FRONTEND_BRANCH": "main", - "NODE_VERSION": "v14.18.2" } jans_dir = '/opt/jans' @@ -50,6 +48,7 @@ parser.add_argument('--jans-app-version', help="Version for Jannses applications") parser.add_argument('--jans-build', help="Buid version for Janssen applications") parser.add_argument('--setup-branch', help="Jannsen setup github branch") +parser.add_argument('--no-setup', help="Do not launch setup", action='store_true') if '-a' in sys.argv: parser.add_argument('--jetty-version', help="Jetty verison. For example 11.0.6") @@ -99,7 +98,7 @@ print("Can't continue...") sys.exit() -os.system('{} install -y {}'.format(package_installer, ' '.join(package_dependencies))) + os.system('{} install -y {}'.format(package_installer, ' '.join(package_dependencies))) def extract_subdir(zip_fn, sub_dir, target_dir, zipf=None): @@ -221,7 +220,6 @@ def download_gcs(): download('https://corretto.aws/downloads/resources/{0}/amazon-corretto-{0}-linux-x64.tar.gz'.format(app_versions['AMAZON_CORRETTO_VERSION']), os.path.join(app_dir, 'amazon-corretto-{0}-linux-x64.tar.gz'.format(app_versions['AMAZON_CORRETTO_VERSION']))) download('https://repo1.maven.org/maven2/org/eclipse/jetty/{1}/{0}/{1}-{0}.tar.gz'.format(app_versions['JETTY_VERSION'], jetty_dist_string), os.path.join(app_dir,'{1}-{0}.tar.gz'.format(app_versions['JETTY_VERSION'], jetty_dist_string))) download('https://maven.gluu.org/maven/org/gluufederation/jython-installer/{0}/jython-installer-{0}.jar'.format(app_versions['JYTHON_VERSION']), os.path.join(app_dir, 'jython-installer-{0}.jar'.format(app_versions['JYTHON_VERSION']))) - download('https://nodejs.org/dist/{0}/node-{0}-linux-x64.tar.xz'.format(app_versions['NODE_VERSION']), os.path.join(app_dir, 'node-{0}-linux-x64.tar.xz'.format(app_versions['NODE_VERSION']))) download(urljoin(maven_base_url, 'jans-auth-server/{0}{1}/jans-auth-server-{0}{1}.war'.format(app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])), os.path.join(jans_app_dir, 'jans-auth.war')) download(urljoin(maven_base_url, 'jans-auth-client/{0}{1}/jans-auth-client-{0}{1}-jar-with-dependencies.jar'.format(app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])), os.path.join(jans_app_dir, 'jans-auth-client-jar-with-dependencies.jar')) download(urljoin(maven_base_url, 'jans-config-api-server/{0}{1}/jans-config-api-server-{0}{1}.war'.format(app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])), os.path.join(jans_app_dir, 'jans-config-api.war')) @@ -229,9 +227,8 @@ def download_gcs(): download(urljoin(maven_base_url, 'scim-plugin/{0}{1}/scim-plugin-{0}{1}-distribution.jar'.format(app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])), os.path.join(jans_app_dir, 'scim-plugin.jar')) download('https://ox.gluu.org/icrby8xcvbcv/cli-swagger/jca.tgz', os.path.join(jans_app_dir, 'jca-swagger-client.tgz')) download('https://ox.gluu.org/icrby8xcvbcv/cli-swagger/scim.tgz', os.path.join(jans_app_dir, 'scim-swagger-client.tgz')) - download(urljoin(maven_base_url, 'admin-ui-plugin/{0}{1}/admin-ui-plugin-{0}{1}-distribution.jar'.format(app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])), os.path.join(jans_app_dir, 'admin-ui-plugin-distribution.jar')) - download('https://github.com/GluuFederation/gluu-admin-ui/archive/refs/heads/{}.zip'.format(app_versions['ADMIN_UI_FRONTEND_BRANCH']), os.path.join(jans_app_dir, 'gluu-admin-ui.zip')) download('https://raw.githubusercontent.com/GluuFederation/gluu-snap/master/facter/facter', os.path.join(jans_app_dir, 'facter')) + download('https://github.com/jpadilla/pyjwt/archive/refs/tags/2.3.0.zip', os.path.join(app_dir, 'pyjwt.zip')) if argsp.profile == 'jans': download('https://maven.gluu.org/maven/org/gluufederation/opendj/opendj-server-legacy/{0}/opendj-server-legacy-{0}.zip'.format(app_versions['OPENDJ_VERSION']), os.path.join(app_dir, 'opendj-server-legacy-{0}.zip'.format(app_versions['OPENDJ_VERSION']))) @@ -348,7 +345,7 @@ def profile_setup(): print("Stopping OpenDj Server") os.system('/opt/opendj/bin/stop-ds') - remove_list = ['/etc/certs', '/etc/jans', '/opt/jans', '/opt/amazon-corretto*', '/opt/node*', '/opt/jre', '/opt/jetty*', '/opt/jython*'] + remove_list = ['/etc/certs', '/etc/jans', '/opt/jans', '/opt/amazon-corretto*', '/opt/jre', '/opt/jetty*', '/opt/jython*'] if argsp.profile == 'jans': remove_list.append('/opt/opendj') if not argsp.keep_downloads: @@ -377,16 +374,16 @@ def profile_setup(): profile_setup() extract_file(jans_zip_file, 'jans-config-api/server/src/main/resources/log4j2.xml', jans_app_dir) - extract_file(jans_zip_file, 'jans-config-api/plugins/admin-ui-plugin/config/log4j2-adminui.xml', jans_app_dir) print("Preparing jans-cli package") extract_subdir(jans_zip_file, 'jans-cli', 'jans-cli', os.path.join(jans_app_dir, 'jans-cli.zip')) - print("Launching Janssen Setup") + if not argsp.no_setup: + print("Launching Janssen Setup") - setup_cmd = 'python3 {}/setup.py'.format(setup_dir) + setup_cmd = 'python3 {}/setup.py'.format(setup_dir) - if argsp.args: - setup_cmd += ' ' + argsp.args + if argsp.args: + setup_cmd += ' ' + argsp.args - os.system(setup_cmd) + os.system(setup_cmd) diff --git a/jans-linux-setup/setup.py b/jans-linux-setup/setup.py index e5d91091e34..7d27cc552d9 100755 --- a/jans-linux-setup/setup.py +++ b/jans-linux-setup/setup.py @@ -55,7 +55,6 @@ from setup_app.installers.jre import JreInstaller from setup_app.installers.jetty import JettyInstaller from setup_app.installers.jython import JythonInstaller -from setup_app.installers.node import NodeInstaller from setup_app.installers.jans_auth import JansAuthInstaller if Config.profile == 'jans': @@ -156,7 +155,6 @@ jreInstaller = JreInstaller() jettyInstaller = JettyInstaller() jythonInstaller = JythonInstaller() -nodeInstaller = NodeInstaller() if Config.profile == 'jans': openDjInstaller = OpenDjInstaller() @@ -270,8 +268,6 @@ def do_installation(): jreInstaller.start_installation() jettyInstaller.start_installation() jythonInstaller.start_installation() - if Config.installAdminUI: - nodeInstaller.start_installation() jansInstaller.copy_scripts() jansInstaller.encode_passwords() diff --git a/jans-linux-setup/setup_app/config.py b/jans-linux-setup/setup_app/config.py index deb9ef8b868..56f5f168c47 100644 --- a/jans-linux-setup/setup_app/config.py +++ b/jans-linux-setup/setup_app/config.py @@ -23,7 +23,6 @@ class Config: etc_hostname = '/etc/hostname' osDefault = '/etc/default' sysemProfile = '/etc/profile' - node_home = '/opt/node' jython_home = '/opt/jython' ldapBaseFolder = '/opt/opendj' network = '/etc/sysconfig/network' @@ -171,7 +170,6 @@ def progress(self, service_name, msg, incr=False): self.installJans = True self.installJre = True self.installJetty = True - self.installNode = False self.installJython = True self.installOxAuth = True self.installOxTrust = True @@ -189,7 +187,6 @@ def progress(self, service_name, msg, incr=False): self.installJansCli = False self.loadTestData = False self.allowPreReleasedFeatures = False - self.installAdminUI = False # backward compatibility self.os_type = base.os_type diff --git a/jans-linux-setup/setup_app/installers/config_api.py b/jans-linux-setup/setup_app/installers/config_api.py index 8ac628b6e4a..abd64616f38 100644 --- a/jans-linux-setup/setup_app/installers/config_api.py +++ b/jans-linux-setup/setup_app/installers/config_api.py @@ -38,20 +38,15 @@ def __init__(self): self.load_ldif_files = [self.config_ldif_fn, self.scope_ldif_fn] self.libDir = os.path.join(self.jetty_base, self.service_name, 'custom/libs/') self.custom_config_dir = os.path.join(self.jetty_base, self.service_name, 'custom/config') - self.admin_ui_config_properties = os.path.join(self.output_folder, 'auiConfiguration.properties') self.source_files = [ (os.path.join(Config.distJansFolder, 'jans-config-api.war'), 'https://maven.jans.io/maven/io/jans/jans-config-api-server/{0}/jans-config-api-server-{0}.war'.format(Config.oxVersion)), (os.path.join(Config.distJansFolder, 'scim-plugin.jar'), 'https://maven.jans.io/maven/io/jans/scim-plugin/{0}/scim-plugin-{0}-distribution.jar'.format(Config.oxVersion)), - (os.path.join(Config.distJansFolder, 'admin-ui-plugin-distribution.jar'), 'https://maven.jans.io/maven/io/jans/admin-ui-plugin/{0}/admin-ui-plugin-{0}-distribution.jar'.format(Config.oxVersion)), - (os.path.join(Config.distJansFolder, 'log4j2.xml'), 'https://raw.githubusercontent.com/JanssenProject/jans-config-api/master/server/src/main/resources/log4j2.xml'), - (os.path.join(Config.distJansFolder, 'log4j2-adminui.xml'), 'https://raw.githubusercontent.com/JanssenProject/jans-config-api/master/plugins/admin-ui-plugin/config/log4j2-adminui.xml'), - (os.path.join(Config.distJansFolder, 'gluu-admin-ui.zip'), 'https://github.com/GluuFederation/gluu-admin-ui/archive/refs/heads/main.zip'), (os.path.join(Config.distJansFolder, 'facter'), 'https://raw.githubusercontent.com/GluuFederation/gluu-snap/master/facter/facter'), ] def install(self): - self.copyFile(self.source_files[6][0], '/usr/sbin') + self.copyFile(self.source_files[2][0], '/usr/sbin') self.run([paths.cmd_chmod, '+x', '/usr/sbin/facter']) self.installJettyService(self.jetty_app_configuration[self.service_name], True) self.logIt("Copying fido.war into jetty webapps folder...") @@ -61,8 +56,6 @@ def install(self): self.copyFile(self.source_files[1][0], self.libDir) scim_plugin_path = os.path.join(self.libDir, os.path.basename(self.source_files[1][0])) self.add_extra_class(scim_plugin_path) - if Config.installAdminUI: - self.install_admin_ui_frontend() self.enable() def installed(self): @@ -244,35 +237,3 @@ def load_test_data(self): self.writeFile(out_fn, rendered_text) self.dbUtils.import_ldif([out_fn]) - def service_post_setup(self): - if Config.installAdminUI: - self.logIt("Installing Jans Admin UI", pbar=self.service_name) - self.check_clients([('role_based_client_id', '2000.')]) - self.renderTemplateInOut(self.admin_ui_config_properties, self.templates_folder, self.output_folder) - self.copyFile(self.source_files[2][0], self.libDir) - admin_ui_plugin_path = os.path.join(self.libDir, os.path.basename(self.source_files[2][0])) - self.add_extra_class(admin_ui_plugin_path) - self.copyFile(self.admin_ui_config_properties, self.custom_config_dir) - - for logfn in (self.source_files[3][0], self.source_files[4][0]): - self.copyFile(logfn, self.custom_config_dir) - - - def install_admin_ui_frontend(self): - self.logIt("Installing Jans Admin UI Frontend", pbar=self.service_name) - package_zip = zipfile.ZipFile(self.source_files[5][0], "r") - package_par_dir = package_zip.namelist()[0] - source_dir = os.path.join(Config.outputFolder, package_par_dir) - package_zip.extractall(Config.outputFolder) - - self.renderTemplateInOut(os.path.join(source_dir, '.env.tmp'), source_dir, source_dir) - self.copyFile(os.path.join(source_dir, '.env.tmp'), os.path.join(source_dir, '.env')) - self.run([paths.cmd_chown, '-R', 'node:node', source_dir]) - cmd_path = 'PATH=$PATH:{}/bin:{}/bin'.format(Config.jre_home, Config.node_home) - - for cmd in ('npm install @openapitools/openapi-generator-cli', 'npm run api', 'npm install', 'npm run plugin:clean', 'npm run build:prod'): - self.logIt("Executing `{}`".format(cmd), pbar=self.service_name) - run_cmd = '{} {}'.format(cmd_path, cmd) - self.run(['/bin/su', 'node','-c', run_cmd], source_dir) - - self.copyTree(os.path.join(source_dir, 'dist'), '/var/www/html/admin') diff --git a/jans-linux-setup/setup_app/installers/httpd.py b/jans-linux-setup/setup_app/installers/httpd.py index 6e62ed050fd..4cc312079fd 100644 --- a/jans-linux-setup/setup_app/installers/httpd.py +++ b/jans-linux-setup/setup_app/installers/httpd.py @@ -36,11 +36,11 @@ def __init__(self): self.apache2_ssl_24_conf = os.path.join(self.output_folder, 'https_jans.conf') if base.os_type == 'suse': - self.https_gluu_fn = '/etc/apache2/vhosts.d/_https_gluu.conf' + self.https_jans_fn = '/etc/apache2/vhosts.d/_https_gluu.conf' elif base.clone_type == 'rpm': - self.https_gluu_fn = '/etc/httpd/conf.d/https_gluu.conf' + self.https_jans_fn = '/etc/httpd/conf.d/https_gluu.conf' else: - self.https_gluu_fn = '/etc/apache2/sites-available/https_gluu.conf' + self.https_jans_fn = '/etc/apache2/sites-available/https_gluu.conf' def configure(self): @@ -180,15 +180,15 @@ def write_httpd_config(self): self.copyFile(self.apache2_ssl_24_conf, '/etc/httpd/conf.d/https_gluu.conf') if base.os_type == 'suse': - self.copyFile(self.apache2_ssl_conf, self.https_gluu_fn) + self.copyFile(self.apache2_ssl_conf, self.https_jans_fn) elif base.clone_type == 'rpm' and base.os_initdaemon == 'init': self.copyFile(self.apache2_conf, '/etc/httpd/conf/httpd.conf') - self.copyFile(self.apache2_ssl_conf, self.https_gluu_fn) + self.copyFile(self.apache2_ssl_conf, self.https_jans_fn) elif base.clone_type == 'deb': - self.copyFile(self.apache2_ssl_conf, self.https_gluu_fn) - self.run([paths.cmd_ln, '-s', self.https_gluu_fn, + self.copyFile(self.apache2_ssl_conf, self.https_jans_fn) + self.run([paths.cmd_ln, '-s', self.https_jans_fn, '/etc/apache2/sites-enabled/https_gluu.conf']) def installed(self): diff --git a/jans-linux-setup/setup_app/installers/jans.py b/jans-linux-setup/setup_app/installers/jans.py index 303ad5e7b89..5cb55a3b8d9 100644 --- a/jans-linux-setup/setup_app/installers/jans.py +++ b/jans-linux-setup/setup_app/installers/jans.py @@ -68,10 +68,8 @@ def __repr__(self): txt += 'Install Apache 2 web server'.ljust(30) + repr(Config.installHttpd).rjust(35) + (' *' if 'installHttpd' in Config.addPostSetupService else '') + "\n" - txt += 'Install Node'.ljust(30) + repr(Config.installAdminUI).rjust(35) + "\n" txt += 'Install Auth Server'.ljust(30) + repr(Config.installOxAuth).rjust(35) + "\n" txt += 'Install Jans Auth Config Api'.ljust(30) + repr(Config.installConfigApi).rjust(35) + "\n" - txt += 'Install Jans Admin UI'.ljust(30) + repr(Config.installAdminUI).rjust(35) + "\n" if Config.profile == 'jans': txt += 'Install Fido2 Server'.ljust(30) + repr(Config.installFido2).rjust(35) + (' *' if 'installFido2' in Config.addPostSetupService else '') + "\n" txt += 'Install Scim Server'.ljust(30) + repr(Config.installScimServer).rjust(35) + (' *' if 'installScimServer' in Config.addPostSetupService else '') + "\n" diff --git a/jans-linux-setup/setup_app/installers/jans_cli.py b/jans-linux-setup/setup_app/installers/jans_cli.py index ecd4070aed2..34b90387056 100644 --- a/jans-linux-setup/setup_app/installers/jans_cli.py +++ b/jans-linux-setup/setup_app/installers/jans_cli.py @@ -40,6 +40,7 @@ def __init__(self): (os.path.join(Config.distJansFolder, 'jans-cli.zip'), 'https://api.github.com/repos/JanssenProject/jans-cli/tarball/main'.format(Config.oxVersion)), (os.path.join(Config.distJansFolder, 'jca-swagger-client.tgz'), 'https://ox.gluu.org/icrby8xcvbcv/cli-swagger/jca.tgz'), (os.path.join(Config.distJansFolder, 'scim-swagger-client.tgz'), 'https://ox.gluu.org/icrby8xcvbcv/cli-swagger/scim.tgz'), + (os.path.join(Config.distAppFolder, 'pyjwt.zip'), 'https://github.com/jpadilla/pyjwt/archive/refs/tags/2.3.0.zip'), ] def install(self): @@ -60,6 +61,10 @@ def install(self): self.writeFile(init_fn, '') shutil.unpack_archive(self.source_files[i+1][0], swagger_cli_dir) + #extract pyjwt from archieve + base.extract_from_zip(self.source_files[3][0], 'jwt', os.path.join(self.jans_cli_install_dir, 'pylib/jwt')) + + def generate_configuration(self): self.check_clients([('role_based_client_id', '2000.')]) diff --git a/jans-linux-setup/setup_app/installers/node.py b/jans-linux-setup/setup_app/installers/node.py deleted file mode 100644 index f5bf98789c5..00000000000 --- a/jans-linux-setup/setup_app/installers/node.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import glob - -from setup_app import paths -from setup_app.utils import base -from setup_app.static import AppType, InstallOption -from setup_app.config import Config -from setup_app.utils.setup_utils import SetupUtils -from setup_app.installers.base import BaseInstaller - -class NodeInstaller(BaseInstaller, SetupUtils): - - """This installer provides node installtion for Jans server.""" - - node_base = os.path.join(Config.jansOptFolder, 'node') - templates_rendered = False - - def __init__(self): - """Inits NodeInstaller instance.""" - self.service_name = 'node' - self.needdb = False # we don't need backend connection in this class - self.install_var = 'installNode' - self.app_type = AppType.APPLICATION - self.install_type = InstallOption.MONDATORY - if not base.snap: - self.register_progess() - - self.node_user_home = '/home/node' - - def install(self): - - node_archieve_list = glob.glob(os.path.join(Config.distAppFolder, 'node-*-linux-x64.tar.xz')) - - if not node_archieve_list: - self.logIt("Can't find node archive", True, True) - - if not base.snap: - self.createUser('node', self.node_user_home) - self.addUserToGroup('jans', 'node') - - nodeArchive = max(node_archieve_list) - - try: - self.logIt("Extracting %s into /opt" % nodeArchive) - self.run([paths.cmd_tar, '-xJf', nodeArchive, '-C', '/opt/', '--no-xattrs', '--no-same-owner', '--no-same-permissions']) - except Exception as e: - self.logIt("Error encountered while extracting archive {}: {}".format(nodeArchive, e)) - - nodeDestinationPath = max(glob.glob('/opt/node-*-linux-x64')) - - self.run([paths.cmd_ln, '-sf', nodeDestinationPath, Config.node_home]) - self.run([paths.cmd_chmod, '-R', "755", "%s/bin/" % nodeDestinationPath]) - - # Create temp folder - self.run([paths.cmd_mkdir, '-p', "%s/temp" % Config.node_home]) - - self.run([paths.cmd_chown, '-R', 'node:node', nodeDestinationPath]) - self.run([paths.cmd_chown, '-h', 'node:node', Config.node_home]) - - self.run([paths.cmd_mkdir, '-p', self.node_base]) - self.run([paths.cmd_chown, '-R', 'node:node', self.node_base]) diff --git a/jans-linux-setup/setup_app/installers/rdbm.py b/jans-linux-setup/setup_app/installers/rdbm.py index 1389ffde066..9628331ee55 100644 --- a/jans-linux-setup/setup_app/installers/rdbm.py +++ b/jans-linux-setup/setup_app/installers/rdbm.py @@ -54,7 +54,9 @@ def local_install(self): packageUtils.check_and_install_packages() if Config.rdbm_type == 'mysql': - if base.clone_type == 'rpm': + if base.os_type == 'suse': + self.restart('mysql') + elif base.clone_type == 'rpm': self.restart('mysqld') result, conn = self.dbUtils.mysqlconnection(log=False) if not result: diff --git a/jans-linux-setup/setup_app/setup_options.py b/jans-linux-setup/setup_app/setup_options.py index d22b2485a44..6c4fbdb9d7e 100644 --- a/jans-linux-setup/setup_app/setup_options.py +++ b/jans-linux-setup/setup_app/setup_options.py @@ -107,9 +107,6 @@ def get_setup_options(): if base.argsp.ldap_admin_password: setupOptions['ldapPass'] = base.argsp.ldap_admin_password - if base.argsp.install_admin_ui: - setupOptions['installAdminUI'] = True - if base.argsp.admin_password: setupOptions['admin_password'] = base.argsp.admin_password elif base.argsp.ldap_admin_password: diff --git a/jans-linux-setup/setup_app/utils/arg_parser.py b/jans-linux-setup/setup_app/utils/arg_parser.py index 98955514a8c..8e0e0f8b468 100644 --- a/jans-linux-setup/setup_app/utils/arg_parser.py +++ b/jans-linux-setup/setup_app/utils/arg_parser.py @@ -82,8 +82,6 @@ def arg_parser(): parser.add_argument('-approved-issuer', help="Api Approved Issuer") - parser.add_argument('--install-admin-ui', help="Install Gluu Admin UI", action='store_true') - argsp = parser.parse_args() return argsp diff --git a/jans-linux-setup/setup_app/utils/db_utils.py b/jans-linux-setup/setup_app/utils/db_utils.py index 029adb2c471..697e6f3f3ec 100644 --- a/jans-linux-setup/setup_app/utils/db_utils.py +++ b/jans-linux-setup/setup_app/utils/db_utils.py @@ -39,6 +39,7 @@ class DBUtils: Base = None session = None cbm = None + mariadb = False def bind(self, use_ssl=True, force=False): @@ -118,8 +119,16 @@ def sqlconnection(self, log=True): Session = sqlalchemy.orm.sessionmaker(bind=self.engine) self.session = Session() self.metadata = sqlalchemy.MetaData() - self.session.connection() + myconn = self.session.connection() + + # are we running on MariaDB? + query = myconn.execute("select version()") + result = query.first() + if result and 'mariadb' in result[0].lower(): + self.mariadb = True + base.logIt("{} Connection was successful".format(Config.rdbm_type.upper())) + return True, self.session except Exception as e: @@ -129,6 +138,8 @@ def sqlconnection(self, log=True): @property def json_dialects_instance(self): + if self.mariadb: + return sqlalchemy.dialects.mysql.LONGTEXT return sqlalchemy.dialects.mysql.json.JSON if Config.rdbm_type == 'mysql' else sqlalchemy.dialects.postgresql.json.JSON def mysqlconnection(self, log=True): @@ -880,7 +891,10 @@ def import_ldif(self, ldif_files, bucket=None, force=None): sqlalchObj = sqlalchCls() for v in vals: - setattr(sqlalchObj, v, vals[v]) + vval = vals[v] + if self.mariadb and isinstance(vval, dict): + vval = json.dumps(vals[v]) + setattr(sqlalchObj, v, vval) base.logIt("Adding {}".format(sqlalchObj.doc_id)) self.session.add(sqlalchObj) diff --git a/jans-linux-setup/setup_app/utils/properties_utils.py b/jans-linux-setup/setup_app/utils/properties_utils.py index 507d8380048..ce9faa00ce4 100644 --- a/jans-linux-setup/setup_app/utils/properties_utils.py +++ b/jans-linux-setup/setup_app/utils/properties_utils.py @@ -298,7 +298,7 @@ def getString(value): if obj_name.startswith('cmd_'): continue - + if not obj_name.startswith('__') and (not callable(obj)): if obj_name == 'mappingLocations': @@ -313,15 +313,15 @@ def getString(value): # TODO: uncomment later return - + self.run([paths.cmd_openssl, 'enc', '-aes-256-cbc', '-in', prop_fn, '-out', prop_fn+'.enc', '-k', Config.admin_password]) - + Config.post_messages.append( "Encrypted properties file saved to {0}.enc with password {1}\nDecrypt the file with the following command if you want to re-use:\nopenssl enc -d -aes-256-cbc -in {2}.enc -out {3}".format( prop_fn, Config.admin_password, os.path.basename(prop_fn), os.path.basename(Config.setup_properties_fn))) - + self.run(['rm', '-f', prop_fn]) - + except: self.logIt("Error saving properties", True) @@ -383,7 +383,7 @@ def test_cb_servers(self, couchbase_hostname): return retval def prompt_remote_couchbase(self): - + while True: Config.couchbase_hostname = self.getPrompt(" Couchbase hosts", Config.get('couchbase_hostname')) Config.couchebaseClusterAdmin = self.getPrompt(" Couchbase User", Config.get('couchebaseClusterAdmin')) @@ -589,22 +589,6 @@ def promptForConfigApi(self): if Config.installed_instance and Config.installConfigApi: Config.addPostSetupService.append('installConfigApi') - - - def promptAdminUI(self): - if Config.installed_instance and Config.installAdminUI: - return - - promptForAdminUI = self.getPrompt("Install Jans Admin UI?", - self.getDefaultOption(Config.installAdminUI) - )[0].lower() - - Config.installAdminUI = True if promptForAdminUI == 'y' else False - - if Config.installed_instance and Config.promptForAdminUI: - Config.addPostSetupService.append('installAdminUI') - - def prompt_for_rdbm(self): while True: Config.rdbm_type = self.getPrompt("RDBM Type", Config.rdbm_type) @@ -641,17 +625,17 @@ def prompt_for_rdbm(self): def prompt_for_backend(self): print('Chose Backend Type:') - + backend_types = ['Local OpenDj', 'Remote OpenDj', - 'Remote Couchbase', 'Local MySQL', 'Remote MySQL', - 'Cloud Spanner', ] - if 'couchbase' in self.getBackendTypes(): - backend_types.insert(2, 'Local Couchbase') + if not os.path.exists(os.path.join(Config.install_dir, 'package')): + backend_types += ['Remote Couchbase', 'Cloud Spanner'] + if 'couchbase' in self.getBackendTypes(): + backend_types.insert(2, 'Local Couchbase') nlist = [] for i, btype in enumerate(backend_types): @@ -739,10 +723,10 @@ def prompt_for_backend(self): Config.rdbm_install_type = InstallTypes.LOCAL Config.rdbm_type = 'mysql' Config.rdbm_host = 'localhost' - Config.rdbm_user = 'gluu' + Config.rdbm_user = 'jans' Config.rdbm_password = self.getPW(special='.*=+-()[]{}') Config.rdbm_port = 3306 - Config.rdbm_db = 'gluudb' + Config.rdbm_db = 'jansdb' elif backend_type_str == 'Remote MySQL': Config.opendj_install = InstallTypes.NONE @@ -908,7 +892,6 @@ def promptForProperties(self): Config.admin_password = adminPass self.promptForConfigApi() - self.promptAdminUI() self.promptForScimServer() self.promptForFido2Server() self.promptForEleven() diff --git a/jans-linux-setup/templates/system_profile_init b/jans-linux-setup/templates/system_profile_init index ab44621aa71..52ce8821e2e 100644 --- a/jans-linux-setup/templates/system_profile_init +++ b/jans-linux-setup/templates/system_profile_init @@ -2,14 +2,13 @@ # Added by Jans to prevent user to login into chroot container without starting jans-server service # ##################################################################################################### if [ "$(ls -A /dev/pts/)" != "" ] && [ "$(ls -A /proc/)" != "" ] && [ "$(ls -A /lib/modules/)" != "" ] && [ "$(ls -A /sys/class/net/lo/)" != "" ] && [ "$(ls /dev/ | grep -vE 'null|pts')" != "" ]; then - echo "Welcome to the Jans Server!" + echo "Welcome to the Jans Server!" else - echo "Jans server is not started, please start it from root machine by service jans-server start" - exit + echo "Jans server is not started, please start it from root machine by service jans-server start" + exit fi export JAVA_HOME=%(jre_home)s -export NODE_HOME=%(node_home)s export OPENDJ_JAVA_HOME=%(jre_home)s export PATH=$PATH:$JAVA_HOME/bin:$NODE_HOME/bin:%(ldapBaseFolder)s/bin diff --git a/jans-linux-setup/templates/system_profile_systemd b/jans-linux-setup/templates/system_profile_systemd index 8670066dc17..bfe098cf928 100644 --- a/jans-linux-setup/templates/system_profile_systemd +++ b/jans-linux-setup/templates/system_profile_systemd @@ -3,7 +3,6 @@ ######################################################################## export JAVA_HOME=%(jre_home)s -export NODE_HOME=%(node_home)s export OPENDJ_JAVA_HOME=%(jre_home)s export PATH=$PATH:$JAVA_HOME/bin:$NODE_HOME/bin:%(ldapBaseFolder)s/bin