Changes between Version 20 and Version 21 of Integrated Webserver


Ignore:
Timestamp:
31.07.2023 16:30:24 (9 months ago)
Author:
Alloc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Integrated Webserver

    v20 v21  
    1414
    1515== Access ==
    16 The webserver will listen on the port defined as ControlPanelPort (from serverconfig) + 2. I.e. if you have set ControlPanelPort to 8080 (as it is by default) the webserver will listen on ''!http://<yourIpOrDomain>:8082/''
     16As from mod version 25_30_44 onwards the mod does no longer provide its own HTTP interface but uses vanilla's. Thus the WebDashboard needs to be enabled in the serverconfig and you can access the mod's page on ''!http://<yourIpOrDomain>:8080/legacymap'' (assuming you did not change the port from its default).
    1717
    1818
     
    2020To check if the webserver was started look at the output_log.txt. It should contain a line like:
    2121{{{
    22 1.234 Started Webserver on 8082
     221.234 Started legacy webmod feature on port 8080, local adress /legacymap
    2323}}}
    24 If it does the server was started on the given port.
     24If it does the mod should show on the given port and path.
    2525
    2626
     
    4444== Web Tokens ==
    4545As tools like server managers obviously can not identify themselves with Steam login a token system has been added. That way those tools can provide a predefined token on ''each'' request to the webserver and those requests will be handled with the permission level given to that specific token. Web tokens are set up with the ''webtokens'' command.
    46 The tokens have to be passed to each request like this:
    47  !http://<server>:<port>/map/0/2/1.png?'''adminuser=<tokenuserpart>&admintoken=<tokenpasswordpart>'''
    48 For example, if your server is running on your machine, port 8082 and you added a webtoken with name "admin" and password "supersecrettoken" a request would look like this:
    49  !http://localhost:8082/api/getstats?adminuser=admin&admintoken=supersecrettoken
     46The tokens have to be passed to each request as HTTP headers, e.g.
     47{{{
     48GET /map/0/2/1.png
     49X-SDTD-API-TOKENNAME: <your tokenname here>
     50X-SDTD-API-SECRET: <your token secret here>
     51}}}
     52For example, if your server is running on your machine, port 8080 and you added a webtoken with name "admin" and password "supersecrettoken" a request sent to ''!http://localhost:8080'' would look like this:
     53{{{
     54GET /api/getstats
     55X-SDTD-API-TOKENNAME: admin
     56X-SDTD-API-SECRET: supersecrettoken
     57}}}
    5058
    5159
    5260== apache and mod_proxy ==
    53 If you already have a domain for your server and want a nice looking domain like 7dtd.example.com for your internal webserver instead of http://example.com:8082/ you can use apache and mod_proxy.
     61If you already have a domain for your server and want a nice looking domain like 7dtd.example.com for your internal webserver instead of !http://example.com:8082/ you can use apache and mod_proxy.
    5462We will use apache and ubuntu to provide an example but any other web server or os may be used in a similar way. We will use "example.com" as our domain, please replace it with your own domain or IP address.
    5563
     
    8997}}}
    9098
    91 now active the new config and restart apache
     99now activate the new config and restart apache
    92100{{{
    93101a2ensite 7dtd.example.com.conf
     
    97105You should now be able to visit 7dtd.example.com and see the map.
    98106
    99 '''Please note that this is _not_ a secure way to hide the ControlPanelPort from your users! Port scanning is always an option!
    100 
    101 
    102 == Planned stuff ==
    103 * List of players (filter by online, banned, admin/mod, permission level ... anything else?)
    104   * Info: name, steamid, ip, playtime, last seen, online/offline, stats, last position ...
    105   * Kick/Ban, change permission level
    106   * show on map
    107   * show trail
    108   * show keystones as list and on map (with claimed area overlay)
    109   * Send PM
    110   * ... ?
    111 * List of command permissions
    112 * Chat log
    113 * Console log
    114 * ... ?
     107'''Please note that this is _not_ a secure way to hide the WebDashboardPort from your users! Port scanning is always an option!'''