hostname optimizations
This commit is contained in:
parent
737ac2bfef
commit
26d1bfbd1e
5 changed files with 11 additions and 331 deletions
|
|
@ -5,7 +5,7 @@ return function(app)
|
||||||
local config = { -- default
|
local config = { -- default
|
||||||
name = "XRForge",
|
name = "XRForge",
|
||||||
baseurl="/",
|
baseurl="/",
|
||||||
host="localhost",
|
hostname="",
|
||||||
admin_title = "admin panel",
|
admin_title = "admin panel",
|
||||||
admin_subtitle = "Manage your XR experiences here",
|
admin_subtitle = "Manage your XR experiences here",
|
||||||
admin_user = "admin",
|
admin_user = "admin",
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,14 @@ util.getURL = function(url,opts)
|
||||||
return 'http://localhost:' .. app.port .. url
|
return 'http://localhost:' .. app.port .. url
|
||||||
else
|
else
|
||||||
port = ':' .. GetPort()
|
port = ':' .. GetPort()
|
||||||
if port == ':80' then port = '' end
|
if port == ':80' then port = '' end
|
||||||
if arg[1] == 'generate' and port == ':8080' then port = '' end
|
if arg[1] == 'generate' and port == ':8080' then port = '' end
|
||||||
return GetScheme() .. '://' .. (app.opts.host or GetHost()) .. port .. (url or GetPath())
|
-- if hostname is not localhost or ip then we can assume live server (reverse proxy e.g.)
|
||||||
|
if port and not GetHost():match('localhost') and not GetHost():match('^[0-9]') then
|
||||||
|
port = ''
|
||||||
|
end
|
||||||
|
local host = #app.opts.hostname > 0 and app.opts.hostname or GetHost()
|
||||||
|
return GetScheme() .. '://' .. host .. port .. (url or GetPath())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 117 KiB |
|
|
@ -214,9 +214,6 @@ div#xrecosystem{
|
||||||
<b>Hello</b> post-scarcity technology.
|
<b>Hello</b> post-scarcity technology.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<center>
|
|
||||||
<img src="img/xrforge_term.svg" style="border-radius:7px; border-radius: 7px; width: 100%; max-width: 450px; margin-bottom: 40px;">
|
|
||||||
</center>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spectrum">
|
<div class="spectrum">
|
||||||
|
|
@ -242,12 +239,12 @@ div#xrecosystem{
|
||||||
<tr>
|
<tr>
|
||||||
<td>users can host content themselves</td>
|
<td>users can host content themselves</td>
|
||||||
<td>✅ <small>HTTP/DAT/IPFS Open Protocols</small></td>
|
<td>✅ <small>HTTP/DAT/IPFS Open Protocols</small></td>
|
||||||
<td>❌ <small>we own your data</small></td>
|
<td>❌ <small>they own your data</small></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>User operated content and viewers</td>
|
<td>User operated content and viewers</td>
|
||||||
<td>✅ </td>
|
<td>✅ </td>
|
||||||
<td>❌ <small>we control both</small></td>
|
<td>❌ <small>they control both</small></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>portals to remote content</td>
|
<td>portals to remote content</td>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ end}
|
||||||
{if items then
|
{if items then
|
||||||
|
|
||||||
function getURL(url)
|
function getURL(url)
|
||||||
if app.arg[1] == 'generate' and url:match("://") then
|
if app.arg[1] == 'generate' or url:match("://") then
|
||||||
url = 'janusweb/index.html#janus.url=' ..
|
url = 'janusweb/index.html#janus.url=' ..
|
||||||
EscapeFragment( url ) .. '&janus.referrer=' .. util.getURL(urlpath )
|
EscapeFragment( url ) .. '&janus.referrer=' .. util.getURL(urlpath )
|
||||||
url = util.baseURLify(url)
|
url = util.baseURLify(url)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue