You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xenua
dee6235501
|
2 years ago | |
---|---|---|
entity | 2 years ago | |
migration | 2 years ago | |
src | 2 years ago | |
.gitignore | 2 years ago | |
Cargo.lock | 2 years ago | |
Cargo.toml | 2 years ago | |
README.md | 2 years ago |
README.md
^V
⚠️ this is unfinished software
a tiny link shortener (& maybe pastebin in the future)
running it
^V needs a postgresql database. for ssl, run it behind a reverse proxy like nginx.
all config is done through env vars (.env file works too): here's a list of them (which may be incomplete. the full list can be found at the start of the main() function in src/main.rs)
var | default | description |
---|---|---|
LISTEN_ADDR | 127.0.0.1:8080 | the listen address with port. |
DATABASE_URL | the address to the postgres database. this is passed directly to sea_orm::Database::connect | |
BASE_DOMAIN | ^V assumes https if this is set, and will use secure cookies for that domain | |
V_ID_CHARSET | abcdefghijkmnpqrstuwxyz123467890 | the charset for generated ids that show up in links (manual overrides don't care about this) |
V_ID_GEN_LENGTH | 6 | length of the generated ids (again, manually set ids don't care.) |
V_DEV_TEST_DATA | whether or not to generate a dev user with some test data; probably only useful for devs |
dev info
if you want to tinker with ^V, here's some pointers
- it uses sea_orm for data storage abstraction.
- defining new things works as follows:
- the schema is defined through migrations (migration/), then
- it is applied to an actual database:
$ sea migrate fresh
- entity mappings are generated from that database:
$ sea generate entity --with-serde both --serde-skip-deserializing-primary-key -o entity/src
- the
sea
command is provided from$ cargo install sea-orm-cli
and needs to run withDATABASE_URL
set (or its-u
option)
- defining new things works as follows: