Difference between revisions of "FS2 WebUI Standalone"

From FreeSpace Wiki
Jump to: navigation, search
(Known Issues: updated issues list)
(Clarify that WebUI standalone works on Mac as well)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The WebUI standalone was created by SCP member Eli2 to enable *nix machines to run a standalone FS2 server.
+
The WebUI standalone was created by SCP member Eli2 to enable *nix and Mac machines to run a standalone FS2 server.
  
 
==How to Use==
 
==How to Use==
  
Just add the -standalone command line option to your startup script, or run the game with the Standalone option enabled from wxLauncher, etc.
+
Just add the -standalone command line option to your startup script, or run the game with the Standalone option enabled from wxLauncher, etc.  I highly recommend avoiding wxLauncher for the time being, as it isn't really aware of the *nix standalone and I don't think it can open a monitoring terminal window for you.
  
 
==Configuration==
 
==Configuration==
Line 10: Line 10:
  
 
===+webui_root===
 
===+webui_root===
*Set this value to wherever you have placed the webui document root.  If you don't have it, and you did not download the code and make the build yourself, you can grab it by running the svn command '''svn checkout svn://svn.icculus.org/fs2open/trunk/fs2_open/webui''' in the directory you would like to store the WebUI pages.  So if you run this command in your home folder, your setting might look something like:
+
*Set this value to wherever you have placed the webui document root.  You can grab it by downloading and extracting the [https://github.com/scp-fs2open/fs2open_webui/archive/master.zip master branch archive] from Github, or by cloning the [https://github.com/scp-fs2open/fs2open_webui Github Webui repository], in the directory you would like to store the WebUI pages.  So if you run extract or clone the repo in your home folder, your setting might look something like:
<pre>+webui_root /home/username/webui</pre>
+
<pre>+webui_root /home/username/fs2open_webui</pre>
 +
 
 +
===+webapi_username===
 +
Username for accessing the WebUI administration page.
 +
 
 +
===+webapi_password===
 +
Password for accessing the WebUI administration page.
 +
 
 +
===+webapi_server_port===
 +
Set to change the WebUI server to be running on a different port than the default 8080.
  
 
===+use_pxo===
 
===+use_pxo===
Line 18: Line 27:
 
==Connecting==
 
==Connecting==
  
The WebUI currently listens on port 8080 using unencrypted HTTP.  The user and pass for administration is currently admin:admin.  To secure this, the current recommendation is to run the server behind a firewall and access it via an SSH tunnel or VPN.  Since most *nix machines are themselves accessible via SSH, I will describe the basics needed to set up an SSH tunnel as pertains to this standalone.
+
The WebUI currently listens on port 8080 by default, using unencrypted HTTP.  The default user and pass for administration is admin:admin.  It is highly recommended to change these default settings in your multi.cfg file.  To secure this, the current recommendation is to run the server behind a firewall and access it via an SSH tunnel or VPN.  Since most *nix machines are themselves accessible via SSH, I will describe the basics needed to set up an SSH tunnel as pertains to this standalone.
  
 
===From Windows===
 
===From Windows===
Line 25: Line 34:
  
 
===From CLI SSH on Linux/OSX/etc===
 
===From CLI SSH on Linux/OSX/etc===
You'll need to open a terminal window, and know the normal SSH command you use to access the SSH server on the network where the standalone is running.  Let's say you SSH into myip.dyndns.com, on the default port 22.  Your username on the ssh server is 'me'.  The standalone is running on another machine on the same network as the SSH server, named standalone.  The standalone runs on port 8080.  You want to be able to access the WebUI in your browser on port 8080.  You need to add the -L parameter to your ssh command to resemble the following:
+
You'll need to open a terminal window, and know the normal SSH command you use to access the SSH server on the network where the standalone is running.  Let's say you SSH into myip.dyndns.com, on the default port 22.  Your username on the ssh server is 'me'.  The standalone is running on another machine on the same network as the SSH server, named standalone.  The standalone runs on port 8080.  You want to be able to access the WebUI in your browser on port 8081.  You need to add the -L parameter to your ssh command to resemble the following:
 
<pre>ssh -L 8081:standalone:8080 [email protected]</pre>
 
<pre>ssh -L 8081:standalone:8080 [email protected]</pre>
  
 
===Connect to the WebUI===
 
===Connect to the WebUI===
Now that the SSH tunnel is set up in Putty or your shell, you can just open your browser and point it to [http://localhost:8081/ http://localhost:8081/].  Then you can log in with the credentials admin:admin and access the interface.
+
Now that the SSH tunnel is set up in Putty or your shell, you can just open your browser and point it to [http://localhost:8081/ http://localhost:8081/].  Then you can log in with the credentials (default admin:admin unless set otherwise in multi.cfg) and access the interface.
  
 
==WebUI Interface==
 
==WebUI Interface==
Line 45: Line 54:
  
 
===Debug===
 
===Debug===
This contains debugging output information from the server.  If things go wrong, please include this information in any bug reports.
+
This contains debugging output information from the server.  If things go wrong, please include this information as well as your fs2_standalone.log (found in same location as fs2_open.log) if using a Debug build in any bug reports.
  
 
==Known Issues==
 
==Known Issues==
  
This server is still in alpha stage.  So far, the current issues still exist:
+
This server is still in beta stage.  So far, the current issues still exist:
*Authentication is currently hardcoded to admin:admin
+
 
*No SSL to protect your authentication password when the hardcoding is removed, which is why the SSH tunnel is currently recommended, as that essentially solves both issues for the time being.
+
*No SSL to protect your authentication password, which is why the SSH tunnel is currently recommended, as that essentially solves the issue for the time being.
*+name value does not appear to be displaying on FS2NetD, or in game.  Changing the second Server Name value in the WebUI also seems to have no effect on that.
+
*Servers (whether WebUI standalone or otherwise) do not feature NAT punchthrough, as much of the traffic is UDP traffic. This means the standalone host must be on a public facing IP address, or you must set up port forwarding using standard FreeSpace 2 Open ports. For those on cable or ADSL modem connections, the "DMZ" feature of your modem/router will achieve the equivalent outcome.
*Servers are showing up on FS2NetD when using +use_pxo, but I have been unable to connect to the standalone using FS2NetD in game.  Disabling FS2NetD and adding the standalone's IP has worked, as has finding the standalone when on the same LAN with FS2NetD turned off. This also seems to be a problem I'm having with my Windows standalone and 3.7.0 too, so it might not be a WebUI issue at all.
 
*fs2_standalone.log does not seem to be written to the data folder.
 
  
==Sample multi.cfg==
+
==Sample multi.cfg for WebUI standalone server==
  
 
<pre>
 
<pre>
Line 65: Line 72:
 
+max_players 12
 
+max_players 12
 
+use_pxo
 
+use_pxo
+pxo #autoselect
+
+pxo #Eleh
 
+pxo_login chief_standalone
 
+pxo_login chief_standalone
+pxo_password password
+
+pxo_password [Insert Password]
+webui_root /home/chief1983/webui
+
+webui_root /home/chief1983/fs2open_webui
 +
+webapi_username [Insert Username]
 +
+webapi_password [Insert Password]
 +
+webapi_server_port 8080
 
</pre>
 
</pre>

Latest revision as of 13:02, 24 March 2014

The WebUI standalone was created by SCP member Eli2 to enable *nix and Mac machines to run a standalone FS2 server.

How to Use

Just add the -standalone command line option to your startup script, or run the game with the Standalone option enabled from wxLauncher, etc. I highly recommend avoiding wxLauncher for the time being, as it isn't really aware of the *nix standalone and I don't think it can open a monitoring terminal window for you.

Configuration

The following items are specific to the *nix <fs2_local_data_folder>/data/multi.cfg file, where the local data folder is likely ~/Library/FS2_Open/ for OS X or ~/.fs2_open/ for other *nix platforms. The rest of the file should work like a normal Windows standalone. An example file can be found at the bottom of the page.

+webui_root

  • Set this value to wherever you have placed the webui document root. You can grab it by downloading and extracting the master branch archive from Github, or by cloning the Github Webui repository, in the directory you would like to store the WebUI pages. So if you run extract or clone the repo in your home folder, your setting might look something like:
+webui_root /home/username/fs2open_webui

+webapi_username

Username for accessing the WebUI administration page.

+webapi_password

Password for accessing the WebUI administration page.

+webapi_server_port

Set to change the WebUI server to be running on a different port than the default 8080.

+use_pxo

For FS2NetD connectivity, you will also need to define +use_pxo, as you probably don't have the ability to run the GUI and turn on the PXO checkbox in the game when running the standalone on a headless server.

Connecting

The WebUI currently listens on port 8080 by default, using unencrypted HTTP. The default user and pass for administration is admin:admin. It is highly recommended to change these default settings in your multi.cfg file. To secure this, the current recommendation is to run the server behind a firewall and access it via an SSH tunnel or VPN. Since most *nix machines are themselves accessible via SSH, I will describe the basics needed to set up an SSH tunnel as pertains to this standalone.

From Windows

This page has almost the exact directions you will need to set up a tunnel from Windows to your standalone server. The two things you need to know on the SSH tunnel tab are the ip/hostname of the computer running the standalone, that will resolve on the ssh server (if you SSH into a different machine on the network than the one running the standalone), and the port number on that machine will be 8080. You can set the Source Port to whatever you like, I will use a different port for clarity (8081). So if the SSH server computer can access your standalone server on its network via the hostname 'standalone', your destination line will be standalone:8080. If you use 8081 for your client port as well, the final entry in the forwarded ports list will look like:

L8081 standalone:8080

From CLI SSH on Linux/OSX/etc

You'll need to open a terminal window, and know the normal SSH command you use to access the SSH server on the network where the standalone is running. Let's say you SSH into myip.dyndns.com, on the default port 22. Your username on the ssh server is 'me'. The standalone is running on another machine on the same network as the SSH server, named standalone. The standalone runs on port 8080. You want to be able to access the WebUI in your browser on port 8081. You need to add the -L parameter to your ssh command to resemble the following:

ssh -L 8081:standalone:8080 [email protected]

Connect to the WebUI

Now that the SSH tunnel is set up in Putty or your shell, you can just open your browser and point it to http://localhost:8081/. Then you can log in with the credentials (default admin:admin unless set otherwise in multi.cfg) and access the interface.

WebUI Interface

Below is a description of the tabs in the WebUI interface.

Server

This tab displays the server's current configuration, and allows you to set various options.

Mission

Information about the currently running mission on the server.

Chat

You can send chat messages directly to participants on the standalone, and see the messages from the players to all recipients.

Debug

This contains debugging output information from the server. If things go wrong, please include this information as well as your fs2_standalone.log (found in same location as fs2_open.log) if using a Debug build in any bug reports.

Known Issues

This server is still in beta stage. So far, the current issues still exist:

  • No SSL to protect your authentication password, which is why the SSH tunnel is currently recommended, as that essentially solves the issue for the time being.
  • Servers (whether WebUI standalone or otherwise) do not feature NAT punchthrough, as much of the traffic is UDP traffic. This means the standalone host must be on a public facing IP address, or you must set up port forwarding using standard FreeSpace 2 Open ports. For those on cable or ADSL modem connections, the "DMZ" feature of your modem/router will achieve the equivalent outcome.

Sample multi.cfg for WebUI standalone server

+name WebUI Test
+no_voice
+datarate 1000000000
+high_update
+max_players 12
+use_pxo
+pxo #Eleh
+pxo_login chief_standalone
+pxo_password [Insert Password]
+webui_root /home/chief1983/fs2open_webui
+webapi_username [Insert Username]
+webapi_password [Insert Password]
+webapi_server_port 8080