Coder Social home page Coder Social logo

pldubouilh / gossa Goto Github PK

View Code? Open in Web Editor NEW
864.0 18.0 72.0 6.97 MB

🎶 a fast and simple multimedia fileserver

License: MIT License

Makefile 9.25% HTML 0.29% JavaScript 0.26% Go 87.67% Dockerfile 1.73% Shell 0.79%
golang self-hosted filesharing fileserver server homeserver pwa data-hoarder homelab

gossa's Introduction

gossa

e

build status docker pulls github downloads

a fast and simple webserver for your files, that's dependency-free and with under 250 lines of code, easy to review.

a simple UI comes as default, featuring :

  • 🔍 files/directories browser & handler
  • 📩 drag-and-drop uploader
  • 💾 90s web UI that prints in milliseconds
  • 📸 video streaming, picture browser, pdf viewer
  • ✍️ simple note editor
  • ⌨️ keyboard navigation
  • 🚀 lightweight and dependency free codebase
  • 🔒 >95% test coverage and reproducible builds
  • 🥂 fast golang static server
  • 💑 easy multi account setup, read-only mode
  • ✨ PWA-able
  • 🖥️ multi-platform support

install / build

arch linux (AUR) - e.g. yay -S gossa

nix - e.g. nix-shell -p gossa

binaries are available on the release page - or simply make build this repo.

all builds are reproducible, checkout the hashes on the release page.

usage

% ./gossa --help

% ./gossa -h 192.168.100.33 ~/storage

shortcuts

press Ctrl/Cmd + h to see all the UI/keyboard shortcuts.

fancier setups

release images are pushed to dockerhub, e.g. :

# pull from dockerhub and run
% mkdir ~/LocalDirToShare
% sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 pldubouilh/gossa

in a do-one-thing-well mindset, HTTPS and authentication has been left to middlewares and proxies. sample caddy configs are available to quickly setup multi users setups along with https.

automatic boot-time startup can be handled with a user systemd service - see support

gossa's People

Contributors

fowlmouth avatar jeslinmx avatar kebertxela avatar kovmir avatar pldubouilh avatar shrmnk avatar syncom avatar utdemir avatar va1entin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gossa's Issues

Run behind reverse path based

Currently, this can't be run behind a path based reverse proxy.
Are there any plans to implement this feature?

Otherwise I'll implement it by myself if it does not require too many modifications and do a PR.

Enhancement/feature idea (zip, 7z, tar, tgz, etc.) archive file browsing

Any thoughts on supporting browsing inside of archives so that files could be extracted and downloaded (perhaps added, renamed as well) via the web UI without downloading the entire (ZIP) archive?

This isn't something I desperately need but it would be something I could see myself using (I had a use case this evening where it would have been useful, it was a really large ZIP file that I did not want to pull down to my phone, I only wanted to look inside).

[Pull request] Backend rewrite and many improvements

Hello! I love this project and I have been using it for a long time, but after looking at the code, I noticed multiple problems. I ended up rewriting the whole backend and I think it works much better now. My rewrite is fully backwards-compatible with your project.

You can find my rewrite here: https://github.com/ViRb3/gosses
If you are interested, I would be happy to merge all my changes into this project.

Here are the major changes:

  • Echo is now used as the HTTP webserver, removing certain manual implementations.
  • zerolog is now used for logging, providing colorful, structured logs. Additionally, a -json flag has been added for pure JSON logs.
  • The frontend is now automatically embedded using Go 1.16's native implementation, removing the need for manual build steps.
  • All errors are now properly checked and handled instead of skipping them and hoping something would crash if there's a problem.
  • Path building is now accomplished using the standard path and filepath packages instead of manually appending strings. This ensures robust handling in all cases. Path traversal is also safeguarded by the standard packages.
  • ZIP files are now streamed directly to the client instead of building them in memory. This makes handling larger files much more effective.
  • ZIP file compression is disabled (Store), removing any performance impact.
  • Docker images are now multi-arch and support all major architectures instead of just amd64.
  • Dependabot is enabled for automatic dependency updates.
  • Automatic versioning is enabled through semantic-release.

Thanks!

Rename error when file name has special characters

See log:

2020/02/20 12:32:01 error [rpc {mv [/油管_韩雪&鞠婧祎&原版三版《红昭愿》放在一起自见分晓.mp4 /韩雪&鞠婧祎&原版三版《红昭愿》放在一起自见分晓.mp4]}] rename /root/share/油管_韩雪&鞠婧祎&原版三版《红昭愿》放在一起自见分晓.mp4 /root/share/韩雪&鞠婧祎&原版三版《红昭愿》放在一起自见分晓.mp4: no such file or directory

Original file name:
油管_韩雪&鞠婧祎&原版三版《红昭愿》放在一起自见分晓.mp4

rest api

An api would be nice to be able to

  • create directory
  • upload file
  • get list of files and sub directories for a directory

Docker image runs gossa as root by default

