load mcaptcha-glue

This commit is contained in:
Aravinth Manivannan 2021-10-12 14:54:51 +05:30
parent 2609ade2a5
commit f10c620040
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
9 changed files with 32 additions and 13 deletions

View File

@ -14,6 +14,7 @@
"@types/node": "^15.0.2",
"@types/sinon": "^10.0.0",
"@wasm-tool/wasm-pack-plugin": "^1.4.0",
"dart-sass": "^1.25.0",
"jest": "^26.6.3",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^16.5.3",
@ -24,10 +25,10 @@
"typescript": "^4.1.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^3.1.14",
"dart-sass": "^1.25.0"
"webpack-dev-server": "^3.1.14"
},
"dependencies": {
"mcaptcha-browser": "./vendor/pow/"
"mcaptcha-browser": "./vendor/pow/",
"mcaptcha-glue": "^0.1.0-alpha-3"
}
}

View File

@ -121,9 +121,7 @@ async fn add(
#[cfg(test)]
mod tests {
use std::str::FromStr;
use crate::api::v1::bench::{Bench, BenchConfig, Submission, SubmissionProof};
use crate::api::v1::bench::{Bench, Submission};
use crate::data::Data;
use crate::tests::*;
use crate::*;

View File

@ -54,6 +54,9 @@ lazy_static! {
pub static ref JS: &'static str =
FILES.get("./static/cache/bundle/bundle.js").unwrap();
pub static ref GLUE: &'static str =
FILES.get("./static/cache/bundle/glue.js").unwrap();
/// points to source files matching build commit
pub static ref SOURCE_FILES_OF_INSTANCE: String = {
let mut url = SETTINGS.source_code.clone();

View File

@ -41,12 +41,12 @@ impl Routes {
panel,
home,
errors: Errors::new(),
about: "/about",
about: "https://mcaptcha.org/about/",
sitemap: "/sitemap.xml",
thanks: "/thanks",
donate: "/donate",
security: "/security",
privacy: "/privacy-policy",
thanks: "https://mcaptcha.org/thanks",
donate: "https://mcaptcha.org/donate",
security: "https://mcaptcha.org/security",
privacy: "https://mcaptcha.org/privacy-policy/",
}
}

View File

@ -43,6 +43,10 @@ pub mod assets {
path: FILES.get("./static/cache/img/trash.svg").unwrap(),
name: "Trash logo"
};
pub static ref HEADSETS: Img = Img {
path: FILES.get("./static/cache/img/headsets.jpg").unwrap(),
name: "Headsets image"
};
}
}
@ -119,7 +123,14 @@ mod tests {
async fn static_assets_work() {
let app = get_app!().await;
for file in [assets::LOGO.path, &*crate::JS].iter() {
for file in [
assets::LOGO.path,
assets::HEADSETS.path,
&*crate::JS,
&*crate::GLUE,
]
.iter()
{
let resp = test::call_service(
&app,
test::TestRequest::get().uri(file).to_request(),

View File

@ -28,7 +28,7 @@ use crate::api::v1::admin::{
auth::runners::{Login, Register},
campaigns::{AddCapmaign, AddCapmaignResp},
};
use crate::api::v1::bench::{Bench, BenchConfig, Submission, SubmissionProof};
use crate::api::v1::bench::{BenchConfig, Submission, SubmissionProof};
use crate::data::Data;
use crate::errors::*;
use crate::V1_API_ROUTES;

BIN
static/cache/img/headsets.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -9,6 +9,7 @@ module.exports = {
entry: {
bundle: './templates/index.ts',
bench: './templates/bench.ts',
glue: './templates/vendor.ts',
},
output: {
filename: '[name].js',

View File

@ -3568,6 +3568,11 @@ map-visit@^1.0.0:
mcaptcha-browser@./vendor/pow/:
version "0.1.0"
mcaptcha-glue@^0.1.0-alpha-3:
version "0.1.0-alpha-3"
resolved "https://registry.yarnpkg.com/mcaptcha-glue/-/mcaptcha-glue-0.1.0-alpha-3.tgz#0c1c5cfc6991de6571fb2c0f0950acac289e1141"
integrity sha512-C/Nfw4RGsmbozbyvxx/p0C7bUBn+YmP7tTl/8ORNdQiuy2VQUmD874LvbocnmSar8Isk/8rIaCqmVRBlRw/Yaw==
media-typer@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"