Add ldap settings to db directly

This commit is contained in:
Girish Ramakrishnan 2015-06-24 11:01:16 -07:00
parent d68e6c7522
commit bf63f41072
1 changed files with 21 additions and 0 deletions

View File

@ -57,6 +57,27 @@ sed -e "s/##HOSTNAME/${fqdn}/g" \
-e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \ -e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \
/home/cloudron/app.ini.template > "/home/cloudron/gogs/custom/conf/app.ini" /home/cloudron/app.ini.template > "/home/cloudron/gogs/custom/conf/app.ini"
# update ldap (won't work without _csrf)
#curl -X POST http://localhost:3000/admin/auths/1 \
# --data id=1 \
# --data type=2 \
# --data name=cloudron \
# --data domain=cloudron \
# --data host=${LDAP_SERVER} \
# --data port=${LDAP_PORT} \
# --data-urlencode base_dn=ou=users,dc=cloudron \
# --data attribute_username=uid \
# --data attribute_name= \
# --data attribute_surname= \
# --data attribute_mail=mail \
# --data-urlencode 'filter=(&(objectClass=user)(uid=%s))' \
# --data ms_ad_sa= \
# --data is_actived=on
# id, type, name, is_actived, cfg, allow_auto_register, created, updated
mysql -u"${MYSQL_USERNAME}" -p"${MYSQL_PASSWORD}" -h mysql --database="${MYSQL_DATABASE}" \
-e "REPLACE INTO login_source VALUES (1,2,'cloudron',1,'{\"Name\":\"cloudron\",\"Host\":\"172.17.42.1\",\"Port\":3002,\"UseSSL\":false,\"BaseDN\":\"ou=users,dc=cloudron\",\"AttributeUsername\":\"uid\",\"AttributeName\":\"\",\"AttributeSurname\":\"\",\"AttributeMail\":\"mail\",\"Filter\":\"(\\\\u0026(objectClass=user)(uid=%s))\",\"MsAdSAFormat\":\"cn=%s,ou=users,dc=cloudron\",\"Enabled\":true}',0,'2015-06-24 17:14:12','2015-06-24 17:25:03');"
supervisorctl restart gogs supervisorctl restart gogs
wait wait