Running by root works out fine if the files being shared by gossa are exclusively being used by gossa. However, for example, I am using syncthing to sync my files between my vps, my desktop and my phone, but also want to make my files available through a web ui, and so am using gossa for this purpose. It is not ideal to have gossa running as root in this case, as new files and folders will be owned by root:root.

The ability to set the uid and gid of the processes within the container through an environment variable is common in several widely used images of popular server apps (e.g. wonderfall/nextcloud, linuxserver/syncthing). I could make a PR for this if this is of interest to anyone?

permission denied

I run gossa in docker, and the run cmd is :
sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 pldubouilh/gossa
but when i upload a file,for example css file, the docker log show me:
error [upload %2Fstyle.css] open /shared/style.css: permission denied.

i tried other kind file , same err, why?

comics (cbr, cbz) support

Works great already for PDF, can you add the support of cbr, cbz , basically a zip or rar containing images. This would make this a perfect all in one media viewer.

suggestion

First of all this tool is really good! One requirement: It is recommended to add user authentication function, thank you! stay tuned!

Docker does not match the arm64 platform

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested.

Will it add arm64 support?

Dangerous -ro flag

Could you make it so that when you start gossa, it tells you if read-only mode is enabled or disabled? I've learned that read-only is not enabled if you add -ro after the root file directory path, and this could cause somebody to accidentally allow write access.

Either making it so that it doesn't matter where you give the -ro flag, or giving a warning message about whether or not read-only is enabled or disabled would fix the issue.

raspberry pi 3 install

Hi there,
sorry I'm new to all this, I was wondering how do you install this on a raspberry pi 3? I have used caddy before so i understand that part, I'm just not sure how to build it.

Thanks!

Symlinks to folders not working

Hello,

my directory served by gossa looks like this:

- some
- files
- test/
  - tmp/ -> /tmp/

So test/tmp is a symlink to /tmp. Then I run gossa via:

gossa -h localhost .

I can change into the test directory and then into tmp and I'll
see all the files. But when I click a file, it is not found. The
reason is that it is looked up using the wrong path. Here is the log
output:

 ./gossa -h localhost .
Gossa startig on directory /home/eike/workspace/projects/gossa
Listening on http://localhost:8001
2019/04/07 16:41:12 Get list /home/eike/workspace/projects/gossa
2019/04/07 16:41:15 Get list /home/eike/workspace/projects/gossa/test
2019/04/07 16:41:16 Get list /home/eike/workspace/projects/gossa/test/tmp
2019/04/07 16:41:18 Error stat /home/eike/workspace/projects/gossa/test/IMG_2620.JPG: no such file or directory <nil>

The last line shows that it misses the tmp part of the path. It
looks the file up in test instead. It works if tmp is a normal
directory, but if tmp is a symlink it doesn't work. Also, if the
symlink is a direct child of the root dir, it works, too.

Viedeo player

Can you add that in the video player load the next files and file navigation as in the pics navigation ?

[Feature Request] : Adding checkboxes to files

I use this primarily as a media server, I was wondering if it's possible to add check boxes to different files?

The idea is that a media file, has a check box associated which makes it easier to track which file you have viewed or seen.

Originally
1.mp4
2.mp4

With the above feature:
1. [X] 1.mp4
2. [ ] 2.mp4

I understand that this might not be in everyone's interest, but I'll be happy to get some pointers and get started on this.

Enhancement request - short cuts in URL to auto move cursor

It would be really neat to be able to have URL shortcuts directly to a file or directory so its' selected already, as if the user either used the cursor keys to scroll there or use the filename search. There are already href tags in the page for each file/directory so those would not need to be added.

Docker Hub

Great project. I was thinking it might be a good idea to put one of the dockerfiles, perhaps the caddy one, up on Docker Hub?

Truth is I was looking for an easy way to add it to UnRAID and thought this might be best.

Run `index.html` automatically

Can you make a flag like --index that if non is given, uses index.html, but otherwise, uses specified index file? I want to use this as an alternative to python -m http.server.

Write Permissions Missing on Ubuntu18.04

I followed the steps exactly as they were on the support page using the dockerfile. The LocalDirToShare directory that was created did not have write permissions available to all users or the Docker instance was not seen as having elevated privileges to create or modify existing files.

Amending the created directory's permissions fixed the issue but there is probably a more user friendly solution.

upload big file failed

when i upload a big size movie about 4G , just progress 4% then no response anythings.

so i used mount some folder to /shared way.

How to delete a file

Hi, i uploaded several files to my server, and i can't delete them in webpage. So how to delete them after i upload.

windows paths are probably broken

I found that the software has some problems in setting the shared folder path. It can only be relative paths and not absolute paths
for example:
When I use the command line below, it works normally :
gossa.exe -h 0.0.0.0 -p 8001 .\gossa
When I use the command line below, it does not work properly:
gossa.exe -h 0.0.0.0 -p 8001 f:\download
it can’t display the files in the folder correctly on the webpage,but displays "error [get content /] invalid path"

