rsierra / file-qrs

A simple golang script to publish files of a local folder via http and generate QR codes for published urls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QR Icon

FILE QRS

Docker Pulls Build and release

A simple golang script to publish files of a local folder via http and generate QR codes for published urls.

Index QR

⭐ Features

  • Simple html service.
  • Generate QR codes for file urls.
  • Allow subfolder navigation.
  • Control access by .htpasswd file.

πŸ“œ How it works

Command:

HTPASSWD_FILE=path-to-htpasswd file-qrs -d path-to-files -p port

Options:

  • πŸ“ -d => Local path of the directory to publish. Is the current directory by default.
  • πŸ”Œ -p => Port for local server. 8100 by default.
  • πŸ”‘ HTPASSWD_FILE => Optinal environment variable for htpasswd file if you need basic http auth to control access (only for the web interface, not for the files).

NOTE: if you doesn't have a htpasswd file in your server, you can create one with htpasswd command from apache2-utils package or you can add users to a file with an online generator like this.

🐳 Docker

Run with docker:

docker run -d \
  --name file-qrs \
  -p 8100:8100 \
  -v /local-path:/files \
  -v /local-path-to-htpasswd:/.htpasswd \
  maguilag/file-qrs

Run with docker-compose:

file-qrs:
  image: maguilag/file-qrs
  container_name: file-qrs
  environment:
    - HTPASSWD_FILE=.htpasswd
  volumes:
    - <path to data>:/files
    - <path to htpasswd>/.htpasswd
  ports:
    - 8100:8100
  restart: unless-stopped

πŸ”¨ Dev and build

Install golang, download code and build with:

go build

About

A simple golang script to publish files of a local folder via http and generate QR codes for published urls.

License:MIT License


Languages

Language:Go 38.3%Language:HTML 27.1%Language:CSS 12.2%Language:Dockerfile 12.2%Language:JavaScript 10.2%