Browse Source

update version, readme and sample docker-compose file

master
neri 1 month ago
parent
commit
1eeff7b0c4
  1. 2
      Cargo.lock
  2. 16
      Cargo.toml
  3. 37
      README.md
  4. 23
      docker-compose.yml.sample

2
Cargo.lock generated

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

16
Cargo.toml

@ -1,18 +1,26 @@ @@ -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"

37
README.md

@ -4,29 +4,15 @@ A file and text uploading service with configurable time limit @@ -4,29 +4,15 @@ A file and text uploading service with configurable time limit
![Application screenshot](./screenshot.png)
## compiling
```sh
cargo build --release
```
or
## running
```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
```
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.
## 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 @@ -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
```

23
docker-compose.yml.sample

@ -9,14 +9,14 @@ services: @@ -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: @@ -30,10 +30,3 @@ services:
POSTGRES_USER: datatrash
POSTGRES_PASSWORD: database_password
restart: unless-stopped
networks:
- default
networks:
nginx:
external:
name: nginx_default

Loading…
Cancel
Save