diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml deleted file mode 100644 index b3fc8e8c..00000000 --- a/.github/workflows/dev.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: dev - -on: - push: - branches: - - 'dev_v*' - -jobs: - test-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go test -race -v ./... - lint-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59 - working-directory: backend - format-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go fmt ./... - lint-frontend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - working-directory: frontend - run: npm i eslint && npm run lint - - push_dev_to_registry: - name: Push dev image - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3.0.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.0.0 - # Workaround to fix error: - # failed to push: failed to copy: io: read/write on closed pipe - # See https://github.com/docker/build-push-action/issues/761 - with: - driver-opts: | - image=moby/buildkit:v0.10.6 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: gtstef/filebrowser - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e0eaae03..c6a29c5e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -3,48 +3,10 @@ name: main job on: push: branches: - - 'main' + - "main" jobs: - test-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go test -race -v ./... - lint-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59 - working-directory: backend - format-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go fmt ./... - lint-frontend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - working-directory: frontend - run: npm i eslint && npm run lint - push_latest_to_registry: - needs: [lint-frontend, lint-backend, test-backend, format-backend] name: Push latest runs-on: ubuntu-latest steps: diff --git a/.github/workflows/pr-merge.yaml b/.github/workflows/pr.yaml similarity index 51% rename from .github/workflows/pr-merge.yaml rename to .github/workflows/pr.yaml index 2c5a31b2..c7139ec9 100644 --- a/.github/workflows/pr-merge.yaml +++ b/.github/workflows/pr.yaml @@ -3,48 +3,11 @@ name: pr-merge on: pull_request: branches: - - 'main' - - 'dev_v*' - - 'v[0-9]+.[0-9]+.[0-9]+' + - "main" + - "v[0-9]+.[0-9]+.[0-9]+" + - "dev_*" jobs: - test-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go test -race -v ./... - lint-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59 - working-directory: backend - format-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go fmt ./... - lint-frontend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - working-directory: frontend - run: npm i eslint && npm run lint - push_pr_to_registry: name: Push PR runs-on: ubuntu-latest @@ -78,4 +41,4 @@ jobs: file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/regular-tests.yaml b/.github/workflows/regular-tests.yaml new file mode 100644 index 00000000..e042f395 --- /dev/null +++ b/.github/workflows/regular-tests.yaml @@ -0,0 +1,44 @@ +name: dev + +on: + push: + branches: + - "*" + +jobs: + test-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + - working-directory: backend + run: go test -race -v ./... + lint-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 + working-directory: backend + format-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + - working-directory: backend + run: go fmt ./... + lint-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - working-directory: frontend + run: npm i eslint && npm run lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8bfbeb15..3f842c78 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: release on: push: branches: - - 'v[0-9]+.[0-9]+.[0-9]+' + - "v[0-9]+.[0-9]+.[0-9]+" permissions: contents: write @@ -14,63 +14,27 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} - name: Extract branch name shell: bash run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT id: extract_branch + - uses: actions/setup-go@v5 + with: + go-version: 1.22.2 - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: + target_commitish: ${{ steps.extract_branch.outputs.branch }} + token: ${{ secrets.PAT }} tag_name: ${{ steps.extract_branch.outputs.branch }} - release_name: ${{ steps.extract_branch.outputs.branch }} - body: | - Please see usage on [readme](https://github.com/gtsteffaniak/filebrowser). - Docker repo: https://hub.docker.com/r/gtstef/filebrowser/tags - draft: false prerelease: false - test-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go test -race -v ./... - lint-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59 - working-directory: backend - format-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - working-directory: backend - run: go fmt ./... - lint-frontend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - working-directory: frontend - run: npm i eslint && npm run lint - + draft: false + generate_release_notes: true + name: ${{ steps.extract_branch.outputs.branch }} push_release_to_registry: - needs: [lint-frontend, lint-backend, test-backend, format-backend] name: Push release runs-on: ubuntu-latest steps: diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 00000000..0ed8d0c2 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,24 @@ +name: tag + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + update_tag: + name: Update Release tag + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + args: release --clean + workdir: backend + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 5d411b3a..120f1099 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@

Filebrowser - A modern web-based file manager

- +

> [!WARNING] > Starting with v0.2.0, *ALL* configuration is done via `filebrowser.yaml` -> configuration file. +> Configuration file. > Starting with v0.2.4 *ALL* share links need to be re-created (due to > security fix). @@ -20,7 +20,7 @@ origin: 1. [x] Better search - Lightning fast - - realtime results as you type + - real-time results as you type - Works with more type filters - interactive results page. 2. [x] Revamped and simplified GUI navbar and sidebar menu. @@ -28,49 +28,47 @@ origin: styles. 3. [x] Revamped configuration via `filebrowser.yml` config file. - More configurations possible at a per-user level - - image ## About Filebrowser provides a file managing interface within a specified directory -and it can be used to upload, delete, preview, rename and edit your files. -It allows the creation of multiple users and each user can have its own +and can be used to upload, delete, preview, rename, and edit your files. +It allows the creation of multiple users and each user can have its directory. This repository is a fork, a collection of changes that make this program -work better in terms of asthetics and performance. Improved search, +work better in terms of aesthetics and performance. Improved search, simplified ui (without removing features) and more secure and up-to-date build are just a few examples. This Implementation of filebrowser differs significantly to the original. -There are hundereds of thousands of lines changed and they are generally -no longer compatible with eachother. This has been intentional -- the +There are hundreds of thousands of lines changed and they are generally +no longer compatible with each other. This has been intentional -- the focus of this fork is on a few key principles: - Simplicity and improved user experience - Efficiency of operations and performance - - Minimizing external dependancies and usage of standard libraries. - - Of course -- adding much needed features. + - Minimize external dependencies and standard library usage. + - Of course -- adding much-needed features. ## Look One way you can observe the improved user experience is how I changed -the UI. The Navbar is simplified to a three component system : +the UI. The Navbar is simplified to a three-component system : 1. (Left) The slide-out action panel button 2. (Middle) The powerful search bar. 3. (Right) The view change toggle. All other functions are moved either into the action menu or popup menus. -If the action is does not depend on context, it will exist in the slide-out -action panel. If the action is available based on context, it will showup as +If the action does not depend on context, it will exist in the slide-out +action panel. If the action is available based on context, it will show up as a popup menu.

