Browse Source

Merge branch 'master' of ssh+git://git.aiterp.net/rpdata/frontend

master 1.7.4
Gisle Aune 4 years ago
parent
commit
2c7ba6df1d
  1. 4
      marko/page/data/components/data-menu/index.marko
  2. 7548
      package-lock.json
  3. 7
      server.js

4
marko/page/data/components/data-menu/index.marko

@ -3,7 +3,6 @@
<menu-link key="characters" selected=input.selected.characters icon="C" href="/data/characters/">Characters</menu-link>
<menu-link key="channels" selected=input.selected.channels icon="#" href="/data/channels/">Channels</menu-link>
<menu-link key="history" selected=input.selected.changes icon="H" href="/data/changes/">History</menu-link>
<menu-link key="files" selected=input.selected.files icon="F" href="/data/files/">Files</menu-link>
<if-permitted user=input.user permission=["member", "character.add", "channel.add", "file.add"]>
<menu-gap />
<menu-header>Add</menu-header>
@ -13,8 +12,5 @@
<if-permitted key="channels_add" user=input.user permission="channel.add">
<menu-link dark icon="+" on-click("emit", "open", "channel.add")>Channel</menu-link>
</if-permitted>
<if-permitted key="files_add" user=input.user permission=["file.add", "member"]>
<menu-link dark icon="+" on-click("emit", "open", "file.add")>File</menu-link>
</if-permitted>
</if-permitted>
</menu>

7548
package-lock.json
File diff suppressed because it is too large
View File

7
server.js

@ -28,7 +28,12 @@ lasso.configure(require("./marko-config"))
// Set trusted proxy
if (config.trustedProxy != null) {
if (ip.isV4Format(config.trustedProxy) || ip.isV6Format(config.trustedProxy)) {
if (config.trustedProxy === "GATEWAY") {
const ip = require("child_process").execSync("/sbin/ip route|awk '/default/ { print $3 }'").toString().trim()
app.set('trust proxy', ip)
console.log("Trusting proxy from default gateway", ip);
} else if (ip.isV4Format(config.trustedProxy) || ip.isV6Format(config.trustedProxy)) {
app.set('trust proxy', config.trustedProxy)
console.log("Trusting proxy", config.trustedProxy);

Loading…
Cancel
Save