Upload via click

Thanks for this nice tool!

I saw the issue #8, but unfortunately I'm not able to find the control on the ui to click for uploading files. What am I missing?

Upload support for touch devices

Touch devices like smartphones and tablets do not support drag & drag. A button or clickable area to initiate an upload would be nice.

run as service

Thanks a lot for the program. I would like to know how to run it as service, so it runs with system boot. Currently I am using in in raspberry os. Thanks!

xlsx file mistaken for zip file in IE11

Ran into an issue when trying out gossa in IE11. Yeah, I know, big surprise when using IE11, but it might be indicative of some underlying problem.

Symptom

I have a xlsx file on a gossa share. Using Edge (chromium version) I can download it just fine:
gossa-chromiumedge

But if I use IE11 it changes the file extension and tries to download it as a zip file.
gossa-ie11

At first I thought it was a HTTP Content-Type header issue, but since the extension actually changes there must be some JavaScript voodoo going on.

Environment

Server

Virtual hardware running on Hyper-V on 2012R2
OS is Ubuntu 20.04.1
Container runtime is docker (using docker-compose)
read-only volume mounted on /share

docker-compose ps

REPOSITORY TAG IMAGE ID CREATED SIZE
pldubouilh/gossa latest 49ef9983246c 7 weeks ago 12.1MB

Clients

Issue verified on:

  • IE11 on Windows 8.1

different sorting

investigate different kind of file sorting (modified date, etc...)

Uploading a lot of small files in folders skipped a lot of them.

I have a folder consisting of e-books, about 4GB of them in 20000 files.

When uploading the folder it's done in about 10seconds, which is odd.
I think it's indexing too slow, so when all files up to that point that have been indexed are uploaded it just stops the upload process.

I have included a Google Chrome trace/profile.

History jumps

Going back in history traverses an extra level.

Let's say I'm at path /pictures/2018/christmas/0001.jpg. When I go back i'm redirected to /pictures/2018 instead of the intended /pictures/2018/christmas.

mp4 file doesn't play and cannot download

Great work!

I noticed that when click on a video mp4 file, it fails to play and I don't find a way to download the video file. But I see it works in your demo. How do I debug?

Also, quick question: how to delete a file?

Thank you!

How to write windows path in the command?

I wanted to use a folder "c:/!uploads" with gossa, but there was no way it worked without an error. I had to move the folder so I can use the relative dir commands like "./!uploads" but it didn't work otherwise. I tried everything, both kind of slashes, using unix paths like /c/!up[loads. Please advise, thank you.

File sorting is case-sensitive

Consider the following filenames:

cover.png
Some Track.mp3

The order shown above is what you'd expect, but this is how gossa would order it:

Some Track.mp3
cover.png

Looks to me like it's not being case-sensitive when sorting.

Just to be awkward, these are also valid filenames:

Í'm being awkward.txt
ỳay.c
€5.md
©®eam on the cake.js

I'm also writing a review / tutorial blog post about Gossa, as I'm really impressed with it's ease of use - thanks for awesome software!

Open html file instead of downloading

I intended to host gossa to serve all my HTMLs I downloaded by SingleFile, but just found for html its default action is to download.

Can make an option or config so that it can render the html as web browser?

docker image on dockerhub doesn't contain readonly option

for some reason when I try to pull gossa from dockerhub, the /start.sh script doesn't have the -ro=${READONLY} option and I have to manually edit and restart the container. when I built a container from scratch and I didn't have this issue.

---
version: '3.7'

services:
  gossa:
    image: pldubouilh/gossa
    container_name: gossa
    environment:
      - READONLY=true
    volumes:
      - /mnt/media:/shared
    ports:
      - 8001:8001
    restart: unless-stopped

Previous picture

Can I browse Previous picture without keyboard,such as on phone,now there's only the Next?

Add tagged deploy

It would be great to have tagged deploys to have some idea of stability :)

In addition, having tagged docker images would be 👍

Gossa requires dac_override for some reason

Following the recommendations on https://www.redhat.com/en/blog/secure-your-containers-one-weird-trick, I was seeing if I could secure my docker set-up a little by dropping all capabilities. This works fine on many containers without any changes, except those that bind to a port number below 1024 by default (since that requires net_bind_service).

For some reason, gossa is unable to make any changes to the volume mounted on /shared without dac_override (uploads and deletions just fail silently). From man 7 capabilities:

CAP_DAC_OVERRIDE
    Bypass file read, write, and execute permission checks. (DAC is an abbreviation of "discretionary access control".) 

Now, I don't know much about capabilities or how Go writes files, but 2 things have got me confused:

  1. Other containers can make changes on docker volumes without dac_override
  2. I am running gossa as an unprivileged user, while privileges only apply to root (AFAIK dac_override is what allows root to mess around with files it does not own, even if the permissions do not allow it)

(I recognize this is probably not an issue with gossa but with my lack of understanding, so if anyone could indulge me with an explanation I would be extremely thankful)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.