JLyne / LiveAtlas

A Dynmap, Squaremap, Pl3xmap and Overviewer frontend for the modern web
Apache License 2.0
336 stars 37 forks source link

Dynmap multi-server returning invalid json #641

Open tillerrr opened 5 months ago

tillerrr commented 5 months ago

Followed both guides correctly, can see the Dynmap through LiveAtlas on a non multi-server configuration, when enabling the multi configuration, it states it returned invalid json. Dynmap version is 3.7 beta 4.

I currently have Dynmap directed to a mounted NAS drive, and also mounted the same folder on the drive to the LXC running nginx with LiveAtlas, with a soft symbolic link within the same folder as index.html. I can access the .php files fine through URL

LiveAtlas configuration:

window.liveAtlasConfig = {
            // To configure multiple servers, see https://github.com/JLyne/LiveAtlas/wiki/Configuring-Multiple-Servers.
            // Example multiple Dynmap servers on external webserver configuration
             servers: {
               lobby: {
                 label: 'Lobby',
                 dynmap: {
                     configuration: 'Dynmap/lobby/web/standalone/MySQL_configuration.php',
                     update: 'Dynmap/lobby/web/standalone/MySQL_update.php?world={world}&ts={timestamp}',
                     sendmessage: 'Dynmap/lobby/web/standalone/MySQL_sendmessage.php',
                     login: 'Dynmap/lobby/web/standalone/MySQL_login.php',
                     register: 'Dynmap/lobby/web/standalone/MySQL_register.php',
                     tiles: 'Dynmap/lobby/web/standalone/MySQL_tiles.php?tile=',
                     markers: 'Dynmap/lobby/web/standalone/MySQL_markers.php?marker='
                 }
               },
               smp: {
                 label: 'SMP',
                 dynmap: {
                     configuration: 'Dynmap/smp/web/standalone/MySQL_configuration.php',
                     update: 'Dynmap/smp/web/standalone/MySQL_update.php?world={world}&ts={timestamp}',
                     sendmessage: 'Dynmap/smp/web/standalone/MySQL_sendmessage.php',
                     login: 'Dynmap/smp/web/standalone/MySQL_login.php',
                     register: 'Dynmap/smp/web/standalone/MySQL_register.php',
                     tiles: 'Dynmap/smp/web/standalone/MySQL_tiles.php?tile=',
                     markers: 'Dynmap/smp/web/standalone/MySQL_markers.php?marker='
                 }
               },
             },

Dynmap configuration, that I changed/modified:

storage:
  # Filetree storage (standard tree of image files for maps)
  #type: filetree
  # SQLite db for map storage (uses dbfile as storage location)
  #type: sqlite
  #dbfile: dynmap.db
  # MySQL DB for map storage (at 'hostname':'port' with flags "flags" in database 'database' using user 'userid' password 'password' and table prefix 'prefix')
  type: mysql
  hostname: 192.168.0.72
  port: 3306
  database: minecraft_dynmap
  userid: dynmap
  password: *****************
  prefix: ""
  flags: "?allowReconnect=true&autoReconnect=true"`
  #- class: org.dynmap.InternalClientUpdateComponent
   # sendhealth: true
   # sendposition: true
   # allowwebchat: true
   # webchat-interval: 5
   # hidewebchatip: false
   # trustclientname: false
   # includehiddenplayers: false
   # # (optional) if true, color codes in player display names are used
   # use-name-colors: false
   # # (optional) if true, player login IDs will be used for web chat when their IPs match
   # use-player-login-ip: true
   # # (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored
   # require-player-login-ip: false
   # # (optional) block player login IDs that are banned from chatting
   # block-banned-player-chat: true
   # # Require login for web-to-server chat (requires login-enabled: true)
   # webchat-requires-login: false
   # # If set to true, users must have dynmap.webchat permission in order to chat
   # webchat-permissions: false
   # # Limit length of single chat messages
   # chatlengthlimit: 256
   # # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)
   # hideifshadow: 4
   # # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)
   # hideifundercover: 14
   # # (Optional) if true, players that are crouching/sneaking will be hidden 
   # hideifsneaking: false
   # # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
   # protected-player-info: false
   # # If true, hide players with invisibility potion effects active
   # hide-if-invisiblity-potion: true
   # # If true, player names are not shown on map, chat, list
   # hidenames: false
  - class: org.dynmap.JsonFileClientUpdateComponent
    writeinterval: 1
    sendhealth: true
    sendposition: true
    allowwebchat: true
    webchat-interval: 5
    hidewebchatip: false
    includehiddenplayers: false
    use-name-colors: false
    use-player-login-ip: false
    require-player-login-ip: false
    block-banned-player-chat: true
    hideifshadow: 0
    hideifundercover: 0
    hideifsneaking: false
  #  # Require login for web-to-server chat (requires login-enabled: true)
    webchat-requires-login: false
  #  # If set to true, users must have dynmap.webchat permission in order to chat
    webchat-permissions: false
  #  # Limit length of single chat messages
    chatlengthlimit: 256
    hide-if-invisiblity-potion: true
    hidenames: false

Yes, MySQL. It is also working correctly according to the database becoming populated after run, as well as console output that it has connected to the database.

# The path where the tile-files are placed.
tilespath: /data/Dynmap/lobby/tiles

# The path where the web-files are located.
webpath: /data/Dynmap/lobby/web

# Disables Webserver portion of Dynmap (Advanced users only)
disable-webserver: true

*Note, the Dynmap is on a separate LXC than LiveAtlas, thus the mount location is different. The mount is located under /data/. The LiveAtlas LXC is also mounted in the same location, however, a symbolic link is used rather than bind mounting into the nginx folder. Still access's the files fine, no 404's all return 200's.

Console output:

index.a82d2095.js:57 LiveAtlas version 3.1.0 - https://github.com/JLyne/LiveAtlas
index.a82d2095.js:56 Failed to load server configuration for 'lobby': Error: Request returned invalid json
    at me.fetchJSON (index.a82d2095.js:20:7057)
    at async Proxy.loadServerConfiguration (index.a82d2095.js:20:34008)
    at async Wt.loadConfiguration (index.a82d2095.js:24:7718)
U @ index.a82d2095.js:56
await in U (async)
(anonymous) @ index.a82d2095.js:57
Ie @ vendor.d0ab50b1.js:1
Jt @ vendor.d0ab50b1.js:1
Fi.i.__weh.i.__weh @ vendor.d0ab50b1.js:1
va @ vendor.d0ab50b1.js:1
tn @ vendor.d0ab50b1.js:1
mount @ vendor.d0ab50b1.js:1
i.mount @ vendor.d0ab50b1.js:1
(anonymous) @ index.a82d2095.js:57