# Lens A read only file explorer with media capabilities. # Dev To run the project you simply need to run: ```bash 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.: ```ini # .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 Libvips[^1] is required by bimp [^2] used for image manipulation. ## ffmpeg Used to generate video thumbnail. ## sassc Sassc[^4] 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 * ~~Thumbnail system~~ * ~~Initial setup process~~ * ~~Single binary output~~ * Better worker pool. Allow cron job and ui config * ~~Alpine package~~[^7] [^8] * Demo site * Single image viewer and show exif info (not sure how yet) * ~~User base root folder~~ * ~~Albums(ish)~~ * 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 even done :thinking:). [^1]: https://github.com/libvips/libvips [^2]: https://github.com/h2non/bimg [^3]: https://github.com/alicebob/miniredis [^4]: https://github.com/sass/sassc [^5]: https://github.com/photoview/photoview [^6]: https://github.com/photoview/photoview#why-yet-another-self-hosted-photo-gallery [^7]: https://git.sr.ht/~gabrielgio/apkbuilds [^8]: https://artifacts.gabrielgio.me/repo/v3.18/x86_64/