update version, readme and sample docker-compose file

This commit is contained in:
neri 2022-04-10 23:45:32 +02:00
parent 166d2e09ba
commit 1eeff7b0c4
4 changed files with 39 additions and 39 deletions

2
Cargo.lock generated
View File

@ -434,7 +434,7 @@ dependencies = [
[[package]]
name = "datatrash"
version = "0.1.0"
version = "1.0.0"
dependencies = [
"actix-files",
"actix-multipart",

View File

@ -1,18 +1,26 @@
[package]
name = "datatrash"
version = "0.1.0"
version = "1.0.0"
authors = ["neri"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = { version = "4.0", default-features = false, features = ["macros", "compress-gzip", "compress-zstd"]}
sqlx = { version = "0.5.1", default-features = false, features = [ "runtime-tokio-rustls", "postgres", "time" ] }
actix-web = { version = "4.0", default-features = false, features = [
"macros",
"compress-gzip",
"compress-zstd",
] }
sqlx = { version = "0.5.1", default-features = false, features = [
"runtime-tokio-rustls",
"postgres",
"time",
] }
env_logger = "0.9.0"
log = "0.4.14"
actix-files = "0.6.0"
tokio = { version = "1.17.0", features=["rt", "macros", "sync"] }
tokio = { version = "1.17.0", features = ["rt", "macros", "sync"] }
actix-multipart = "0.4.0"
futures-util = "0.3"
rand = "0.8.3"

View File

@ -4,29 +4,15 @@ A file and text uploading service with configurable time limit
![Application screenshot](./screenshot.png)
## compiling
## running
```sh
cargo build --release
```
For running on docker, use the provided `docker-compose.yml.sample` and adapt it to your needs.
To run the software directly, use the compiling instructions below.
or
```sh
docker build -t datatrash .
docker cp datatrash:/home/rust/.cargo/bin/datatrash datatrash
```
or, to just run it in docker
```sh
docker-compose up -d --build
```
## running & config
## config
- The `static` files directory needs to be next to the binary.
- The `static` directory needs to be writable
- The `static` directory sadly needs to be writable
- On startup the `index.html` will be generated based on the config
- The maximum filename length is 255
@ -65,3 +51,16 @@ Require authentication for certain uploads
| NO_AUTH_MAX_TIME | |
| NO_AUTH_LARGE_FILE_MAX_TIME | |
| NO_AUTH_LARGE_FILE_SIZE | |
## compiling
```sh
cargo build --release
```
or
```sh
docker build -t datatrash .
docker cp datatrash:/home/rust/.cargo/bin/datatrash datatrash
```

View File

@ -9,14 +9,14 @@ services:
DATABASE_HOST: db
DATABASE_USER: datatrash
DATABASE_PASS: database_password
UPLOAD_MAX_BYTES: 1073741824
AUTH_PASSWORD: auth_password
NO_AUTH_MAX_TIME: 604800
NO_AUTH_LARGE_FILE_MAX_TIME: 1800
NO_AUTH_LARGE_FILE_SIZE: 10485760
networks:
- default
- nginx
# BIND_ADDRESS: 0.0.0.0:8000
# UPLOAD_MAX_BYTES: 1073741824 # 1 GiB
# AUTH_PASSWORD: auth_password
# NO_AUTH_MAX_TIME: 604800
# NO_AUTH_LARGE_FILE_MAX_TIME: 1800
# NO_AUTH_LARGE_FILE_SIZE: 10485760
ports:
- "80:8000"
restart: unless-stopped
depends_on:
- db
@ -30,10 +30,3 @@ services:
POSTGRES_USER: datatrash
POSTGRES_PASSWORD: database_password
restart: unless-stopped
networks:
- default
networks:
nginx:
external:
name: nginx_default