imgs/README.md

79 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2021-08-08 00:43:21 +03:00
# imgs
imgs is a minimalictic image sharing web app written with Bottle framework.
No database. No image compression. No time limits. No additional dependencies.
Features:
2022-01-05 13:12:51 +03:00
2021-08-08 00:43:21 +03:00
* Upload images via Drag&Drop
* Easy copy share link
* MIME type detecting
See deployment options in Bottle documentation: https://bottlepy.org/docs/dev/deployment.html
2022-01-05 08:33:43 +03:00
2022-01-05 13:12:51 +03:00
# Run imgs in Docker
Clone repository and edit **imgs.ini**.
Build Docker image:
2022-09-29 10:44:41 +03:00
```shell
2022-01-05 13:12:51 +03:00
docker build --tag imgs .
```
Run container from image. Replace **/path/to/your/uploads/dir** with path to directory where you want to store images:
2022-09-29 10:44:41 +03:00
```shell
docker run -d \
--name imgs \
--publish 127.0.0.1:5000:5000 \
--volume /path/to/your/uploads/dir:/opt/imgs/uploads \
imgs
2022-01-05 13:12:51 +03:00
```
imgs will launched on `127.0.0.1:5000`. Set up reverse proxy server. I recommed to use basic authentication to prevent abuses. Nginx virtual host example:
```nginx
server {
listen 80;
server_name yourdomain.tld;
2022-01-05 13:22:13 +03:00
root /path/to/imgs/root;
2022-01-05 13:12:51 +03:00
location / {
auth_basic "Authentication required";
auth_basic_user_file /path/to/.htpasswd;
proxy_pass http://127.0.0.1:5000;
}
2022-01-05 13:22:13 +03:00
location ~* ^/favicon.ico$ {
try_files $uri $uri/ =404;
}
2022-01-05 13:12:51 +03:00
location ~* \..* {
auth_basic off;
proxy_pass http://127.0.0.1:5000;
}
}
```
2022-01-05 08:33:43 +03:00
# Additional
## imgs client with CLI
imgs has a simple CLI tool based on curl. Copy **imgs** script to your PATH.
2022-09-29 10:44:41 +03:00
```shell
2022-01-05 08:33:43 +03:00
sudo cp imgs /usr/bin/imgs
```
## Nautilus integration
2022-01-23 16:47:49 +03:00
Push files to your imgs instance via GNOME Files (former name: Nautilus). Depends on: curl, libnotify (notify-send utility).
2022-01-05 08:33:43 +03:00
2022-01-05 13:12:51 +03:00
Just place **Upload to imgs** script into **~/.local/share/nautilus/scripts/** directory.
2022-09-29 10:44:41 +03:00
```shell
DIR=~/.local/share/nautilus/scripts/; mkdir -p $DIR && cp Upload\ to\ imgs $DIR
```