Trioxidation / Triox

A free file hosting server that focuses on speed, reliability and security.
GNU Affero General Public License v3.0
102 stars 14 forks source link

slqx migration, credential processing and cookie authentication #34

Closed realaravinth closed 3 years ago

realaravinth commented 3 years ago

This PR is massive and I apologize for that. The sqlx migration work touched various areas so I figured I'd refactor those areas as well.

Changes:

AaronErhardt commented 3 years ago

Wow, that's huge! Thank you so much for your work! I have an exam tomorrow so I don't have time today, but I will review these patches after the exam :)

realaravinth commented 3 years ago

sure, take your time! and best of luck for the test! :)

AaronErhardt commented 3 years ago

Also I just noticed that if no Postgres server is running, the connection timeout is pretty high which causes the program to run for quite some time before realizing that there's no server to connect to. Also in this phase while waiting for the database pool (which should be pretty much idle) the server has a pretty high CPU usage for some reason...

realaravinth commented 3 years ago

IMO, the timeout is alright as it comes in handy when theres a start up delay in situations like systemd service set to launch thus program at boot time or launching a trail net with docker compose.

The high CPU usage is caused by argon2-creds initializing regex filters. In release builds, it should be brief but in debug, it's awfully long.

realaravinth commented 3 years ago

I've added a coverage workflow. Tarpaulin is failing on my computer with same error(broken pipe) but it seems to function well in CI runs on my other repositories. We'll see if I can get it running on here.

codecov-commenter commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@942868b). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #34   +/-   ##
=========================================
  Coverage          ?   65.00%           
=========================================
  Files             ?       28           
  Lines             ?      620           
  Branches          ?        0           
=========================================
  Hits              ?      403           
  Misses            ?      217           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 942868b...ff1c006. Read the comment docs.