Skip to content

Commit

Permalink
Bundle license as static file
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeTF committed Nov 26, 2023
1 parent 002319f commit 863b63c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ async fn favicon(TypedHeader(tags): TypedHeader<IfNoneMatch>) -> Response {
file!("favicon.svg", "image/svg+xml").response(&tags)
}

async fn license(TypedHeader(tags): TypedHeader<IfNoneMatch>) -> Response {
file!("../license.txt", "text/plain; charset=utf-8").response(&tags)
}

async fn robots(TypedHeader(tags): TypedHeader<IfNoneMatch>) -> Response {
file!("robots.txt", "text/plain; charset=utf-8").response(&tags)
}
Expand All @@ -82,6 +86,7 @@ async fn style(TypedHeader(tags): TypedHeader<IfNoneMatch>) -> Response {
pub fn routes() -> Router<AppState> {
Router::new()
.route("/favicon.svg", get(favicon))
.route("/license.txt", get(license))
.route("/robots.txt", get(robots))
.route("/style.css", get(style))
}
3 changes: 3 additions & 0 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ img {
#001f3d 100%
);
}
#license {
max-width: 400px;
}
#code {
background-color: #000000;
border: 2px solid #E1DED5;
Expand Down
18 changes: 13 additions & 5 deletions templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
{% endblock %}

{% block content %}
<p>
Released under
<a href="https://gnu.org/licenses/agpl-3.0.html">AGPLv3</a>
at <a href="https://github.com/JockeTF/sopaste">GitHub</a>.
<p>
<div id="license">
<p>
Written in <a href="https://www.rust-lang.org/">Rust</a>
and released under <a href="/license.txt">AGPLv3</a>
at <a href="https://github.com/JockeTF/sopaste">GitHub</a>.
</p>

<p>
As stated in section 9 of AGPLv3, you do not need to accept the
license in order to use this website. Acceptance is only required
if you choose to modify or propogate any of the covered works.
</p>
</div>
{% endblock %}

0 comments on commit 863b63c

Please sign in to comment.