better clouddrive support + about page

This commit is contained in:
Leon van Kammen 2026-07-31 22:08:22 +02:00
parent 15c0d56e53
commit 75c69332e1
6 changed files with 69 additions and 37 deletions

View file

@ -30,6 +30,15 @@ app = require("soakbean") {
addPlugin = function(file) addPlugin = function(file)
local p = require(file) local p = require(file)
table.insert(app.plugin,p) table.insert(app.plugin,p)
-- ensure plugin config-defaults
foreach( app.plugin, function(name,plugin)
foreach( plugin.opts, function(k,opt)
local key = opt.key:gsub("app.opts.","")
if not app.opts[ key ] then
app.opts[ key ] = opt.default
end
end)
end)
return p return p
end end
} }
@ -52,16 +61,6 @@ app.plugin.clouddrive = app.addPlugin('plugin/clouddrive')
app.plugin.webhook = app.addPlugin('plugin/webhook') app.plugin.webhook = app.addPlugin('plugin/webhook')
app.plugin.markdown = app.addPlugin('plugin/markdown') app.plugin.markdown = app.addPlugin('plugin/markdown')
-- ensure plugin config-defaults
foreach( app.plugin, function(name,plugin)
foreach( plugin.opts, function(k,opt)
local key = opt.key:gsub("app.opts.","")
if not app.opts[ key ] then
app.opts[ key ] = opt.default
end
end)
end)
app.runcmd(app) -- run clicmds app.runcmd(app) -- run clicmds
print = function(...) Log(kLogInfo, ... or "''") end -- nice redbean logging from now on print = function(...) Log(kLogInfo, ... or "''") end -- nice redbean logging from now on

View file

@ -104,6 +104,14 @@ util.contains = function(tab,k_or_v)
return result return result
end end
util.execute = function(cmd)
local handle = io.popen(cmd)
print("running : "..cmd)
local result = handle:read("*a")
handle:close()
return result
end
util.memoize = function(fn, ttl_seconds) util.memoize = function(fn, ttl_seconds)
local cached_results = nil local cached_results = nil
local last_executed = 0 local last_executed = 0
@ -123,7 +131,7 @@ util.memoize = function(fn, ttl_seconds)
end end
util.cmdExist = function(cmd) util.cmdExist = function(cmd)
if api.runtime.os == 'unixy' then cmd = cmd .. " 1>/dev/null 2>/dev/null" end cmd = cmd .. " 1>/dev/null 2>/dev/null"
local stdout, retstr, retcode = os.execute(cmd) local stdout, retstr, retcode = os.execute(cmd)
return retcode ~= 127 return retcode ~= 127
end end

View file

@ -91,6 +91,11 @@ div#xrecosystem{
<div class="clear"></div> <div class="clear"></div>
</header> </header>
<h3>What is it</h3>
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).
<br>
<br> <br>
<h3>Why people want XRForge</h3> <h3>Why people want XRForge</h3>

View file

@ -13,6 +13,7 @@
<tr> <tr>
<td class="col3"> <td class="col3">
<a href="https://xrhf.isvery.ninja">XR Hypermedia Federation</a><br/> <a href="https://xrhf.isvery.ninja">XR Hypermedia Federation</a><br/>
<a href="https://xrfragment.org">XR Fragment deeplinking spec</a><br/>
<a href="https://coderofsalvation.github.io/janus-guide/">JanusXR Guide</a><br/> <a href="https://coderofsalvation.github.io/janus-guide/">JanusXR Guide</a><br/>
<a href="https://nlnet.nl">NLNET</a><br/> <a href="https://nlnet.nl">NLNET</a><br/>
</td> </td>

View file

@ -1,4 +1,5 @@
local util = require('util') local util = require('util')
local remotes = {"-- disabled --"}
app.on('scan_experience', function(exp) app.on('scan_experience', function(exp)
--print_r(exp) --print_r(exp)
@ -11,46 +12,64 @@ app.on('set', function(k,v)
print("content was updated") print("content was updated")
end) end)
if util.cmdExist('rclone') then
local stdout = util.execute('rclone listremotes 2>&1')
print('stdout = ' .. stdout)
local lines = util.split(stdout,"\n")
foreach( lines, function(k,v)
local remote = v:gsub(":$","")
remotes[ remote ] = remote
end)
end
-- this registers the plugin UI -- this registers the plugin UI
local plugin = { local plugin = {
name = 'Clouddrive <b class="tag">disabled</b>', name = 'Cloud drives <b class="tag">disabled</b>',
info = '', info = '',
opts = { opts = {
{ {
key='app.opts.plugin_clouddrive_webdir', key='app.opts.plugin_clouddrive_remote_1',
title='Webdirectory URL', title='Cloud 1',
info='scan for experiences in open webdirs (apache/lighttpd/nginx/rclone/archive.org/copyparty)', info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
default="https://archive.org/download/janusxr-1", default="-- disabled --",
values=remotes
},
{
key='app.opts.plugin_clouddrive_remote_1_target',
title='Cloud 1 URL',
info='at which URL should this folder show up?',
default=app.opts.plugin_diskscan_dir:sub(2) .. "/cloud1",
values='' values=''
}, },
{ {
key='app.opts.plugin_clouddrive_remotestorage', key='app.opts.plugin_clouddrive_remote_2',
title='Remotestorage URL', title='Cloud 2',
info='scan for experiences via <a href="https://remotestorage.io/" target="_blank">remotestorage protocol</a> (via <a href="https://5apps.com" target="_blank">5apps</a> e.g.', info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
default="username@5apps.com", default="-- disabled --",
values=remotes
},
{
key='app.opts.plugin_clouddrive_remote_2_target',
title='Cloud 2 URL',
info='at which URL should this folder show up?',
default=app.opts.plugin_diskscan_dir:sub(2) .. "/cloud2",
values='' values=''
}, },
{ {
key='app.opts.plugin_clouddrive_webdav', key='app.opts.plugin_clouddrive_remote_3',
title='WebDav URL', title='Cloud 3',
info='scan for experiences in <a href="https://en.wikipedia.org/wiki/WebDAV" target="_blank">WebDav</a>-drive (NextCloud/copyparty e.g.) via <a href="https://rclone.org" target="_blank">rclone</a>', info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
default="", default="-- disabled --",
values='' values=remotes
}, },
{ {
key='app.opts.plugin_clouddrive_dropbox', key='app.opts.plugin_clouddrive_remote_3_target',
title='Dropbox remote', title='Cloud 3 URL',
info='scan for experiences in Dropbox via <a href="https://rclone.org" target="_blank">rclone</a>', info='at which URL should this folder show up?',
default="", default=app.opts.plugin_diskscan_dir:sub(2) .. "/cloud3",
values='' values=''
}, },
{
key='app.opts.plugin_clouddrive_gdrive',
title='Gdrive remote',
info='scan for experiences in <a href="https://drive.google.com" target="_blank">Google Drive</a> via <a href="https://rclone.org" target="_blank">rclone</a>',
default="",
values=''
}
} }
} }

View file

@ -39,7 +39,7 @@ local plugin = {
}, },
{ {
key='app.opts.plugin_manyfold_sync_strategy', key='app.opts.plugin_manyfold_sync_strategy',
title='Instance 3 URL', title='Sync strategy',
info="Specify how content from manyfold instances should be fetched", info="Specify how content from manyfold instances should be fetched",
default="recent", default="recent",
values={recent='only recent',all_recent='everything + recent', disabled='disabled'} values={recent='only recent',all_recent='everything + recent', disabled='disabled'}