
This reverts commit f9d6cc4bdc
.
Gaseous Server
This is the server for the Gaseous system. It offers ROM and title management, as well as some basic in browser emulation of those ROM's.
Warning
This project is currently not suitable for being exposed to the internet.
- there is currently no authentication support, meaning anyone could trash your library
- the server has not been hardened for exposure to the internet - so there maybe unknown vulnerabilities
If you expose the server to the internet, you do so at your own risk.
Screenshots
Requirements
- MySQL Server 8+*
- Internet Game Database API Key. See: https://api-docs.igdb.com/#account-creation
*Note: MariaDB is currently not supported as Gaseous uses features present only in MySQL. This is being tracked in https://github.com/gaseous-project/gaseous-server/issues/93
Third Party Projects
The following projects are used by Gaseous
- https://dotnet.microsoft.com/en-us/apps/aspnet
- https://github.com/JamesNK/Newtonsoft.Json
- https://www.nuget.org/packages/MySql.Data/8.0.32.1
- https://github.com/kamranayub/igdb-dotnet
- https://github.com/EmulatorJS/EmulatorJS
Discord Server
Setup
Configuration File
When Gaseous-Server is started for the first time, it creates a configuration file at ~/.gaseous-server/config.json if it doesn't exist. Some values can be filled in using environment variables (such as in the case of using docker).
DatabaseConfiguration
Attribute | Environment Variable |
---|---|
HostName | dbhost |
UserName | dbuser |
Password | dbpass |
IGDBConfiguration
Attribute | Environment Variable |
---|---|
ClientId | igdbclientid |
Secret. | igdbclientsecret |
config.json
{
"DatabaseConfiguration": {
"HostName": "localhost",
"UserName": "gaseous",
"Password": "gaseous",
"DatabaseName": "gaseous",
"Port": 3306
},
"IGDBConfiguration": {
"ClientId": "<clientid>",
"Secret": "<secret>"
},
"LoggingConfiguration": {
"DebugLogging": false,
"LogFormat": "text"
}
}
Docker
Deploy with the prebuilt Docker image
Dockerfile and docker-compose.yml files have been provided to make deployment of the server as easy as possible.
- Download the docker-compose.yml file
- Open the docker-compose.yml file and edit the igdbclientid and igdbclientsecret to the values retrieved from your IGDB account
- Run the command
docker-compose up -d
- Connect to the host on port 5198
Build and deploy a Docker image from source
Dockerfile and docker-compose-build.yml files have been provided to make deployment of the server as easy as possible.
- Clone the repo with
git clone https://github.com/gaseous-project/gaseous-server.git
- Change into the gaseous-server directory
- Clone the submodules with the command
git submodule update --init
- Open the docker-compose-build.yml file and edit the igdbclientid and igdbclientsecret to the values retrieved from your IGDB account
- Run the command
docker-compose --file docker-compose-build.yml up -d
- Connect to the host on port 5198
Source
Build and deploy
- Install and configure a MySQL instance
- Install the dotnet 7.0 packages appropriate for your operating system
- Create a database user with permission to create a databse. Gaseous will create the new database and apply the database schema on it's first startup.
- Clone the repo with
git clone https://github.com/gaseous-project/gaseous-server.git
- Change into the gaseous-server directory
- As the main branch is the development branch, you might want to change to a stable version - these are tagged with a version number. For example to change to the 1.5.0 release, use the command
git checkout v1.5.0
- Check the releases page for the version you would like to run: https://github.com/gaseous-project/gaseous-server/releases
- Clone the submodules with the command
git submodule update --init --recursive
- This command will clone the code that the server uses from other projects (currently only EmulatorJS)
- Create a directory in the home directory of the user that will run the server. For example, if running as the user
gaseous
, create the directory/home/gaseous/.gaseous-server
- Change into the
.gaseous-server
directory created in the previous step - Copy the JSON from the config file above into a new file named
config.json
- Update the database section with the database server hostname, username, password, and port
- Compile the server by changing back to the repo cloned earlier and executing:
dotnet restore "gaseous-server/gaseous-server.csproj"
dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained false -c Release -o <output directory>
- replace
<output directory>
with the directory of your choosing. The compiled application will be copied there. For this example we'll use/opt/gaseous-server
- The server can then be started by executing
dotnet /opt/gaseous-server/gaseous-server.dll
- If you would like the server to run on a different ip address and port (for example 0.0.0.0:8080), add the --urls argument:
dotnet /opt/gaseous-server/gaseous-server.dll --urls http://0.0.0.0:8080
- If you would like the server to run on a different ip address and port (for example 0.0.0.0:8080), add the --urls argument:
Note: The above instructions were tested on macOS Ventura, and Ubuntu 22.04.3. There was a report that Debian 11 had an issue with the git submodule commands (see: https://github.com/gaseous-project/gaseous-server/issues/71). This was possibly due to an older git package.
If the git submodule commands aren't working, you can:
- change to the
gaseous-server/wwwroot/emulators
directory - delete the
EmulatorJS
directory - clone the EmulatorJS repository with
git clone https://github.com/EmulatorJS/EmulatorJS.git
Updating from source
- Stop the server
- Switch to the source directory
- Update your repo:
- If running from the main branch, run
git pull
to update the repo - If running from another branch or tag, run:
git fetch
git checkout <branch or tag name>
- If running from the main branch, run
- Update the submodules with
git submodule update --recursive
- Run steps 12 and 13 from the above Build guide
Adding Content
While games can be added to the server without them, it is recommended adding some signature DAT files beforehand to allow for better matching of ROMs to games.
These signature DAT files contain a list of titles with hashes for many of the ROM images that have been found by the community.
Currently supported DAT's:
- TOSEC: https://www.tosecdev.org/downloads/category/56-2023-01-23
- MAME Arcade and MAME Mess: https://www.progettosnaps.net/dats/MAME
If there are other DAT's you'd like to see support for, please raise an issue with a link to the DAT's.
Adding signature DAT files
TOSEC
- Download the DAT files from the source website. For example; from https://www.tosecdev.org/downloads/category/56-2023-01-23
- Extract the archive
- Copy the DAT files to ~/.gaseous-server/Data/Signatures/TOSEC/
MAME Arcade
- Download the DAT files from the source website. For example; from https://www.progettosnaps.net/dats/MAME
- Extract the archive
- Copy the file name "MAME 0.257 (arcade).dat" files to ~/.gaseous-server/Data/Signatures/MAME Arcade/
MAME MESS
- Download the DAT files from the source website. For example; from https://www.progettosnaps.net/dats/MAME
- Extract the archive
- Copy the file name "MAME 0.257 (mess).dat" files to ~/.gaseous-server/Data/Signatures/MAME MESS/
Adding Game Images
- Files can be presented as either stand alone files, or as zip files - currently 7z is unsupported.
- Name the file appropriately.
- Attempting a search for the game name on https://www.igdb.com can help with file naming. If a hash search is unsuccessful, Gaseous will fall back to attempting to search by the file name.
- Add the file to the server:
- Click the Upload button in the top right of the main Gaseous web page, and drag the files into the modal. The files will be uploaded and analyzed.
- Copy the file to ~/.gaseous-server/Data/Import
Game Image Title Matching
Image to game matching follows the following order of operations, stopping the process at the first match:
Get the file signature
- Attempt a hash search
- Attempt to search the signature database for a rom matching the file name - sometimes the hash can not be matched as a highscore table for example was saved to the image
- Attempt to parse the file name - clues such as the extension being used to define which platform the file belongs to are used to create a search criteria
Note: If the file being scanned is a zip, the file will be extracted and searched. The first file whose signature can be found will be used to match the entire zip archive - be sure that the zip only contains files related to one game.
Create a list of search candidates
Before beginning, remove any version numbers, and anything in the search string that is between ()
- Add the full name of the image
- Add the name of the image with any " - " replaced by ": "
- Add the name of the image with text after a " - " removed
- Add the name of the image with text after a ": " removed
Search IGDB for a game match
Loop through each of the search candidates searching using:
- "where" - exact match as the search candidate
- "wherefuzzy" - partial match using wildcards
- "search" - uses a more flexible search method
- "searchNoPlatform" - uses the "search" method, but does not constrain the search to the determined platform
Note: If more than one result is found, the seach will loop through the returned results:
- If an exact (case-insensitive) match is found, that result is used for the match
- If still no match, the image will be set as "Unknown" as there is no way for Gaseous to know which title is the correct one.