A simple storage system plus more for personal use.
- Postgres Database
- Rust: installation instructions
-
Create a Database in Postgres
-
Setup the
.env
file. Setup instructions can be found below -
Setup Rocket.toml (Optional) Setup instructions can be found here
-
Diesel
needs the schema to match the project before it starts.diesel migration run
is the easiest way to do this.
Simply run the command cargo run
from your terminal. Any configuration options are specified in the .env
file.
This project requires a package Diesel
and Rocket
. Before compiling, both Diesel
and Rocket
run other code to build dependencies.
This is important because if it cannot connect to the database, or it mismatches the database, it will look like a compiling error: thats because it is. When errors arise; the first place to look is your database.
As well, this project only works on nightly
builds. If dependencies fail to build, ensure you're using the nightly
build channel.
-
Security
-
APP_KEY
: Required,string
. Security key used by the application to encrypt tokens. -
BCRYPT_COST
: Optional,uint
. Number of hash iterations for passwords. Lower is faster but less secure, higher is slower but more secure. Default is12
.
-
-
Database
-
DATABASE_URL
: Required,string
. Connection string to your database. Looks something likepostgres://postgres:secret@db/database
. -
TEST_DATABASE_URL
: Required if running tests,string
. Connection string to your testing database.
-
-
Logging!
LOG_LEVEL
: Optional,string
. Minimum level at which logging should occur. Default iserror
.
-
Storage
-
STORAGE_DRIVER
: Optional,string
. Driver that should be used to store objects, eitherdisk
oraws
. Default isdisk
. -
AWS
-
AWS_ACCESS_KEY_ID
: Required with driveraws
,string
. Your AWS Access Key ID. -
AWS_ACCESS_KEY_SECRET
: Required with driveraws
,string
. Your AWS Access Key Secret. -
AWS_BUCKET_NAME
: Required with driveraws
,string
. Bucket to be used to store objects. -
AWS_BUCKET_REGION
: Required with driveraws
,string
. Bucket region to be used to store objects.
-
-
-
Other
STREAM_CHUNK_SIZE
: Optional,string
. Size of the chunks to be used when streaming objects. Default is1024
.
Note: The Linux kernel uses 256 by default, and this will not be overrode. Any chunk sizes smaller than this will have no impact