timeout=args.timeout if args.timeout else 30 # seconds
out = cli(['-h'], timeout=timeout)
return 'dashboard' in out
- is_available('Dashboard', is_dashboard_available)()
+ is_available('Dashboard', is_dashboard_available)
- logger.info('Generating a dashboard self-signed certificate...')
- cli(['dashboard', 'create-self-signed-cert'])
+
+
+ # dashboard crt and key
+ if args.dashboard_key and args.dashboard_crt:
+ logger.info('Using provided dashboard certificate...')
+ mounts = {}
+ mounts[pathify(args.dashboard_crt)] = '/tmp/dashboard.crt:z'
+ mounts[pathify(args.dashboard_key)] = '/tmp/dashboard.key:z'
+ cli(['dashboard', 'set-ssl-certificate', '-i', '/tmp/dashboard.crt'], extra_mounts=mounts)
+ cli(['dashboard', 'set-ssl-certificate-key', '-i', '/tmp/dashboard.key'], extra_mounts=mounts)
+ else:
+ logger.info('Generating a dashboard self-signed certificate...')
+ cli(['dashboard', 'create-self-signed-cert'])
logger.info('Creating initial admin user...')
password = args.initial_dashboard_password or generate_password()