1# Lens
2
3A read only file explorer with media capabilities.
4
5# Dev
6
7To run the project you simply need to run:
8
9```bash
10make run
11```
12
13It should run using sqlite with a randon AES key. But if you don't set a
14`AES_KEY` a new one will generated every time the project is realead and you
15will be logged out.
16
17You can also create a `.env` file which will be read by make to populate the
18environment variables, e.g.:
19
20```ini
21# .env
22DB_TYPE=psql
23DB_CON=host=localhost user=admin password=admin dbname=lens port=5432
24LOG_LEVEL=error
25SCHEDULER_COUNT=10
26CACHE_PATH=/home/myhome/.thumb
27AES_KEY=X4Eu3OT/WqUtUJhGLUtQ4xRahwhWYaSs+k2a03Kz1A8=
28```
29
30Obs.: don't quote the value, that will be done automatically.
31
32Throughout the development you can also run `make watch` for a hot reload
33experience. It will feedback loop a bit faster.
34
35## Build and install
36
37To build you simply run:
38```
39make
40```
41
42And a `./bin/lens` will be created.
43
44To install run:
45
46```
47make install
48```
49
50Or you can pass a custom target folder.
51
52```
53PREFIX=~/.local/ make install
54```
55
56# Requirements
57
58## qtc
59
60It is used as template engine for html. To install it:
61
62```
63go install github.com/valyala/quicktemplate/qtc@latest
64```
65
66## libvips
67
68Libvips[^1] is required by bimp [^2] used for image manipulation.
69
70## ffmpeg
71
72Used to generate video thumbnail.
73
74## sassc
75
76Sassc[^4] is used to generate the css file from sass.
77
78## Bulma
79
80Bulma is the css framework of choice for this project. It is added as sub-module, so don't forget to pull it.
81
82# TODO
83
84* ~~Thumbnail system~~
85* ~~Initial setup process~~
86* ~~Single binary output~~
87* Better worker pool. Allow cron job and ui config
88* Alpine package and demo site
89* Single image viewer and show exif info (not sure how yet)
90* ~~User base root folder~~
91* Albums
92* Testing. Since I still on initial iteration phases I'm not adding as many
93 testing as I'd like to. Once I set on most of the design I'll add more test
94 (is this even done :thinking:).
95
96[^1]: https://github.com/libvips/libvips
97[^2]: https://github.com/h2non/bimg
98[^3]: https://github.com/alicebob/miniredis
99[^4]: https://github.com/sass/sassc
100[^5]: https://github.com/photoview/photoview
101[^6]: https://github.com/photoview/photoview#why-yet-another-self-hosted-photo-gallery