[PR #96] [MERGED] Serve libraries locally in the docker container #541

Closed
opened 2026-02-27 08:17:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/lldap/lldap/pull/96
Author: @kaysond
Created: 11/28/2021
Status: Merged
Merged: 11/30/2021
Merged by: @nitnelave

Base: mainHead: main


📝 Commits (10+)

  • 8aafcef server libraries locally in the docker container
  • 100ee47 fix typo
  • 5d21409 remove unnecessary attrs
  • 9501a41 add icon fonts to library list
  • b9426e1 fix rust formatting
  • dea62c0 add bootstrap global var to rollup command
  • 9f9ed5b download static fonts to their own directory
  • fb05ec8 add SRI back
  • 9a12733 fix icons download
  • d419b36 add SRI for other resources; add routing for all root requests

📊 Changes

9 files changed (+90 additions, -16 deletions)

View changed files

📝 Dockerfile (+4 -1)
📝 app/build.sh (+1 -1)
📝 app/index.html (+11 -4)
app/index_local.html (+37 -0)
app/static/fonts.css (+18 -0)
app/static/fonts/fonts.txt (+3 -0)
app/static/libraries.txt (+4 -0)
📝 app/static/style.css (+0 -0)
📝 server/src/infra/tcp_server.rs (+12 -10)

📄 Description

Addresses #93

Created a static directory and the index_local.html that gets copied in the container. I put all of the libraries in static/libraries.txt and the container automatically downloads all of the files in that list.

I had to manually add/modify the google fonts css file since it includes font imports that also need to be downloaded.

I also cleaned up the tcp_server a little in terms of routing.

Everything works fine, but I am getting some warnings on build:

Step 13/26 : RUN cargo build --release -p lldap     && ./app/build.sh 
 ---> Running in ae86bb0e19da
   Compiling lldap_auth v0.2.0 (/app/auth)
   Compiling lldap v0.2.0 (/app/server)
    Finished release [optimized] target(s) in 2m 20s
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling lldap_auth v0.2.0 (/app/auth)
   Compiling lldap_app v0.2.0 (/app/app)
    Finished release [optimized] target(s) in 57.40s
[WARN]: :-) origin crate has no README
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended                                                       [INFO]: :-) Done in 2m 07s
[INFO]: :-) Your wasm pkg is ready to publish at /app/app/pkg.

./main.js → ./pkg/bundle.js...
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
bootstrap (imported by pkg/lldap_app.js)
(!) Missing global variable name
Use output.globals to specify browser global variable names corresponding to external modules
bootstrap (guessing 'bootstrap')
created ./pkg/bundle.js in 708ms

Not sure if this is old or caused by making bootstrap local.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/lldap/lldap/pull/96 **Author:** [@kaysond](https://github.com/kaysond) **Created:** 11/28/2021 **Status:** ✅ Merged **Merged:** 11/30/2021 **Merged by:** [@nitnelave](https://github.com/nitnelave) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`8aafcef`](https://github.com/lldap/lldap/commit/8aafcef541f43e8c1a9100277f1c744a620f2d06) server libraries locally in the docker container - [`100ee47`](https://github.com/lldap/lldap/commit/100ee47051cb2359f18f99ee1666a818209c08e1) fix typo - [`5d21409`](https://github.com/lldap/lldap/commit/5d21409052e72d05b4fe61550fba0d044e67084e) remove unnecessary attrs - [`9501a41`](https://github.com/lldap/lldap/commit/9501a4186956b3b5669ef3c8d8ca565bbaea1d0a) add icon fonts to library list - [`b9426e1`](https://github.com/lldap/lldap/commit/b9426e198cb61fbed87c393ff428a16bb28cc73d) fix rust formatting - [`dea62c0`](https://github.com/lldap/lldap/commit/dea62c03b5844b2c44db8ce8c7b495e9c76cc0ca) add bootstrap global var to rollup command - [`9f9ed5b`](https://github.com/lldap/lldap/commit/9f9ed5b0d57419e03527c2d43850bbf6dae9481f) download static fonts to their own directory - [`fb05ec8`](https://github.com/lldap/lldap/commit/fb05ec80c8b855941139a9d99eb13370f8d38b01) add SRI back - [`9a12733`](https://github.com/lldap/lldap/commit/9a127332c5f2798905a338b4063488a2ed730f54) fix icons download - [`d419b36`](https://github.com/lldap/lldap/commit/d419b364ef2e3dd2f342d1a111bc816f785b6897) add SRI for other resources; add routing for all root requests ### 📊 Changes **9 files changed** (+90 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+4 -1) 📝 `app/build.sh` (+1 -1) 📝 `app/index.html` (+11 -4) ➕ `app/index_local.html` (+37 -0) ➕ `app/static/fonts.css` (+18 -0) ➕ `app/static/fonts/fonts.txt` (+3 -0) ➕ `app/static/libraries.txt` (+4 -0) 📝 `app/static/style.css` (+0 -0) 📝 `server/src/infra/tcp_server.rs` (+12 -10) </details> ### 📄 Description Addresses #93 Created a `static` directory and the `index_local.html` that gets copied in the container. I put all of the libraries in `static/libraries.txt` and the container automatically downloads all of the files in that list. I had to manually add/modify the google fonts css file since it includes font imports that also need to be downloaded. I also cleaned up the tcp_server a little in terms of routing. Everything works fine, but I am getting some warnings on build: ``` Step 13/26 : RUN cargo build --release -p lldap && ./app/build.sh ---> Running in ae86bb0e19da Compiling lldap_auth v0.2.0 (/app/auth) Compiling lldap v0.2.0 (/app/server) Finished release [optimized] target(s) in 2m 20s [INFO]: Checking for the Wasm target... [INFO]: Compiling to Wasm... Compiling lldap_auth v0.2.0 (/app/auth) Compiling lldap_app v0.2.0 (/app/app) Finished release [optimized] target(s) in 57.40s [WARN]: :-) origin crate has no README [INFO]: Installing wasm-bindgen... [INFO]: Optimizing wasm binaries with `wasm-opt`... [INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended [INFO]: :-) Done in 2m 07s [INFO]: :-) Your wasm pkg is ready to publish at /app/app/pkg. ./main.js → ./pkg/bundle.js... (!) Unresolved dependencies https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency bootstrap (imported by pkg/lldap_app.js) (!) Missing global variable name Use output.globals to specify browser global variable names corresponding to external modules bootstrap (guessing 'bootstrap') created ./pkg/bundle.js in 708ms ``` Not sure if this is old or caused by making bootstrap local. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 08:17:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#541
No description provided.