Browse Source

[fix] Fix installation on root domain

ljf 8 years ago
parent
commit
92448277a1
2 changed files with 7 additions and 5 deletions
  1. 4 3
      conf/local.py
  2. 3 2
      scripts/install

+ 4 - 3
conf/local.py

@@ -1,7 +1,8 @@
 # -*- coding: utf-8 -*-
-DEBUG=True
+#DEBUG=True
+ALLOWED_HOSTS= ['YNH_APP_ARG_DOMAIN']
 
-URL_PREFIX='YNH_APP_PREFIX/'
+URL_PREFIX='YNH_APP_PREFIX'
 STATIC_ROOT='YNH_APP_STATIC_ROOT'
 NOTIFICATION_EMAILS=['YNH_APP_ARG_EMAIL']
 DEFAULT_FROM_EMAIL='notifier@YNH_APP_ARG_DOMAIN'
@@ -36,7 +37,7 @@ AUTHENTICATION_BACKENDS = (
     'django.contrib.auth.backends.ModelBackend',
 )
 AUTH_LDAP_SERVER_URI = "ldap://localhost:389"
-AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
+AUTH_LDAP_USER_SEARCH = LDAPSearch("uid=YNH_APP_ARG_ADMIN,ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
 AUTH_LDAP_USER_FLAGS_BY_GROUP = {
     "is_active": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",
     "is_staff": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",

+ 3 - 2
scripts/install

@@ -98,12 +98,13 @@ set +o nounset
 deactivate
 set -o nounset
 
-
+prefix="${path#"/"}/"
+prefix=${prefix%"/"}
 # Configuration Django
 sed -i "s@YNH_APP_ARG_ADMIN@$admin@g" ../conf/local.py
 sed -i "s@YNH_APP_ARG_DOMAIN@$domain@g" ../conf/local.py
 sed -i "s@YNH_APP_ARG_PATH@$path@g" ../conf/local.py
-sed -i "s@YNH_APP_PREFIX@${path#"/"}@g" ../conf/local.py
+sed -i "s@YNH_APP_PREFIX@$prefix@g" ../conf/local.py
 sed -i "s#YNH_APP_ARG_EMAIL#$email#g" ../conf/local.py
 sed -i "s#YNH_APP_SECRET_KEY#$secret#g" ../conf/local.py
 sed -i "s#YNH_APP_ARG_ISP_NAME#$isp_name#g" ../conf/local.py