forked from neri/datatrash
update version, readme and sample docker-compose file
This commit is contained in:
parent
166d2e09ba
commit
1eeff7b0c4
|
@ -434,7 +434,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "datatrash"
|
name = "datatrash"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-files",
|
"actix-files",
|
||||||
"actix-multipart",
|
"actix-multipart",
|
||||||
|
|
16
Cargo.toml
16
Cargo.toml
|
@ -1,18 +1,26 @@
|
||||||
[package]
|
[package]
|
||||||
name = "datatrash"
|
name = "datatrash"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
authors = ["neri"]
|
authors = ["neri"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = { version = "4.0", default-features = false, features = ["macros", "compress-gzip", "compress-zstd"]}
|
actix-web = { version = "4.0", default-features = false, features = [
|
||||||
sqlx = { version = "0.5.1", default-features = false, features = [ "runtime-tokio-rustls", "postgres", "time" ] }
|
"macros",
|
||||||
|
"compress-gzip",
|
||||||
|
"compress-zstd",
|
||||||
|
] }
|
||||||
|
sqlx = { version = "0.5.1", default-features = false, features = [
|
||||||
|
"runtime-tokio-rustls",
|
||||||
|
"postgres",
|
||||||
|
"time",
|
||||||
|
] }
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
actix-files = "0.6.0"
|
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"
|
actix-multipart = "0.4.0"
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
rand = "0.8.3"
|
rand = "0.8.3"
|
||||||
|
|
37
README.md
37
README.md
|
@ -4,29 +4,15 @@ A file and text uploading service with configurable time limit
|
||||||
|
|
||||||
![Application screenshot](./screenshot.png)
|
![Application screenshot](./screenshot.png)
|
||||||
|
|
||||||
## compiling
|
## running
|
||||||
|
|
||||||
```sh
|
For running on docker, use the provided `docker-compose.yml.sample` and adapt it to your needs.
|
||||||
cargo build --release
|
To run the software directly, use the compiling instructions below.
|
||||||
```
|
|
||||||
|
|
||||||
or
|
## config
|
||||||
|
|
||||||
```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
|
|
||||||
|
|
||||||
- The `static` files directory needs to be next to the binary.
|
- 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
|
- On startup the `index.html` will be generated based on the config
|
||||||
- The maximum filename length is 255
|
- The maximum filename length is 255
|
||||||
|
|
||||||
|
@ -65,3 +51,16 @@ Require authentication for certain uploads
|
||||||
| NO_AUTH_MAX_TIME | |
|
| NO_AUTH_MAX_TIME | |
|
||||||
| NO_AUTH_LARGE_FILE_MAX_TIME | |
|
| NO_AUTH_LARGE_FILE_MAX_TIME | |
|
||||||
| NO_AUTH_LARGE_FILE_SIZE | |
|
| 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
|
||||||
|
```
|
||||||
|
|
|
@ -9,14 +9,14 @@ services:
|
||||||
DATABASE_HOST: db
|
DATABASE_HOST: db
|
||||||
DATABASE_USER: datatrash
|
DATABASE_USER: datatrash
|
||||||
DATABASE_PASS: database_password
|
DATABASE_PASS: database_password
|
||||||
UPLOAD_MAX_BYTES: 1073741824
|
# BIND_ADDRESS: 0.0.0.0:8000
|
||||||
AUTH_PASSWORD: auth_password
|
# UPLOAD_MAX_BYTES: 1073741824 # 1 GiB
|
||||||
NO_AUTH_MAX_TIME: 604800
|
# AUTH_PASSWORD: auth_password
|
||||||
NO_AUTH_LARGE_FILE_MAX_TIME: 1800
|
# NO_AUTH_MAX_TIME: 604800
|
||||||
NO_AUTH_LARGE_FILE_SIZE: 10485760
|
# NO_AUTH_LARGE_FILE_MAX_TIME: 1800
|
||||||
networks:
|
# NO_AUTH_LARGE_FILE_SIZE: 10485760
|
||||||
- default
|
ports:
|
||||||
- nginx
|
- "80:8000"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
@ -30,10 +30,3 @@ services:
|
||||||
POSTGRES_USER: datatrash
|
POSTGRES_USER: datatrash
|
||||||
POSTGRES_PASSWORD: database_password
|
POSTGRES_PASSWORD: database_password
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
|
|
||||||
networks:
|
|
||||||
nginx:
|
|
||||||
external:
|
|
||||||
name: nginx_default
|
|
||||||
|
|
Loading…
Reference in New Issue