blob: 5f9e3690fd4510be27451aae0c5c8403bbac9c14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# 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/
|