From fb472ed6c625722cb3f2f1678963e700faef7cfd Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 17 Oct 2023 21:53:35 +0530 Subject: [PATCH 1/3] chore: update deps, docker img and woodpecker ci def --- .gitignore | 1 + ...6ee8269cc500f400114a7472b83f0f1c568b5.json | 16 + ...691f2867bbcd50dc47a000ac9bf3ff878c97c.json | 26 + ...55951fe217d3a3cefe40a006fdd3cb31f0ac4.json | 28 + ...8ae53a44559aa0e7eb64680185baf1c481723.json | 22 + ...9eadea81f125933f76261c8b3c8319d43bbe0.json | 22 + ...4e2b9aa40c7181eae9a31e51451cce95f04e8.json | 28 + ...5c8cb0c5db277fc4c8a9b19951a03166c6492.json | 15 + ...5a02bcf3aa1aa72a1f6f6c8884e885fc3b953.json | 17 + ...4017719720aa986d680d4727a1facbb869c7a.json | 14 + ...05be06a28925af1b3799ffef5371d511fd138.json | 15 + ...b42b73a7741ae4a348ff539ac410022e03ace.json | 22 + ...648494a403c7d09ea3caf91bf54869a81aa73.json | 15 + ...f680dd2273ead74c3583ef0322f472b1d33fd.json | 61 ++ ...3f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693.json | 23 + ...1a978c9fe0657da13af99796e4461134b5a43.json | 15 + ...358ed7c0a50ba9597fd387b4b09b0a8a154db.json | 22 + ...947d51bfc4a53cedc020016ee25ff98586c93.json | 28 + ...a464544374842450d580517ca2bd01d67402e.json | 62 ++ ...7ca4aa0d6558a9803778ad28cfa7b62382c3e.json | 18 + ...2d106d09d0cbff10c197f2242dcb5c437a1df.json | 28 + ...758ee0929e93ff3f8ce81fe35594756644246.json | 22 + ...2aeba1a635bcf49d18ced5474caa10b7cae4f.json | 16 + ...f52c61bcfe5e5be1901379b715e77f5214dd2.json | 15 + ...607b795a151ddc212361a3c6d8c70ea1c93eb.json | 28 + ...8a44c4f2e1cb125f8db061dd198cc380bf807.json | 15 + ...4a933f324e267f1e7dbb48e1caf1c021adc3f.json | 22 + ...f37bee5b25ffe9a2d175f39a69899bc559965.json | 38 + ...6d9626b74ab33cd6e75e5a08ae88967403b72.json | 16 + .woodpecker.yml | 11 +- Cargo.lock | 972 ++++++++++++------ Cargo.toml | 17 +- Dockerfile | 6 +- src/archive.rs | 4 +- src/settings.rs | 171 ++- 35 files changed, 1420 insertions(+), 431 deletions(-) create mode 100644 .sqlx/query-0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5.json create mode 100644 .sqlx/query-10924f3726a45c3bc709118375d691f2867bbcd50dc47a000ac9bf3ff878c97c.json create mode 100644 .sqlx/query-117f1ae18f6a3936f27446b75b555951fe217d3a3cefe40a006fdd3cb31f0ac4.json create mode 100644 .sqlx/query-1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723.json create mode 100644 .sqlx/query-15a8484de6f035e56c34ce3f6979eadea81f125933f76261c8b3c8319d43bbe0.json create mode 100644 .sqlx/query-19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8.json create mode 100644 .sqlx/query-1972be28a6bda2c3a3764a836e95c8cb0c5db277fc4c8a9b19951a03166c6492.json create mode 100644 .sqlx/query-1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953.json create mode 100644 .sqlx/query-2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a.json create mode 100644 .sqlx/query-43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138.json create mode 100644 .sqlx/query-536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace.json create mode 100644 .sqlx/query-55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73.json create mode 100644 .sqlx/query-57c673ad8529371d77aa305917cf680dd2273ead74c3583ef0322f472b1d33fd.json create mode 100644 .sqlx/query-58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693.json create mode 100644 .sqlx/query-683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43.json create mode 100644 .sqlx/query-6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db.json create mode 100644 .sqlx/query-70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93.json create mode 100644 .sqlx/query-74c41e33f91cf31ea13582c8b3ca464544374842450d580517ca2bd01d67402e.json create mode 100644 .sqlx/query-82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e.json create mode 100644 .sqlx/query-858a4c06a5c1ba7adb79bcac7d42d106d09d0cbff10c197f2242dcb5c437a1df.json create mode 100644 .sqlx/query-9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246.json create mode 100644 .sqlx/query-a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f.json create mode 100644 .sqlx/query-ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2.json create mode 100644 .sqlx/query-b2619292aa6bd1ac38dca152cbe607b795a151ddc212361a3c6d8c70ea1c93eb.json create mode 100644 .sqlx/query-c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807.json create mode 100644 .sqlx/query-e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f.json create mode 100644 .sqlx/query-efa0e41910fa5bcb187ba9e2fc8f37bee5b25ffe9a2d175f39a69899bc559965.json create mode 100644 .sqlx/query-fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72.json diff --git a/.gitignore b/.gitignore index 7849ba2..faedbdd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ __pycache__/ *.py[cod] *$py.class src/sailfish/ +src/libcachebust_data.json diff --git a/.sqlx/query-0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5.json b/.sqlx/query-0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5.json new file mode 100644 index 0000000..bfe5758 --- /dev/null +++ b/.sqlx/query-0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO survey_admins \n (name , password, secret) VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5" +} diff --git a/.sqlx/query-10924f3726a45c3bc709118375d691f2867bbcd50dc47a000ac9bf3ff878c97c.json b/.sqlx/query-10924f3726a45c3bc709118375d691f2867bbcd50dc47a000ac9bf3ff878c97c.json new file mode 100644 index 0000000..26d5457 --- /dev/null +++ b/.sqlx/query-10924f3726a45c3bc709118375d691f2867bbcd50dc47a000ac9bf3ff878c97c.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name, id FROM survey_campaigns ORDER BY id;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "10924f3726a45c3bc709118375d691f2867bbcd50dc47a000ac9bf3ff878c97c" +} diff --git a/.sqlx/query-117f1ae18f6a3936f27446b75b555951fe217d3a3cefe40a006fdd3cb31f0ac4.json b/.sqlx/query-117f1ae18f6a3936f27446b75b555951fe217d3a3cefe40a006fdd3cb31f0ac4.json new file mode 100644 index 0000000..f2dfd00 --- /dev/null +++ b/.sqlx/query-117f1ae18f6a3936f27446b75b555951fe217d3a3cefe40a006fdd3cb31f0ac4.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO survey_responses (\n user_id,\n campaign_id,\n device_user_provided,\n device_software_recognised,\n threads,\n submitted_at,\n submission_bench_type_id\n ) VALUES (\n $1, $2, $3, $4, $5, $6,\n (SELECT ID FROM survey_bench_type WHERE name = $7)\n )\n RETURNING ID;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Varchar", + "Varchar", + "Int4", + "Timestamptz", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "117f1ae18f6a3936f27446b75b555951fe217d3a3cefe40a006fdd3cb31f0ac4" +} diff --git a/.sqlx/query-1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723.json b/.sqlx/query-1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723.json new file mode 100644 index 0000000..a86defd --- /dev/null +++ b/.sqlx/query-1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT password FROM survey_admins WHERE name = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "password", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723" +} diff --git a/.sqlx/query-15a8484de6f035e56c34ce3f6979eadea81f125933f76261c8b3c8319d43bbe0.json b/.sqlx/query-15a8484de6f035e56c34ce3f6979eadea81f125933f76261c8b3c8319d43bbe0.json new file mode 100644 index 0000000..821b428 --- /dev/null +++ b/.sqlx/query-15a8484de6f035e56c34ce3f6979eadea81f125933f76261c8b3c8319d43bbe0.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n survey_admins.name\n FROM\n survey_admins\n INNER JOIN survey_campaigns ON\n survey_admins.ID = survey_campaigns.user_id\n WHERE\n survey_campaigns.ID = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "15a8484de6f035e56c34ce3f6979eadea81f125933f76261c8b3c8319d43bbe0" +} diff --git a/.sqlx/query-19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8.json b/.sqlx/query-19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8.json new file mode 100644 index 0000000..8a28475 --- /dev/null +++ b/.sqlx/query-19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name, password FROM survey_admins WHERE email = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "password", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8" +} diff --git a/.sqlx/query-1972be28a6bda2c3a3764a836e95c8cb0c5db277fc4c8a9b19951a03166c6492.json b/.sqlx/query-1972be28a6bda2c3a3764a836e95c8cb0c5db277fc4c8a9b19951a03166c6492.json new file mode 100644 index 0000000..783a036 --- /dev/null +++ b/.sqlx/query-1972be28a6bda2c3a3764a836e95c8cb0c5db277fc4c8a9b19951a03166c6492.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE \n FROM survey_campaigns \n WHERE \n user_id = (\n SELECT \n ID \n FROM \n survey_admins \n WHERE \n name = $1\n )\n AND\n id = ($2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "1972be28a6bda2c3a3764a836e95c8cb0c5db277fc4c8a9b19951a03166c6492" +} diff --git a/.sqlx/query-1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953.json b/.sqlx/query-1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953.json new file mode 100644 index 0000000..a9289d9 --- /dev/null +++ b/.sqlx/query-1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "insert into survey_admins \n (name , password, email, secret) values ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953" +} diff --git a/.sqlx/query-2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a.json b/.sqlx/query-2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a.json new file mode 100644 index 0000000..edaa9fd --- /dev/null +++ b/.sqlx/query-2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM survey_admins WHERE name = ($1)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a" +} diff --git a/.sqlx/query-43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138.json b/.sqlx/query-43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138.json new file mode 100644 index 0000000..de3e766 --- /dev/null +++ b/.sqlx/query-43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO survey_users (created_at, id) VALUES($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138" +} diff --git a/.sqlx/query-536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace.json b/.sqlx/query-536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace.json new file mode 100644 index 0000000..acf9596 --- /dev/null +++ b/.sqlx/query-536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE name = $1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace" +} diff --git a/.sqlx/query-55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73.json b/.sqlx/query-55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73.json new file mode 100644 index 0000000..c853f38 --- /dev/null +++ b/.sqlx/query-55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE survey_admins set password = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73" +} diff --git a/.sqlx/query-57c673ad8529371d77aa305917cf680dd2273ead74c3583ef0322f472b1d33fd.json b/.sqlx/query-57c673ad8529371d77aa305917cf680dd2273ead74c3583ef0322f472b1d33fd.json new file mode 100644 index 0000000..e68b248 --- /dev/null +++ b/.sqlx/query-57c673ad8529371d77aa305917cf680dd2273ead74c3583ef0322f472b1d33fd.json @@ -0,0 +1,61 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n survey_responses.ID,\n survey_responses.device_software_recognised,\n survey_responses.threads,\n survey_responses.user_id,\n survey_responses.submitted_at,\n survey_responses.device_user_provided,\n survey_bench_type.name\n FROM\n survey_responses\n INNER JOIN survey_bench_type ON\n survey_responses.submission_bench_type_id = survey_bench_type.ID\n WHERE\n survey_responses.campaign_id = (\n SELECT ID FROM survey_campaigns\n WHERE\n ID = $1\n AND\n user_id = (SELECT ID FROM survey_admins WHERE name = $2)\n )\n LIMIT $3 OFFSET $4", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "device_software_recognised", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "threads", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "user_id", + "type_info": "Uuid" + }, + { + "ordinal": 4, + "name": "submitted_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 5, + "name": "device_user_provided", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Text", + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + true, + false, + false, + false, + false + ] + }, + "hash": "57c673ad8529371d77aa305917cf680dd2273ead74c3583ef0322f472b1d33fd" +} diff --git a/.sqlx/query-58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693.json b/.sqlx/query-58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693.json new file mode 100644 index 0000000..a858b65 --- /dev/null +++ b/.sqlx/query-58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name \n FROM survey_campaigns\n WHERE \n id = $1\n AND\n user_id = (SELECT ID from survey_admins WHERE name = $2)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693" +} diff --git a/.sqlx/query-683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43.json b/.sqlx/query-683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43.json new file mode 100644 index 0000000..f95b7e2 --- /dev/null +++ b/.sqlx/query-683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE survey_admins set email = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43" +} diff --git a/.sqlx/query-6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db.json b/.sqlx/query-6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db.json new file mode 100644 index 0000000..ae65dda --- /dev/null +++ b/.sqlx/query-6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE email = $1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db" +} diff --git a/.sqlx/query-70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93.json b/.sqlx/query-70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93.json new file mode 100644 index 0000000..ebe1447 --- /dev/null +++ b/.sqlx/query-70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n name, id\n FROM \n survey_campaigns \n WHERE\n user_id = (\n SELECT \n ID\n FROM \n survey_admins\n WHERE\n name = $1\n )", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93" +} diff --git a/.sqlx/query-74c41e33f91cf31ea13582c8b3ca464544374842450d580517ca2bd01d67402e.json b/.sqlx/query-74c41e33f91cf31ea13582c8b3ca464544374842450d580517ca2bd01d67402e.json new file mode 100644 index 0000000..90cb49d --- /dev/null +++ b/.sqlx/query-74c41e33f91cf31ea13582c8b3ca464544374842450d580517ca2bd01d67402e.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n survey_responses.ID,\n survey_responses.device_software_recognised,\n survey_responses.threads,\n survey_responses.user_id,\n survey_responses.submitted_at,\n survey_responses.device_user_provided,\n survey_bench_type.name\n FROM\n survey_responses\n INNER JOIN survey_bench_type ON\n survey_responses.submission_bench_type_id = survey_bench_type.ID\n WHERE\n survey_bench_type.name = $3\n AND\n survey_responses.campaign_id = (\n SELECT ID FROM survey_campaigns\n WHERE\n ID = $1\n AND\n user_id = (SELECT ID FROM survey_admins WHERE name = $2)\n )\n LIMIT $4 OFFSET $5", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "device_software_recognised", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "threads", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "user_id", + "type_info": "Uuid" + }, + { + "ordinal": 4, + "name": "submitted_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 5, + "name": "device_user_provided", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Text", + "Text", + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + true, + false, + false, + false, + false + ] + }, + "hash": "74c41e33f91cf31ea13582c8b3ca464544374842450d580517ca2bd01d67402e" +} diff --git a/.sqlx/query-82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e.json b/.sqlx/query-82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e.json new file mode 100644 index 0000000..d2add5b --- /dev/null +++ b/.sqlx/query-82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO survey_campaigns (\n user_id, ID, name, difficulties, created_at\n ) VALUES(\n (SELECT id FROM survey_admins WHERE name = $1),\n $2, $3, $4, $5\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Uuid", + "Varchar", + "Int4Array", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e" +} diff --git a/.sqlx/query-858a4c06a5c1ba7adb79bcac7d42d106d09d0cbff10c197f2242dcb5c437a1df.json b/.sqlx/query-858a4c06a5c1ba7adb79bcac7d42d106d09d0cbff10c197f2242dcb5c437a1df.json new file mode 100644 index 0000000..4ef42c5 --- /dev/null +++ b/.sqlx/query-858a4c06a5c1ba7adb79bcac7d42d106d09d0cbff10c197f2242dcb5c437a1df.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n created_at,\n ID\n FROM\n survey_users\n WHERE\n ID = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 1, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "858a4c06a5c1ba7adb79bcac7d42d106d09d0cbff10c197f2242dcb5c437a1df" +} diff --git a/.sqlx/query-9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246.json b/.sqlx/query-9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246.json new file mode 100644 index 0000000..d3ee284 --- /dev/null +++ b/.sqlx/query-9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT difficulties FROM survey_campaigns WHERE id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "difficulties", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246" +} diff --git a/.sqlx/query-a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f.json b/.sqlx/query-a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f.json new file mode 100644 index 0000000..7d5af4b --- /dev/null +++ b/.sqlx/query-a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO survey_benches \n (resp_id, difficulty, duration) \n VALUES ($1, $2, $3);", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Float4" + ] + }, + "nullable": [] + }, + "hash": "a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f" +} diff --git a/.sqlx/query-ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2.json b/.sqlx/query-ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2.json new file mode 100644 index 0000000..81a6b16 --- /dev/null +++ b/.sqlx/query-ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE survey_admins set secret = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2" +} diff --git a/.sqlx/query-b2619292aa6bd1ac38dca152cbe607b795a151ddc212361a3c6d8c70ea1c93eb.json b/.sqlx/query-b2619292aa6bd1ac38dca152cbe607b795a151ddc212361a3c6d8c70ea1c93eb.json new file mode 100644 index 0000000..cad4431 --- /dev/null +++ b/.sqlx/query-b2619292aa6bd1ac38dca152cbe607b795a151ddc212361a3c6d8c70ea1c93eb.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n duration,\n difficulty\n FROM\n survey_benches\n WHERE\n resp_id = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "duration", + "type_info": "Float4" + }, + { + "ordinal": 1, + "name": "difficulty", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "b2619292aa6bd1ac38dca152cbe607b795a151ddc212361a3c6d8c70ea1c93eb" +} diff --git a/.sqlx/query-c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807.json b/.sqlx/query-c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807.json new file mode 100644 index 0000000..f4101dd --- /dev/null +++ b/.sqlx/query-c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE survey_admins set name = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807" +} diff --git a/.sqlx/query-e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f.json b/.sqlx/query-e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f.json new file mode 100644 index 0000000..18cf70b --- /dev/null +++ b/.sqlx/query-e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT secret FROM survey_admins WHERE name = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "secret", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f" +} diff --git a/.sqlx/query-efa0e41910fa5bcb187ba9e2fc8f37bee5b25ffe9a2d175f39a69899bc559965.json b/.sqlx/query-efa0e41910fa5bcb187ba9e2fc8f37bee5b25ffe9a2d175f39a69899bc559965.json new file mode 100644 index 0000000..46078fe --- /dev/null +++ b/.sqlx/query-efa0e41910fa5bcb187ba9e2fc8f37bee5b25ffe9a2d175f39a69899bc559965.json @@ -0,0 +1,38 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT ID, name, difficulties, created_at FROM survey_campaigns", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "difficulties", + "type_info": "Int4Array" + }, + { + "ordinal": 3, + "name": "created_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "efa0e41910fa5bcb187ba9e2fc8f37bee5b25ffe9a2d175f39a69899bc559965" +} diff --git a/.sqlx/query-fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72.json b/.sqlx/query-fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72.json new file mode 100644 index 0000000..e8aca61 --- /dev/null +++ b/.sqlx/query-fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO survey_response_tokens \n (resp_id, user_id, id)\n VALUES ($1, $2, $3);", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Uuid", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72" +} diff --git a/.woodpecker.yml b/.woodpecker.yml index c960f89..de64c7b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,17 +6,22 @@ pipeline: - GIT_HASH=8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - OPEN_API_DOCS=8e77345f1597e40c2e266cb4e6dee74888918a61 - COMPILED_DATE=2021-07-21 + - NODE_MAJOR=19 commands: - - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\ - - apt update && apt-get -y --no-install-recommends install nodejs tar gpg curl wget + - apt-get update + - apt-get install -y ca-certificates curl gnupg tar wget + - mkdir -p /etc/apt/keyrings + - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + - NODE_MAJOR=18 echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + - apt-get -y install nodejs npm - npm install --global yarn - rustup component add rustfmt - rustup component add clippy - make dev-env - make migrate - make frontend - - make lint - make test + - make lint build_docker_img: image: plugins/docker diff --git a/Cargo.lock b/Cargo.lock index 3c7a366..9e02df6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,7 +20,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-sink", @@ -57,7 +57,7 @@ dependencies = [ "actix-utils", "actix-web", "askama_escape", - "bitflags", + "bitflags 1.3.2", "bytes", "derive_more", "futures-core", @@ -81,7 +81,7 @@ dependencies = [ "actix-utils", "ahash 0.8.3", "base64 0.21.0", - "bitflags", + "bitflags 1.3.2", "brotli", "bytes", "bytestring", @@ -118,7 +118,7 @@ dependencies = [ "actix-utils", "actix-web", "futures-util", - "serde 1.0.153", + "serde", "serde_json", "time", ] @@ -130,7 +130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -142,7 +142,7 @@ dependencies = [ "bytestring", "http", "regex", - "serde 1.0.153", + "serde", "tracing", ] @@ -198,7 +198,7 @@ dependencies = [ "anyhow", "async-trait", "derive_more", - "serde 1.0.153", + "serde", "serde_json", "time", "tracing", @@ -246,7 +246,7 @@ dependencies = [ "once_cell", "pin-project-lite", "regex", - "serde 1.0.153", + "serde", "serde_json", "serde_urlencoded", "smallvec", @@ -264,18 +264,19 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "actix-web-codegen-const-routes" -version = "0.1.0" -source = "git+https://github.com/realaravinth/actix-web-codegen-const-routes?tag=0.1.0#1cc9b8dbaaef4b3634dabbf537f313200dd91bd9" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d712777cbc2c81d451663724c4a8c6028fdc4d79209ca14ad7b4c5dc9ef53c" dependencies = [ "actix-router", "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -416,12 +417,6 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.2" @@ -442,27 +437,16 @@ checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ - "num-traits 0.2.15", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "num-traits", ] [[package]] @@ -489,12 +473,27 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + [[package]] name = "blake2b_simd" version = "1.0.1" @@ -502,7 +501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec", "constant_time_eq 0.2.4", ] @@ -545,7 +544,7 @@ dependencies = [ "memchr", "once_cell", "regex-automata", - "serde 1.0.153", + "serde", ] [[package]] @@ -584,7 +583,7 @@ dependencies = [ "derive_builder", "mime", "mime_guess", - "serde 1.0.153", + "serde", "serde_json", "sha2", "walkdir", @@ -613,7 +612,7 @@ checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", "num-integer", - "num-traits 0.2.15", + "num-traits", "winapi", ] @@ -661,20 +660,29 @@ dependencies = [ [[package]] name = "config" -version = "0.11.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" dependencies = [ + "async-trait", + "json5", "lazy_static", - "nom 5.1.2", + "nom", + "pathdiff", + "ron", "rust-ini", - "serde 1.0.153", - "serde-hjson", + "serde", "serde_json", "toml", "yaml-rust", ] +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -792,7 +800,7 @@ dependencies = [ "futures", "itoa", "ryu", - "serde 1.0.153", + "serde", "tokio", "tokio-stream", ] @@ -839,7 +847,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] @@ -856,7 +864,7 @@ checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -880,7 +888,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] @@ -891,7 +899,7 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -900,6 +908,17 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "derive_builder" version = "0.11.2" @@ -918,7 +937,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -928,7 +947,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn", + "syn 1.0.109", ] [[package]] @@ -941,7 +960,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", ] [[package]] @@ -957,29 +976,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] [[package]] -name = "dirs" -version = "4.0.0" +name = "dlv-list" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" [[package]] name = "dotenvy" @@ -993,7 +999,7 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" dependencies = [ - "serde 1.0.153", + "serde", ] [[package]] @@ -1007,23 +1013,56 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ - "atty", "humantime", + "is-terminal", "log", "regex", "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "flate2" version = "1.0.25" @@ -1034,6 +1073,17 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1103,13 +1153,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot", ] [[package]] @@ -1126,7 +1176,7 @@ checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1209,7 +1259,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "ignore", "walkdir", ] @@ -1226,7 +1276,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.2", "slab", "tokio", "tokio-util", @@ -1242,13 +1292,19 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + [[package]] name = "hashlink" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1260,15 +1316,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.2.6" @@ -1278,6 +1325,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + [[package]] name = "hex" version = "0.4.3" @@ -1302,6 +1355,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "html5ever" version = "0.26.0" @@ -1313,7 +1375,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1353,12 +1415,9 @@ checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" @@ -1441,7 +1500,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", ] [[package]] @@ -1454,12 +1523,14 @@ dependencies = [ ] [[package]] -name = "instant" -version = "0.1.12" +name = "is-terminal" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "cfg-if", + "hermit-abi 0.3.3", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -1495,6 +1566,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + [[package]] name = "language-tags" version = "0.3.2" @@ -1506,25 +1588,32 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec 0.5.2", - "bitflags", - "cfg-if", - "ryu", - "static_assertions", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.139" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libsqlite3-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] [[package]] name = "link-cplusplus" @@ -1541,6 +1630,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + [[package]] name = "local-channel" version = "0.1.3" @@ -1665,16 +1760,16 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] name = "mktemp" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bdc1f74dd7bb717d39f784f844e490d935b3aa7e383008006dbbf29c1f7820a" +checksum = "69fed8fbcd01affec44ac226784c6476a6006d98d13e33bc0ca7977aaf046bd8" dependencies = [ - "uuid 1.2.2", + "uuid", ] [[package]] @@ -1683,17 +1778,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.3" @@ -1704,6 +1788,23 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -1711,16 +1812,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-traits 0.2.15", + "num-traits", ] [[package]] -name = "num-traits" +name = "num-iter" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ - "num-traits 0.2.15", + "autocfg", + "num-integer", + "num-traits", ] [[package]] @@ -1730,6 +1833,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1755,14 +1859,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "parking_lot" -version = "0.11.2" +name = "ordered-multimap" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", + "dlv-list", + "hashbrown 0.12.3", ] [[package]] @@ -1772,21 +1875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -1797,9 +1886,9 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1817,6 +1906,21 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.2.0" @@ -1853,7 +1957,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1956,6 +2060,27 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.26" @@ -1988,9 +2113,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_env_logger" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" +checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" dependencies = [ "env_logger", "log", @@ -2005,7 +2130,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2022,24 +2147,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2080,18 +2199,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] -name = "redox_users" -version = "0.4.3" +name = "redox_syscall" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", + "bitflags 1.3.2", ] [[package]] @@ -2126,12 +2243,45 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", ] +[[package]] +name = "ron" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" +dependencies = [ + "base64 0.13.1", + "bitflags 1.3.2", + "serde", +] + +[[package]] +name = "rsa" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +dependencies = [ + "byteorder", + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rust-argon2" version = "1.0.0" @@ -2164,7 +2314,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn", + "syn 1.0.109", "walkdir", ] @@ -2180,9 +2330,13 @@ dependencies = [ [[package]] name = "rust-ini" -version = "0.13.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if", + "ordered-multimap", +] [[package]] name = "rustc_version" @@ -2194,15 +2348,27 @@ dependencies = [ ] [[package]] -name = "rustls" -version = "0.20.8" +name = "rustix" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ - "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -2214,6 +2380,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.13" @@ -2257,12 +2433,6 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" -[[package]] -name = "serde" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" - [[package]] name = "serde" version = "1.0.153" @@ -2272,18 +2442,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hjson" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" -dependencies = [ - "lazy_static", - "num-traits 0.1.43", - "regex", - "serde 0.8.23", -] - [[package]] name = "serde_derive" version = "1.0.153" @@ -2292,7 +2450,7 @@ checksum = "1ef476a5790f0f6decbc66726b6e5d63680ed518283e64c7df415989d880954f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2303,7 +2461,7 @@ checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", - "serde 1.0.153", + "serde", ] [[package]] @@ -2315,7 +2473,7 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde 1.0.153", + "serde", ] [[package]] @@ -2349,6 +2507,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "siphasher" version = "0.3.10" @@ -2395,6 +2563,25 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sqlformat" version = "0.2.1" @@ -2402,80 +2589,86 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" dependencies = [ "itertools", - "nom 7.1.3", + "nom", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "atoi", - "base64 0.13.1", - "bitflags", "byteorder", "bytes", "crc", "crossbeam-queue", - "dirs", "dotenvy", "either", "event-listener", "futures-channel", "futures-core", "futures-intrusive", + "futures-io", "futures-util", "hashlink", "hex", - "hkdf", - "hmac", - "indexmap", - "itoa", - "libc", + "indexmap 2.0.2", "log", - "md-5", "memchr", "once_cell", "paste", "percent-encoding", - "rand", "rustls", "rustls-pemfile", - "serde 1.0.153", + "serde", "serde_json", - "sha1", "sha2", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror", "time", + "tokio", "tokio-stream", + "tracing", "url", - "uuid 1.2.2", + "uuid", "webpki-roots", - "whoami", ] [[package]] name = "sqlx-macros" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" dependencies = [ "dotenvy", "either", @@ -2484,31 +2677,127 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "serde 1.0.153", + "serde", "serde_json", "sha2", "sqlx-core", - "sqlx-rt", - "syn", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.6.2" +name = "sqlx-mysql" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" dependencies = [ + "atoi", + "base64 0.21.0", + "bitflags 2.4.1", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "uuid", + "whoami", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "sqlx-postgres" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" +dependencies = [ + "atoi", + "base64 0.21.0", + "bitflags 2.4.1", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "time", + "tracing", + "url", + "uuid", +] [[package]] name = "string_cache" @@ -2518,10 +2807,10 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "phf_shared 0.10.0", "precomputed-hash", - "serde 1.0.153", + "serde", ] [[package]] @@ -2587,7 +2876,7 @@ dependencies = [ "pretty_env_logger", "rand", "rust-embed", - "serde 1.0.153", + "serde", "serde_json", "sqlx", "tera", @@ -2595,7 +2884,7 @@ dependencies = [ "tracing", "url", "urlencoding", - "uuid 0.8.2", + "uuid", "validator 0.14.0", ] @@ -2610,6 +2899,30 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "tendril" version = "0.4.3" @@ -2637,7 +2950,7 @@ dependencies = [ "pest_derive", "rand", "regex", - "serde 1.0.153", + "serde", "serde_json", "slug", "unic-segment", @@ -2669,7 +2982,7 @@ checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2689,7 +3002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa", - "serde 1.0.153", + "serde", "time-core", "time-macros", ] @@ -2735,23 +3048,11 @@ dependencies = [ "libc", "memchr", "mio", - "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", - "windows-sys", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", + "windows-sys 0.45.0", ] [[package]] @@ -2785,7 +3086,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "serde 1.0.153", + "serde", ] [[package]] @@ -2809,7 +3110,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2965,7 +3266,7 @@ dependencies = [ "form_urlencoded", "idna 0.3.0", "percent-encoding", - "serde 1.0.153", + "serde", ] [[package]] @@ -2982,21 +3283,12 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "0.8.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde 1.0.153", -] - -[[package]] -name = "uuid" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", + "serde", ] [[package]] @@ -3008,7 +3300,7 @@ dependencies = [ "idna 0.2.3", "lazy_static", "regex", - "serde 1.0.153", + "serde", "serde_derive", "serde_json", "url", @@ -3025,7 +3317,7 @@ dependencies = [ "idna 0.2.3", "lazy_static", "regex", - "serde 1.0.153", + "serde", "serde_derive", "serde_json", "url", @@ -3044,7 +3336,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 1.0.109", "validator_types 0.14.0", ] @@ -3060,7 +3352,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 1.0.109", "validator_types 0.15.0", ] @@ -3071,7 +3363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded9d97e1d42327632f5f3bae6403c04886e2de3036261ef42deebd931a6a291" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -3081,9 +3373,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ddf34293296847abfc1493b15c6e2f5d3cd19f57ad7d22673bf4c6278da329" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -3128,7 +3426,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -3150,7 +3448,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3171,23 +3469,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "webpki", + "rustls-webpki", ] [[package]] @@ -3195,10 +3483,6 @@ name = "whoami" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3" -dependencies = [ - "wasm-bindgen", - "web-sys", -] [[package]] name = "winapi" @@ -3237,7 +3521,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", ] [[package]] @@ -3246,13 +3539,28 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -3261,42 +3569,84 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_i686_gnu" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_x86_64_gnu" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -3306,6 +3656,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" + [[package]] name = "zstd" version = "0.12.3+zstd.1.5.2" diff --git a/Cargo.toml b/Cargo.toml index c8e7adf..a99259a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://github.con/mCaptcha/survey" readme = "https://github.com/mCaptcha/survey/blob/master/README.md" license = "AGPLv3 or later version" authors = ["realaravinth "] -edition = "2018" +edition = "2021" default-run = "survey" build = "build.rs" @@ -31,26 +31,27 @@ actix-cors = "0.6.1" actix-files = "0.6.0" actix-service = "2.0.0" #actix = "0.12" -actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" } +actix-web-codegen-const-routes = "0.2.0" #libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] } futures = "0.3.15" -sqlx = { version = "0.6.2", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "uuid" ] } +#argon2-creds = "0.2.3" argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} derive_builder = "0.11" validator = { version = "0.14", features = ["derive"]} derive_more = "0.99" -config = "0.11" +config = "0.13" serde = "1" serde_json = "1" -pretty_env_logger = "0.4" +pretty_env_logger = "0.5" log = "0.4" lazy_static = "1.4" @@ -58,10 +59,11 @@ url = { version = "2.2", features = ["serde"] } urlencoding = "2.1.0" rand = "0.8" -uuid = { version = "0.8.2", features = ["v4", "serde"] } +uuid = { version = "1.4.1", features = ["v4", "serde"] } mime_guess = "2.0.3" rust-embed = "6.0.0" +#libcachebust = "0.3.0" cache-buster = { git = "https://github.com/realaravinth/cache-buster" } mime = "0.3.16" @@ -81,10 +83,9 @@ version = "0.2" [build-dependencies] -sqlx = { version = "0.6.2", features = [ "runtime-actix-rustls", "uuid", "postgres", "time", "offline" ] } #serde_yaml = "0.8.17" +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "uuid", "postgres", "time"] } serde_json = "1" -#yaml-rust = "0.4.5" cache-buster = { version = "0.2.0", git = "https://github.com/realaravinth/cache-buster" } mime = "0.3.16" diff --git a/Dockerfile b/Dockerfile index 45b42bc..df4d085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.11-bullseye-slim as frontend +FROM node:16.11-bookworm-slim as frontend LABEL org.opencontainers.image.source https://github.com/mCaptcha/survey RUN apt-get update && apt-get install -y make COPY package.json yarn.lock /src/ @@ -8,14 +8,14 @@ RUN yarn install COPY . . RUN make frontend -FROM rust:1-slim-bullseye as rust +FROM rust:1-slim-bookworm as rust WORKDIR /src RUN apt-get update && apt-get install -y git COPY . /src COPY --from=frontend /src/static/cache/bundle /src/static/cache/bundle RUN cargo build --release -FROM debian:bullseye-slim +FROM debian:bookworm-slim RUN useradd -ms /bin/bash -u 1001 mcaptcha-survey WORKDIR /home/mcaptcha-survey COPY --from=rust /src/target/release/survey /usr/local/bin/ diff --git a/src/archive.rs b/src/archive.rs index e152435..ad4b190 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -17,12 +17,14 @@ use std::future::Future; use std::path::{Path, PathBuf}; + use serde::{Deserialize, Serialize}; use sqlx::types::time::OffsetDateTime; use sqlx::types::Uuid; use tokio::fs; use tokio::io::AsyncWriteExt; use tokio::sync::oneshot::{self, error::TryRecvError, Sender}; +use tokio::task::JoinHandle; use crate::api::v1::admin::campaigns::runners::get_results; use crate::api::v1::admin::campaigns::SurveyResponse; @@ -213,7 +215,7 @@ impl Archiver { pub async fn init_archive_job( self, data: AppData, - ) -> ServiceResult<(Sender, impl Future)> { + ) -> ServiceResult<(Sender, JoinHandle<()>)> { let (tx, mut rx) = oneshot::channel(); let job = async move { diff --git a/src/settings.rs b/src/settings.rs index e820f03..7c7117e 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -41,34 +41,34 @@ impl Server { format!("{}:{}", self.ip, self.port) } } - -#[derive(Debug, Clone, Serialize, Deserialize)] -struct DatabaseBuilder { - pub port: u32, - pub hostname: String, - pub username: String, - pub password: String, - pub name: String, - pub url: String, -} - -impl DatabaseBuilder { - #[cfg(not(tarpaulin_include))] - fn extract_database_url(url: &Url) -> Self { - debug!("Databse name: {}", url.path()); - let mut path = url.path().split('/'); - path.next(); - let name = path.next().expect("no database name").to_string(); - DatabaseBuilder { - port: url.port().expect("Enter database port").into(), - hostname: url.host().expect("Enter database host").to_string(), - username: url.username().into(), - url: url.to_string(), - password: url.password().expect("Enter database password").into(), - name, - } - } -} +// +//#[derive(Debug, Clone, Serialize, Deserialize)] +//struct DatabaseBuilder { +// pub port: u32, +// pub hostname: String, +// pub username: String, +// pub password: String, +// pub name: String, +// pub url: String, +//} +// +//impl DatabaseBuilder { +// #[cfg(not(tarpaulin_include))] +// fn extract_database_url(url: &Url) -> Self { +// debug!("Databse name: {}", url.path()); +// let mut path = url.path().split('/'); +// path.next(); +// let name = path.next().expect("no database name").to_string(); +// DatabaseBuilder { +// port: url.port().expect("Enter database port").into(), +// hostname: url.host().expect("Enter database host").to_string(), +// username: url.username().into(), +// url: url.to_string(), +// password: url.password().expect("Enter database password").into(), +// name, +// } +// } +//} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Database { @@ -121,111 +121,66 @@ pub struct Settings { #[cfg(not(tarpaulin_include))] impl Settings { pub fn new() -> Result { - let mut s = Config::new(); - - // setting default values - #[cfg(test)] - s.set_default("database.pool", 2.to_string()) - .expect("Couldn't get the number of CPUs"); + let mut s = Config::builder(); const CURRENT_DIR: &str = "./config/default.toml"; const ETC: &str = "/etc/mcaptcha-survey/config.toml"; - if let Ok(path) = env::var("ATHENA_CONFIG") { - s.merge(File::with_name(&path))?; + if let Ok(path) = env::var("SURVEY_CONFIG") { + s = s.add_source(File::with_name(&path)); } else if Path::new(CURRENT_DIR).exists() { // merging default config from file - s.merge(File::with_name(CURRENT_DIR))?; + s = s.add_source(File::with_name(CURRENT_DIR)); } else if Path::new(ETC).exists() { - s.merge(File::with_name(ETC))?; + s = s.add_source(File::with_name(ETC)); } else { log::warn!("configuration file not found"); } - s.merge(Environment::with_prefix("MCAPTCHA").separator("__"))?; - - check_url(&s); - check_uuid(&s); + s = s.add_source(Environment::with_prefix("MCAPTCHA").separator("__")); match env::var("PORT") { Ok(val) => { - s.set("server.port", val).unwrap(); + s = s.set_override("server.port", val).unwrap(); } Err(e) => warn!("couldn't interpret PORT: {}", e), } match env::var("DATABASE_URL") { Ok(val) => { - let url = Url::parse(&val).expect("couldn't parse Database URL"); - let database_conf = DatabaseBuilder::extract_database_url(&url); - set_from_database_url(&mut s, &database_conf); + Url::parse(&val).expect("couldn't parse Database URL"); + s = s.set_override("database.url", val).unwrap(); } Err(e) => warn!("couldn't interpret DATABASE_URL: {}", e), } - set_database_url(&mut s); + let settings = s.build()?.try_deserialize::()?; + settings.check_url(); + settings.check_uuid(); - match s.try_into::() { - Ok(val) => { - val.publish.create_root_dir(); - Ok(val) - }, - Err(e) => Err(ConfigError::Message(format!("\n\nError: {}. If it says missing fields, then please refer to https://github.com/mCaptcha/mcaptcha#configuration to learn more about how mcaptcha reads configuration\n\n", e))), - } + Ok(settings) + } + + fn check_url(&self) { + Url::parse(&self.source_code) + .expect("Please enter a URL for source_code in settings"); + } + + #[cfg(not(tarpaulin_include))] + fn check_uuid(&self) { + use std::str::FromStr; + + Uuid::from_str(&self.default_campaign) + .expect("Please enter a UUID for default_campaign in settings"); } } -#[cfg(not(tarpaulin_include))] -fn check_url(s: &Config) { - let url = s - .get::("source_code") - .expect("Couldn't access source_code"); - - Url::parse(&url).expect("Please enter a URL for source_code in settings"); -} - -#[cfg(not(tarpaulin_include))] -fn check_uuid(s: &Config) { - use std::str::FromStr; - - let id = s - .get::("default_campaign") - .expect("Couldn't access default_campaign"); - - Uuid::from_str(&id).expect("Please enter a UUID for default_campaign in settings"); -} - -#[cfg(not(tarpaulin_include))] -fn set_from_database_url(s: &mut Config, database_conf: &DatabaseBuilder) { - s.set("database.username", database_conf.username.clone()) - .expect("Couldn't set database username"); - s.set("database.password", database_conf.password.clone()) - .expect("Couldn't access database password"); - s.set("database.hostname", database_conf.hostname.clone()) - .expect("Couldn't access database hostname"); - s.set("database.port", database_conf.port as i64) - .expect("Couldn't access database port"); - s.set("database.name", database_conf.name.clone()) - .expect("Couldn't access database name"); -} - -#[cfg(not(tarpaulin_include))] -fn set_database_url(s: &mut Config) { - s.set( - "database.url", - format!( - r"postgres://{}:{}@{}:{}/{}", - s.get::("database.username") - .expect("Couldn't access database username"), - s.get::("database.password") - .expect("Couldn't access database password"), - s.get::("database.hostname") - .expect("Couldn't access database hostname"), - s.get::("database.port") - .expect("Couldn't access database port"), - s.get::("database.name") - .expect("Couldn't access database name") - ), - ) - .expect("Couldn't set databse url"); -} +//#[cfg(not(tarpaulin_include))] +//fn check_url(s: &Config) { +// let url = s +// .get::("source_code") +// .expect("Couldn't access source_code"); +// +// Url::parse(&url).expect("Please enter a URL for source_code in settings"); +//} +// -- 2.39.5 From d4d08e9d9a3ce0420c8a18903cc8af3506ad7fcd Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 17 Oct 2023 22:00:11 +0530 Subject: [PATCH 2/3] debug: disable linting --- .woodpecker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index de64c7b..31dfa39 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,7 +21,6 @@ pipeline: - make migrate - make frontend - make test - - make lint build_docker_img: image: plugins/docker -- 2.39.5 From 43dc36554d0806704b828ba8ddc775e46221d5b5 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 17 Oct 2023 22:06:54 +0530 Subject: [PATCH 3/3] fix: upgrade docker img --- .woodpecker.yml | 1 - Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 31dfa39..2f1fb48 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,7 +6,6 @@ pipeline: - GIT_HASH=8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - OPEN_API_DOCS=8e77345f1597e40c2e266cb4e6dee74888918a61 - COMPILED_DATE=2021-07-21 - - NODE_MAJOR=19 commands: - apt-get update - apt-get install -y ca-certificates curl gnupg tar wget diff --git a/Dockerfile b/Dockerfile index df4d085..d0bad82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.11-bookworm-slim as frontend +FROM node:18-bookworm-slim as frontend LABEL org.opencontainers.image.source https://github.com/mCaptcha/survey RUN apt-get update && apt-get install -y make COPY package.json yarn.lock /src/ -- 2.39.5