Skip to content

Commit c02f74f

Browse files
committed
Update until v2.56.0
1 parent f9058b5 commit c02f74f

45 files changed

Lines changed: 498 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

auth/json.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import (
1818
// MethodJSONAuth is used to identify json auth.
1919
const MethodJSONAuth settings.AuthMethod = "json"
2020

21+
// dummyHash is used to prevent user enumeration timing attacks.
22+
// It MUST be a valid bcrypt hash.
23+
const dummyHash = "$2a$10$O4mEMeOL/nit6zqe.WQXauLRbRlzb3IgLHsa26Pf0N/GiU9b.wK1m"
24+
2125
type jsonCred struct {
2226
Password string `json:"password"`
2327
Username string `json:"username"`
@@ -221,6 +225,9 @@ func (a JSONAuth) Auth(r *http.Request, usr users.Store, _ *settings.Settings, s
221225
u, err := usr.Get(srv.Root, cred.Username)
222226
if err != nil {
223227
log.Printf("Warning: Login error for %s - lookup failed: %v", cred.Username, err)
228+
// Even if the user is not found, we check the password against a dummy hash
229+
// to prevent user enumeration timing attacks.
230+
users.CheckPwd(cred.Password, dummyHash)
224231
handleAuthError(r)
225232
return nil, os.ErrPermission
226233
}

cmd/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var usersCmd = &cobra.Command{
2727

2828
func printUsers(usrs []*users.User) {
2929
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
30-
fmt.Fprintln(w, "ID\tUsername\tScope\tLocale\tV. Mode\tS.Click\tAdmin\tExecute\tCreate\tRename\tModify\tDelete\tShare\tDownload\tPwd Lock")
30+
fmt.Fprintln(w, "ID\tUsername\tScope\tLocale\tV. Mode\tS.Click\tRed. After C/M\tAdmin\tExecute\tCreate\tRename\tModify\tDelete\tShare\tDownload\tPwd Lock")
3131

3232
for _, u := range usrs {
3333
fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%s\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t%t\t\n",

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@
7171
"vite-plugin-compression2": "^2.3.1",
7272
"vue-tsc": "^3.1.3"
7373
},
74-
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
74+
"packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316"
7575
}

frontend/pnpm-lock.yaml

Lines changed: 252 additions & 234 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/api/users.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ export async function update(
4242
});
4343
}
4444

45-
export async function remove(id: number) {
45+
export async function remove(
46+
id: number,
47+
currentPassword: string | null = null
48+
) {
4649
await fetchURL(`/api/users/${id}`, {
4750
method: "DELETE",
51+
body: JSON.stringify({
52+
...(currentPassword != null ? { current_password: currentPassword } : {}),
53+
}),
4854
});
4955
}

frontend/src/css/base.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,7 @@ html[dir="rtl"] .breadcrumbs a {
185185
.vfm-modal {
186186
z-index: 9999999 !important;
187187
}
188+
189+
body > div[style*="z-index: 9990"] {
190+
z-index: 10000 !important;
191+
}

frontend/src/i18n/ar.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"permissions": "الصلاحيات",
234234
"permissionsHelp": "يمكنك تعيين المستخدم كـ \"مدير\" أو تحديد الصلاحيات بشكل منفرد.\n إذا قمت بتحديد المستخدم كـ \"مدير\"، باقي الخيارات سيتم تحديدها تلقائياً.\n إدارة المستخدمين تبقى صلاحية فريدة للـ \"مدير\" فقط.\n",
235235
"profileSettings": "إعدادات الحساب",
236+
"redirectAfterCopyMove": "الانتقال إلى الموقع الجديد بعد النسخ/النقل",
236237
"ruleExample1": "منع الوصول إلى الملفات التي تبدأ بنقطة مثل (.git، و .gitignore) في كل مجلد.\n",
237238
"ruleExample2": "منع الوصول إلى الملف المسمى Caddyfile في نطاق الجذر.",
238239
"rules": "المجموعات",

frontend/src/i18n/bg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"permissions": "Разрешения",
234234
"permissionsHelp": "Можете да зададете потребител да бъде администратор или да изберете разрешения индивидуално. Ако изберете \"Администратор\" всички други опции ще бъдат автоматично отметнати. Управлението на потребителите е привилегия на администратор.\n",
235235
"profileSettings": "Настройки на Профила",
236+
"redirectAfterCopyMove": "Пренасочване към дестинацията след копиране/преместване",
236237
"ruleExample1": "предотвратете достъпа до всеки файл започващ с точка (като .git, .gitignore) във всяка папка.\n",
237238
"ruleExample2": "блокира достъпа до файл именуван Caddyfile поставен в началото за обхвата.",
238239
"rules": "Правила",

frontend/src/i18n/ca.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"permissions": "Permisos",
234234
"permissionsHelp": "Pots nomenar l'usuari com a administrador o triar els permisos individualment. Si selecciones \"Administrador\", totes les altres opcions s'activaran automàticament. L'administració d'usuaris és un privilegi d'administrador.\n",
235235
"profileSettings": "Ajustos del perfil",
236+
"redirectAfterCopyMove": "Redirigir a la destinació després de copiar/moure",
236237
"ruleExample1": "prevé l'accés a una extensió de fitxer (Com .git) en cada carpeta.\n",
237238
"ruleExample2": "bloqueja l'accés al fitxer anomenat Caddyfile a la carpeta arrel.",
238239
"rules": "Regles",

frontend/src/i18n/cs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"permissions": "Oprávnění",
234234
"permissionsHelp": "Můžete nastavit uživatele jako administrátora nebo zvolit jednotlivá oprávnění. Pokud vyberete \"Administrátor\", všechny ostatní možnosti budou automaticky zaškrtnuty. Správa uživatelů zůstává výsadou administrátora.\n",
235235
"profileSettings": "Nastavení profilu",
236+
"redirectAfterCopyMove": "Přesměrovat na cíl po kopírování/přesunutí",
236237
"ruleExample1": "zabraňuje přístupu k jakémukoli skrytému souboru (např. .git, .gitignore) v každé složce.\n",
237238
"ruleExample2": "blokuje přístup k souboru s názvem Caddyfile v kořenovém adresáři.",
238239
"rules": "Pravidla",

0 commit comments

Comments
 (0)