Browse Source

Merge pull request #3014 from salleman33/master

hide password auth with PASSWORD_LOGIN_ENABLED variable
Lauri Ojansivu 5 years ago
parent
commit
13563e20e7

+ 2 - 1
Dockerfile

@@ -113,7 +113,8 @@ ENV BUILD_DEPS="apt-utils libarchive-tools gnupg gosu wget curl bzip2 g++ build-
     CORS_EXPOSE_HEADERS="" \
     CORS_EXPOSE_HEADERS="" \
     DEFAULT_AUTHENTICATION_METHOD="" \
     DEFAULT_AUTHENTICATION_METHOD="" \
     SCROLLINERTIA="0" \
     SCROLLINERTIA="0" \
-    SCROLLAMOUNT="auto"
+    SCROLLAMOUNT="auto" \
+    PASSWORD_LOGIN_ENABLED=true
 
 
 # Copy the app to the image
 # Copy the app to the image
 COPY ${SRC_PATH} /home/wekan/app
 COPY ${SRC_PATH} /home/wekan/app

+ 5 - 0
client/components/main/layouts.js

@@ -31,6 +31,11 @@ Template.userFormsLayout.onCreated(function() {
       return this.stop();
       return this.stop();
     },
     },
   });
   });
+  Meteor.call('isPasswordLoginDisabled', (_, result) => {
+    if (result) {
+      $('.at-pwd-form').hide();
+    }
+  });
 });
 });
 
 
 Template.userFormsLayout.onRendered(() => {
 Template.userFormsLayout.onRendered(() => {

+ 3 - 0
docker-compose.yml

@@ -598,6 +598,9 @@ services:
       # example : LOGOUT_ON_MINUTES=55
       # example : LOGOUT_ON_MINUTES=55
       #- LOGOUT_ON_MINUTES=
       #- LOGOUT_ON_MINUTES=
       #-------------------------------------------------------------------
       #-------------------------------------------------------------------
+      # Hide password login form 
+      # - PASSWORD_LOGIN_ENABLED=true
+      #-------------------------------------------------------------------
     depends_on:
     depends_on:
       - wekandb
       - wekandb
 
 

+ 5 - 0
models/settings.js

@@ -334,6 +334,11 @@ if (Meteor.isServer) {
     getDefaultAuthenticationMethod() {
     getDefaultAuthenticationMethod() {
       return process.env.DEFAULT_AUTHENTICATION_METHOD;
       return process.env.DEFAULT_AUTHENTICATION_METHOD;
     },
     },
+
+    isPasswordLoginDisabled() {
+      return process.env.PASSWORD_LOGIN_ENABLED === 'false';
+    },
+
   });
   });
 }
 }
 
 

+ 1 - 0
sandstorm-pkgdef.capnp

@@ -259,6 +259,7 @@ const myCommand :Spk.Manifest.Command = (
     (key = "OAUTH2_USERINFO_ENDPOINT", value=""),
     (key = "OAUTH2_USERINFO_ENDPOINT", value=""),
     (key = "OAUTH2_TOKEN_ENDPOINT", value=""),
     (key = "OAUTH2_TOKEN_ENDPOINT", value=""),
     (key = "LDAP_ENABLE", value="false"),
     (key = "LDAP_ENABLE", value="false"),
+    (key = "PASSWORD_LOGIN_ENABLED", value="true"),    
     (key = "SANDSTORM", value="1"),
     (key = "SANDSTORM", value="1"),
     (key = "METEOR_SETTINGS", value = "{\"public\": {\"sandstorm\": true}}")
     (key = "METEOR_SETTINGS", value = "{\"public\": {\"sandstorm\": true}}")
   ]
   ]

File diff suppressed because it is too large
+ 0 - 0
snap-src/bin/config


+ 3 - 0
snap-src/bin/wekan-help

@@ -461,6 +461,9 @@ echo -e "Default authentication method."
 echo -e "The default authentication method used if a user does not exist to create and authenticate. Method can be password or ldap."
 echo -e "The default authentication method used if a user does not exist to create and authenticate. Method can be password or ldap."
 echo -e "\t$ snap set $SNAP_NAME default-authentication-method='ldap'"
 echo -e "\t$ snap set $SNAP_NAME default-authentication-method='ldap'"
 echo -e "\n"
 echo -e "\n"
+echo -e "Enable or not password login Form"
+echo -e "\t$ snap set $SNAP_NAME password-login-enabled='false'"
+echo -e "\n"
 # parse config file for supported settings keys
 # parse config file for supported settings keys
 echo -e "wekan supports settings keys"
 echo -e "wekan supports settings keys"
 echo -e "values can be changed by calling\n$ snap set $SNAP_NAME <key name>='<key value>'"
 echo -e "values can be changed by calling\n$ snap set $SNAP_NAME <key name>='<key value>'"

+ 7 - 0
start-wekan.bat

@@ -363,6 +363,13 @@ REM SET LDAP_SYNC_ADMIN_STATUS=true
 REM # Comma separated list of admin group names to sync.
 REM # Comma separated list of admin group names to sync.
 REM SET LDAP_SYNC_ADMIN_GROUPS=group1,group2
 REM SET LDAP_SYNC_ADMIN_GROUPS=group1,group2
 
 
+REM ------------------------------------------------
+
+REM # Enable/Disable password login form.
+REM SET PASSWORD_LOGIN_ENABLED=true
+
+REM ------------------------------------------------
+
 REM # Login to LDAP automatically with HTTP header.
 REM # Login to LDAP automatically with HTTP header.
 REM # In below example for siteminder, at right side of = is header name.
 REM # In below example for siteminder, at right side of = is header name.
 REM SET HEADER_LOGIN_ID=HEADERUID
 REM SET HEADER_LOGIN_ID=HEADERUID

+ 3 - 0
start-wekan.sh

@@ -362,6 +362,9 @@
       # LOGOUT_ON_MINUTES : The number of minutes
       # LOGOUT_ON_MINUTES : The number of minutes
       # example : LOGOUT_ON_MINUTES=55
       # example : LOGOUT_ON_MINUTES=55
       #export LOGOUT_ON_MINUTES=
       #export LOGOUT_ON_MINUTES=
+      #---------------------------------------------------------------------
+      # PASSWORD_LOGIN_ENABLED : Enable or not the password login form. 
+      #export PASSWORD_LOGIN_ENABLED=true
 
 
       node main.js
       node main.js
       # & >> ../../wekan.log
       # & >> ../../wekan.log

+ 5 - 0
torodb-postgresql/docker-compose.yml

@@ -527,7 +527,12 @@ services:
       # LOGOUT_ON_MINUTES : The number of minutes
       # LOGOUT_ON_MINUTES : The number of minutes
       # example : LOGOUT_ON_MINUTES=55
       # example : LOGOUT_ON_MINUTES=55
       #- LOGOUT_ON_MINUTES=
       #- LOGOUT_ON_MINUTES=
+      #---------------------------------------------------------------------
+      # PASSWORD_LOGIN_ENABLED : Enable or not the password login form. 
+      # example: PASSWORD_LOGIN_ENABLED=false
+      # - PASSWORD_LOGIN_ENABLED
       #-------------------------------------------------------------------
       #-------------------------------------------------------------------
+      
 
 
     depends_on:
     depends_on:
       - mongodb
       - mongodb

Some files were not shown because too many files changed in this diff