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. 9
      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="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="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="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"]> <if-permitted user=input.user permission=["member", "character.add", "channel.add", "file.add"]>
<menu-gap /> <menu-gap />
<menu-header>Add</menu-header> <menu-header>Add</menu-header>
@ -13,8 +12,5 @@
<if-permitted key="channels_add" user=input.user permission="channel.add"> <if-permitted key="channels_add" user=input.user permission="channel.add">
<menu-link dark icon="+" on-click("emit", "open", "channel.add")>Channel</menu-link> <menu-link dark icon="+" on-click("emit", "open", "channel.add")>Channel</menu-link>
</if-permitted> </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> </if-permitted>
</menu> </menu>

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

9
server.js

@ -28,7 +28,12 @@ lasso.configure(require("./marko-config"))
// Set trusted proxy // Set trusted proxy
if (config.trustedProxy != null) { 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) app.set('trust proxy', config.trustedProxy)
console.log("Trusting proxy", config.trustedProxy); console.log("Trusting proxy", config.trustedProxy);
@ -128,4 +133,4 @@ app.listen(config.port, function() {
// Handle shutdown signals (Docker needs this to shutdown quickly) // Handle shutdown signals (Docker needs this to shutdown quickly)
process.on('SIGINT', () => process.exit(0)) process.on('SIGINT', () => process.exit(0))
process.on('SIGTERM', () => process.exit(0))
process.on('SIGTERM', () => process.exit(0))
Loading…
Cancel
Save