Explorar el Código

Add optionalSso support

Girish Ramakrishnan hace 7 años
padre
commit
bf1b859b4b
Se han modificado 2 ficheros con 5 adiciones y 1 borrados
  1. 1 0
      CloudronManifest.json
  2. 4 1
      start.sh

+ 1 - 0
CloudronManifest.json

@@ -24,6 +24,7 @@
   "website": "https://gogs.io",
   "contactEmail": "apps@cloudron.io",
   "icon": "file://logo.png",
+  "optionalSso": true,
   "mediaLinks": [
     "https://gogs.io/img/screenshots/1.png",
     "https://gogs.io/img/screenshots/2.png",

+ 4 - 1
start.sh

@@ -16,6 +16,7 @@ setup_ldap_source() {
     now=$(date +%s)
 
     # Get the existing LDAP source status. This allows the user to disable LDAP
+    # Note that this method is deprecated since this app now supports optionalSso
     ldap_status=$(mysql -u"${MYSQL_USERNAME}" -p"${MYSQL_PASSWORD}" -h mysql --database="${MYSQL_DATABASE}" -N -B -e "select is_actived from login_source WHERE name='cloudron';")
     [[ -z "${ldap_status}" ]] && ldap_status="1"
 
@@ -100,7 +101,9 @@ mkdir -p /app/data/repository /app/data/ssh
 
 chown -R git:git /app/data /run/gogs
 
-( setup_ldap_source ) &
+if [[ -n "${LDAP_SERVER:-}" ]]; then
+    ( setup_ldap_source ) &
+fi
 
 exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gogs