Using a browser | Using an Android device |
---|---|
So you have a lot of pictures in your NAS and no way to share them? Did you take a lot of pictures at last party and want to share them to other people without resorting to a social network? Would you like to browse your pictures from a handheld device without uploading them to the cloud? If yes, and you have some basic docker skills, this program is for you.
NAS Gallery does just what you expect it to do: you point it to a folder and it creates a browsable gallery of its pictures and videos. Simple and effective. It also allows you to browse the subdirectories (you spent days organizing your photos, didn't you?).
NAS Gallery also allows you, optionally, you to specify who can access each folder: this way you can safely share the kid's pictures with your in-laws while keeping the "other" pictures for yourself only. The configuration can be as complex as you like.
NAS Gallery is comprised of three components:
- A REST back-end written in Rust (Rocket). The back-end handles the creation of thumbnails and the enforcement of the ACLs. It also streams the files as needed so you can serve large video files without having an enterprise-class computer. Also, being Rust, it's pretty fast.
- An Angular front-end for the data visualization. At this stage the front-end does not use Angular routing but care has been taken to allow permanent links. This way you can share a URL of a picture and the recipient will open it (provided they have the proper authorization of course).
- An authentication proxy. The proxy is oauth2-proxy - an external unaffiliated project. The proxy handles authentication so NAS Gallery does not have to do it itself. It also means we are using a great, secure program for this sensitive task!
The authentication proxy is optional. If you do not care about authentication and authorization you can freely skip it as demonstrated in simple deploy.
While you can run NAS Gallery as an executable, it's way easier use docker compose. Simple and complex docker-compose template files are available under the docker-compose folder. Following is the simple deploy, for the advanced one please refer to complete deploy.
- Clone the repo:
git clone https://github.com/MindFlavor/nas_gallery.git
- Build the image
cd nas_gallery && docker build -t nas_gallery .
- Copy the docker-compose.yml simple file to a directory of your choice.
- Edit the
docker-compose.yml
file: find the line mapping- /your_folder:/mnt/nas
and replace/your_folder
with your path (you might need to change port if it's already in use). - Start the container with
docker-compose up
. - Browse http::<your_server_ip> and profit!
Step 1 and 2 will become unnecessary after I have published the image in the public docker registry.
This setup is fine for an internal networks only since there is no authentication.
This program won't be very appealing if it costed you money, right? Well it's free, open source and under MIT License.
Every contribution is welcome, no formality required: just open an issue or PR. Keep in mind this is a pet project: while I use it every day and thus I am personally interested, I cannot make guarantees of response time.
Cheers, Francesco