diff --git a/client/pages/adminpage.scss b/client/pages/adminpage.scss
index fd11295b..f6c244b5 100644
--- a/client/pages/adminpage.scss
+++ b/client/pages/adminpage.scss
@@ -103,6 +103,10 @@
background: rgba(0,0,0,0.05); border-bottom: 0;
border-radius: 3px;
padding-left: 5px;
+ &[readonly]{
+ background: var(--dark);
+ color: var(--light);
+ }
}
}
}
diff --git a/client/pages/adminpage/backend.js b/client/pages/adminpage/backend.js
index 775ff3a2..b99dd47f 100644
--- a/client/pages/adminpage/backend.js
+++ b/client/pages/adminpage/backend.js
@@ -214,7 +214,16 @@ export class BackendPage extends React.Component {
{
- struct.description ? (
{struct.description}
) : null
+ struct.description ? (
+
$1")
+ .replaceAll("\n", "
");
+ }()
+ }}>
+ ) : null
}
diff --git a/server/plugin/plg_authenticate_admin/index.go b/server/plugin/plg_authenticate_admin/index.go
index bb5de298..bb0be76d 100644
--- a/server/plugin/plg_authenticate_admin/index.go
+++ b/server/plugin/plg_authenticate_admin/index.go
@@ -22,10 +22,13 @@ func (this Admin) Setup() Form {
Value: "admin",
},
{
- Name: "hint",
+ Name: "password",
Type: "text",
ReadOnly: true,
- Value: "You will be ask for your Filestash admin password",
+ Value: Config.Get("auth.admin").String(),
+ Description: `This plugin will redirect the user to a page asking for a password. Only the admin password will be considered valid.
+This plugin exposes {{ .user }} (which is 'admin') and {{ .password }} for the attribute mapping section
+`,
},
},
}
@@ -42,15 +45,18 @@ func (this Admin) EntryPoint(idpParams map[string]string, req *http.Request, res
MaxAge: -1,
Path: "/",
})
- return fmt.Sprintf("%s", c.Value)
+ return fmt.Sprintf(`%s
`, c.Value)
}
res.Header().Set("Content-Type", "text/html; charset=utf-8")
res.WriteHeader(http.StatusOK)
res.Write([]byte(Page(`
`)))
return nil
}
@@ -69,6 +75,7 @@ func (this Admin) Callback(formData map[string]string, idpParams map[string]stri
return nil, ErrAuthenticationFailed
}
return map[string]string{
- "username": "admin",
+ "user": "admin",
+ "password": formData["password"],
}, nil
}
diff --git a/server/plugin/plg_authenticate_htpasswd/index.go b/server/plugin/plg_authenticate_htpasswd/index.go
index 92408112..d013f0d0 100644
--- a/server/plugin/plg_authenticate_htpasswd/index.go
+++ b/server/plugin/plg_authenticate_htpasswd/index.go
@@ -25,9 +25,10 @@ func (this Htpasswd) Setup() Form {
{
Name: "users",
Type: "long_text",
- Placeholder: "eg:\nbob123:$apr1$FaPCZHMe$jYiw5.9UevKx25pBH4AsT/\nnancy456:$apr1$mrCHcVhc$oNdJeRcWKPk2z8dlzQI0x/",
+ Placeholder: "test:$apr1$nEDlyMK/$4jL0BUAuEifz2VajdjVnE.\ntest:{SHA}qUqP5cyxm6YcTAhz05Hph5gvu9M=",
Default: "",
- Description: "The list of users that will be granted access using the htpasswd file format. This plugin exposes the following variables which you can use from the attribute mapping: {{ .user }}, {{ .password }}",
+ Description: `The list of users who are granted access using the htpasswd file format.
+This plugin exposes {{ .user }} and {{ .password }} for the attribute mapping section`,
},
},
}
@@ -64,12 +65,11 @@ func (this Htpasswd) EntryPoint(idpParams map[string]string, req *http.Request,
}
func (this Htpasswd) Callback(formData map[string]string, idpParams map[string]string, res http.ResponseWriter) (map[string]string, error) {
- lines := strings.Split(idpParams["users"], "\n")
- if len(lines) == 0 {
+ if idpParams["users"] == "" {
Log.Error("plg_authenticate_htpasswd::callback there is no user configured")
- return nil, ErrAuthenticationFailed
+ return nil, NewError("You haven't configured any users", 500)
}
-
+ lines := strings.Split(idpParams["users"], "\n")
for _, line := range lines {
pair := strings.SplitN(line, ":", 2)
if len(pair) != 2 {
diff --git a/server/plugin/plg_authenticate_ldap/index.go b/server/plugin/plg_authenticate_ldap/index.go
index 866e0c58..b556e555 100644
--- a/server/plugin/plg_authenticate_ldap/index.go
+++ b/server/plugin/plg_authenticate_ldap/index.go
@@ -20,39 +20,39 @@ func (this Ldap) Setup() Form {
Value: "ldap",
},
{
- Name: "Hostname",
- Type: "text",
- Value: "",
- ReadOnly: true,
- Placeholder: "",
+ Name: "Hostname",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Port",
- Type: "text",
- Value: "",
- ReadOnly: true,
- Placeholder: "",
+ Name: "Port",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Bind DN",
- Type: "text",
- Value: "",
- ReadOnly: true,
- Placeholder: "",
+ Name: "Bind DN",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Bind DN Password",
- Type: "text",
- Value: "",
- ReadOnly: true,
- Placeholder: "",
+ Name: "Bind DN Password",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Base DN",
- Type: "text",
- Value: "",
- ReadOnly: true,
- Placeholder: "",
+ Name: "Base DN",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
+ Description: `This plugin is to integrate with your LDAP server. After successfully authenticating to your IDP, the attributes relating to the user will be available in the attribute mapping section either by:
+ 1. copying those attributes in any field: {{ .sAMAccountName }} {{ .cn }} {{ .userPrincipalName }} {{ .mail }}, ...
+ 2. create custom rules based on some attributes like this: {{ if contains .memberOf "cn=admins" }}adminuser{{ else }}regularuser{{ end }} or {{ if eq .userPrincipalName "root" }}adminuser{{ else }}regularuser{{ end }}
+
+[Purchase the enterprise edition](https://www.filestash.app/purchase-enterprise-selfhosted.html)`,
},
},
}
diff --git a/server/plugin/plg_authenticate_openid/index.go b/server/plugin/plg_authenticate_openid/index.go
index 0be8f678..69360b07 100644
--- a/server/plugin/plg_authenticate_openid/index.go
+++ b/server/plugin/plg_authenticate_openid/index.go
@@ -20,25 +20,25 @@ func (this OpenID) Setup() Form {
Value: "openid",
},
{
- Name: "OpenID Config URL",
- Type: "text",
- ReadOnly: true,
- Value: "",
- Placeholder: "",
+ Name: "OpenID Config URL",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Client ID",
- Type: "text",
- ReadOnly: true,
- Value: "",
- Placeholder: "",
+ Name: "Client ID",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "Scope",
- Type: "text",
- ReadOnly: true,
- Value: "",
- Placeholder: "",
+ Name: "Scope",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
+ Description: `This plugin is to integrate with your IDP using SSO via OpenID. After having authenticated to your IDP, all the information related to the user will be available in the attribute mapping section like this: {{ .email }} {{ .name }} {{ .sub }}, ...
+
+[Purchase the enterprise edition](https://www.filestash.app/purchase-enterprise-selfhosted.html)`,
},
},
}
diff --git a/server/plugin/plg_authenticate_passthrough/index.go b/server/plugin/plg_authenticate_passthrough/index.go
index 538965da..2dcdeedf 100644
--- a/server/plugin/plg_authenticate_passthrough/index.go
+++ b/server/plugin/plg_authenticate_passthrough/index.go
@@ -21,12 +21,15 @@ func (this Admin) Setup() Form {
Value: "passthrough",
},
{
- Name: "strategy",
- Type: "select",
- Default: "direct",
- Opts: []string{"direct", "password_only", "username_and_password"},
- Id: "strategy",
- Description: "This plugin has 3 base strategy for authentication. The 'username_and_password' strategy will redirect the user to a page asking for a username and password whose value can be used in the attribute mapping section of the selected storage. The 'password_only' strategy will do the same but instead of asking for both a username and password will only ask for a password and the remaining 'direct' strategy will be a transparent redirect where the user won't be ask for any information\n\nThis plugin will enable 2 variable which can be used in the attribute mapping section, namely {{ .user }} and {{ .password }}",
+ Name: "strategy",
+ Type: "select",
+ Default: "direct",
+ Opts: []string{"direct", "password_only", "username_and_password"},
+ Id: "strategy",
+ Description: `This plugin has 3 base strategies:
+1. The 'direct' strategy will redirect the user to your storage without asking for anything and use whatever is configured in the attribute mapping section.
+2. The 'password_only' strategy will redirect the user to a page asking for a password which you can map to a field in the attribute mapping section like this: {{ .password }}
+3. The 'username_and_password' strategy is similar to the 'password_only' strategy but you will see in the login page both a username and password field which can be used fom the attribute mapping section like this: {{ .user }} {{ .password }}`,
},
},
}
diff --git a/server/plugin/plg_authenticate_saml/index.go b/server/plugin/plg_authenticate_saml/index.go
index 5d24d001..d857504a 100644
--- a/server/plugin/plg_authenticate_saml/index.go
+++ b/server/plugin/plg_authenticate_saml/index.go
@@ -20,18 +20,21 @@ func (this Saml) Setup() Form {
Value: "saml",
},
{
- Name: "SP Metadata",
- Type: "text",
- ReadOnly: true,
- Value: "",
- Placeholder: "",
+ Name: "SP Metadata",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
},
{
- Name: "IDP Metadata",
- Type: "text",
- ReadOnly: true,
- Value: "",
- Placeholder: "",
+ Name: "IDP Metadata",
+ Type: "text",
+ ReadOnly: true,
+ Value: "plugin available in the enterprise release",
+ Description: `This plugin is to integrate with your IDP using SAML Single Sign-On. After having authenticated to your IDP, all the information about the user sent by your IDP will be available in the attribute mapping section either by:
+ 1. copying those attributes in any field: {{ .mail }}, {{ .uid }}, {{ .givenName }}
+ 2. create custom rules based on some attributes like this: {{ if eq .role "admin" }}adminuser{{ else }}regularuser{{ end }}
+
+[Purchase the enterprise edition](https://www.filestash.app/purchase-enterprise-selfhosted.html)`,
},
},
}