better clouddrive support + about page
This commit is contained in:
parent
15c0d56e53
commit
75c69332e1
6 changed files with 69 additions and 37 deletions
|
|
@ -30,6 +30,15 @@ app = require("soakbean") {
|
|||
addPlugin = function(file)
|
||||
local p = require(file)
|
||||
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
|
||||
end
|
||||
}
|
||||
|
|
@ -52,16 +61,6 @@ app.plugin.clouddrive = app.addPlugin('plugin/clouddrive')
|
|||
app.plugin.webhook = app.addPlugin('plugin/webhook')
|
||||
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
|
||||
|
||||
print = function(...) Log(kLogInfo, ... or "''") end -- nice redbean logging from now on
|
||||
|
|
|
|||
|
|
@ -104,6 +104,14 @@ util.contains = function(tab,k_or_v)
|
|||
return result
|
||||
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)
|
||||
local cached_results = nil
|
||||
local last_executed = 0
|
||||
|
|
@ -123,7 +131,7 @@ util.memoize = function(fn, ttl_seconds)
|
|||
end
|
||||
|
||||
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)
|
||||
return retcode ~= 127
|
||||
end
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ div#xrecosystem{
|
|||
<div class="clear"></div>
|
||||
</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>
|
||||
<h3>Why people want XRForge</h3>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<tr>
|
||||
<td class="col3">
|
||||
<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://nlnet.nl">NLNET</a><br/>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
local util = require('util')
|
||||
local remotes = {"-- disabled --"}
|
||||
|
||||
app.on('scan_experience', function(exp)
|
||||
--print_r(exp)
|
||||
|
|
@ -11,46 +12,64 @@ app.on('set', function(k,v)
|
|||
print("content was updated")
|
||||
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
|
||||
local plugin = {
|
||||
name = 'Clouddrive <b class="tag">disabled</b>',
|
||||
name = 'Cloud drives <b class="tag">disabled</b>',
|
||||
info = '',
|
||||
opts = {
|
||||
{
|
||||
key='app.opts.plugin_clouddrive_webdir',
|
||||
title='Webdirectory URL',
|
||||
info='scan for experiences in open webdirs (apache/lighttpd/nginx/rclone/archive.org/copyparty)',
|
||||
default="https://archive.org/download/janusxr-1",
|
||||
key='app.opts.plugin_clouddrive_remote_1',
|
||||
title='Cloud 1',
|
||||
info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
|
||||
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=''
|
||||
},
|
||||
{
|
||||
key='app.opts.plugin_clouddrive_remotestorage',
|
||||
title='Remotestorage URL',
|
||||
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.',
|
||||
default="username@5apps.com",
|
||||
key='app.opts.plugin_clouddrive_remote_2',
|
||||
title='Cloud 2',
|
||||
info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
|
||||
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=''
|
||||
},
|
||||
{
|
||||
key='app.opts.plugin_clouddrive_webdav',
|
||||
title='WebDav URL',
|
||||
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>',
|
||||
default="",
|
||||
values=''
|
||||
key='app.opts.plugin_clouddrive_remote_3',
|
||||
title='Cloud 3',
|
||||
info='<a href="https://rclone.org">rclone</a> remotes show up in the dropdown (if installed)',
|
||||
default="-- disabled --",
|
||||
values=remotes
|
||||
},
|
||||
{
|
||||
key='app.opts.plugin_clouddrive_dropbox',
|
||||
title='Dropbox remote',
|
||||
info='scan for experiences in Dropbox via <a href="https://rclone.org" target="_blank">rclone</a>',
|
||||
default="",
|
||||
key='app.opts.plugin_clouddrive_remote_3_target',
|
||||
title='Cloud 3 URL',
|
||||
info='at which URL should this folder show up?',
|
||||
default=app.opts.plugin_diskscan_dir:sub(2) .. "/cloud3",
|
||||
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=''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ local plugin = {
|
|||
},
|
||||
{
|
||||
key='app.opts.plugin_manyfold_sync_strategy',
|
||||
title='Instance 3 URL',
|
||||
title='Sync strategy',
|
||||
info="Specify how content from manyfold instances should be fetched",
|
||||
default="recent",
|
||||
values={recent='only recent',all_recent='everything + recent', disabled='disabled'}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue