-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lldap: 0.5.0 -> 0.5.1-unstable-2024-08-09 (#333125)
* lldap: rust 1.80 compatibility * lldap: remove unneeded rec Co-authored-by: Sandro <[email protected]> * lldap: use upstream PR to fix 1.80 build * lldap: use stable patch url * lldap: check in patch file instead of referring to GH * Clean up Co-authored-by: Sandro <[email protected]> * lldap: update to latest main * lldap: remove obsolete patch file * remove unused fetchpatch --------- Co-authored-by: Sandro <[email protected]>
- Loading branch information
1 parent
792028c
commit b14750b
Showing
4 changed files
with
121 additions
and
71 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
pkgs/servers/ldap/lldap/0001-parameterize-frontend-location.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
From a09babb0cd9dd532ad2de920a2a35aa03d740dc6 Mon Sep 17 00:00:00 2001 | ||
From: Herwig Hochleitner <[email protected]> | ||
Date: Thu, 8 Aug 2024 00:29:14 +0200 | ||
Subject: [PATCH] parameterize frontend location | ||
|
||
--- | ||
server/src/infra/tcp_server.rs | 14 +++++++------- | ||
1 file changed, 7 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/server/src/infra/tcp_server.rs b/server/src/infra/tcp_server.rs | ||
index fa5f11f..16e64c5 100644 | ||
--- a/server/src/infra/tcp_server.rs | ||
+++ b/server/src/infra/tcp_server.rs | ||
@@ -25,7 +25,7 @@ use std::sync::RwLock; | ||
use tracing::info; | ||
|
||
async fn index<Backend>(data: web::Data<AppState<Backend>>) -> actix_web::Result<impl Responder> { | ||
- let mut file = std::fs::read_to_string(r"./app/index.html")?; | ||
+ let mut file = std::fs::read_to_string(r"@frontend@/index.html")?; | ||
|
||
if data.server_url.path() != "/" { | ||
file = file.replace( | ||
@@ -80,7 +80,7 @@ pub(crate) fn error_to_http_response(error: TcpError) -> HttpResponse { | ||
async fn main_js_handler<Backend>( | ||
data: web::Data<AppState<Backend>>, | ||
) -> actix_web::Result<impl Responder> { | ||
- let mut file = std::fs::read_to_string(r"./app/static/main.js")?; | ||
+ let mut file = std::fs::read_to_string(r"@frontend@/static/main.js")?; | ||
|
||
if data.server_url.path() != "/" { | ||
file = file.replace("/pkg/", format!("{}/pkg/", data.server_url.path()).as_str()); | ||
@@ -92,12 +92,12 @@ async fn main_js_handler<Backend>( | ||
} | ||
|
||
async fn wasm_handler() -> actix_web::Result<impl Responder> { | ||
- Ok(actix_files::NamedFile::open_async("./app/pkg/lldap_app_bg.wasm").await?) | ||
+ Ok(actix_files::NamedFile::open_async("@frontend@/pkg/lldap_app_bg.wasm").await?) | ||
} | ||
|
||
async fn wasm_handler_compressed() -> actix_web::Result<impl Responder> { | ||
Ok( | ||
- actix_files::NamedFile::open_async("./app/pkg/lldap_app_bg.wasm.gz") | ||
+ actix_files::NamedFile::open_async("@frontend@/pkg/lldap_app_bg.wasm.gz") | ||
.await? | ||
.customize() | ||
.insert_header(header::ContentEncoding::Gzip) | ||
@@ -143,11 +143,11 @@ fn http_config<Backend>( | ||
.service(web::resource("/pkg/lldap_app_bg.wasm").route(web::route().to(wasm_handler))) | ||
.service(web::resource("/static/main.js").route(web::route().to(main_js_handler::<Backend>))) | ||
// Serve the /pkg path with the compiled WASM app. | ||
- .service(Files::new("/pkg", "./app/pkg")) | ||
+ .service(Files::new("/pkg", "@frontend@/pkg")) | ||
// Serve static files | ||
- .service(Files::new("/static", "./app/static")) | ||
+ .service(Files::new("/static", "@frontend@/static")) | ||
// Serve static fonts | ||
- .service(Files::new("/static/fonts", "./app/static/fonts")) | ||
+ .service(Files::new("/static/fonts", "@frontend@/static/fonts")) | ||
// Default to serve index.html for unknown routes, to support routing. | ||
.default_service(web::route().guard(guard::Get()).to(index::<Backend>)); | ||
} | ||
-- | ||
2.45.2 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.