From 6fbb153272c0a6c6f96f41a4b97038f72c198fbf Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 28 Mar 2020 18:15:46 +0100 Subject: [PATCH 1/3] Remove redirected_urls after postinstall --- src/yunohost/tools.py | 2 -- src/yunohost/user.py | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index ea9521020..b3cb5b218 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -306,8 +306,6 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, if 'redirected_urls' not in ssowat_conf: ssowat_conf['redirected_urls'] = {} - ssowat_conf['redirected_urls']['/'] = domain + '/yunohost/admin' - write_to_json('/etc/ssowat/conf.json.persistent', ssowat_conf) os.system('chmod 644 /etc/ssowat/conf.json.persistent') diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 4a047b58f..82dd72cf7 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -192,22 +192,6 @@ def user_create(operation_logger, username, firstname, lastname, mail, password, 'loginShell': '/bin/false' } - # If it is the first user, add some aliases - if not ldap.search(base='ou=users,dc=yunohost,dc=org', filter='uid=*'): - attr_dict['mail'] = [attr_dict['mail']] + aliases - - # If exists, remove the redirection from the SSO - if not os.path.exists('/etc/ssowat/conf.json.persistent'): - ssowat_conf = {} - else: - ssowat_conf = read_json('/etc/ssowat/conf.json.persistent') - - if 'redirected_urls' in ssowat_conf and '/' in ssowat_conf['redirected_urls']: - del ssowat_conf['redirected_urls']['/'] - - write_to_json('/etc/ssowat/conf.json.persistent', ssowat_conf) - os.system('chmod 644 /etc/ssowat/conf.json.persistent') - try: ldap.add('uid=%s,ou=users' % username, attr_dict) except Exception as e: From b3ccc9273a68af25eaa941d0bb1cb6b5e0519cb5 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 28 Mar 2020 18:33:00 +0100 Subject: [PATCH 2/3] Keep aliases for the first user --- src/yunohost/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 82dd72cf7..39a2d8f15 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -192,6 +192,10 @@ def user_create(operation_logger, username, firstname, lastname, mail, password, 'loginShell': '/bin/false' } + # If it is the first user, add some aliases + if not ldap.search(base='ou=users,dc=yunohost,dc=org', filter='uid=*'): + attr_dict['mail'] = [attr_dict['mail']] + aliases + try: ldap.add('uid=%s,ou=users' % username, attr_dict) except Exception as e: From 1815e56cd91725bdc4f09cb850b4409c470ca49d Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 28 Mar 2020 18:33:46 +0100 Subject: [PATCH 3/3] Remove unused ssowat conf --- src/yunohost/tools.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index b3cb5b218..77a120d46 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -303,9 +303,6 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, else: ssowat_conf = read_json('/etc/ssowat/conf.json.persistent') - if 'redirected_urls' not in ssowat_conf: - ssowat_conf['redirected_urls'] = {} - write_to_json('/etc/ssowat/conf.json.persistent', ssowat_conf) os.system('chmod 644 /etc/ssowat/conf.json.persistent')