Seperated code frontend/backend

- also temporarily un-embeded filesystem for debugging
This commit is contained in:
graham 2023-06-13 08:15:11 -05:00
parent 3945228161
commit 619385dd05
117 changed files with 73 additions and 32 deletions

View File

@ -6,8 +6,7 @@ RUN npm run build
FROM golang:alpine as base FROM golang:alpine as base
WORKDIR /app WORKDIR /app
COPY ./src/ ./ COPY ./src/backend ./
COPY --from=nbuild /app/dist ./frontend/dist
RUN go build -o filebrowser . RUN go build -o filebrowser .
FROM alpine:latest FROM alpine:latest
@ -24,4 +23,6 @@ EXPOSE 80
COPY --from=base /app/docker_config.json /.filebrowser.json COPY --from=base /app/docker_config.json /.filebrowser.json
COPY --from=base /app/filebrowser /filebrowser COPY --from=base /app/filebrowser /filebrowser
COPY --from=nbuild /app/dist/ ./frontend/dist/
ENTRYPOINT [ "/filebrowser" ] ENTRYPOINT [ "/filebrowser" ]

View File

@ -1,33 +1,70 @@
<p align="center"> ## gtstef fork of filebrowser
<img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/>
</p>
![Preview](https://user-images.githubusercontent.com/5447088/50716739-ebd26700-107a-11e9-9817-14230c53efd2.gif) Intended for docker use only, makes the following significant changes to filebrowser;
[![Build](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml) 1. Improves search to use index instead of filesystem search.
[![Go Report Card](https://goreportcard.com/badge/github.com/filebrowser/filebrowser?style=flat-square)](https://goreportcard.com/report/github.com/filebrowser/filebrowser) - lightning fast
[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/filebrowser/filebrowser) - realtime results as you type
[![Version](https://img.shields.io/github/release/filebrowser/filebrowser.svg?style=flat-square)](https://github.com/filebrowser/filebrowser/releases/latest) 1. Preview enhancments
[![Chat IRC](https://img.shields.io/badge/freenode-%23filebrowser-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23filebrowser) - preview default view is constrained to files subwindow, which can be toggled to fullscreen.
1. Updated node version and dependancies
- uses latest npm and node version
- removes deprecated npm packages
1. Improved routing
- fixed bugs in original version
1. Added authentication type
- Using bearer token with remote authentication server
## 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 directory. It can be used as a standalone app. 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 directory. It can be used as a standalone app.
## Features
Please refer to our docs at [https://filebrowser.org/features](https://filebrowser.org/features)
## Install ## Install
For installation instructions please refer to our docs at [https://filebrowser.org/installation](https://filebrowser.org/installation). Using docker:
1. docker run:
```
```
1. docker-compose:
- with local storage
```
version: '3.7'
services:
filebrowser:
volumes:
- '/path/to/folder:/srv'
#- './database/:/database/'
#- './config.json:/.filebrowser.json'
ports:
- '8080:80'
image: gtstef/filebrowser:0.1.0
```
- with network share
```
version: '3.7'
services:
filebrowser:
volumes:
- 'nas:/srv'
#- './database/:/database/'
#- './config.json:/.filebrowser.json'
ports:
- '8080:80'
image: gtstef/filebrowser:0.1.0
volumes:
nas:
driver_opts:
type: cifs
o: "username=myusername,password=mypassword,rw"
device: "//fileshare/"
```
## Configuration ## Configuration
[Authentication Method](https://filebrowser.org/configuration/authentication-method) - You can change the way the user authenticates with the filebrowser server
[Command Runner](https://filebrowser.org/configuration/command-runner) - The command runner is a feature that enables you to execute any shell command you want before or after a certain event.
[Custom Branding](https://filebrowser.org/configuration/custom-branding) - You can customize your File Browser installation by change its name to any other you want, by adding a global custom style sheet and by using your own logotype if you want.
## Contributing
If you're interested in contributing to this project, our docs are best places to start [https://filebrowser.org/contributing](https://filebrowser.org/contributing).

View File

@ -23,7 +23,6 @@ import (
"github.com/filebrowser/filebrowser/v2/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/diskcache" "github.com/filebrowser/filebrowser/v2/diskcache"
"github.com/filebrowser/filebrowser/v2/frontend"
fbhttp "github.com/filebrowser/filebrowser/v2/http" fbhttp "github.com/filebrowser/filebrowser/v2/http"
"github.com/filebrowser/filebrowser/v2/img" "github.com/filebrowser/filebrowser/v2/img"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
@ -35,6 +34,14 @@ var (
cfgFile string cfgFile string
) )
type dirFS struct {
http.Dir
}
func (d dirFS) Open(name string) (fs.File, error) {
return d.Dir.Open(name)
}
func init() { func init() {
cobra.OnInitialize(initConfig) cobra.OnInitialize(initConfig)
cobra.MousetrapHelpText = "" cobra.MousetrapHelpText = ""
@ -170,11 +177,7 @@ user created with the credentials from options "username" and "password".`,
signal.Notify(sigc, os.Interrupt, syscall.SIGTERM) signal.Notify(sigc, os.Interrupt, syscall.SIGTERM)
go cleanupHandler(listener, sigc) go cleanupHandler(listener, sigc)
assetsFs, err := fs.Sub(frontend.Assets(), "dist") assetsFs := dirFS{Dir: http.Dir("frontend/dist")}
if err != nil {
panic(err)
}
handler, err := fbhttp.NewHandler(imgSvc, fileCache, d.store, server, assetsFs) handler, err := fbhttp.NewHandler(imgSvc, fileCache, d.store, server, assetsFs)
checkErr(err) checkErr(err)

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Some files were not shown because too many files have changed in this diff Show More