Best laravel framework open-source packages.

Valheim Server Web GUI

This is a web GUI that can live on top of a Valheim server, giving you a web interface for controlling some of the basic functions of managing a server. This is database-less, no SQL required. Can publicly show mods, lets you edit your CFG files via a web interface, can show your world seed ID (publicly or not), can start/stop/restart valheimserver.service and can download your .db and .fwl files.
Updated 3 months ago

Valheim-Server-Web-GUI (V1.01 4/20/2021)

Features

  • Web page that publicly shows the status of valheimserver.service
  • Has a public facing Copy to clipboard button for easy pasting into Valheim
  • Looks at your /BepInEx/config folder and can publicly display mods installed with a link to their Nexus page or display a defined list of mods
  • Can show (publicly or not) the Seed of the running world with a custom link to http://valheim-map.world/

When Logged in

  • Gives you the ability to edit the CFG mod files with an in-browser editor
  • Turn off/on the valheimserver.service process
  • Download a copy of your .DB and .FWL files

Beta Features (See Beta section below for enabling)

  • View a system log
  • Panel for adding/removing players from the admin and ban list

This GUI works/looks best in Chrome, ironing out non-Chrome errors is on the to-do list

Credits

Simple no database login from https://gist.github.com/thagxt/94b976db4c8f14ec1527
In-browser editor code from https://github.com/pheditor/pheditor
This would not work without https://github.com/Nimdy/Dedicated_Valheim_Server_Script

Screenshots

alt text

alt text

alt text

Install instructions

These instrcutions assume you are working on Ubuntu server as outlined by Nimdy.

  1. Follow Nimdy's instuctions for setting up and configuring your Valheim server ( https://github.com/Nimdy/Dedicated_Valheim_Server_Script#readme )

  2. Install PHP and Apache2

sudo apt install php libapache2-mod-php

Verify that the install was successful by putting the IP of the server in your web browser. You should see the default Apache2 Ubuntu page. If you have connection issues with this default page, you should verify that HTTP is enabled on the VM.

Note: If you click the little open arrow in the GCP VM management panel next to the server IP it will go to https://your-IP, which will not work without further configuration.

  1. Remove the default html folder from /var/www/ and then install repository to /var/www/
sudo rm -R /var/www/
cd ~
git clone https://github.com/Peabo83/Valheim-Server-Web-GUI.git
sudo cp -R ~/Valheim-Server-Web-GUI/www/ /var/

Now when visting the IP of the server you should see the main GUI screen.

  1. Change the default username/password/hash keys. Using your preferred text editor open /var/www/VSW-GUI-CONFIG, you will see the inital section with the variables to change:
// *************************************** //
// *              VARIABLES              * //
// *************************************** //
	$username = 'Default_Admin';
	$password = 'ch4n93m3';
	$random1 = 'secret_key1';
	$random2 = 'secret_key2';
	$hash = md5($random1.$pass.$random2); 
	$self = $_SERVER['REQUEST_URI'];
	$show_mods = true;
	$cfg_editor = false;
	$make_seed_public = false;

Change $username and $password to your preffered values. Change $random1 and $random2 to any variables of your choice, like 'Valheim365' and 'OdinRules'.

  1. To execute systemctl commands the PHP user (www-data) needs to be able to run systemctl commands, which by default it can not. The following will allow www-data to run the specific commands used to make the GUI work.
sudo visudo

This will open your sudo file, add the following at the bottom:

# Valheim web server commands
www-data ALL = (root) NOPASSWD: /bin/systemctl restart valheimserver.service
www-data ALL = (root) NOPASSWD: /bin/systemctl start valheimserver.service
www-data ALL = (root) NOPASSWD: /bin/systemctl stop valheimserver.service
www-data ALL = (root) NOPASSWD: /bin/cp -R /home/steam/.config/unity3d/IronGate/Valheim/worlds/* /var/www/html/download/

Then hit CTRL + X to exit VI, you will be prompted to save, so press Y and then Enter. VI will then ask where to save a .tmp file, just hit Enter again. After you save the .tmp visudo will check the file for errors, if there are none it will push the content to the live file automatically.

  1. Optional - Enable the CFG Editor. Using your preferred text editor open /var/www/VSW-GUI-CONFIG and toggle the value of $cfg_editor from false to true, as so:
$cfg_editor = 'true';

VIA a terminal window set new permissions on the BepInEx/config folder and the the files in it.

sudo chmod -R 664 /home/steam/valheimserver/BepInEx/config/
sudo chmod 755 /home/steam/valheimserver/BepInEx/config/

Set the default of new files in the folder to the correct permissions.

sudo chmod g+s /home/steam/valheimserver/BepInEx/config/
sudo setfacl -d -m g::rwx /home/steam/valheimserver/BepInEx/config/

Then add www-data to the steam group.

sudo usermod -a -G steam www-data

Now reboot the server to ensure these new settings are in effect.

sudo reboot now

Once the reboot is complete reload your browser and (when logged in) you will see a new tab named Mod CFG Editor that can be used to edit your CFG files.

Making Mods Show up on the Public list of Mods

Find a mods nexusID

A mod's nexusID appears in the URL of the mod, for example the URL for ValheimPlus is: https://www.nexusmods.com/valheim/mods/4 - That number at the end is the ID, so in the case of ValheimPlus the nexusID is 4. To have this mod display in the list you would add the following to valheim_plus.cfg:

NexusID = 4

Add NexusID to the CFG File

Some mods will work automatically, but some will not. If you have a mod installed and it's not displaying you will need to add the mods nexus ID to it's CFG file like this:

NexusID = ###

Please note that this formatting must be exact, including the spaces around the equals sign.

Manually add mods to the displayed list

Using your preferred text editor open /var/www/VSW-GUI-CONFIG, you will see the following option:

// Manually add nexus mods to displayed mods insert mod IDs comma delineated as such:
// $manual_add_displayed_mods = array('4', '189', '387');
$manual_add_displayed_mods = array();

The inline comments describe how to manually add a displayed Nexus mod, simply add the NexusID value in array() as shown in the example.

Beta Features

Server Log

Using your preferred text editor open /var/www/VSW-GUI-CONFIG, you will see the following option:

$server_log = false;

Change this setting to true and then (here comes the beta part) add one additional line to your sudoers file.

sudo visudo

at the bottom add the following line:

www-data                ALL=(ALL) NOPASSWD: ALL

Now when you are logged into the GUI under your server tab you will see 'server log' expandable tab.

alt text

Admin and Ban Panel

Using your preferred text editor open /var/www/VSW-GUI-CONFIG, you will see the following option:

$server_log = false;

Change this setting to true and then (here comes the beta part) add one additional line to your sudoers file.

sudo visudo

at the bottom add the following line (This only needs to be added once):

www-data                ALL=(ALL) NOPASSWD: ALL

Now when you are logged into the GUI you will see a new tab called Admins & Bans where you can set users to admins or ban them. alt text

To-do

Add additional error checking on systemctl commands
Add log output to server section w/ live update via jquery
Upload .zip to be uncompressed and imported to /BepInEx/plugins
Do a compatiblity pass on non-chrome browsers