introduce .xrforge folder

This commit is contained in:
Leon van Kammen 2025-10-30 09:13:46 +01:00
parent af9e36e14f
commit fe779a9a97
8 changed files with 38 additions and 27 deletions

View file

@ -130,7 +130,6 @@ mount_dir(){
find /mnt -type d -mindepth 1 -maxdepth 1 | while read dir; do find /mnt -type d -mindepth 1 -maxdepth 1 | while read dir; do
echocolor "[$APPNAME]" "mounting $dir as library" echocolor "[$APPNAME]" "mounting $dir as library"
add_lib_to_db "$dir" add_lib_to_db "$dir"
ln -s "$dir" /usr/src/app/public/.
done done
} }

View file

@ -17,5 +17,5 @@ test -n "$FEDERATE_DRIVE_CERT" && test -m "$FEDERATE_DRIVE_KEY" && {
set -x set -x
rclone serve http \ rclone serve http \
--poll-interval $FEDERATE_DRIVE_CACHE \ --exclude .xrforge --poll-interval $FEDERATE_DRIVE_CACHE \
--addr 0.0.0.0:$FEDERATE_DRIVE_PORT ${AUTH} ${SSL} $FEDERATE_DRIVE_PATH &> /var/log/rclone.log & --addr 0.0.0.0:$FEDERATE_DRIVE_PORT ${AUTH} ${SSL} $FEDERATE_DRIVE_PATH &> /var/log/rclone.log &

View file

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/sh
cd "$(dirname $1)" dir="$(dirname $1)/.xrforge"
mkdir -p "$dir" || true
cd "$dir"
echo "[v] reset log.txt" echo "[v] reset log.txt"
date > log.txt date > log.txt

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
dir="$(dirname $1)" dir="$(dirname $1)"
cd "$dir" cd "$dir"
echo "[package_experience.sh] zipping $dir.zip" echo "[package_experience.sh] zipping experience.zip"
zip -r "$dir".zip $dir/* zip -D ".xrforge/experience.zip * | tee -a .xrforge/log.txt

View file

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
dir="$(dirname $1)" dir="$(dirname $1)"
cd "$dir" cd "$dir"
echo "[package_experience.sh] zipping $dir.zip" echo "[package_godot_zip.sh] zipping godot.zip"
# overwrite empty godot template project-zip with given URL # overwrite empty godot template project-zip with given URL
test -n "$GODOT_TEMPLATE_ZIP" && timeout 50 wget "$GODOT_TEMPLATE_ZIP" -O ~/template_godot.zip test -n "$GODOT_TEMPLATE_ZIP" && timeout 50 wget "$GODOT_TEMPLATE_ZIP" -O ~/template_godot.zip
cp ~/template_godot.zip package_godot.zip cp ~/template_godot.zip package_godot.zip
zip package_godot.zip *.glb *.usdz *.obj zip .xrforge/godot.zip *.glb *.usdz *.obj

View file

@ -6,6 +6,7 @@ echo "[package_janusxr.sh] packing janusxr.html"
glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match
jml=' jml='
<!DOCTYPE html>
<html> <html>
<head> <head>
<title>janusxr room</title> <title>janusxr room</title>
@ -13,16 +14,17 @@ jml='
<body> <body>
<script src="https://web.janusvr.com/janusweb.js"></script> <script src="https://web.janusvr.com/janusweb.js"></script>
<janus-viewer> <janus-viewer>
<FireBoxRoom> <FireBoxRoom>
<Room> <Assets>
<Object id="experience" src="'$glb'" locked="true" pos="0 0 0"></Object> <assetobject id="experience" src="'${FEDERATE_DRIVE_HOST}/$1'"/>
</Room> </Assets>
<Room>
<object pos="0 0 0" collision_id="experience" id="experience" />
</Room>
</FireBoxRoom> </FireBoxRoom>
</janus-viewer> </janus-viewer>
</body> </body>
</html> </html>
' '
echo "$jml" > janusxr.html echo "$jml" > .xrforge/janusxr.html

View file

@ -15,7 +15,7 @@ begin
# Read and parse the JSON file # Read and parse the JSON file
data = JSON.parse(File.read(filename)) data = JSON.parse(File.read(filename))
logfile = File.join( File.dirname(filename), "log.txt" ) logfile = File.join( File.dirname(filename), ".xrforge/log.txt" )
XRForge.log("✅ starting XR fragments check", logfile, true) XRForge.log("✅ starting XR fragments check", logfile, true)

View file

@ -68,24 +68,32 @@
<td><%= link_to @model.creator.name, @model.creator, itemprop: "author" %></td> <td><%= link_to @model.creator.name, @model.creator, itemprop: "author" %></td>
</tr> </tr>
<% end %> <% end %>
<% if ENV['FEDERATE_DRIVE_HOST'].present? %>
<tr> <tr>
<td> <td>
<i class="bi bi-people" role="img"></i> <i class="bi bi-people" role="img"></i>
</td> </td>
<td><%= link_to "JanusXR room", "/"+@model.library.name+"/"+@model.path.gsub("#","%23")+"/janusxr.html" %></td> <td><%= link_to "JanusXR room", ENV['FEDERATE_DRIVE_HOST']+"/"+@model.library.name+"/"+@model.path.gsub("#","%23")+"/.xrforge/janusxr.html" %></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<i class="bi bi-file-zip" role="img"></i> <i class="bi bi-file-zip" role="img"></i>
</td> </td>
<td><%= link_to "zip archive", "/"+@model.library.name+"/"+@model.path.gsub("#","%23")+".zip" %></td> <td><%= link_to "zip archive", "/"+@model.library.name+"/"+@model.path.gsub("#","%23")+"/.xrforge/experience.zip" %></td>
</tr>
<tr>
<td>
<i class="bi bi-note" role="img"></i>
</td>
<td><%= link_to "build log", ENV['FEDERATE_DRIVE_HOST']+"/"+@model.library.name+"/.xrforge/log.txt" %></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<i class="bi bi-controller" role="img"></i> <i class="bi bi-controller" role="img"></i>
</td> </td>
<td><%= link_to "Godot project", "/"+@model.library.name+"/"+@model.path.gsub("#","%23")+"/package_godot.zip" %></td> <td><%= link_to "Godot project", "/"+@model.library.name+"/"+@model.path.gsub("#","%23")+"/.xrforge/godot.zip" %></td>
</tr> </tr>
<% end %>
<% if @model.collection %> <% if @model.collection %>
<tr> <tr>
<td><%= icon "collection", Collection.model_name.human(count: 100) %></td> <td><%= icon "collection", Collection.model_name.human(count: 100) %></td>