mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Postinstall bugfixes
This commit is contained in:
parent
3321103498
commit
6893a51514
2 changed files with 61 additions and 59 deletions
7
yunohost
7
yunohost
|
@ -83,8 +83,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
with open('/etc/yunohost/installed') as f: pass
|
with open('/etc/yunohost/installed') as f: pass
|
||||||
except IOError:
|
except IOError:
|
||||||
admin_password_provided = True
|
postinstall = True
|
||||||
admin_password = "yunohost"
|
|
||||||
if len(sys.argv) < 3 or sys.argv[1] != 'tools' or sys.argv[2] != 'postinstall':
|
if len(sys.argv) < 3 or sys.argv[1] != 'tools' or sys.argv[2] != 'postinstall':
|
||||||
raise YunoHostError(17, _("YunoHost is not correctly installed, please execute 'yunohost tools postinstall'"))
|
raise YunoHostError(17, _("YunoHost is not correctly installed, please execute 'yunohost tools postinstall'"))
|
||||||
|
|
||||||
|
@ -101,7 +100,9 @@ def main():
|
||||||
admin_password = f.read()
|
admin_password = f.read()
|
||||||
admin_password_provided = True
|
admin_password_provided = True
|
||||||
except IOError: pass
|
except IOError: pass
|
||||||
if admin_password_provided:
|
if postinstall:
|
||||||
|
result = args.func(**args_dict)
|
||||||
|
elif admin_password_provided:
|
||||||
with YunoHostLDAP(password=admin_password):
|
with YunoHostLDAP(password=admin_password):
|
||||||
result = args.func(**args_dict)
|
result = args.func(**args_dict)
|
||||||
elif os.isatty(1) and write_ldap:
|
elif os.isatty(1) and write_ldap:
|
||||||
|
|
|
@ -207,7 +207,6 @@ def tools_postinstall(domain, password, dyndns=False):
|
||||||
password -- YunoHost admin password
|
password -- YunoHost admin password
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP(password='yunohost') as yldap:
|
|
||||||
try:
|
try:
|
||||||
with open('/etc/yunohost/installed') as f: pass
|
with open('/etc/yunohost/installed') as f: pass
|
||||||
except IOError:
|
except IOError:
|
||||||
|
@ -244,7 +243,7 @@ def tools_postinstall(domain, password, dyndns=False):
|
||||||
os.system('hostname yunohost.yunohost.org')
|
os.system('hostname yunohost.yunohost.org')
|
||||||
|
|
||||||
# Samba sh*t fix
|
# Samba sh*t fix
|
||||||
if os.system('net getlocalsid') != 0:
|
if os.system('net getlocalsid > /dev/null') != 0:
|
||||||
os.system('apt-get install --reinstall -y -qq samba yunohost-config-samba')
|
os.system('apt-get install --reinstall -y -qq samba yunohost-config-samba')
|
||||||
os.system('smbpasswd -w yunohost')
|
os.system('smbpasswd -w yunohost')
|
||||||
|
|
||||||
|
@ -265,6 +264,8 @@ def tools_postinstall(domain, password, dyndns=False):
|
||||||
if os.system(command) != 0:
|
if os.system(command) != 0:
|
||||||
raise YunoHostError(17, _("There were a problem during CA creation"))
|
raise YunoHostError(17, _("There were a problem during CA creation"))
|
||||||
|
|
||||||
|
with YunoHostLDAP(password='yunohost') as yldap:
|
||||||
|
|
||||||
# Initialize YunoHost LDAP base
|
# Initialize YunoHost LDAP base
|
||||||
tools_ldapinit(password)
|
tools_ldapinit(password)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue