Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a migration script for older Torrust versions #56

Closed
mickvandijke opened this issue Aug 15, 2022 · 6 comments · Fixed by #77
Closed

Provide a migration script for older Torrust versions #56

mickvandijke opened this issue Aug 15, 2022 · 6 comments · Fixed by #77

Comments

@mickvandijke
Copy link
Member

mickvandijke commented Aug 15, 2022

There have been quite some database changes between V1 and V2 of the backend and this renders the database of a backend running V1 incompatible with backend V2. The biggest change we made to the database is the way torrents are stored. In V1, torrents were stored as actual .torrent files in a dedicated uploads folder on the backend server. As of V2, all torrents are completely stored in the database.

To make sure all V1 users can move to V2 of the backend, we want to provide some kind of migration script. This script would take a V1 database (dump) and torrent uploads folder as input and should be able to convert this data to a new database dump that is suitable for the backend V2.

We will start working on this script when we believe V2 is in a usable state.

@shadowrowan
Copy link

Is there any progress or future plans on this? Would be super helpful. Thanks.

@mickvandijke
Copy link
Member Author

Hey @shadowrowan ,

Sorry for the late reply. A member of the team will look into the migration script in a couple of days from now, but I can not tell how long it will take. We will make sure it is done before releasing the production ready V2 update, so that V1 users don't miss out :)

@josecelano
Copy link
Member

hi @WarmBeer @da2ce7. I want to define the scope of this issue and propose an implementation.

I've been taking a look at these two commits:

  • v.1.0.0.
  • develop. Current HEAD of development which contains the DB schema that is going to be used in release v2.0.0`

Migrations

This is the list of migrations in v1.0.0:

20210831113004_torrust_users.sql
20210904135524_torrust_tracker_keys.sql
20210905160623_torrust_categories.sql
20210907083424_torrust_torrent_files.sql
20211208143338_torrust_users.sql
20220308083424_torrust_torrents.sql
20220308170028_torrust_categories.sql

And this is the current list of migrations (develop):

20220721205537_torrust_users.sql
20220721210530_torrust_user_authentication.sql
20220727213942_torrust_user_profiles.sql
20220727222313_torrust_tracker_keys.sql
20220730102607_torrust_user_public_keys.sql
20220730104552_torrust_user_invitations.sql
20220730105501_torrust_user_invitation_uses.sql
20220801201435_torrust_user_bans.sql
20220802161524_torrust_categories.sql
20220810192613_torrust_torrents.sql
20220810201538_torrust_torrent_files.sql
20220810201609_torrust_torrent_announce_urls.sql
20220812181520_torrust_torrent_info.sql
20220812184806_torrust_torrent_tracker_stats.sql

The list of migrations is different. Migrations have been rebuilt from scratch, so they only work if you set up a new installation.

V1 only has SQLite migrations.

Tables

The v1 contains these tables:

_sqlx_migrations
torrust_categories
torrust_torrent_files
torrust_torrents
torrust_tracker_keys
torrust_users

The v2 contains these tables:

_sqlx_migrations
torrust_categories
torrust_torrent_announce_urls
torrust_torrent_files
torrust_torrent_info
torrust_torrent_tracker_stats
torrust_torrents
torrust_tracker_keys
torrust_user_authentication
torrust_user_bans
torrust_user_invitation_uses
torrust_user_invitations
torrust_user_profiles
torrust_user_public_keys
torrust_users

Migration manipulation

Migrations were changed for both for SQLite and MySQL at least once.

Solution

I'm going to start focusing only on a solution for a concrete case. I think we can make the solution more generic later.

What I think we could do is:

  • Add a new binary to the crate to export the current in V1 to database to V2.
  • You can run the command with cargo run --bin db_migrate
  • The first version will only work for SQLite.
  • You have you run the command in production (although you have to test it before in a local copy of the production system).
  • The command will get data from file data in the root folder and torrent from uploads folder, creating new records in a new database data2.
  • After the data transfer, you can test the new database. You can use it in production and remove the uploads folder with torrents if it works.
  • The command could run the migrations in v2 in the empty new DB.

Once we have this script I think we can easily change it to migrate from any commit to any other as long as we know the schema used in both commits.

Improvements

  • I assume people are using only releases and not intermediary commits. That means only SQLite should be used in production. I think MySQL migrations were also introduced at some point (probably in this commit 6456c54) and changed later (in this commit d96c56f). We would have to build a custom migration command if someone uses an intermediary case (commit).
  • The command has to be executed manually. If we want to execute it automatically, we could do it before executing migrations, but I do not know how we could check which version was the previous one and which is the current one. I think the only way to do it is by using the "migrations" table and the current list of migrations. Anyway, I would prefer to execute it manually. But even if we execute manually, I would double-check that you are migrating from v1 to v2.

Notes

  • I do not know how easy it could be to export data from DB to DB due to foreign key constraints.

Alternatives

  • Using the REST API. That would be useful to transfer data from one app to another, but we do not expose all the data (like user info).
  • Try to find out the DB schema used in each commit and rewrite the migrations git history. Although it may be feasible, I think it would take too much time.

@mickvandijke
Copy link
Member Author

Hey @josecelano , I agree with the scope and your approach 👍 .

@josecelano josecelano linked a pull request Oct 26, 2022 that will close this issue
39 tasks
josecelano added a commit that referenced this issue Oct 27, 2022
First action for the command to upgrade data. It transfers the
categories from the current DB schema (v1.0.0) to the new DB schema.
josecelano added a commit that referenced this issue Oct 31, 2022
Make name more generic to allow addding other upgrade command in the
future.
josecelano added a commit that referenced this issue Oct 31, 2022
josecelano added a commit that referenced this issue Nov 2, 2022
Migrations were not executed while running integration tests.
After adding a new migration without changing any Rust code.

More info: https://docs.rs/sqlx/latest/sqlx/macro.migrate.html#triggering-recompilation-on-migration-changes
josecelano added a commit that referenced this issue Nov 2, 2022
We are going to start storing the hash method (argon2 or pbkdf2).
We are going to import user data from version v1.0.0.
In that version we were using pbkdf2.
We can keep both methods or gradually change to argon2 every time a user
with pbkdf2 hash logs in.
josecelano added a commit that referenced this issue Nov 2, 2022
Transfered users will not be able to login until login works with the
Pbkdf2 hash method.
josecelano added a commit that referenced this issue Nov 2, 2022
We transfer the field `torrust_users.password` to
`torrust_user_authentication.password_hash`.

The hash value is using the PHC string format since v.1.0.0.

In v1.0.0 we were using the hash function "pbkdf2-sha256".
In v2.0.0 we are using "argon2id".

The packages we use to verify password allow using different hash
functions. So we only had to use a different algorithm depending on the
hash id in the PHC string.
josecelano added a commit that referenced this issue Nov 3, 2022
When we import users from previous versions where the app did not store
the registration date we assign the current datetime for the registration.
josecelano added a commit that referenced this issue Nov 4, 2022
Transferred data to tables in versio v2.0.0:

- [x] Table `torrust_torrents`
- [ ] Table `torrust_torrent_files`
- [ ] Table `torrust_torrent_announce_urls`
- [ ] Table `torrust_torrent_info`
josecelano added a commit that referenced this issue Nov 9, 2022
Add the "Record" suffix to structs representing DB records.
In order to avoid mixing them up with models.
josecelano added a commit that referenced this issue Nov 9, 2022
josecelano added a commit that referenced this issue Nov 9, 2022
From BEP-12:

"In addition to the standard "announce" key, in the main area of the metadata file and not part of the "info" section, will be a new key, "announce-list". This key will refer to a list of lists of URLs, and will contain a list of tiers of announces. If the client is compatible with the multitracker specification, and if the "announce-list" key is present, the client will ignore the "announce" key and only use the URLs in "announce-list".
josecelano added a commit that referenced this issue Nov 9, 2022
Instead of reading the current configuration.
josecelano added a commit that referenced this issue Nov 9, 2022
First action for the command to upgrade data. It transfers the
categories from the current DB schema (v1.0.0) to the new DB schema.
josecelano added a commit that referenced this issue Nov 9, 2022
Make name more generic to allow addding other upgrade command in the
future.
josecelano added a commit that referenced this issue Nov 30, 2022
Add the "Record" suffix to structs representing DB records.
In order to avoid mixing them up with models.
josecelano added a commit that referenced this issue Nov 30, 2022
josecelano added a commit that referenced this issue Nov 30, 2022
From BEP-12:

"In addition to the standard "announce" key, in the main area of the metadata file and not part of the "info" section, will be a new key, "announce-list". This key will refer to a list of lists of URLs, and will contain a list of tiers of announces. If the client is compatible with the multitracker specification, and if the "announce-list" key is present, the client will ignore the "announce" key and only use the URLs in "announce-list".
josecelano added a commit that referenced this issue Nov 30, 2022
Instead of reading the current configuration.
josecelano added a commit that referenced this issue Nov 30, 2022
Extract different testers for every type of data transferred.
josecelano added a commit that referenced this issue Nov 30, 2022
josecelano added a commit that referenced this issue Nov 30, 2022
We do not need to read migrations from dir becuase they are not going to
change for verion v1.0.0.
josecelano added a commit that referenced this issue Nov 30, 2022
The application now supports two hashing methods:

- "pbkdf2-sha256": the old one. Only for imported users from DB version
  v1.0.0.
- "argon2": the new one for registered users.
josecelano added a commit that referenced this issue Nov 30, 2022
Imported users from DB version v1.0.0 (only SQLite) do not have a
"date_registered" field. WE have to copy that behavior in MySQL even if
we do not have users imported from from previous versions in MySQL.

Support for MySQL was added after the version v1.0.0.
josecelano added a commit that referenced this issue Nov 30, 2022
Instead of regenerating ID sequence we keep the category id.
Becuase we were keeping IDs for all tables except for this one.

@ldpr helped testing the migration script and found the issue with the
categories IDs.

Co-authored-by: ldpr <[email protected]>
josecelano added a commit that referenced this issue Nov 30, 2022
5a7d875 feat: [#56] console command to import tracker stats for all torrents (Jose Celano)
19d054e refactor: [#56] rename test mods to follow prod mods (Jose Celano)
e8d984d refactor: [#56] rename destiny DB to target DB (Jose Celano)
b400962 fix: format (Jose Celano)
8b761c8 feat: [#56] keep category id in DB migration script (Jose Celano)
b29d4d7 fix: [#56] db migration for imported users (Jose Celano)
38fee53 test: [#56] new test for password verification (Jose Celano)
b9a8bf9 fix: [#56] remove comment (Jose Celano)
e1790f6 refactor: [#56] extract mods in upgrader (Jose Celano)
e23d948 refactor: remove duplication in tests (Jose Celano)
ee01e7b test: [#56] for torrent files table in upgrader (new case) (Jose Celano)
afffaef tests: [#56] for torrents files table in upgrader (Jose Celano)
82b84a3 refactor: [#56] extract test configuration (Jose Celano)
750969d refactor: [#56] rename methods (Jose Celano)
0063289 tests: [#56] for torrents info and announce urls tables in upgrader (Jose Celano)
cd95987 refactor: [#56] rename mod and variables (Jose Celano)
f0f581f tests: [#56] for torrents table in upgrader (Jose Celano)
eef980c tests: [#56] for tracker keys table in upgrader (Jose Celano)
8d74e66 tests: [#56] for users profile and auth tables in upgrader (Jose Celano)
0a58b6c fix: [#56] bio and avatar is user profile should be NULL for imported users (Jose Celano)
5d0def2 refactor: [#56] tests for upgrader (Jose Celano)
f993107 tests: [#56] for users table in upgrader (Jose Celano)
6188b10 refactor: extract mod sqlite_v1_0_0 in tests (Jose Celano)
44927e5 test: [#56] WIP. scaffolding to test upgrader command (Jose Celano)
7f0a7ea fix: open source db in read-only mode in upgarder (Jose Celano)
217fae2 feat: [#56] take source DB in upgrader command from args (Jose Celano)
aabc3ef feat: the upgrader command takes args (Jose Celano)
693994f feat: add new dependency text_colorizer (Jose Celano)
f620e05 fix: [#56] announce list has precedence over announce (Jose Celano)
309e141 fix: take torrent private flag from torrent file (Jose Celano)
72dc139 refactor: reformat sql queries (Jose Celano)
6bb4c53 refactor: extract struct TorrentRecordV2 (Jose Celano)
b9bf405 feat: [#56] improve command output (Jose Celano)
7152654 refactor: [#56] rename structs for DB records (Jose Celano)
99edf52 feat: imported users have importation date instead of registrataion date (Jose Celano)
21174d4 feat: [#56] trasnfer torrents (4/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
8bdf32f feat: [#56] trasnfer torrents (3/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
3fea6ea feat: [#56] trasnfer torrents (2/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
03e4bef feat: [#56] remove unused scripts and write basic upgrage guide (Jose Celano)
0b3aefa feat: [#56] transfer torrents (1/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
8d26faa fix: [#78] parsing keys from tracker (Jose Celano)
35f1e37 fix: [#56} default user registration date with time (Jose Celano)
dd949fa feat: [#56] transfer tracker keys from v1.0.0 to v2.0.0 (Jose Celano)
d9b4e87 feat: [#56] transfer user password from v1.0.0 to v2.0.0 (Jose Celano)
01921ed fix: [#56] triggering recompilation on migration changes (Jose Celano)
cf09283 docs: [#56] update README for integration tests (Jose Celano)
d1059f5 feat: [#56] trasnfer user data from v1.0.0 to v2.0.0 (Jose Celano)
d590972 refactor: [#56] move upgrader from main upgrade mod to specific version upgrader mod (Jose Celano)
996c7d1 refactor: [#56] rename command al dirs (Jose Celano)
b92fb08 feat: [#56] transfer categories from db v1.0.0 to v2.0.0 (Jose Celano)
7513df0 refactor: add scaffolding for database migration command (Jose Celano)
5d6dec0 refactor: allow adding more binaries (Jose Celano)
c3414da feat: add target dir to .gitignore (Jose Celano)

Pull request description:

  Depends on: #87

  I've created the basic scaffolding of the command. My plan is:

  - Migrate all the table records.
  - Insert torrents in DB from `uploads` dir.

  Potential problems are:

  - AUTOINCREMENTS
  - Foreign keys

  **UPDATE 2022-11-30**

  ### Tasks

  - [x] Transfer `torrent_categories`
  - [x] Transfer `torrent_user`
  - [x] Allow login for the transferred users using the Pbkdf2 for hashing the password
  - [x] Use date and time in `today_iso8601` function instead of only the date
  - [x] Transfer `torrent_tracker_keys`
  - [x] Remove unused content from dir `upgrades`. We do not need the MySQL stuff for this migration. There was no MySQL support for version `v1.0.0`
  - [x] Transfer `torrent_torrents`. See below the subtasks for this task
  - [x] Transfer `torrent_torrent_files`. It was not used in `v1.0.0`
  - [x] Make `registration_date` optional and leave it empty for imported users
  - [x] Add a new DB field `imported_date` to the `torrust_users` table with the importation date for user records imported with this command
  - [x] Refactor
  - [x] Add automated tests
  - [x] Intensive testing
  - [x] Write documentation explaining how to upgrade
  - [x] Rename `destiny` DB to `target` DB.

  ### Subtasks from issue #84

  This rework is needed because @ldpr found a bug in the current version that affects the upgrader. We have to fix that bug and update the "upgrader".
  - [x] Fix issue #84
  - [x] Rework: remove the `torrust_torrent_tracker_stats::tracker_url` column. **DISCARDED**.
  - [x] Populate table `torrust_torrent_tracker_stats` with one record per torrent.

  ### Transfer torrents subtasks

  - [x] Fill table `torrust_torrents`
  - [x] Fill table `torrust_torrent_files`
  - [x] Fill table `torrust_torrent_announce_urls`
  - [x] Fill table `torrust_torrent_info`

  ### Testing subtasks

  Assertions for integration test:

  - [x] `torrust_users` table
  - [x] `torrust_user_authentication` table
  - [x] `torrust_user_profiles` table
  - [x] `torrust_tracker_keys` table
  - [x] `torrust_torrents` table
  - [x] `torrust_torrent_files` table
  - [x] `torrust_torrent_info` table
  - [x] `torrust_torrent_announce_urls` table

  Some cases to test:

  - [x] Torrent with `pieces`.

  Using a single tracker URL or multiple URLs:

  - [x] Torrent with `announce` (single tracker url).
  - [x] Torrent with `announce_list` (multiple tracker URLs).

  Containing one file or multiple files:

  - [x] Torrent with one file.
  - [x] Torrent with multiple files.

  Add tests for the application behaviour changed:

  - [x] User can use have the password hashed with "argon2id" or a "pbkdf2-sha256". Add a test for the "verify_password" function.

  Things I'm not going to test:

  - [ ] Torrent with MD5 checksum?. I do not know how to include this MD5 checksum in the torrent file.
  - [ ] Torrent with `root_hash` ([BEP-0030](https://www.bittorrent.org/beps/bep_0030.html)).
  - [ ] The user registration date can be null for users that have been imported. We do not test it for MySQL since the upgrader is only for SQLite.

ACKs for top commit:
  josecelano:
    ACK 5a7d875
  da2ce7:
    ACK 5a7d875

Tree-SHA512: 0f79cb36bc8fac5f0166fa55d6addbbb1a4096c2f2e0e1d898b5b694bf16877cdc572a9336a69d0afd7da8c075edc21d49f6a5d640b187163269e59fe8f37138
da2ce7 added a commit to da2ce7/torrust-index that referenced this issue Oct 15, 2023
27afd4e release: version 3.0.0-alpha.1 (Cameron Garnham)
e93e5cd docs: add release process (Cameron Garnham)
3a9954e various: work on readme (Cameron Garnham)
9dc540b chore(deps): bump indexmap from 1.9.3 to 2.0.2 (dependabot[bot])
1f5351d dev: upgrade containers (Cameron Garnham)
b0f2913 chore: format cargo file (Cameron Garnham)
f610b92 dev: replace sailfish with tera (Cameron Garnham)
047359d ci: temp: clean before build (Cameron Garnham)
67555d9 ci: avoid rust `cargo check` bug (Cameron Garnham)
b7448e8 chore: update deps (Cameron Garnham)
b6cfcc3 various: change name to `torrust-index` (Cameron Garnham)
f59b16e ci: update testing workflow (Cameron Garnham)
4dc795f chore: update cargo lockfile (Cameron Garnham)
5495658 ci: small fixes (Cameron Garnham)
ca05034 ci: add labels sync workflow (Cameron Garnham)
4100d8d ci: add dependabot file (Cameron Garnham)
41be37a github: add codeowners file (Cameron Garnham)
e6dcbb1 chore: update dependencies (Jose Celano)
8304bf6 chore: [torrust#247] rename yml extension to yaml (postmeback)
275231a doc: [torrust#276] add comment for upload torrent secondary tasks (Jose Celano)
f19e801 refactor: [torrust#276] extract fn Torrent::import_torrent_statistics_from_tracker (Jose Celano)
fbb42ad feat!: [torrust#276] do not persist uploaded torrent if it cannot persit tags (Jose Celano)
6a75c54 refactor: [torrust#276] extract fn Torrent::canonical_info_hash_group_checks (Jose Celano)
bbadd59 refactor: [torrust#276] extract fn Torrent::customize_announcement_info_for (Jose Celano)
4cc97c7 feat!: [torrust#276] upload torrent returns 400 instead of empty response (Jose Celano)
329485f refactor: [torrust#276] extract fn parse_torrent::decode_and_validate_torrent_file (Jose Celano)
a46d300 refactor: [torrust#276] extract function Torrent::validate_and_build_metadata (Jose Celano)
ca6e97c refactor: [torrust#276] move metadata format validation to Metadata struct (Jose Celano)
a302c22 test: [torrust#276] add more tests for torrent upload (Jose Celano)
7d50a17 refactor: reorganize test mods for torrent contract (Jose Celano)
2cb0ade chore: remove unused dependencies (Jose Celano)
378d19b chore: cargo update (Jose Celano)
8821346 doc: add some comments for BEP 30 implementation (Jose Celano)
dfdac19 refator: [torrust#296] move logic to service layer (Jose Celano)
1660fd5 refactor: [torrust#296] rename vars (Jose Celano)
b6fe36b refactor: [torrust#296] extract duplicate code (Jose Celano)
f0ad6a4 refactor: rename structs and reorganize mods (Jose Celano)
e9476fc feat: [torrust#296] persist torrent comment (Jose Celano)
eb26c8d fix: tag name for random tag in tests (Jose Celano)
3cf9c44 test: add two more test torrents (Jose Celano)
50cef81 chore: update config for debuggin in Visual Studio Code (Jose Celano)
7fedf15 feat!: [torrust#289] do not allow duplicate tags (Jose Celano)
01a7d2e feat!: [torrust#289] do not allow empty tag names (Jose Celano)
c2b7488 feat!: [torrust#288] do not allow empty category names (Jose Celano)
022692e fix: [torrust#273] add tags to torrent details in test responses (Jose Celano)
2a73f10 test: [torrust#278] allow using non canonical info-hash to download a torrent (Jose Celano)
05b67c7 test: [torrust#278] use non canonical info-hash to get torrent details (Jose Celano)
83d31f2 feat: [torrust#278] redirect to URL with canonical infohash (Jose Celano)
5e2ae68 ci: enable rust cache for integration test (Jose Celano)
d7cc040 refactor: [torrust#282] tests (Jose Celano)
6ff3600 fix: [torrust#282] downloaded torrent info-hash matches uploaded one (Jose Celano)
b34c7d8 test: [torrust#282] compare uploaded and downloaded torrent info-hashes (Jose Celano)
05a4977 fix: [torrust#279] rename tracker container env var TORRUST_TRACKER_DATABASE_DRIVER (Jose Celano)
110e159 test: [torrust#261]: do not allow uploading two torrents with the same canonical infohash (Jose Celano)
3b7a762 feat: [torrust#261] store original infohashes (Jose Celano)
d9cdd65 feat: new binary to par torrent files (Jose Celano)
7c4b530 test: [torrust#264] Added torrent name to list and detail endpoints (MMelchor)
f2369b4 feat: [torrust#264] Added torrent name to list and detail endpoints (MMelchor)
891a744 fix: clean sqlite bash commands (Jose Celano)
bf95d85 fix: docker compose with the new tracker container image (Jose Celano)
bf3f66f torrust#262: Add tower-http compression middleware (Alex Wellnitz)
9bb8578 feat: [torrust#256] add original infohash to upload torrent response (Jose Celano)
7c047e2 refactor: [torrust#256] extract struct AddTorrentResponse (Jose Celano)
d7c9d93 feat: [torrust#256] store the original infohash in the database (Jose Celano)
0cb63dc feat: [#2560] new function to calculate the original torrent infohash (Jose Celano)
941694e docs: [torrust#256] add ADR for custom info dcit fields (Jose Celano)
77a7f8a test: [torrust#256] uploaded torrent inhohash changes when contains custom fields (Jose Celano)
05141fd fix: type for parsed torrent metadata using intermodal console app (Jose Celano)
354cb7d ci: overhaul testing workflow (Cameron Garnham)
ce50f26 feat: [torrust#257] improve bad request error message for uploading (Jose Celano)
a8aad7a fix: clippy errors (Jose Celano)
35a5430 feat: increase max request body size to 10MB (Jose Celano)
0b29678 refactor(ci): reorganize E2E testing scripts (Jose Celano)
22b8f8a fix: [torrust#223] HTTP error status code trying to insert duplicate category in MySQL (Jose Celano)
c6346a5 test: [torrust#223] run E2E with MySQL too (Jose Celano)
8fe0955 fix: clippy warning (Jose Celano)
bc04231 doc: [torrust#242] improve infohash generation documentaion (Jose Celano)
6fc4050 test: [torrust#242] add tests for infohash calculation (Jose Celano)
c3e61ea fix: [torrust#242] wrong infohash when info dict contains source field (Jose Celano)
2e6fe12 ci: overhaul coverage workflow (Cameron Garnham)
9de7aa7 dev: tighten lint for build and clippy (Cameron Garnham)
f7f76ff fix: clippy warning (Jose Celano)
414c6c1 feat: add a custom header with infohash to the download endpoints (Jose Celano)
0f163cf refactor: invert the dependency between Torrent named constructors (Jose Celano)
4b6f25c test: add test for random torrent file generator service (Jose Celano)
40c4df0 refactor: extract hasher service (Jose Celano)
b2870b9 refactor: extract torrent file service (Jose Celano)
dfa260e fix: clippy warnings alter updating clippy to clippy 0.1.73 (Jose Celano)
b269ecb feat!: change random torrent generator endpoint (Jose Celano)
30bf79e feat: new endpoint to generate random torrents (Jose Celano)
dd1dc0c chore: add dependencies: hex, uuid (Jose Celano)
f739657 torrust#72: Change MIN_TORRENT_TITLE_LENGTH type from u32 to usize for Rust compatibility (Alex Wellnitz)
1828883 torrust#72: Constant added so you can easily adjust the value (Alex Wellnitz)
7db0275 Remove referencing the reference (Alex Wellnitz)
a15af48 torrust#72: Specific error code added (Alex Wellnitz)
946ea97 torrust#72: Add minimum length in Torrent Title (Alex Wellnitz)
6bf1b19 ci: fix cargo publish command (Jose Celano)
6347cdb chore(release): 2.0.0-alpha.3 (Jose Celano)
e627ef9 refactor: use a third party package for email valildation (Jose Celano)
734e6cb feat: add cargo dependency: email_address (Jose Celano)
b069421 chore: normalize workflow names (Jose Celano)
db1612c ci: add upload coverage report to codecov (Jose Celano)
a534e38 fix: [torrust#230] make sure user exist in upload torrent endpoint (Jose Celano)
fe25778 chore: udpate rust toolchain 1.72.0-nightly (Jose Celano)
ba8b2c2 feat!: change default API port to 3001 (Jose Celano)
802df10 fix: [torrust#227] load error images in image proxy before serving them (Jose Celano)
acf5728 docs: proxied images can only be PNG (Jose Celano)
7803d5a feat!: [torrust#217] lowercase infohashes (Jose Celano)
21a1f16 feat!: [torrust#97] make torrent category optional (Jose Celano)
21ee689 feat!: [torrust#215] return 404 when torrent is not found (Jose Celano)
f85e153 feat!: [torrust#144] don't allow to update settings (Jose Celano)
986d2f8 fix: [torrust#194] add missing tables to truncate when reseting the DB (Jose Celano)
7a06fe8 test: [torrust#194] remove database tests (Jose Celano)
b4ea3d5 fix: [torrust#216] allow updating torrent category after upload (Jose Celano)
f998d9d feat: add env var to set permissive CORS policy (Jose Celano)
910a419 chore: format toml files (Jose Celano)
6b94f77 release: v2.0.0-alpha.2 (Jose Celano)
717cdaa refactor(api): [torrust#208] use API impementation enum for API versioning (Jose Celano)
44c799e refator(api): [torrust#208] remove ActixWeb implementation (Jose Celano)
6fc6872 refactor(api): [torrust#197] make Axum implementation the default one (Jose Celano)
f0017ae refactor(api): move auth logic to web api (Jose Celano)
ff8816f refactor(api): rename structs (Jose Celano)
d8b2104 refactor(api): move Create struct (Jose Celano)
9591239 refector(api): move API_VERSION const out of ActixWeb implementation (Jose Celano)
a6881e3 refactor: move funtion get_optional_logged_in_user (Jose Celano)
b73d864 fix(api): Axum API, error should return a 500 status code (Jose Celano)
b4744e7 test(api): fix test for empty categories (Jose Celano)
34db879 fix(api): Axum API, fix delete tag response (Jose Celano)
0af2cb7 refactor(api): [torrust#180] Axum API, proxy context (Jose Celano)
24394ea refactor(api): [torrust#182] Axum API, torrent context, delete torrent info (Jose Celano)
ca257ff refactor(api): [torrust#182] Axum API, torrent context, update torrent info (Jose Celano)
4bed98a refactor(api): [torrust#182] Axum API, torrent context, get torrent info (Jose Celano)
b998a16 refactor(api): [torrust#182] Axum API, torrent context, search for torrents (Jose Celano)
ed533b7 refactor(api): [torrust#182] Axum API, torrent context, download torrent file (Jose Celano)
538ebcc refactor(api): [torrust#182] Axum API, torrent context, upload torrent file (Jose Celano)
d7f1e34 feat(api): add multipart feature for Axum package (Jose Celano)
dc469c4 refactor(api): [torrust#181] Axum API, settings contex (Jose Celano)
b53ce8d refactor(api): [torrust#198] Axum API, tag context (Jose Celano)
878bb7b refactor(api): [torrust#198] Axum API, root endpoints (Jose Celano)
b4a7ea6 refactor(api): [torrust#179] Axum API, category context, delete category (Jose Celano)
f63bf05 refactor(api): [torrust#179] Axum API, category context, add category (Jose Celano)
bb6d9bf refactor(api): [torrust#179] Axum API, category context, get all categories (Jose Celano)
6f9c1a2 refactor: API category context tetests (Jose Celano)
d3b5b15 refactor(api): [torrust#183] Axum API, user context, ban user (Jose Celano)
9564dec refactor(api): [torrust#183] Axum API, user context, renew JWT (Jose Celano)
b15616c refactor(api): [torrust#183] Axum API, user context, verify JWT (Jose Celano)
3f639b3 refactor(api): [torrust#183] Axum API, user context, login (Jose Celano)
a341e38 refactor(api): [torrust#183] Axum API, user context, email verification (Jose Celano)
91522f4 feat: add cargo dependency tower-http (Jose Celano)
79682a5 refactor(api): [torrust#183] Axum API, user context, registration (Jose Celano)
6023b96 fix: [torrust#190] SQL error in SQLite (Jose Celano)
b4c43da fix: [torrust#189] make 'Development checks' workflow fail if E2E tests fail (Jose Celano)
f693a02 refactor: [torrust#187] extract tag::Service (Jose Celano)
b97698a test(api): [torrust#187] add tests for new 'tag' context (Jose Celano)
4730afd chore: clippy errors (Warm Beer)
a6cf184 chore: cargo fmt (Warm Beer)
4286ba9 feat: added filtering torrents on tags (Warm Beer)
a1bd92f fix: sql queries (Warm Beer)
7ce3d5e feat: torrent tags (Warm Beer)
1924365 refactor(api): [torrust#178] axum API, 'about' context migrated (Jose Celano)
68e2132 refactor: disable logging for testing (Jose Celano)
0264e5c feat: [torrust#177] new config option for log level (Jose Celano)
3edd507 docs: [torrust#97] update README (Jose Celano)
d08f70e refactor(api): [torrust#174] Axum API scaffolding (Jose Celano)
7bcf20e feat: disable sqlx logging for all statements (Jose Celano)
7347fee feat(api): [torrust#174] new cargo dependencies: axum, hyper (Jose Celano)
d7f51fa docs: [torrust#169] app upgrader documentation (Jose Celano)
5485589 refactor: remove unneeded code (Jose Celano)
93d1b64 docs: [torrust#168] statistics importer console command (Jose Celano)
9baedfb docs: [torrust#166] installation and configuration (Jose Celano)
9ca7341 docs(api): [torrust#163] API documentation on docs.rs (Jose Celano)
5396301 refactor: [torrust#157] extract authentication service (Jose Celano)
8101048 refactor: [torrust#157] extract service to ban users (Jose Celano)
2eb0f7c refactor: [torrust#157] extract service for user registration (Jose Celano)
1abcc4d refactor: [torrust#157] extract service: torrent (Jose Celano)
0387b97 refactor: [torrust#157] extract service: settings (Jose Celano)
c9fb249 refactor: [torrust#157] extract service: proxy (Jose Celano)
d58f3cc refactor: [torrust#157] extract service: category (Jose Celano)
baa4c7e refactor: [torrust#157] extract service: about (Jose Celano)
02c4a7e feat!: add API version prefix in API URLs (Jose Celano)
7c07920 ci: install imdl binary (Jose Celano)
75ec0a6 feat: release 2.0.0-alpha.1 (Jose Celano)
260452f ci: [torrust#152] add workflow to publish on crates.io (Jose Celano)
57642ea feat!: [torrust#143] move config option torrent_info_update_interval (Jose Celano)
d1a3077 chore: normalize infohash -> info_hash (Jose Celano)
25016e0 feat: [torrust#146] return infohash after successfully uploading a torrent (Jose Celano)
07943f1 docs: add adr for lowercase infohashes (Jose Celano)
83ec1d6 dev: fix clippy warnings with env var CARGO_INCREMENTAL=0 (Jose Celano)
5bd233a feat: add env var CARGO_INCREMENTAL before running clippy (Jose Celano)
c71949f feat: enable pedantic clippy on CI (Jose Celano)
f0d3da5 dev: fix remaning clippy warnings 2 (Cameron Garnham)
da91f97 dev: fix remaning clippy warnings (Cameron Garnham)
493adbb dev: fix clippy warnings for: src/tracker.rs (Cameron Garnham)
6d5e2ed dev: fix clippy warnings for: src/routes/user.rs (Cameron Garnham)
33c3218 dev: fix clippy warnings for: src/routes/torrent.rs (Cameron Garnham)
c20608f dev: fix clippy warnings for: src/routes/settings.rs (Cameron Garnham)
7277e4e dev: fix clippy warnings for: src/routes/mod.rs (Cameron Garnham)
fd75fd4 dev: fix clippy warnings for: src/routes/category.rs (Cameron Garnham)
21493b0 dev: fix clippy warnings for: src/routes/about.rs (Cameron Garnham)
f1b3663 dev: fix clippy warnings for: src/models/user.rs (Cameron Garnham)
a0947d0 dev: fix clippy warnings for: src/models/torrent.rs (Cameron Garnham)
269cd28 dev: fix clippy warnings for: src/models/torrent_file.rs (Cameron Garnham)
eb3dd11 dev: fix clippy warnings for: src/models/response.rs (Cameron Garnham)
b737f10 dev: fix clippy warnings for: src/mailer.rs (Cameron Garnham)
3e7a917 dev: fix clippy warnings for: src/lib.rs (Cameron Garnham)
7f79fa9 dev: fix clippy warnings for: src/errors.rs (Cameron Garnham)
578b213 dev: fix clippy warnings for: src/databases/sqlite.rs (Cameron Garnham)
593ac6f dev: fix clippy warnings for: src/databases/mysql.rs (Cameron Garnham)
ebc360e dev: fix clippy warnings for: src/databases/database.rs (Cameron Garnham)
7b28120 dev: fix clippy warnings for: src/console/commands/import_tracker_statistics.rs (Cameron Garnham)
836d53f dev: fix clippy warnings for: src/config.rs (Cameron Garnham)
a741a22 dev: fix clippy warnings for: src/auth.rs (Cameron Garnham)
4a70ee0 dev: apply clippy auto-fixes (Cameron Garnham)
404caee refactor: use tracker::Service in StatisticsImporter (Jose Celano)
63aefcf refactor: decouple tracker::StatisticsImporter from tracker::Service (Jose Celano)
0198361 refactor: rename structs and functions, and add docs (Jose Celano)
00926e1 refactor: split tracker mod into submods (Jose Celano)
fddf020 fix: failing test (Jose Celano)
6cc1380 refactor: extract tracker api client from tracker service (Jose Celano)
655f631 feat: [torrust#130] add env var to change the default config path (Jose Celano)
4764825 feat: [torrust#114] add new config section api (Jose Celano)
41b6000 feat!: [torrust#114] remove the torrents response min page size and add max page size (Jose Celano)
fc15671 feat: remove debug output (Jose Celano)
de56be0 refactor: move docs and compose config for database tests (Jose Celano)
7298238 feat!: [torrust#115] change endpoints /torrent/{id} to /torrent({infohash} (Jose Celano)
e9762ff test: [torrust#115] add more E2E tests for endpoints using torrent ID (Jose Celano)
16bd04c feat!: [torrust#115] change endpoint GET /torrent/download/{id} to GET /torrent/download/{infohash} (Jose Celano)
e0c01d6 feat: [torrust#115] add cargo dependencies: thiserror and binascii (Jose Celano)
32af56d test: [torrust#115] add E2E tests for torrent download with personal announce url (Jose Celano)
e8bf537 refactor: [torrust#115] extractfunction expected_torrent (Jose Celano)
4782f67 fix: run E2E tests that require a running tracker (Jose Celano)
234e07a refactor: [torrust#115] make TrackerService::retrieve_new_tracker_key private (Jose Celano)
df650db refactor: rename mod time to clock (Jose Celano)
d2f8db9 fix: [torrust#132] deprecate chrono function warning (Jose Celano)
b97da41 refactor: [torrust#130] configuration for E2E tests (Jose Celano)
87edb36 test: [torrust#130] do not update settings for shared test evns (Jose Celano)
88bd598 fix: tests. Missing new image cache section in config (Jose Celano)
916d869 refactor: remove patch versions from added packages (Warm Beer)
d5c5487 refactor: cargo fmt (Warm Beer)
005817f feat: [torrust#91] added image proxy with cache (Warm Beer)
14d0acb refactor: run e2e tests with independent isolated servers too. (Jose Celano)
1df870b refactor: extract logic for setting up test envs (Jose Celano)
36f17f1 tests: panic when E2E server env is not running (Jose Celano)
bce946f refactor: removed unneeded intermediary var (Jose Celano)
6d5e002 test: isolated environments for integration testing (Jose Celano)
2211871 refactor: extract app from main (Jose Celano)
89e544e feat: server port assigned by OS with port 0 (Jose Celano)
489061e refactor: extract logic from e2e tests to reuse it for integrations tests (Jose Celano)
1aee356 fix: [torrust#125] dependabot alert GHSA-wcg3-cvx6-7396 (Jose Celano)
b77de22 chore(deps): [torrust#122] cargo udpate (Jose Celano)
488601d chore(deps): [torrust#122] bump actix-cors, actix-multipart, actix-web (Jose Celano)
9174a0c chore(deps): [torrust#122] bump async-trait from 0.1.52 to 0.1.68 (Jose Celano)
e4c19c1 chore(deps): [torrust#122] bump futures from 0.3.15 to 0.3.24 (Jose Celano)
cd1a9ec chore(deps): [torrust#122] bump sqlx from 0.6.1 to 0.6.3 (Jose Celano)
ec9fee7 chore(deps): [torrust#122] bump toml from 0.5.8 to 0.7.3 (Jose Celano)
b45f6fb chore(deps): [torrust#122] bump derive_more from 0.99.14 to v0.99.17 (Jose Celano)
e4bfc09 chore(deps): [torrust#122] bump serde_json from 1.0.64 to v1.0.96 (Jose Celano)
45846aa chore(deps): [torrust#122] bump serde_bytes from 0.11.5 to v0.11.9 (Jose Celano)
a420a82 chore(deps): [torrust#122] bump urlencoding from 2.1.0 to 2.1.2 (Jose Celano)
84cde9b chore(deps): [torrust#122] bump chrono from 0.4.19 to 0.4.24 (Jose Celano)
6a1a965 chore(deps): [torrust#122] bump jsonwebtoken from 8.1.1 to 8.3.0 (Jose Celano)
9de3225 chore(deps): [torrust#122] bump sha-1 from 0.10.0 to 0.10.1 (Jose Celano)
30bccd3 chore(deps): [torrust#122] bump reqwest from 0.11.4 to 0.11.16 (Jose Celano)
cfad809 chore(deps): [torrust#122] bump tokio from 1.13.1 to 1.28.0 (Jose Celano)
5be1b83 chore(deps): [torrust#122] bump lettre from 0.10.0-rc.3 to 0.10.4 (Jose Celano)
49e582b chore(deps): [torrust#122] bump sailfish from 0.4.0 to 0.6.1 (Jose Celano)
4a5b7bb chore(deps): [torrust#122] bump regex from 1.6.0 to 1.8.1 (Jose Celano)
e8f8803 chore(deps): [torrust#122] bump argon2 from 0.4.1 to 0.5.0 and pbkdf2 0.11.0 to 0.12.1 (Jose Celano)
e3ed344 tests: [torrust#120] E2E tests for torrent routes (Jose Celano)
ea36618 feat: [torrust#120] add cargo dependency which (Jose Celano)
bac7e64 feat: [torrust#120] add cargo dependency uuid (Jose Celano)
a5bdaad feat: [torrust#120] add cargo dependency tempfile (Jose Celano)
c7c6ffd feat: [torrust#120] add dependency feature (Jose Celano)
9b2266d tests: [torrust#109] E2E tests for settings routes (Jose Celano)
2b6c04f test: [torrust#109] add more E2E tests for categories (Jose Celano)
2b58923 tests: [torrust#111] E2E test for user routes (Jose Celano)
f257692 feat: [torrust#111] add cargo dependency rand (Jose Celano)
73a26ae tests: [torrust#109] E2E test for category routes (Jose Celano)
652f50b refactor: [torrust#109] extract structs and functions (Jose Celano)
5678e4d tests: [torrust#107] E2E tests for API entrypoint and about routes (Jose Celano)
08f0aac chore: add code owners for github workflows (Jose Celano)
eedb0ce tests: e2e tests scaffolding (Jose Celano)
6ecde1d feat: add docker support (Jose Celano)
e6c5e30 feat: update vscode config to follow Tracker conventions (Jose Celano)
005eae5 feat: optionally load config with env var (Jose Celano)
ec52713 docs: minimise and cleanup readme file (Cameron Garnham)
247a043 feat: update licence files (Cameron Garnham)
f68d625 feat: [torrust#85] add cspell configuration (Jose Celano)
0c4eb02 feat: [torrust#94] add prefix v1 to tracker API (Jose Celano)
728fe8a fix: [torrust#78] remove unused struct NewTrackerKey (Jose Celano)
83bafb4 fix: console command help messages (Jose Celano)
5a7d875 feat: [torrust#56] console command to import tracker stats for all torrents (Jose Celano)
19d054e refactor: [torrust#56] rename test mods to follow prod mods (Jose Celano)
e8d984d refactor: [torrust#56] rename destiny DB to target DB (Jose Celano)
b400962 fix: format (Jose Celano)
8b761c8 feat: [torrust#56] keep category id in DB migration script (Jose Celano)
b29d4d7 fix: [torrust#56] db migration for imported users (Jose Celano)
38fee53 test: [torrust#56] new test for password verification (Jose Celano)
b9a8bf9 fix: [torrust#56] remove comment (Jose Celano)
e1790f6 refactor: [torrust#56] extract mods in upgrader (Jose Celano)
e23d948 refactor: remove duplication in tests (Jose Celano)
ee01e7b test: [torrust#56] for torrent files table in upgrader (new case) (Jose Celano)
afffaef tests: [torrust#56] for torrents files table in upgrader (Jose Celano)
82b84a3 refactor: [torrust#56] extract test configuration (Jose Celano)
750969d refactor: [torrust#56] rename methods (Jose Celano)
0063289 tests: [torrust#56] for torrents info and announce urls tables in upgrader (Jose Celano)
cd95987 refactor: [torrust#56] rename mod and variables (Jose Celano)
f0f581f tests: [torrust#56] for torrents table in upgrader (Jose Celano)
eef980c tests: [torrust#56] for tracker keys table in upgrader (Jose Celano)
8d74e66 tests: [torrust#56] for users profile and auth tables in upgrader (Jose Celano)
0a58b6c fix: [torrust#56] bio and avatar is user profile should be NULL for imported users (Jose Celano)
5d0def2 refactor: [torrust#56] tests for upgrader (Jose Celano)
f993107 tests: [torrust#56] for users table in upgrader (Jose Celano)
6188b10 refactor: extract mod sqlite_v1_0_0 in tests (Jose Celano)
44927e5 test: [torrust#56] WIP. scaffolding to test upgrader command (Jose Celano)
7f0a7ea fix: open source db in read-only mode in upgarder (Jose Celano)
217fae2 feat: [torrust#56] take source DB in upgrader command from args (Jose Celano)
aabc3ef feat: the upgrader command takes args (Jose Celano)
693994f feat: add new dependency text_colorizer (Jose Celano)
f620e05 fix: [torrust#56] announce list has precedence over announce (Jose Celano)
309e141 fix: take torrent private flag from torrent file (Jose Celano)
72dc139 refactor: reformat sql queries (Jose Celano)
6bb4c53 refactor: extract struct TorrentRecordV2 (Jose Celano)
b9bf405 feat: [torrust#56] improve command output (Jose Celano)
7152654 refactor: [torrust#56] rename structs for DB records (Jose Celano)
99edf52 feat: imported users have importation date instead of registrataion date (Jose Celano)
21174d4 feat: [torrust#56] trasnfer torrents (4/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
8bdf32f feat: [torrust#56] trasnfer torrents (3/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
3fea6ea feat: [torrust#56] trasnfer torrents (2/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
03e4bef feat: [torrust#56] remove unused scripts and write basic upgrage guide (Jose Celano)
0b3aefa feat: [torrust#56] transfer torrents (1/4 tables) from v1.0.0 to v2.0.0 (Jose Celano)
8d26faa fix: [torrust#78] parsing keys from tracker (Jose Celano)
35f1e37 fix: [torrust#56} default user registration date with time (Jose Celano)
dd949fa feat: [torrust#56] transfer tracker keys from v1.0.0 to v2.0.0 (Jose Celano)
d9b4e87 feat: [torrust#56] transfer user password from v1.0.0 to v2.0.0 (Jose Celano)
01921ed fix: [torrust#56] triggering recompilation on migration changes (Jose Celano)
cf09283 docs: [torrust#56] update README for integration tests (Jose Celano)
d1059f5 feat: [torrust#56] trasnfer user data from v1.0.0 to v2.0.0 (Jose Celano)
d590972 refactor: [torrust#56] move upgrader from main upgrade mod to specific version upgrader mod (Jose Celano)
996c7d1 refactor: [torrust#56] rename command al dirs (Jose Celano)
b92fb08 feat: [torrust#56] transfer categories from db v1.0.0 to v2.0.0 (Jose Celano)
7513df0 refactor: add scaffolding for database migration command (Jose Celano)
5d6dec0 refactor: allow adding more binaries (Jose Celano)
c3414da feat: add target dir to .gitignore (Jose Celano)
3c47ffc fix: [torrust#84] SQL query to get list of torrents without stats (Jose Celano)
c291557 fix: [torrust#84] restore behavior. Update torrent stats after upload (Jose Celano)
50dc9d3 ci: make full test (Cameron Garnham)
84324a8 test: skip for mysql test, as db isn't setup and it hangs. (Cameron Garnham)
52d23ee clippy: fix clippy errors, and most warnings (Cameron Garnham)
f3cc562 clippy: auto fix (Cameron Garnham)
63f8b6f vscode: add auto-formating, and clippy for lint (Cameron Garnham)
a39a0d9 ci: verify formating for pull requests (Cameron Garnham)
c982c4e fmt: add world format to git-blame-ignore file (Cameron Garnham)
9ddc079 fmt: format the world (Cameron Garnham)
06bb34b fmt: include rust format, same as torrust-index (Cameron Garnham)
4e72995 fix: [torrust#79] prioritize `announce-list` over `announce` (Warm Beer)
4bb814c feat: auto detect `db_driver` from `connect_url` (Warm Beer)

Pull request description:

ACKs for top commit:
  da2ce7:
    ACK 27afd4e

Tree-SHA512: c23856d41e784f81177cfe9751eabd7bdcbdf662a412f75e3dc64c11c7e7f70dab737c9b4f2333c8a6e2a684c212c0ded5424b8581925c19af3e979a3a79cd6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants