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
30To generate a new `AES_KEY` run:
31```
32openssl rand -rand /dev/urandom 32 | base64
33```
34
35Obs.: don't quote the value, that will be done automatically.
36
37Throughout the development you can also run `make watch` for a hot reload
38experience. It will feedback loop a bit faster.
39
40## Build and install
41
42To build you simply run:
43```
44make
45```
46
47And a `./bin/lens` will be created.
48
49To install run:
50
51```
52make install
53```
54
55Or you can pass a custom target folder.
56
57```
58PREFIX=~/.local/ make install
59```
60
61# Requirements
62
63## qtc
64
65It is used as template engine for html. To install it:
66
67```
68go install github.com/valyala/quicktemplate/qtc@latest
69```
70
71## libvips
72
73Libvips[^1] is required by bimp [^2] used for image manipulation.
74
75## ffmpeg
76
77Used to generate video thumbnail.
78
79## sassc
80
81Sassc[^4] is used to generate the css file from sass.
82
83## Bulma
84
85Bulma is the css framework of choice for this project. It is added as sub-module, so don't forget to pull it.
86
87# TODO
88
89* ~~Thumbnail system~~
90* ~~Initial setup process~~
91* ~~Single binary output~~
92* Better worker pool. Allow cron job and ui config
93* ~~Alpine package~~[^7] [^8]
94* Demo site
95* Single image viewer and show exif info (not sure how yet)
96* ~~User base root folder~~
97* Albums
98* Testing. Since I still on initial iteration phases I'm not adding as many
99 testing as I'd like to. Once I set on most of the design I'll add more test
100 (is this even done :thinking:).
101
102[^1]: https://github.com/libvips/libvips
103[^2]: https://github.com/h2non/bimg
104[^3]: https://github.com/alicebob/miniredis
105[^4]: https://github.com/sass/sassc
106[^5]: https://github.com/photoview/photoview
107[^6]: https://github.com/photoview/photoview#why-yet-another-self-hosted-photo-gallery
108[^7]: https://git.sr.ht/~gabrielgio/apkbuilds
109[^8]: https://artifacts.gabrielgio.me/repo/v3.18/x86_64/