Changes between Version 20 and Version 21 of Integrated Webserver
- Timestamp:
- Jul 31, 2023, 4:30:24 PM (16 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Integrated Webserver
v20 v21 14 14 15 15 == 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/'' 16 As 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). 17 17 18 18 … … 20 20 To check if the webserver was started look at the output_log.txt. It should contain a line like: 21 21 {{{ 22 1.234 Started Webserver on 808222 1.234 Started legacy webmod feature on port 8080, local adress /legacymap 23 23 }}} 24 If it does the server was started on the given port.24 If it does the mod should show on the given port and path. 25 25 26 26 … … 44 44 == Web Tokens == 45 45 As 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 46 The tokens have to be passed to each request as HTTP headers, e.g. 47 {{{ 48 GET /map/0/2/1.png 49 X-SDTD-API-TOKENNAME: <your tokenname here> 50 X-SDTD-API-SECRET: <your token secret here> 51 }}} 52 For 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 {{{ 54 GET /api/getstats 55 X-SDTD-API-TOKENNAME: admin 56 X-SDTD-API-SECRET: supersecrettoken 57 }}} 50 58 51 59 52 60 == 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.61 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. 54 62 We 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. 55 63 … … 89 97 }}} 90 98 91 now activ e the new config and restart apache99 now activate the new config and restart apache 92 100 {{{ 93 101 a2ensite 7dtd.example.com.conf … … 97 105 You should now be able to visit 7dtd.example.com and see the map. 98 106 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!'''