from ipsilon.login.common import LoginMgrsInstall
from ipsilon.providers.common import ProvidersInstall
+from ipsilon.util.data import Store
import argparse
import cherrypy
import logging
logger.info('Installing default config files')
ipsilon_conf = os.path.join(CONFDIR, 'ipsilon.conf')
idp_conf = os.path.join(CONFDIR, 'idp.conf')
- httpd_conf = os.path.join(HTTPDCONFD, 'idp.conf')
+ args['httpd_conf'] = os.path.join(HTTPDCONFD, 'idp.conf')
if os.path.exists(ipsilon_conf):
shutil.move(ipsilon_conf, '%s.bakcup.%s' % (ipsilon_conf, now))
if os.path.exists(idp_conf):
shutil.move(idp_conf, '%s.backup.%s' % (idp_conf, now))
shutil.copy(os.path.join(TEMPLATES, 'ipsilon.conf'), CONFDIR)
shutil.copy(os.path.join(TEMPLATES, 'idp.conf'), CONFDIR)
- if not os.path.exists(httpd_conf):
- os.symlink(idp_conf, httpd_conf)
+ if not os.path.exists(args['httpd_conf']):
+ os.symlink(idp_conf, args['httpd_conf'])
# Load the cherrypy config from the newly installed file so
# that db paths and all is properly set before configuring
# components
if os.path.exists(admin_db):
shutil.move(admin_db, '%s.backup.%s' % (admin_db, now))
+ # Rebuild user db
+ users_db = cherrypy.config['user.prefs.db']
+ if os.path.exists(users_db):
+ shutil.move(users_db, '%s.backup.%s' % (users_db, now))
+ db = Store()
+ db.save_user_preferences(args['admin_user'], {'is_admin': 1})
+
logger.info('Configuring login managers')
for plugin_name in args['lm_order']:
plugin = plugins['Login Managers'][plugin_name]
help="Machine's fully qualified host name")
parser.add_argument('--system-user', default='ipsilon',
help="User account used to run the server")
+ parser.add_argument('--admin-user', default='admin',
+ help="User account that is assigned admin privileges")
parser.add_argument('--ipa', choices=['yes', 'no'], default='yes',
help='Detect and use an IPA server for authentication')
parser.add_argument('--uninstall', action='store_true',