backend
Laguna
- For general documentation see Laguna docs
- For internal documentation see Dev docs.
Laguna backend source tree
License: Apache License 2.0
This is a very low priority long distance issue ATM.
Independence only applies to backend.
Get rid of following systems:
Run multiple DBs, multiple root services, promotion system to Primary. Independent of providers, on "internal" network.
Powerful search > any filter.
Since we are using postgres we can have tsvector
and tsquery
based searches while introducing a search-optimized index on torrent filename https://www.postgresql.org/docs/current/textsearch-intro.html.
title:<title of torrent> uploaded_by:<username> from:<date>
. (Postgres supports this very nicely).cat/
PARTITION BY
and indexing of categories.Probably argon2
Can we make it fail tolerant?
This is not a priority, but adds to DX.
Completed in #87 . @kozabrada123 close plz, tnx
Reported by @zigapovhe
My proposal:
.toml config files that can be overwriten by environment variables
ex:
Config.toml
port = 8000
No PORT enviornment variable
Server uses port 8000
Config.toml
port = 8000
Enviornment variables
PORT=8080
Server uses port 8080
INSERT
, CREATE
and UPDATE
queries carry digest('plaintext password', 'sha-256')
with current design.This is something that could be fixed with GraphQL, so many different flavours of DTOs for the same thing: TorrentPatchDTO
, TorrentPutDTO
, TorrentDTO
.
Is trying to abstract here violation of WET?
/api/user/me
(current user, based on JWT)/api/user/{id}
#[doc(hidden)]
(ie. having a struct
and fn
after macro is applied on eg. get_me()
function in laguna-backend-api
).laguna-docs
.Currently logging in requires a timestamp that is blindly inserted into the database
that timestamp can be any valid timestamp, it can even be 20 years old or 20 years in the future
ex:
POST /login/
{
"username_or_email": "test",
"password": "testpassword",
"login_timestamp": "1997-07-05T11:41:08+0000"
}
->
{
"LoginSuccess": {
"user": {
"id": "b33b630d-e098-47d0-bc21-94c6a7467f17",
"username": "test",
"email": "test@microsoft-net",
"first_login": "2023-07-05T11:36:26.431821Z",
"last_login": "1997-07-05T11:41:08Z",
"avatar_url": null,
"role": "Normie",
"behaviour": "Lurker",
"is_active": true,
"has_verified_email": false,
"is_history_private": true,
"is_profile_private": true
}
}
}
we should either validate the timestamp is plausible or generate the timestamp ourselves
PATCH /api/user
Using Docker. This is a Could-Have for now.
Check this out: https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/database/schema.pdf
/register
/login
Probably using GitHub pages
Currently success on login returns:
{
"LoginSuccess": {
"user": {
"id": "b33b630d-e098-47d0-bc21-94c6a7467f17"
"username": "test",
"email": "[email protected]",
"first_login": "2023-07-04T10:18:17.391698Z",
"last_login": "2023-07-04T10:18:17.391698Z",
"avatar_url": null,
"role": "Normie",
"is_active": true,
"has_verified_email": false,
"is_history_private": true,
"is_profile_private": true
}
}
}
We want:
{
"id": "b33b630d-e098-47d0-bc21-94c6a7467f17"
"username": "test",
"email": "[email protected]",
"first_login": "2023-07-04T10:18:17.391698Z",
"last_login": "2023-07-04T10:18:17.391698Z",
"avatar_url": null,
"role": "Normie",
"is_active": true,
"has_verified_email": false,
"is_history_private": true,
"is_profile_private": true
}
When its just:
"RegisterSuccess"
We want:
This can probably be achieved using #[serde(transparent)]
on enum (or enum member).
Do we even need *State
structs? Is 200 OK not sufficient?
This would reduce CI/CD pipeline time by cca 3min.
/api/user/me/delete
This is SQLx WIP thing. Do we wait it out?
This is really about solving the multithread issue with current tests. The problem is that all tests ATM access single laguna_test_db
which means many conflicts and forced us into doing DELETE FROM
on teardown.
Theres two ways to combat this:
I think its better to do (2).
Instead of Cookies or other header trickery.
Inactive users are marked false on is_active field. This allows for reasonable account cleanup if DB gets big.
Verify email when registring by sending user a "confirmation code" (this prevents spam accounts).
This requires mailer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.