From e34a87d475c43f2066b2e9e5db960037ac8b8493 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Sun, 2 Aug 2026 14:00:56 +0200 Subject: [PATCH] optimized scanner --- run.sh | 2 +- src/.init.lua | 2 +- src/cmd/server.lua | 12 ++++++++---- src/css/xrforge.css | 1 + src/css/xrforge.max.css | 2 +- src/page/about.html | 40 ++++++++++++++++++++++++++++++++++---- src/page/dir.html | 2 +- src/page/dir.lua | 2 +- src/plugin/diskscan.lua | 38 ++++++++++++++++++++---------------- src/plugin/janusxr.lua | 2 +- src/plugin/xrfragments.lua | 2 +- 11 files changed, 73 insertions(+), 32 deletions(-) diff --git a/run.sh b/run.sh index c33553c..8f43100 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,4 @@ #!/bin/sh source ./.env rebuild -DEBUG=1 result/bin/xrforge.com -c 0 "$@" +DEBUG=1 result/bin/xrforge.com -c 0 "$@" --nobrowser diff --git a/src/.init.lua b/src/.init.lua index 381fe39..5c98e9f 100644 --- a/src/.init.lua +++ b/src/.init.lua @@ -21,7 +21,7 @@ app = require("soakbean") { forkpids = {}, cmd={ help = {file="cmd/help.lua", info="display all possible flags"}, - server = {file="cmd/server.lua", info="starts the webserver"}, + server = {file="cmd/server.lua", info="starts the webserver [without --nobrowser]"}, admin = {file="cmd/server.lua", info="launch adminpanel to configure stuff (/admin)"}, createplugin = {file="cmd/createplugin.lua", info="generates skeleton plugin"}, generate = {file="cmd/generate.lua", info="generate www-folder with XR experiences"}, diff --git a/src/cmd/server.lua b/src/cmd/server.lua index facb2f6..e815841 100644 --- a/src/cmd/server.lua +++ b/src/cmd/server.lua @@ -1,8 +1,12 @@ +local util = require('util') + return function(app,argv) print("starting server") - if arg[1] == 'admin' then - LaunchBrowser('/admin') - else - LaunchBrowser('/') + if not util.contains(arg,"--nobrowser") then + if arg[1] == 'admin' then + LaunchBrowser('/admin') + else + LaunchBrowser('/') + end end end diff --git a/src/css/xrforge.css b/src/css/xrforge.css index 8ad8d85..cbca605 100644 --- a/src/css/xrforge.css +++ b/src/css/xrforge.css @@ -155,6 +155,7 @@ form > table > tbody > tr > td:nth-child(3) { background:#224; } pre{ + line-height:initial !important; font-family: monospace; line-height: 1; word-spacing: normal; diff --git a/src/css/xrforge.max.css b/src/css/xrforge.max.css index 8e54bcc..fcebdf8 100644 --- a/src/css/xrforge.max.css +++ b/src/css/xrforge.max.css @@ -262,7 +262,7 @@ div.tab-frame > input#info:checked ~ .info{ left:5%; right:5%; max-height:60vh; - padding:0px 30px 30px 30px; + padding:30px 30px 30px 30px; background:#112e; z-index:1000; overflow:hidden; diff --git a/src/page/about.html b/src/page/about.html index 7a0be45..d2957b7 100644 --- a/src/page/about.html +++ b/src/page/about.html @@ -92,16 +92,48 @@ div#xrecosystem{

What is it

+ An open, seamless XR web built from simple URLs and directories, without gatekeepers.
- XRForge is a little VR/AR utility, which projects directories from (remote) filesystems into 3D, allowing users to 'surf' the deep immersive web, of experiences (3d files) and portal-rooms (directories). + XRForge transforms standard local or remote file directories into interconnected 3D spaces. Users can seamlessly "surf" the spatial web, turning everyday directories into gateways and portals. +

-
+
+
+
+    ┌───────────────────────────────────┐   ┌──────────────────────────────────────────┐
+    │           local disk              │   │          Surf via 3D portals             │
+    ├───────────────────────────────────┤   └──────────────────────────────────────────┘
+    │                                   │
+    │  /myverse                         │    https://my.org/myverse
+    │    /elearnings                    │    https://my.org/myverse/elearnings
+    │       /elearning1/1.glb           │    https://my.org/myverse/elearning/elearning1
+    │       /elearning2/2.glb           │    https://my.org/myverse/elearning/elearning2
+    │                                   │
+    │  ┌──────────────────────────────┐ │
+    │  │ github / webdav / dropbox etc│ │
+    │  │                              │ │
+    │  │ /mygames                     │ │    https://my.org/myverse/mygames
+    │  │   /biggusgateWebXR           │ │    https://my.org/myverse/mygames/biggusgate
+    │  │   /spasca                    │ │    https://my.org/myverse/mygames/spasca
+    │  │ /otherxrforge                │ │    https://my.org/myverse/otherxrforge
+    │  │                              │ │
+    │  │  ┌───────────┐ ┌───────────┐ │ │
+    │  │  │/manyfold  │ │archive.org│ │ │    https://my.org/myverse/manyfold
+    │  │  └───────────┘ └───────────┘ │ │    https://my.org/myverse/myarchive
+    │  │                              │ │
+    │  │ +40 integrations!            │ │
+    │  └──────────────────────────────┘ │
+    └───────────────────────────────────┘ 
+
+    
+
+

Why people want XRForge

