Compare commits

..

4 Commits

Author SHA1 Message Date
jagadam97
35ca24adb8 build: improve docker image and binary sizes 2025-07-12 08:46:22 +02:00
Henrique Dias
14b0dfec34
chore(release): 2.38.0 2025-07-12 08:02:41 +02:00
Jonathan Bout
528ce92fad
feat: Show the current users name in the sidebar (#2821)
Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
Co-authored-by: Henrique Dias <mail@hacdias.com>
2025-07-12 07:59:50 +02:00
Ryan
fbe169b84f
fix: prevent page change if there are outstanding edits (#5260) 2025-07-12 07:52:41 +02:00
9 changed files with 79 additions and 24 deletions

View File

@ -85,6 +85,8 @@ jobs:
node-version: "22.x" node-version: "22.x"
cache: "pnpm" cache: "pnpm"
cache-dependency-path: "frontend/pnpm-lock.yaml" cache-dependency-path: "frontend/pnpm-lock.yaml"
- name: Install upx
run: sudo apt-get install -y upx
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx

View File

@ -40,6 +40,17 @@ archives:
- goos: windows - goos: windows
formats: ["zip"] formats: ["zip"]
upx:
- enabled: true
goos:
- linux
- darwin
goarch:
- amd64
- arm64
compress: "best"
lzma: true
dockers: dockers:
# Alpine docker images # Alpine docker images
- dockerfile: Dockerfile - dockerfile: Dockerfile

View File

@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [2.38.0](https://github.com/filebrowser/filebrowser/compare/v2.37.0...v2.38.0) (2025-07-12)
### Features
* Show the current users name in the sidebar ([#2821](https://github.com/filebrowser/filebrowser/issues/2821)) ([528ce92](https://github.com/filebrowser/filebrowser/commit/528ce92fad6dcc8e8b7910036bf9175146e27bf7))
* Updates for project File Browser ([b4eddf4](https://github.com/filebrowser/filebrowser/commit/b4eddf45e4d7e6f6ccf242e67fe20f89f5e2f9a9))
### Bug Fixes
* prevent page change if there are outstanding edits ([#5260](https://github.com/filebrowser/filebrowser/issues/5260)) ([fbe169b](https://github.com/filebrowser/filebrowser/commit/fbe169b84f28cba22ea87f01b52f2420f1ea6814))
## [2.37.0](https://github.com/filebrowser/filebrowser/compare/v2.36.3...v2.37.0) (2025-07-08) ## [2.37.0](https://github.com/filebrowser/filebrowser/compare/v2.36.3...v2.37.0) (2025-07-08)

View File

@ -1,7 +1,7 @@
FROM alpine:3.22 FROM alpine:3.22
RUN apk update && \ RUN apk update && \
apk --no-cache add ca-certificates mailcap curl jq tini apk --no-cache add ca-certificates mailcap jq tini
# Make user and create necessary directories # Make user and create necessary directories
ENV UID=1000 ENV UID=1000

View File

@ -1,7 +1,7 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.22 FROM ghcr.io/linuxserver/baseimage-alpine:3.22
RUN apk update && \ RUN apk update && \
apk --no-cache add ca-certificates mailcap curl jq apk --no-cache add ca-certificates mailcap jq
# Make user and create necessary directories # Make user and create necessary directories
RUN mkdir -p /config /database /srv && \ RUN mkdir -p /config /database /srv && \

View File

@ -6,4 +6,4 @@ PORT=${FB_PORT:-$(jq -r .port /config/settings.json)}
ADDRESS=${FB_ADDRESS:-$(jq -r .address /config/settings.json)} ADDRESS=${FB_ADDRESS:-$(jq -r .address /config/settings.json)}
ADDRESS=${ADDRESS:-localhost} ADDRESS=${ADDRESS:-localhost}
curl -f http://$ADDRESS:$PORT/health || exit 1 wget -q --spider http://$ADDRESS:$PORT/health || exit 1

View File

@ -2,6 +2,10 @@
<div v-show="active" @click="closeHovers" class="overlay"></div> <div v-show="active" @click="closeHovers" class="overlay"></div>
<nav :class="{ active }"> <nav :class="{ active }">
<template v-if="isLoggedIn"> <template v-if="isLoggedIn">
<button @click="toAccountSettings" class="action">
<i class="material-icons">person</i>
<span>{{ user.username }}</span>
</button>
<button <button
class="action" class="action"
@click="toRoot" @click="toRoot"
@ -34,7 +38,7 @@
</button> </button>
</div> </div>
<div> <div v-if="user.perm.admin">
<button <button
class="action" class="action"
@click="toSettings" @click="toSettings"
@ -44,7 +48,7 @@
<i class="material-icons">settings_applications</i> <i class="material-icons">settings_applications</i>
<span>{{ $t("sidebar.settings") }}</span> <span>{{ $t("sidebar.settings") }}</span>
</button> </button>
</div>
<button <button
v-if="canLogout" v-if="canLogout"
@click="logout" @click="logout"
@ -56,7 +60,6 @@
<i class="material-icons">exit_to_app</i> <i class="material-icons">exit_to_app</i>
<span>{{ $t("sidebar.logout") }}</span> <span>{{ $t("sidebar.logout") }}</span>
</button> </button>
</div>
</template> </template>
<template v-else> <template v-else>
<router-link <router-link
@ -190,8 +193,12 @@ export default {
this.$router.push({ path: "/files" }); this.$router.push({ path: "/files" });
this.closeHovers(); this.closeHovers();
}, },
toSettings() { toAccountSettings() {
this.$router.push({ path: "/settings" }); this.$router.push({ path: "/settings/profile" });
this.closeHovers();
},
toGlobalSettings() {
this.$router.push({ path: "/settings/global" });
this.closeHovers(); this.closeHovers();
}, },
help() { help() {

View File

@ -39,21 +39,21 @@ import { files as api } from "@/api";
import buttons from "@/utils/buttons"; import buttons from "@/utils/buttons";
import url from "@/utils/url"; import url from "@/utils/url";
import ace, { Ace, version as ace_version } from "ace-builds"; import ace, { Ace, version as ace_version } from "ace-builds";
import modelist from "ace-builds/src-noconflict/ext-modelist";
import "ace-builds/src-noconflict/ext-language_tools"; import "ace-builds/src-noconflict/ext-language_tools";
import modelist from "ace-builds/src-noconflict/ext-modelist";
import DOMPurify from "dompurify"; import DOMPurify from "dompurify";
import HeaderBar from "@/components/header/HeaderBar.vue";
import Action from "@/components/header/Action.vue";
import Breadcrumbs from "@/components/Breadcrumbs.vue"; import Breadcrumbs from "@/components/Breadcrumbs.vue";
import Action from "@/components/header/Action.vue";
import HeaderBar from "@/components/header/HeaderBar.vue";
import { useAuthStore } from "@/stores/auth"; import { useAuthStore } from "@/stores/auth";
import { useFileStore } from "@/stores/file"; import { useFileStore } from "@/stores/file";
import { useLayoutStore } from "@/stores/layout"; import { useLayoutStore } from "@/stores/layout";
import { inject, onBeforeUnmount, onMounted, ref, watchEffect } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { getTheme } from "@/utils/theme"; import { getTheme } from "@/utils/theme";
import { marked } from "marked"; import { marked } from "marked";
import { inject, onBeforeUnmount, onMounted, ref, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
const $showError = inject<IToastError>("$showError")!; const $showError = inject<IToastError>("$showError")!;
@ -77,6 +77,7 @@ const isMarkdownFile =
onMounted(() => { onMounted(() => {
window.addEventListener("keydown", keyEvent); window.addEventListener("keydown", keyEvent);
window.addEventListener("wheel", handleScroll); window.addEventListener("wheel", handleScroll);
window.addEventListener("beforeunload", handlePageChange);
const fileContent = fileStore.req?.content || ""; const fileContent = fileStore.req?.content || "";
@ -126,9 +127,19 @@ onMounted(() => {
onBeforeUnmount(() => { onBeforeUnmount(() => {
window.removeEventListener("keydown", keyEvent); window.removeEventListener("keydown", keyEvent);
window.removeEventListener("wheel", handleScroll); window.removeEventListener("wheel", handleScroll);
window.removeEventListener("beforeunload", handlePageChange);
editor.value?.destroy(); editor.value?.destroy();
}); });
onBeforeRouteUpdate((to, from, next) => {
if (!editor.value?.session.getUndoManager().isClean()) {
layoutStore.showHover("discardEditorChanges");
next(false);
} else {
next();
}
});
const keyEvent = (event: KeyboardEvent) => { const keyEvent = (event: KeyboardEvent) => {
if (event.code === "Escape") { if (event.code === "Escape") {
close(); close();
@ -153,6 +164,15 @@ const handleScroll = (event: WheelEvent) => {
} }
}; };
const handlePageChange = (event: BeforeUnloadEvent) => {
if (!editor.value?.session.getUndoManager().isClean()) {
event.preventDefault();
// returnValue is now depecrated, though keeping in for legacy browser support
// https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent/returnValue
event.returnValue = true;
}
};
const save = async () => { const save = async () => {
const button = "save"; const button = "save";
buttons.loading("save"); buttons.loading("save");

View File

@ -30,6 +30,7 @@ type userInfo struct {
LockPassword bool `json:"lockPassword"` LockPassword bool `json:"lockPassword"`
HideDotfiles bool `json:"hideDotfiles"` HideDotfiles bool `json:"hideDotfiles"`
DateFormat bool `json:"dateFormat"` DateFormat bool `json:"dateFormat"`
Username string `json:"username"`
} }
type authToken struct { type authToken struct {
@ -198,6 +199,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
Commands: user.Commands, Commands: user.Commands,
HideDotfiles: user.HideDotfiles, HideDotfiles: user.HideDotfiles,
DateFormat: user.DateFormat, DateFormat: user.DateFormat,
Username: user.Username,
}, },
RegisteredClaims: jwt.RegisteredClaims{ RegisteredClaims: jwt.RegisteredClaims{
IssuedAt: jwt.NewNumericDate(time.Now()), IssuedAt: jwt.NewNumericDate(time.Now()),