+
+
Contestants
+
+ There are cuttently {{ contestants_amount }} contestants.
+ These contestants currently have had at least one connection to
+ the challenge:
+
+
+ {% for contestant in contestants %}
-
-
-
+
+
+
- Light
-
-
-
-
-
-
-
-
-
-
- Dark
-
-
-
-
-
-
-
-
-
-
- Auto
-
-
-
-
+ {{ contestant.ip }}
+
+ {% endfor %}
-
-
-
-
-
- {{title}} Admin Interface
-
- You have reached the {{title}} Admin Interface. This site can be used by
- the host of the challenge to see the challenge progress, solution, and
- hints for that challenge. This site is NOT part of the
- challenge.
-
-
-
-
-
-
Challenge {{ challenge_idx}} — {{ challenge_title }}
-
{{ challenge_description }}
-
-
Hints
-
- Show hints
-
-
-
- {% for hint in challenge_hints %}
-
-
-
-
-
- {{hint}}
-
-
- {% endfor %}
-
-
-
-
-
Solution
-
- Show solution
-
-
-
-
-
-
- {{challenge_solution}}
-
-
-
-
-
-
-
-
-
-
Contestants
-
- There are cuttently {{ contestants_amount }} contestants.
- These contestants currently have had at least one connection to
- the challenge:
-
-
-
-
-
-
Winners
-
- There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the secret:
-
-
-
-
-
-
- Created by {{ author }} © {{year}}
-
+
+
Winners
+
+ There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the secret:
+
+
-
-
-
-
-
+
+{% endblock %}
diff --git a/data/www/admin/index.html b/data/www/admin/index.html
index 534b920..bdb0f33 100644
--- a/data/www/admin/index.html
+++ b/data/www/admin/index.html
@@ -1,157 +1,34 @@
-
-
+{% extends "base" %}
+{% block main %}
+
{{title}}
+
+ You have reached the {{title}}. This site can be used by
+ the host of the challenge to see the challenge progress, solution, and
+ hints for that challenge. This site is NOT part of the
+ challenge.
+
-
-
+
-
-
-
-
{{title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bootstrap
-
-
-
-
-
-
-
-
-
-
-
- Toggle theme
-
-
+
+
+
Challenges
+
+ There are cuttently {{ challenges_amount }} active challenges.
+
+
+ {% for challenge in challenges %}
-
-
-
+
+
+
- Light
-
-
-
-
-
-
-
-
-
-
- Dark
-
-
-
-
-
-
-
-
-
-
- Auto
-
-
-
-
+ {{ challenge.id }} — {{ challenge.title }}
+
+ {% endfor %}
-
-
-
-
-
- {{title}} Admin Interface
-
- You have reached the {{title}} Admin Interface. This site can be used by
- the host of the challenge to see the challenge progress, solution, and
- hints for that challenge. This site is NOT part of the
- challenge.
-
-
-
-
-
-
-
Challenges
-
- There are cuttently {{ challenges_amount }} active challenges.
-
-
-
-
-
-
-
- Created by {{ author }} © {{year}}
-
-
-
-
-
-
-
+
+{% endblock %}
diff --git a/data/www/base.html b/data/www/base.html
new file mode 100644
index 0000000..8bc2755
--- /dev/null
+++ b/data/www/base.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bootstrap
+
+
+
+
+
+
+
+
+
+
+
+ Toggle theme
+
+
+
+
+
+
+
+ Light
+
+
+
+
+
+
+
+
+
+
+ Dark
+
+
+
+
+
+
+
+
+
+
+ Auto
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% block main %}{% endblock %}
+
+
+ Created by {{ author }} © {{year}}
+
+
+
+
+
+
+
diff --git a/data/www/details.html b/data/www/details.html
index d7e98de..9ae5f60 100644
--- a/data/www/details.html
+++ b/data/www/details.html
@@ -1,207 +1,85 @@
-
-
+{% extends "base" %}
+{% block title %}{{ title }}{% endblock %}
+{% block main %}
+{{title}} User Interface
+
+ You have reached the {{title}} User
+ Interface. This site can be used by the
+ contestants see the challenges and their
+ progress and hints for that challenge. This
+ site is NOT part of the challenge.
+
-
-
+
-
-
-
- {{title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bootstrap
-
-
-
-
-
-
-
-
-
-
-
- Toggle theme
+
+
Challenge {{ challenge_idx}} — {{ challenge_title }}
+
{{ challenge_description }}
+
+
Hints
+
+ Show hints
-
+
+
+ {% for hint in challenge_hints %}
+
+
+
+
+
+ {{hint}}
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
Contestants
+
+ There are cuttently {{ contestants_amount }} contestants.
+ These contestants currently have had at least one connection to
+ the challenge:
+
+
+ {% for contestant in contestants %}
-
-
-
+
+
+
- Light
-
-
-
-
-
-
-
-
-
-
- Dark
-
-
-
-
-
-
-
-
-
-
- Auto
-
-
-
-
+ {{ contestant.ip }}
+
+ {% endfor %}
-
-
-
-
-
- {{title}} User Interface
-
- You have reached the {{title}} User
- Interface. This site can be used by the
- contestants see the challenges and their
- progress and hints for that challenge. This
- site is NOT part of the challenge.
-
-
-
-
-
-
Challenge {{ challenge_idx}} — {{ challenge_title }}
-
{{ challenge_description }}
-
-
Hints
-
- Show hints
-
-
-
- {% for hint in challenge_hints %}
-
-
-
-
-
- {{hint}}
-
-
- {% endfor %}
-
-
-
-
-
-
-
-
-
-
Contestants
-
- There are cuttently {{ contestants_amount }} contestants.
- These contestants currently have had at least one connection to
- the challenge:
-
-
-
-
-
-
Winners
-
- There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the
- secret:
-
-
-
-
-
-
- Created by {{ author }} © {{year}}
-
+
+
Winners
+
+ There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the
+ secret:
+
+
-
-
-
-
-
+
+{% endblock %}
diff --git a/data/www/index.html b/data/www/index.html
index 4bc8808..be7412e 100644
--- a/data/www/index.html
+++ b/data/www/index.html
@@ -1,158 +1,34 @@
-
-
-
-
-
-
-
-
-
-
{{title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bootstrap
-
-
-
-
-
-
-
-
-
-
-
- Toggle theme
-
-
+{% extends "base" %}
+{% block title %}{{ title }}{% endblock %}
+{% block main %}
+{{title}} Admin Interface
+
+ You have reached the {{title}} User
+ Interface. This site can be used by the
+ contestants see the challenges and their
+ progress and hints for that challenge. This
+ site is NOT part of the challenge.
+
+
+
+
+
Challenges
+
+ There are cuttently {{ challenges_amount }} active challenges.
+
+
+ {% for challenge in challenges %}
-
-
-
+
+
+
- Light
-
-
-
-
-
-
-
-
-
-
- Dark
-
-
-
-
-
-
-
-
-
-
- Auto
-
-
-
-
+ {{ challenge.id }} — {{ challenge.title }} ⇒ {{ challenge.addr }}
+
+ {% endfor %}
-
-
-
-
-
- {{title}} Admin Interface
-
- You have reached the {{title}} User
- Interface. This site can be used by the
- contestants see the challenges and their
- progress and hints for that challenge. This
- site is NOT part of the challenge.
-
-
-
-
-
-
-
Challenges
-
- There are cuttently {{ challenges_amount }} active challenges.
-
-
-
-
-
-
-
- Created by {{ author }} © {{year}}
-
-
-
-
-
-
-
+
+{% endblock %}
diff --git a/src/meta/admin.rs b/src/meta/admin.rs
index 4d74070..27ac860 100644
--- a/src/meta/admin.rs
+++ b/src/meta/admin.rs
@@ -54,7 +54,7 @@ async fn details(
.get_template("admin:details")
.map_err(TemplateError::from)?
.render(context!(
- title => "Wooly-Vault",
+ title => "Wooly-Vault Admin Interface",
author => env!("CARGO_PKG_AUTHORS"),
year => "2024",
challenge_idx => challenge.id(),
@@ -87,7 +87,7 @@ async fn index(serv: Arc>) -> Result, warp::Rej
.get_template("admin:index")
.map_err(TemplateError::from)?
.render(context!(
- title => "Wooly-Vault",
+ title => "Wooly-Vault Admin Interface",
author => env!("CARGO_PKG_AUTHORS"),
year => "2024",
challenges => challenges,
diff --git a/src/meta/errors.rs b/src/meta/errors.rs
index 3373140..2d4b122 100644
--- a/src/meta/errors.rs
+++ b/src/meta/errors.rs
@@ -11,7 +11,10 @@ pub struct TemplateError(#[from] minijinja::Error);
impl reject::Reject for TemplateError {}
impl Display for TemplateError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "something went wrong with producing this page")
+ write!(
+ f,
+ "something went wrong with producing this page: {self:#?}"
+ )
}
}
diff --git a/src/meta/mod.rs b/src/meta/mod.rs
index 882c25d..8306e11 100644
--- a/src/meta/mod.rs
+++ b/src/meta/mod.rs
@@ -28,6 +28,7 @@ pub struct Service<'tp> {
impl<'tp> Service<'tp> {
fn build(config: Config, challenges: Vec<(ChallengeDesc, VaultRef)>) -> Result> {
let mut env = Environment::new();
+ env.add_template("base", include_str!("../../data/www/base.html"))?;
env.add_template(
"admin:index",
include_str!("../../data/www/admin/index.html"),
diff --git a/src/meta/user.rs b/src/meta/user.rs
index b5259a5..ed107f7 100644
--- a/src/meta/user.rs
+++ b/src/meta/user.rs
@@ -54,7 +54,7 @@ async fn details(
.get_template("details")
.map_err(TemplateError::from)?
.render(context!(
- title => "Wooly-Vault",
+ title => "Wooly-Vault User Interface",
author => env!("CARGO_PKG_AUTHORS"),
year => "2024",
challenge_idx => challenge.id(),
@@ -87,7 +87,7 @@ async fn index(serv: Arc>) -> Result, warp::Rej
.get_template("admin:index")
.map_err(TemplateError::from)?
.render(context!(
- title => "Wooly-Vault",
+ title => "Wooly-Vault User Interface",
author => env!("CARGO_PKG_AUTHORS"),
year => "2024",
challenges => challenges,