- In short: a hyperscalable portal-system and projection of existing 2D ecosystems into XR.
- XRForge interconnects experiences via portals, according to the JanusXR and XR Fragments standard.
+ In short: hyperscalability (it uses web URLs) PLUS portal-system and projection of existing 2D ecosystems into XR.
+ XRForge interconnects XR experiences via portals, thanks to JanusXR and XR Fragments standards.
The metaverse has shown: people like 3D but certain existing 2D ecosystems are king.
They're just more cost-efficient to use.
Hence, XRForge incorporates the opensource JanusXR-client called JanusWeb, which promotes projecting these ecosystems as virtual hyperlinked worlds (via XR translators).
diff --git a/src/page/dir.html b/src/page/dir.html index 510f847..5cd5759 100644 --- a/src/page/dir.html +++ b/src/page/dir.html @@ -23,7 +23,7 @@ end} local item = items[i] local icon = 'list-tree' local thumbnail = '' - if #item.thumbnail > 0 then thumbnail = 'style="background-image: url(' .. item.thumbnail .. ');"' end + if #item.thumbnail > 0 then thumbnail = 'style="background-image: url(' .. EscapeFragment(item.thumbnail) .. ');"' end if item.view3D or item.portal3D == false then icon = 'play' end print([[
diff --git a/src/page/dir.lua b/src/page/dir.lua index be66ec0..700d324 100644 --- a/src/page/dir.lua +++ b/src/page/dir.lua @@ -38,7 +38,7 @@ return { end -- add items from dir - if match(v.parent.path, matchpath) then + if match(v.parent.path, matchpath) and (v.dir or v.view3D) then local parent = app.cache.items[ v.parent.id ] res.items[ v.id ] = v res.parent = parent diff --git a/src/plugin/diskscan.lua b/src/plugin/diskscan.lua index 8f06571..c6b91f5 100644 --- a/src/plugin/diskscan.lua +++ b/src/plugin/diskscan.lua @@ -35,7 +35,7 @@ return { path = scandir, url = "/" .. util.stripPath(scandir), name = scandir:gsub(".*/",""), - title = scandir:gsub(".*/",""), + title = scandir:gsub(".*/",""):gsub("-"," "), file = { ino = scandir }, id = scandir } @@ -57,9 +57,11 @@ return { -- cleanup file handles foreach( app.cache.items, function(k,v) -- remove file attributes (which are closed already) - v.file.stat = nil - v.file.attr = nil - v.file.state = nil + if v.file then + v.file.stat = nil + v.file.attr = nil + v.file.state = nil + end end) end, @@ -73,7 +75,7 @@ return { path = fullpath, url = "/" .. util.stripPath(fullpath), name = name, - title = name, + title = name:gsub("-"," "), sidecarfile = {}, thumbnail = '', tag = {}, @@ -82,22 +84,14 @@ return { } experience.parent = parent - -- check for thumbnail - local thumbExt = {"png","jpg","webp"} - foreach( thumbExt, function(k,ext) - local thumbnailFile = fullpath .. "/" .. name .. "." .. ext - if util.fileExist( thumbnailFile ) then - print("✅ └─ plugin/diskscan: detected .".. ext:lower() .. " thumbnail file") - experience.thumbnail = "/" .. util.stripPath(thumbnailFile) - end - end) - if seen[ino] then return end -- dont process dirs/files twice if (kind == unix.DT_LNK) then local stat, err = unix.stat(fullpath) - experience.id_target = stat:ino() - seen.symlinks[ ino ] = experience + if stat then + experience.id_target = stat:ino() + seen.symlinks[ ino ] = experience + end return end @@ -110,6 +104,16 @@ return { experience.portal3D = true -- can be viewed as 3d portal app.pub("scan_experience", nil, experience) app.cache.items[ino] = experience + -- check for directory thumbnail sidecarfile + local thumbExt = {"png","jpg","webp"} + foreach( thumbExt, function(k,ext) + local thumbnailFile = fullpath .. '.' .. ext + if util.fileExist( thumbnailFile ) then + experience.thumbnail = "/" .. util.stripPath(thumbnailFile) + print("✅ └─ plugin/diskscan: detected .".. ext:lower() .. " thumbnail file: " .. thumbnailFile) + end + end) + -- scan children me.scanDir(fullpath,experience,seen,symlinks) end diff --git a/src/plugin/janusxr.lua b/src/plugin/janusxr.lua index 49a8ef9..50a6dba 100644 --- a/src/plugin/janusxr.lua +++ b/src/plugin/janusxr.lua @@ -9,7 +9,7 @@ end) app.on('scan_experience_file', function(exp) local size = exp.file.attr:size() - if size < 1000 then -- skip large binary files + if size < 100000 then -- skip large binary files > 100kb local data = util.readfile( exp.file.fullpath) if data then if data:match(pattern_fireboxroom) then diff --git a/src/plugin/xrfragments.lua b/src/plugin/xrfragments.lua index ef32cfa..93b4dd0 100644 --- a/src/plugin/xrfragments.lua +++ b/src/plugin/xrfragments.lua @@ -24,7 +24,7 @@ app.on('scan_experience_file', function(exp) end) -- set thumbnail if any if exp.sidecarfile.png then - exp.thumnbail = exp.sidecarfile.png + exp.thumbnail = exp.sidecarfile.png end local jsonfile = exp.path:gsub("."..ext.."$",".json") -- scan for hrefs in json sidecarfile