Merge f9ba7580fc
into 089255997a
commit
0e259431c4
|
@ -31,6 +31,7 @@ func addConfigFlags(flags *pflag.FlagSet) {
|
|||
addServerFlags(flags)
|
||||
addUserFlags(flags)
|
||||
flags.BoolP("signup", "s", false, "allow users to signup")
|
||||
flags.Bool("publiclogin", true, "allow users to login from the public page")
|
||||
flags.Bool("create-user-dir", false, "generate user's home directory automatically")
|
||||
flags.String("shell", "", "shell command to which other commands should be appended")
|
||||
|
||||
|
@ -143,6 +144,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
|
|||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
|
||||
fmt.Fprintf(w, "Sign up:\t%t\n", set.Signup)
|
||||
fmt.Fprintf(w, "Public login:\t%t\n", set.PublicLogin)
|
||||
fmt.Fprintf(w, "Create User Dir:\t%t\n", set.CreateUserDir)
|
||||
fmt.Fprintf(w, "Auth method:\t%s\n", set.AuthMethod)
|
||||
fmt.Fprintf(w, "Shell:\t%s\t\n", strings.Join(set.Shell, " "))
|
||||
|
|
|
@ -31,6 +31,7 @@ override the options.`,
|
|||
s := &settings.Settings{
|
||||
Key: generateKey(),
|
||||
Signup: mustGetBool(flags, "signup"),
|
||||
PublicLogin: mustGetBool(flags, "publiclogin"),
|
||||
CreateUserDir: mustGetBool(flags, "create-user-dir"),
|
||||
Shell: convertCmdStrToCmdArray(mustGetString(flags, "shell")),
|
||||
AuthMethod: authMethod,
|
||||
|
|
|
@ -43,6 +43,8 @@ you want to change. Other options will remain unchanged.`,
|
|||
ser.Port = mustGetString(flags, flag.Name)
|
||||
case "log":
|
||||
ser.Log = mustGetString(flags, flag.Name)
|
||||
case "publiclogin":
|
||||
set.PublicLogin = mustGetBool(flags, flag.Name)
|
||||
case "signup":
|
||||
set.Signup = mustGetBool(flags, flag.Name)
|
||||
case "auth.method":
|
||||
|
|
|
@ -367,6 +367,7 @@ func quickSetup(flags *pflag.FlagSet, d pythonData) {
|
|||
set := &settings.Settings{
|
||||
Key: generateKey(),
|
||||
Signup: false,
|
||||
PublicLogin: true,
|
||||
CreateUserDir: false,
|
||||
UserHomeBasePath: settings.DefaultUsersHomeBasePath,
|
||||
Defaults: settings.UserDefaults{
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</template>
|
||||
<template v-else>
|
||||
<router-link
|
||||
v-if="publiclogin"
|
||||
class="action"
|
||||
to="/login"
|
||||
:aria-label="$t('sidebar.login')"
|
||||
|
@ -121,6 +122,7 @@ import * as auth from "@/utils/auth";
|
|||
import {
|
||||
version,
|
||||
signup,
|
||||
publiclogin,
|
||||
disableExternal,
|
||||
disableUsedPercentage,
|
||||
noAuth,
|
||||
|
@ -150,6 +152,7 @@ export default {
|
|||
return this.currentPromptName === "sidebar";
|
||||
},
|
||||
signup: () => signup,
|
||||
publiclogin: () => publiclogin,
|
||||
version: () => version,
|
||||
disableExternal: () => disableExternal,
|
||||
disableUsedPercentage: () => disableUsedPercentage,
|
||||
|
|
|
@ -18,6 +18,7 @@ const enableExec: boolean = window.FileBrowser.EnableExec;
|
|||
const tusSettings = window.FileBrowser.TusSettings;
|
||||
const origin = window.location.origin;
|
||||
const tusEndpoint = `/api/tus`;
|
||||
const publiclogin = window.FileBrowser.PublicLogin;
|
||||
|
||||
export {
|
||||
name,
|
||||
|
@ -39,4 +40,5 @@ export {
|
|||
tusSettings,
|
||||
origin,
|
||||
tusEndpoint,
|
||||
publiclogin,
|
||||
};
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
type settingsData struct {
|
||||
Signup bool `json:"signup"`
|
||||
PublicLogin bool `json:"publiclogin"`
|
||||
CreateUserDir bool `json:"createUserDir"`
|
||||
UserHomeBasePath string `json:"userHomeBasePath"`
|
||||
Defaults settings.UserDefaults `json:"defaults"`
|
||||
|
@ -23,6 +24,7 @@ type settingsData struct {
|
|||
var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
data := &settingsData{
|
||||
Signup: d.settings.Signup,
|
||||
PublicLogin: d.settings.PublicLogin,
|
||||
CreateUserDir: d.settings.CreateUserDir,
|
||||
UserHomeBasePath: d.settings.UserHomeBasePath,
|
||||
Defaults: d.settings.Defaults,
|
||||
|
|
|
@ -46,6 +46,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
|
|||
"ResizePreview": d.server.ResizePreview,
|
||||
"EnableExec": d.server.EnableExec,
|
||||
"TusSettings": d.settings.Tus,
|
||||
"PublicLogin": d.settings.PublicLogin,
|
||||
}
|
||||
|
||||
if d.settings.Branding.Files != "" {
|
||||
|
|
|
@ -18,6 +18,7 @@ type AuthMethod string
|
|||
type Settings struct {
|
||||
Key []byte `json:"key"`
|
||||
Signup bool `json:"signup"`
|
||||
PublicLogin bool `json:"publiclogin"`
|
||||
CreateUserDir bool `json:"createUserDir"`
|
||||
UserHomeBasePath string `json:"userHomeBasePath"`
|
||||
Defaults UserDefaults `json:"defaults"`
|
||||
|
|
Loading…
Reference in New Issue