|
|
||
|---|---|---|
| .builds | ||
| cmd/server | ||
| pkg | ||
| scss | ||
| static | ||
| templates | ||
| .gitignore | ||
| .gitmodules | ||
| go.mod | ||
| go.sum | ||
| golangci.yml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Lens
A read only file explorer with media capabilities.
Dev
To run the project you simply need to run:
make run
It should run using sqlite with a randon AES key. But if you don't set a
AES_KEY a new one will generated every time the project is realead and you
will be logged out.
You can also create a .env file which will be read by make to populate the
environment variables, e.g.:
# .env
DB_TYPE=psql
DB_CON=host=localhost user=admin password=admin dbname=lens port=5432
LOG_LEVEL=error
SCHEDULER_COUNT=10
CACHE_PATH=/home/myhome/.thumb
AES_KEY=X4Eu3OT/WqUtUJhGLUtQ4xRahwhWYaSs+k2a03Kz1A8=
To generate a new AES_KEY run:
openssl rand -rand /dev/urandom 32 | base64
Obs.: don't quote the value, that will be done automatically.
Throughout the development you can also run make watch for a hot reload
experience. It will feedback loop a bit faster.
Build and install
To build you simply run:
make
And a ./bin/lens will be created.
To install run:
make install
Or you can pass a custom target folder.
PREFIX=~/.local/ make install
Requirements
qtc
It is used as template engine for html. To install it:
go install github.com/valyala/quicktemplate/qtc@latest
libvips
Libvips1 is required by bimp 2 used for image manipulation.
ffmpeg
Used to generate video thumbnail.
sassc
Sassc3 is used to generate the css file from sass.
Bulma
Bulma is the css framework of choice for this project. It is added as sub-module, so don't forget to pull it.
TODO
- Demo site
- Single image viewer and show exif info (not sure how yet)
- Better UI error handling (or error handling at all).
- Log out option
- Better pagination
- Better Testing. Since I still on initial iteration phases I'm not adding as many testing as I'd like to. Once I set on most of the design I'll add more test (is this ever done 🤔).