From: miniduikboot Date: Sun, 17 Dec 2023 19:22:36 +0000 (+0100) Subject: Update docs to reflect http plugin merge (#546) X-Git-Tag: v1.9.0~7 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=b5ea1d8864d4e37c2bc9ba6d3763bd2d5752bd72;p=rhonda%2Fimpostor.git Update docs to reflect http plugin merge (#546) Co-authored-by: js6pak --- diff --git a/docs/Http-server.md b/docs/Http-server.md new file mode 100644 index 0000000..f74eeff --- /dev/null +++ b/docs/Http-server.md @@ -0,0 +1,65 @@ +# HTTP Server + +Since Impostor 1.9.0 a HTTP service is included for matchmaking. Recent versions of Among Us require this service in order to connect correctly and not kick players after a round. + +Depending on whether you want to support mobile players, you can set up the HTTP server in one of two ways: + +- Directly expose the HTTP server. Simpler, but only works if you don't want to support mobile players +- Use a reverse proxy to expose the HTTP safer. More complex, but allows mobile players to connect + +## Directly expose the HTTP server. + +In config.json, set "ListenIp" to "0.0.0.0" in the "HttpServer" section. If you don't have this section, look in the example [config.json](https://github.com/Impostor/Impostor/blob/master/src/Impostor.Server/config.json) + +## Use a reverse proxy + +A reverse proxy allows you to forward HTTP requests from users to multiple services. If you already have one, you should configure it to add Impostor. This page contains an Nginx configuration you can use for reference. + +If you have never set up a reverse proxy before, we recommend you to set up [Caddy](https://caddyserver.com/). It is easy to set up and comes with support for requesting SSL certificates out of the box. + +### Caddy + +To install Caddy, follow the [official installation guide](https://caddyserver.com/docs/install). Then use the following lines as your `Caddyfile` configuration file: + +``` +example.com # replace example.com with your domain name + +reverse_proxy :22023 +``` + +Now run `caddy run` in the folder with this Caddyfile and it should set up a server for you with a free SSL certificate. +If this works, you should set up [Caddy to run in the background](https://caddyserver.com/docs/running) + +### Nginx + +Nginx is an alternative to Caddy that is a bit harder to set up. If you already use Nginx, you can use our snippet to add Impostor: + +
Nginx configuration + +```nginx +server { + listen 443 ssl http2; + server_name example.com; # replace example.com with your domain name + + # Assuming you're using Certbot, replace example.com with your domain name + ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/example.com/fullchain.pem; + + location / { + proxy_pass http://localhost:22023; # Change the port to your HttpServer's ListenPort + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + } +} + +# Redirect all traffic to HTTPS +server { + listen 80 default_server; + location / { + return 307 https://$host$request_uri; + } +} +``` + +
diff --git a/docs/Running-the-server.md b/docs/Running-the-server.md index db8ccee..4443dd3 100644 --- a/docs/Running-the-server.md +++ b/docs/Running-the-server.md @@ -10,19 +10,19 @@ To connect to the server, you need to configure and install a region file on htt Among Us connects to the server using two network services: the (TCP) HTTP service points Among Us to the UDP service, then the UDP service hosts the actual game traffic. Because of this, Impostor uses port 22023 using **both** the TCP and UDP protocols. -As the phone version of Among Us requires this HTTP connection to be secure, we recommend using a HTTP reverse proxy to terminate SSL on the HTTP service. Setup instructions for this are in the [Impostor.Http readme](https://github.com/Impostor/Impostor.Http#readme). +As the phone version of Among Us requires this HTTP connection to be secure, we recommend using a HTTP reverse proxy to terminate SSL on the HTTP service. Setup instructions for this are in the [Http Server documentation](Http-server.md). Depending on your host you may also need to port forward Impostor to the internet or pass Impostor traffic by your firewall. Port 22023 UDP needs to be accessible for everyone that wants to play on the server, then you also need to portforward your HTTP reverse proxy or port 22023 TCP if you don't use a reverse proxy. As port forwarding changes per host or router configuration, port forwarding is not covered by this guide. ## Normal installation 1. Install [.NET 7.0](https://dotnet.microsoft.com/download/dotnet/7.0). We recommend either the ASP.NET Core Runtime or the SDK. The SDK is necessary in case you want to develop Impostor or Impostor plugins. -2. Download the [latest release](https://github.com/Impostor/Impostor/releases) or the [latest CI build](https://nightly.link/Impostor/Impostor/workflows/ci/master). Note that Impostor is built for multiple CPU-architectures and operating systems, you most likely want the x64 version, unless you are running on a Raspberry Pi or another device with an Arm processor. +2. Download the [latest release](https://github.com/Impostor/Impostor/releases) or the [latest CI build](https://nightly.link/Impostor/Impostor/workflows/ci/master). Note that Impostor is built for multiple CPU-architectures and operating systems, you most likely want the x64 version, unless you are running on a Raspberry Pi or another device/VPS with an Arm processor. 3. Extract the zip. -4. Download the [Impostor.Http](https://github.com/Impostor/Impostor.Http) plugin and put it in your `plugins` folder. Please note the Reverse Proxy configuration: you either need to configure a reverse proxy to terminate SSL or expose the service to the world by changing ListenIp. -5. Modify `config.json` to your liking. Documentation can be found [here](Server-configuration.md). You need to at least change `PublicIp` to the address people will connect to your server to. -6. Run `Impostor.Server` (Linux/macOS) or `Impostor.Server.exe` (Windows) -7. (OPTIONAL - Linux) Configure a systemd definition file and enable the service to start on boot - [systemd configuration](Server-configuration.md#systemd) +4. Modify `config.json` to your liking. Documentation can be found [here](Server-configuration.md). You need to at least change `PublicIp` to the address people will connect to your server to. +5. Run `Impostor.Server` (Linux/macOS) or `Impostor.Server.exe` (Windows) +6. (OPTIONAL - Linux) Configure a systemd definition file and enable the service to start on boot, see [systemd configuration](Server-configuration.md#systemd) +7. (OPTIONAL) Set up a reverse proxy to support HTTPS, so mobile phones can connect, see [reverse proxy configuration](Http-server.md) ## Using Docker @@ -37,7 +37,7 @@ After installing Docker, you can just start a Docker container with `docker run` docker run -p 127.0.0.1:22023:22023/tcp -p 22023:22023/udp -e IMPOSTOR_Server__PublicIp=your.public.ip.here aeonlucid/impostor:nightly ``` -Please replace `your.public.ip.here` with the public IP address of your server. This is the address Among Us will try to reach your client at. +Please replace `your.public.ip.here` with the public IP address of your server. This is the address Among Us will try to reach your server at. To configure the docker container, either use environment variables or mount config.json in your container. @@ -53,7 +53,7 @@ services: image: aeonlucid/impostor:nightly container_name: impostor ports: - - 127.0.0.1:22023:22023/tcp + - 127.0.0.1:22023:22023/tcp # Remove "127.0.0.1:" if you want to expose Impostor's HTTP server directly to the internet - 22023:22023/udp environment: # Either configure Impostor using environment variables or mount a copy of config.json - IMPOSTOR_Server__PublicIp=your.public.ip.here diff --git a/docs/Server-configuration.md b/docs/Server-configuration.md index 642c0bc..0c33d13 100644 --- a/docs/Server-configuration.md +++ b/docs/Server-configuration.md @@ -11,7 +11,17 @@ Some information about all the possible configurations. Click [here](https://git | **PublicIp** | `127.0.0.1` | This needs to the public IPv4 address of the server which you give to others to connect. You can find your IPv4 address [on this website](http://whatismyip.host/). Unless you are only planning to use Impostor privately, on your local network, you should change this to your public ip. It is also possible to use hostnames instead of IPv4 addresses, which will be resolved to IPv4 addresses. | | **PublicPort** | `22023` | The public port of the server which you give to others to connect. (**This is the external port you configure on your router when port forwarding.**) Usually `22023`. | | **ListenIp** | `0.0.0.0` | The network interface to listen on. If you do not know what to put here, use `0.0.0.0`. Since 1.2.2 it is also possible to use hostnames instead of IPv4 addresses, these must resolve to a valid IPv4 address. | -| **ListenPort** | `22023` | The listen port of the server, usually `22023`. | +| **ListenPort** | `22023` | The listen port of the server, usually `22023`. For port forwarding purposes: this is an UDP port | + +### HttpServer + +Impostor has an Http Server that is used by recent versions of Among Us to connect to. See [the Http Server page](Http-server.md) for more details on how to set this up. + +| Key | Default | Description | +|----------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Enabled** | `true` | Whether the http server should be enabled. | +| **ListenIp** | `127.0.0.1` | The network interface to listen on. Use `127.0.0.1` if you use a reverse proxy or just run locally. Use `0.0.0.0` if you are directly exposing this server to the internet (not recommended) | +| **ListenPort** | `22023` | The listen port of this server. For port forwarding purposes, this is an TCP port. | ### AntiCheat @@ -158,4 +168,4 @@ If everything has started correctly, ensure the service is set to start on boot. ``` sudo systemctl enable impostor.service -``` \ No newline at end of file +``` diff --git a/docs/Upgrading.md b/docs/Upgrading.md new file mode 100644 index 0000000..7b7be31 --- /dev/null +++ b/docs/Upgrading.md @@ -0,0 +1,12 @@ +# Upgrading Impostor + +Sometimes we make incompatible changes to existing code. This document lists these changes and which changes you should make as a server administrator. + +## Impostor 1.9.0 + +Previously we recommended using the Impostor.Http plugin for HTTP matchmaking. Because Among Us now relies on HTTP matchmaking, this plugin is now part of the default installation. As a result, you should change your server as follows: + +- If you have Impostor.Http installed, you should remove that plugin. If you have changed the default settings, you need to move these changes to the [HttpServer section in config.json](Server-configuration.md#HttpServer). +- If you have plugins that required Impostor.Http's API (like Reactor.Impostor.Http), you should check that plugin for updates +- It is no longer necessary to add the ASP.NET Core folder to the PluginLoader's LibraryPaths +