Skip to content

Commit

Permalink
Add Linux specific feature for openssl
Browse files Browse the repository at this point in the history
Remove images endpoint and replace with GitHub source content
  • Loading branch information
dormant-user committed Feb 18, 2024
1 parent 10f67a8 commit d153d02
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 88 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ rand = "0.8.5"
fernet = "0.2.1"
minijinja = { version = "1.0.12", features = ["loader"] }
url = "2.5.0"
openssl = "0.10"
regex = "1.5"
walkdir = "2.3.2"
openssl = "0.10"
[target.'cfg(target_os = "linux")'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ pub async fn start() -> io::Result<()> {
.service(routes::video::track)
.service(routes::video::stream)
.service(routes::video::streaming_endpoint)
.service(routes::images::image_endpoint)
};
let server = HttpServer::new(application)
.workers(config.workers as usize)
Expand Down
60 changes: 0 additions & 60 deletions src/routes/images.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ pub mod basics;
pub mod video;
/// Module for `/home`, `/login`, `/logout` and `/error` entrypoints.
pub mod auth;
/// Module to render images for the HTML pages requested via JavaScript.
pub mod images;
11 changes: 3 additions & 8 deletions src/templates/logout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pub fn get_content() -> String {
<h2 style="margin-top:5%">LOGOUT</h2>
<h3>{{ detail }}</h3>
<p>
<img id="logout_img" src="" width="200" height="200" alt="loader" class="center">
<img src="https://github.com/thevickypedia/RuStream/blob/main/src/images/logout.gif?raw=true"
onerror="this.src='https://vigneshrao.com/img/auth_server/logout.gif'"
width="200" height="200" alt="Image" class="center">
</p>
{% if show_login %}
<button style="text-align:center" onClick="window.location.href = '/';">LOGIN</button>
Expand All @@ -69,13 +71,6 @@ pub fn get_content() -> String {
{% endif %}
<h4>Click <a href="https://vigneshrao.com/contact">ME</a> to reach out.</h4>
</body>
<script>
document.addEventListener("DOMContentLoaded", function() {
let image = document.getElementById("logout_img");
let currentLocation = window.origin;
image.src = currentLocation + "/images/logout.gif";
});
</script>
</html>
"###.to_string()
}
11 changes: 3 additions & 8 deletions src/templates/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,16 @@ pub fn get_content() -> String {
<h2 style="margin-top:5%">{{ reason }}</h2>
<h3>Authentication doesn't last forever ¯\_(ツ)_/¯ </h3>
<p>
<img id="session_img" src="" width="200" height="200" alt="loader" class="center">
<img src="https://github.com/thevickypedia/RuStream/blob/main/src/images/session.gif?raw=true"
onerror="this.src='https://vigneshrao.com/img/auth_server/session.gif'"
width="200" height="200" alt="Image" class="center">
</p>
<button style="text-align:center" onClick="window.location.href = '/';">LOGIN</button>
<br>
<button style="text-align:center" onClick="alert('Forgot Password?\n\nRelax and try to remember your password.');">HELP
</button>
<h4>Click <a href="https://vigneshrao.com/contact">HERE</a> to reach out.</h4>
</body>
<script>
document.addEventListener("DOMContentLoaded", function() {
let image = document.getElementById("session_img");
let currentLocation = window.location.origin;
image.src = currentLocation + "/images/session.gif";
});
</script>
</html>
"###.to_string()
}
11 changes: 3 additions & 8 deletions src/templates/unauthorized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,16 @@ pub fn get_content() -> String {
<h2 style="margin-top:5%">LOGIN FAILED</h2>
<h3>USER ERROR - REPLACE USER</h3>
<p>
<img id="no_auth_img" src="" width="210" height="170" alt="loader" class="center">
<img src="https://github.com/thevickypedia/RuStream/blob/main/src/images/no_auth.gif?raw=true"
onerror="this.src='https://vigneshrao.com/img/auth_server/no_auth.gif'"
width="200" height="170" alt="Image" class="center">
</p>
<button style="text-align:center" onClick="window.location.href = '/';">LOGIN</button>
<br>
<button style="text-align:center" onClick="alert('Forgot Password?\n\nRelax and try to remember your password.');">HELP
</button>
<h4>Click <a href="https://vigneshrao.com/contact">HERE</a> to reach out.</h4>
</body>
<script>
document.addEventListener("DOMContentLoaded", function() {
let image = document.getElementById("no_auth_img");
let currentLocation = window.origin;
image.src = currentLocation + "/images/no_auth.gif";
});
</script>
</html>
"###.to_string()
}

0 comments on commit d153d02

Please sign in to comment.