- - image - image - image - image + + + +

## Install @@ -135,7 +133,7 @@ Note: Must download asset with frontend directory next to filebrowser binary ## Configuration All configuration is now done via a single configuration file: -`filebrowser.yaml`, here is an example minimal [configuration +`filebrowser.yaml`, here is an example of minimal [configuration file](./backend/filebrowser.yaml). View the [Configuration Help Page](./configuration.md) for available @@ -144,8 +142,8 @@ configuration options and other help. ## Migration from filebrowser/filebrowser -If you are currently using filebrowser from the filebrowser/filebrowser -repo, but want to try using this. I recommend you start fresh without +If you currently use filebrowser from the filebrowser/filebrowser +repo but want to try using this. I recommend you start fresh without reusing the database, but there are a few things you'll need to do if you must migrate: @@ -158,33 +156,13 @@ must migrate: command to use the config file as described in the install section above. 5. If you are not using docker, just make sure you run filebrowser -c - filebrowser.yml and have valid filebrowser config. + filebrowser.yml and have a valid filebrowser config. The filebrowser application should run with the same user and rules that you have from the original. But keep in mind the differences that are mentioned at the top of this readme. -### background & help - -The original project filebrowser/filebrowser used multiple different ways -to configure the server. This was confusing and difficult to work with -from a user and from a developer's perspective. So I completely redesigned -the program to use one single human-readable config file. - -I understand many coming from the original fork may notice differences -which make using this improved version more difficult. If you notice -issues that you believe should be fixed, please open an issue here and it -will very likely be addressed with a PR within a few weeks. - -This version of filebrowser is going through a configuration overhaul as -mentioned above. Certain features related to rules and commands may not -work as they do on the original filebrowser. The purpose of this is to -create a more consistent experience where configuration is done via files -rather than running commands, so that it's very clear what the current -state of the configuration is. When running commands its not clear what -the configuration is. - ## Roadmap see [Roadmap Page](./roadmap.md) diff --git a/backend/version/version.go b/backend/version/version.go index 7534745f..23a2978f 100644 --- a/backend/version/version.go +++ b/backend/version/version.go @@ -2,7 +2,7 @@ package version var ( // Version is the current File Browser version. - Version = "(0.2.6)" + Version = "(0.2.7)" // CommitSHA is the commmit sha. CommitSHA = "(unknown)" ) diff --git a/frontend/src/api/users.js b/frontend/src/api/users.js index b5f554bf..78a97015 100644 --- a/frontend/src/api/users.js +++ b/frontend/src/api/users.js @@ -30,7 +30,6 @@ export async function update(user, which = ["all"]) { if (user.username == "publicUser") { return } - console.log("updating user",user,which) await fetchURL(`/api/users/${user.id}`, { method: "PUT", body: JSON.stringify({ diff --git a/frontend/src/components/Search.vue b/frontend/src/components/Search.vue index ddf6fa59..e822b694 100644 --- a/frontend/src/components/Search.vue +++ b/frontend/src/components/Search.vue @@ -29,7 +29,12 @@ -
+
Search Context: {{ getContext }}
@@ -97,7 +102,7 @@
-
+
Search Context: {{ getContext }}
diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js index 3cba705a..c02717a3 100644 --- a/frontend/src/store/getters.js +++ b/frontend/src/store/getters.js @@ -40,7 +40,8 @@ export const getters = { return false } const hasPrompt = getters.currentPrompt() !== null && getters.currentPromptName() !== "more"; - return hasPrompt || getters.isSidebarVisible(); + const shouldOverlaySidebar = getters.isSidebarVisible() && !getters.isStickySidebar() + return hasPrompt || shouldOverlaySidebar; }, getRoutePath: () => { return state.route.path.endsWith("/") diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js index 89b2116a..f01dc253 100644 --- a/frontend/src/store/mutations.js +++ b/frontend/src/store/mutations.js @@ -6,7 +6,6 @@ import { users } from "@/api"; export const mutations = { setMobile() { state.mobile = window.innerWidth <= 800 - console.log("state updated",state.mobile) emitStateChanged(); }, toggleDarkMode() { diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index 5db3fc3e..ba5e4cdb 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -60,7 +60,6 @@ export default { $route: "fetchData", reload(value) { if (value) { - console.log("reloading"); this.fetchData(); } }, diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index cf1cb548..ce6d0d02 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -63,7 +63,7 @@ export default { }, computed: { showSearch() { - return getters.isFiles() && getters.isLoggedIn(); + return getters.isLoggedIn() && this.currentView == "listingView"; }, isLoggedIn() { return getters.isLoggedIn(); @@ -121,7 +121,6 @@ export default { }, methods: { updateIsMobile() { - console.log("setting"); mutations.setMobile(); }, resetPrompts() {