Compare commits

...
Author SHA1 Message Date
Graham Steffaniak 7eda40a77a patch stable download delay 2025-12-02 09:18:07 -06:00
Graham Steffaniak 2f604a7339 release 2025-11-25 11:57:33 -06:00
Graham Steffaniak ab4973447a updated password protected shares (#1658) 2025-11-25 11:18:05 -06:00
Graham Steffaniak 8c267a6bec updated staging v1.0.2 2025-11-24 15:32:37 -06:00
dc60832d22 Patch/misc fixes (#1558)
Co-authored-by: Pyro <pyrodd@gmail.com>
Co-authored-by: Kevin B. <kurami32_kbm@proton.me>
Co-authored-by: lps-rocks <10893911+lps-rocks@users.noreply.github.com>
Co-authored-by: contributor <foss.contributor@gmail.com>
Co-authored-by: Sarabanga <96509626+Sarabanga@users.noreply.github.com>
Co-authored-by: Ironic <202444094+YoureIronic@users.noreply.github.com>
2025-11-10 10:40:13 -06:00
Graham Steffaniak 809e1e5ea4 patch a few bugs 2025-11-05 18:46:57 -06:00
24 changed files with 128 additions and 62 deletions

No files matched your search

+29 -2
View File
@@ -2,7 +2,34 @@
All notable changes to this project will be documented in this file. For commit guidelines, please refer to [Standard Version](https://github.com/conventional-changelog/standard-version).
## v1.0.1
## v1.0.3-stable
**BugFixes**:
- download progress is not shown #1687
## v1.0.2-stable
**Notes**:
- [docker] upgraded ffmpeg 8.0 to 8.0.1
**BugFixes**:
- added missing exiftool to docker image for heic conversion orientation support
- Uploading a file will silently overwrite any existing file with the same name #1564
- Unable to download folder as ZIP #1604
- issues downloading and file actions on password protected share
## v1.0.1-stable
**BugFixes**:
- UserDefault always applies to newly created users #1518
- Updating user's own password sometimes doesn't work
- Anonymous Share link with optional password does not allow downloads #1553
- Share options should go in the meta tags #1511
- Unable to select compression format when downloading multiple files/dir via Share link (v1.0.0) #1557
- fixed sidebar clipping on some browsers like safari
- Files show as Download is not available even though it is #1537
## v1.0.1-beta & v1.0.0-stable
**New Features**:
- login icon support added via `frontend.loginIcon` config path variable
@@ -27,7 +54,7 @@ All notable changes to this project will be documented in this file. For commit
- fixed some condition that the halloween background doesn't load properly
- some comments not showing up on config viewer in settings
## v1.0.0
## v1.0.0-beta
**Notes**:
- Enhanced onlyoffice debugger with more wholistic backend logs
-3
View File
@@ -15,9 +15,6 @@
<img width="800" src="https://github.com/user-attachments/assets/162d7a95-33b7-49bd-976c-dd6822c0d22b">
</div>
> [!WARNING]
> There is no stable version -- :construction: coming very soon!
## Pinned
:loudspeaker: [Stable Release & v1.0.0 Update](https://github.com/gtsteffaniak/filebrowser/discussions/1293)
+6 -4
View File
@@ -1,4 +1,4 @@
FROM gtstef/ffmpeg:8.0-decode AS ffmpeg
FROM gtstef/ffmpeg:8.0.1-decode AS ffmpeg
FROM golang:alpine AS base
ARG VERSION
ARG REVISION
@@ -13,7 +13,7 @@ RUN go build -tags mupdf,musl -ldflags="-w -s \
-o filebrowser .
RUN upx filebrowser
FROM node:lts-slim AS nbuild
FROM node:jod-slim AS nbuild
WORKDIR /app
COPY ./frontend/package.json ./
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
@@ -28,19 +28,21 @@ COPY --from=ffmpeg [ "/ffmpeg", "/ffprobe", "/usr/local/bin/" ]
ENV FILEBROWSER_FFMPEG_PATH="/usr/local/bin/"
ENV FILEBROWSER_DATABASE="/home/filebrowser/data/database.db"
ENV PATH="$PATH:/home/filebrowser"
RUN apk --no-cache add ca-certificates mailcap tzdata curl
RUN apk --no-cache add ca-certificates mailcap tzdata curl exiftool
RUN adduser -D -s /bin/true -u 1000 filebrowser
USER filebrowser
WORKDIR /home/filebrowser
# copy config to two locations for compatibility
COPY --from=base --chown=filebrowser:1000 [ "/app/filebrowser", "/app/config.yaml", "./" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/filebrowser", "./" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/config.yaml", "./data/config.yaml" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/config.yaml", "./" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/reduce-rounded-corners.css", "./" ]
COPY --from=nbuild --chown=filebrowser:1000 [ "/app/dist/", "./http/dist/" ]
## sanity checks
RUN [ "filebrowser", "version" ]
RUN [ "ffmpeg", "-version" ]
RUN [ "ffprobe", "-version" ]
RUN [ "exiftool", "-ver" ]
USER root
# exposing default port for auto discovery.
EXPOSE 80
+1
View File
@@ -30,6 +30,7 @@ USER filebrowser
WORKDIR /home/filebrowser
COPY --from=base --chown=filebrowser:1000 [ "/app/filebrowser", "./" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/config.yaml", "./data/config.yaml" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/config.yaml", "./" ]
COPY --from=base --chown=filebrowser:1000 [ "/app/reduce-rounded-corners.css", "./" ]
COPY --from=nbuild --chown=filebrowser:1000 [ "/app/dist/", "./http/dist/" ]
## sanity checks
+1 -1
View File
@@ -112,7 +112,7 @@ func runCLI() bool {
}
newUser.Permissions = settings.Config.UserDefaults.Permissions
newUser.Permissions.Admin = asAdmin
err = storage.CreateUser(newUser)
err = storage.CreateUser(newUser, newUser.Permissions)
if err != nil {
logger.Errorf("could not create user: %v", err)
}
+7 -3
View File
@@ -7,6 +7,7 @@ import (
"strings"
"time"
"github.com/gtsteffaniak/filebrowser/backend/common/settings"
"github.com/gtsteffaniak/filebrowser/backend/common/version"
"github.com/gtsteffaniak/go-logger/logger"
"golang.org/x/mod/semver"
@@ -30,6 +31,9 @@ func CheckForUpdates() (updateInfo, error) {
repoOwner := "gtsteffaniak"
repoName := "filebrowser"
currentVersion := version.Version
if currentVersion == "untracked" || currentVersion == "testing" || currentVersion == "" || settings.Config.Env.IsDevMode {
return updateInfo{}, nil
}
splitVersion := strings.Split(currentVersion, "-")
versionCategory := "stable"
if len(splitVersion) > 1 {
@@ -51,13 +55,13 @@ func CheckForUpdates() (updateInfo, error) {
if err := json.NewDecoder(resp.Body).Decode(&tags); err != nil {
return updateInfo{}, err
}
// Find the latest beta version greater than the current one
// Find the latest version greater than the current one that matches the version category
var NewVersion string
for _, tag := range tags {
// Check if the version is valid, is a pre-release, and contains "beta"
// Check if the version is valid and the prerelease contains the version category
if semver.IsValid(tag.Name) && strings.Contains(semver.Prerelease(tag.Name), versionCategory) {
// Check if this tag is greater than the current version
// and also greater than any other beta version we've found so far
// and also greater than any other version we've found so far
if semver.Compare(tag.Name, currentVersion) > 0 {
if NewVersion == "" || semver.Compare(tag.Name, NewVersion) > 0 {
NewVersion = tag.Name
+4
View File
@@ -84,6 +84,10 @@ func (st usersBackend) Update(user *users.User, actorIsAdmin bool, fields ...str
return err
}
if user.LoginMethod == "" {
user.LoginMethod = existingUser.LoginMethod
}
if !slices.Contains(fields, "Password") {
user.Password = existingUser.Password
} else {
+3 -1
View File
@@ -107,7 +107,7 @@ func quickSetup(store *bolt.BoltStore) {
}
// create new user
func CreateUser(userInfo users.User) error {
func CreateUser(userInfo users.User, permissions users.Permissions) error {
newUser := &userInfo
newUser.ShowFirstLogin = settings.Config.Env.IsFirstLoad && newUser.Permissions.Admin
if userInfo.LoginMethod == "password" {
@@ -125,6 +125,8 @@ func CreateUser(userInfo users.User) error {
if userInfo.Username == "" {
return fmt.Errorf("username is required to create a user")
}
settings.ApplyUserDefaults(newUser)
newUser.Permissions = permissions
logger.Debugf("Creating user: %v %v", userInfo.Username, userInfo.Scopes)
// create new home directories
err := userStore.Save(newUser, true, false)
+2 -3
View File
@@ -84,7 +84,7 @@ func setupProxyUser(r *http.Request, data *requestContext, proxyUser string) (*u
if user.Username == config.Auth.AdminUsername {
user.Permissions.Admin = true
}
err = storage.CreateUser(user)
err = storage.CreateUser(user, user.Permissions)
if err != nil {
return nil, err
}
@@ -223,8 +223,7 @@ func signupHandler(w http.ResponseWriter, r *http.Request, d *requestContext) (i
},
LoginMethod: users.LoginMethodPassword,
}
user.Permissions = settings.Config.UserDefaults.Permissions
err := storage.CreateUser(user)
err := storage.CreateUser(user, settings.Config.UserDefaults.Permissions)
if err != nil {
logger.Debug(err.Error())
// Return the actual error message instead of a generic one
+1 -1
View File
@@ -300,7 +300,7 @@ func loginWithOidcUser(w http.ResponseWriter, r *http.Request, username string,
if isAdmin {
user.Permissions.Admin = true
}
err = storage.CreateUser(*user)
err = storage.CreateUser(*user, user.Permissions)
if err != nil {
return http.StatusInternalServerError, err
}
+6 -1
View File
@@ -378,7 +378,12 @@ func resourcePostHandler(w http.ResponseWriter, r *http.Request, d *requestConte
}
fileInfo, err := files.FileInfoFaster(fileOpts, accessStore)
if err != nil {
if err == nil { // File exists
if r.URL.Query().Get("override") != "true" {
logger.Debugf("resource already exists: %v", fileInfo.RealPath)
return http.StatusConflict, nil
}
// If overriding, delete existing thumbnails
preview.DelThumbs(r.Context(), *fileInfo)
}
err = files.WriteFile(fileOpts.Source, fileOpts.Path, r.Body)
+6 -4
View File
@@ -70,6 +70,8 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
defaultThemeColor := "#455a64"
staticURL := config.Server.BaseURL + "public/static"
description := config.Frontend.Description
title := config.Frontend.Name
// Use custom favicon if configured and validated, otherwise fall back to default
var favicon string
@@ -148,10 +150,10 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
}
}
if d.share.Description != "" {
data["description"] = d.share.Description
description = d.share.Description
}
if d.share.Title != "" {
data["title"] = d.share.Title
title = d.share.Title
}
if d.share.ShareTheme != "" {
theme, ok := config.Frontend.Styling.CustomThemeOptions[d.share.ShareTheme]
@@ -176,7 +178,7 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
loginIcon := staticURL + "/loginIcon"
data["htmlVars"] = map[string]interface{}{
"title": config.Frontend.Name,
"title": title,
"customCSS": config.Frontend.Styling.CustomCSSRaw,
"userSelectedTheme": userSelectedTheme,
"lightBackground": config.Frontend.Styling.LightBackground,
@@ -188,7 +190,7 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
"color": defaultThemeColor,
"winIcon": staticURL + "/img/icons/mstile-144x144.png",
"appIcon": staticURL + "/img/icons/android-chrome-256x256.png",
"description": config.Frontend.Description,
"description": description,
}
// variables consumed by frontend as json
data["globalVars"] = map[string]interface{}{
+1 -1
View File
@@ -164,7 +164,7 @@ func usersPostHandler(w http.ResponseWriter, r *http.Request, d *requestContext)
return http.StatusBadRequest, errors.ErrEmptyPassword
}
err = storage.CreateUser(req.User)
err = storage.CreateUser(req.User, req.User.Permissions)
if err != nil {
return http.StatusInternalServerError, err
}
+9 -7
View File
@@ -1,6 +1,6 @@
import { fetchURL, adjustedData } from './utils'
import { getApiPath, doubleEncode, getPublicApiPath } from '@/utils/url.js'
import { mutations } from '@/store'
import { mutations,state } from '@/store'
import { notify } from '@/notify'
import { globalVars } from '@/utils/constants'
@@ -85,7 +85,7 @@ export async function put(source, path, content = '') {
}
}
export function download(format, files, shareHash = "") {
export async function download(format, files, shareHash = "") {
if (format !== 'zip') {
format = 'tar.gz'
}
@@ -101,17 +101,19 @@ export function download(format, files, shareHash = "") {
const apiPath = getApiPath(shareHash == "" ? 'api/raw' : 'public/api/raw', {
files: fileargs,
algo: format,
hash: shareHash
hash: shareHash,
...(state.share.token && { token: state.share.token }),
sessionId: state.sessionId
})
const url = window.origin + apiPath
// Create a temporary <a> element to trigger the download
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '') // Ensures it triggers a download
link.style.display = 'none'
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // Clean up
setTimeout(() => {
document.body.removeChild(link)
}, 100)
}
export function post(
+10
View File
@@ -117,6 +117,10 @@ export function post(
if (!hash || hash === undefined || hash === null) {
throw new Error('no hash provided')
}
let sharePassword = localStorage.getItem("sharepass:" + hash);
if (sharePassword) {
headers["X-SHARE-PASSWORD"] = sharePassword;
}
try {
const apiPath = getPublicApiPath("resources", {
targetPath: doubleEncode(path),
@@ -184,11 +188,17 @@ async function resourceAction(path, method, content) {
throw new Error('invalid share')
}
try {
let headers = {};
let sharePassword = localStorage.getItem("sharepass:" + shareInfo.hash);
if (sharePassword) {
headers["X-SHARE-PASSWORD"] = sharePassword;
}
path = doubleEncode(path)
const apiPath = getPublicApiPath('resources', { path, hash: shareInfo.hash, token: shareInfo.token })
const response = await fetch(apiPath, {
method,
body: content,
headers,
});
if (!response.ok) {
const error = new Error(response.statusText);
+1 -1
View File
@@ -261,7 +261,7 @@ export default {
// Add keyboard event listener for "/" to activate search
this.handleKeydown = (event) => {
if (event.key === '/' && !state.isSearchActive) {
if (event.key === '/' && !state.isSearchActive && getters.currentPrompt() === null) {
event.preventDefault();
this.open();
}
@@ -27,7 +27,8 @@
</div>
<div v-if="!shareInfo.disableDownload" class="share__box__element share__box__center">
<button class="button button--flat clickable" @click="goToDownload()"> {{ $t("buttons.download") }} </button>
<button class="button button--flat clickable" @click="goToDownload()"> {{ $t("buttons.download") }}
</button>
</div>
</div>
@@ -41,7 +42,7 @@
<script>
import { publicApi } from "@/api";
import { state, getters } from "@/store";
import { state, getters, mutations } from "@/store";
import { getHumanReadableFilesize } from "@/utils/filesizes";
import { getTypeInfo } from "@/utils/mimetype";
import QrcodeVue from "qrcode.vue";
@@ -115,13 +116,29 @@ export default {
},
methods: {
goToDownload() {
const downloadLink = publicApi.getDownloadURL({
path: "/",
hash: state.share.hash,
token: state.share.token,
inline: false,
}, [state.req.path]);
window.open(downloadLink, "_blank");
if (state.req.items.length > 1) {
mutations.showHover({
name: "download",
confirm: (format) => {
mutations.closeHovers();
const downloadLink = publicApi.getDownloadURL({
path: "/",
hash: state.share.hash,
token: state.share.token,
inline: false,
}, [state.req.path]);
window.open(downloadLink + "&format=" + format, "_blank");
},
});
} else {
const downloadLink = publicApi.getDownloadURL({
path: "/",
hash: state.share.hash,
token: state.share.token,
inline: false,
}, [state.req.path]);
window.open(downloadLink, "_blank");
}
},
getShareLink() {
return publicApi.getShareURL({
+1 -3
View File
@@ -514,9 +514,7 @@ button.action {
}
.headline-card {
padding: 1em;
overflow: hidden !important;
min-height: fit-content;
padding: 0.5em;
}
.person-button {
+13 -3
View File
@@ -13,13 +13,23 @@ export default function downloadFiles(items) {
}
if (getters.isShare()) {
// Perform download without opening a new window
startDownload(null, items, state.share.hash);
if (getters.isSingleFileSelected()) {
startDownload(null, items, state.share.hash);
} else {
// Multiple files download with user confirmation
mutations.showHover({
name: "download",
confirm: (format) => {
mutations.closeHovers();
startDownload(format, items, state.share.hash);
},
});
}
return;
}
if (getters.isSingleFileSelected()) {
startDownload(null, items);
return;
} else {
// Multiple files download with user confirmation
mutations.showHover({
@@ -34,7 +44,7 @@ export default function downloadFiles(items) {
async function startDownload(config, files, hash = "") {
try {
filesApi.download(config, files, hash);
await filesApi.download(config, files, hash);
notify.showSuccess("Downloading...");
} catch (e) {
notify.showError(`Error downloading: ${e}`);
-3
View File
@@ -104,7 +104,6 @@ export default {
},
created() {
if (getters.eventTheme() === "halloween" && !localStorage.getItem("seenHalloweenMessage")) {
mutations.showHover({
name: "generic",
props: {
@@ -129,9 +128,7 @@ export default {
},
});
}
this.fetchData();
},
watch: {
$route: "fetchData",
-3
View File
@@ -967,9 +967,6 @@ export default {
mutations.setMultiple(val == true);
showMultipleSelection();
},
openSearch() {
this.currentPrompt = "search";
},
windowsResize: throttle(function () {
this.colunmsResize();
this.width = window.innerWidth;
+1 -1
View File
@@ -88,7 +88,7 @@ export default {
},
computed: {
permissions() {
return state.user.permissions;
return getters.permissions();
},
showImage() {
if (state.req.type == "image/heic" || state.req.type == "image/heif") {
@@ -27,8 +27,4 @@ test("share download multiple files", async ({ page, checkForErrors, context })
await page.locator('button[aria-label="Download"]').waitFor({ state: 'visible' });
await page.locator('button[aria-label="Download"]').click();
const popup2 = page.locator('#popup-notification-content');
await popup2.waitFor({ state: 'visible' });
await expect(popup2).toHaveText("Downloading...");
checkForErrors(0,1);
});
@@ -43,8 +43,4 @@ test("share download multiple files", async ({ page, checkForErrors, context })
await page.locator('button[aria-label="Download"]').waitFor({ state: 'visible' });
await page.locator('button[aria-label="Download"]').click();
const popup2 = page.locator('#popup-notification-content');
await popup2.waitFor({ state: 'visible' });
await expect(popup2).toHaveText("Downloading...");
checkForErrors(0,1); // redirect errors are expected
});