personal-gallery-node/README.md

98 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2021-03-23 14:12:51 +00:00
# Personal image gallery
2021-03-25 09:08:43 +00:00
[![Run tests](https://github.com/karasevm/personal-gallery-node/actions/workflows/test.yml/badge.svg)](https://github.com/karasevm/personal-gallery-node/actions/workflows/test.yml)
[![Docker CI](https://github.com/karasevm/personal-gallery-node/actions/workflows/publish.yml/badge.svg)](https://github.com/karasevm/personal-gallery-node/actions/workflows/publish.yml)
2021-03-23 14:12:51 +00:00
A simple to use, modern place to store your images. Perfect for storing large
amounts of screenshots and screen recordings.
## Uploading
After searching for a solution that would allow me to upload easily from every
kind of device, I've decided to make my own. If you are using a relatively modern
device, you probably can upload images from it.
### Dialog
Click the upload icon and then click the upload area to trigger a system file
pick dialog.
### Drag-n-drop
Simply drag any file into the window, and the upload area should magically appear.
![](README/drag.gif)
### Paste
2021-09-26 15:08:32 +00:00
Got a screenshot in your clipboard, Ctrl-V and now you've got it online.
2021-03-23 14:12:51 +00:00
![](README/paste.gif)
### API
Want use your own uploader? You can. Get the API key, put it into the `Authorization`
header and that's it.
### ShareX
While we're on the topic of APIs, if you're using ShareX you can simply get
a ready made custom uploader config.
![](README/sharex.gif)
### Android
Sharing on mobile is easier than ever thanks to the PWA Share Target APIs.
![](README/android.gif)
## Installation
### Docker (Reccommended)
The image is available on dockerhub, you can start with an example
docker-compose below:
2021-03-29 09:27:20 +00:00
```yaml
2021-09-26 15:08:32 +00:00
version: '3'
2021-03-23 14:12:51 +00:00
services:
gallery:
2021-03-23 14:45:45 +00:00
image: karasevm/personal-gallery-node
2021-09-26 15:08:32 +00:00
ports:
2021-03-23 14:12:51 +00:00
- 80:80
volumes:
2021-09-26 15:08:32 +00:00
- ./images:/images
2021-03-23 14:12:51 +00:00
- ./db:/db
2021-09-26 15:08:32 +00:00
- ./cache:/cache
restart: unless-stopped
environment:
- CACHE_DIR=/cache
2021-03-29 09:27:20 +00:00
```
2021-03-23 14:12:51 +00:00
**Environment Variables**
All docker environment variables are optional
2022-06-06 11:27:10 +00:00
`PORT` - which port to listen on, by default set to 80
2021-03-23 14:12:51 +00:00
`PROXY` - [express proxy settings](https://expressjs.com/en/guide/behind-proxies.html), by default set to `true`
`USERNAME` and `PASSWORD` - used to reset user credentials, if set, all sessions and API key are invalidated
`BASE_URL` - base directory if app isn't in root
`FULLS_AS_THUMBS` - whether to use full size images as thumbnails (useful on slow servers with fast clients)
2021-03-23 14:12:51 +00:00
To use Redis instead of built-it memory cache:
`REDIS_HOST` - Redis host
`REDIS_PASSWORD` - Redis password
2021-09-12 12:10:49 +00:00
Or to store cache on disk :
`CACHE_DIR` - Cache directory
2021-03-23 14:12:51 +00:00
### On bare machine
You'll need node 14+ and yarn to complete the build.
Copy the .env.example to .env, changing it according to your needs. In the root directory run `yarn build` then `yarn start`, if everything went well, you'll have the server running.
## Develompent
Clone the repo, set the server environment with .env, install dependencies, start with `yarn start-dev`.
REST API documentation is available [here](packages/server/docs/api/README.md)
## Contributing
2021-03-29 09:27:20 +00:00
Easiest way to contribute is to submit a translation, use `./packages/web/public/locales/en.json`
2021-03-23 14:12:51 +00:00
as a template and submit a pull request with your language.
## License
2021-03-23 14:16:12 +00:00
[MIT](LICENSE)