Skip to content

Latest commit

 

History

History
196 lines (138 loc) · 7.82 KB

README.md

File metadata and controls

196 lines (138 loc) · 7.82 KB

AC

CircleCI Go Report Card

Assetto Corsa server web interface

This tool provides monitoring and management for your Assetto Corsa server instances. You can create multiple configuration profiles, start/stop server instances and watch the status of them.

Screenshots at the bottom of this page!

System requirements

  • 64bit Linux or Windows server
  • MySQL or Postgres database

Install

Download releases from the GitHub release page. If you find any issues installing the server or bugs, please open an issue in the issue section on GitHub. If you don't have an account on GitHub, you can also contact me in the Assetto Corsa forums (link at bottom of page). These instructions do not provide information on how to install the Assetto Corsa server itself. On Linux, you basically install steam, login to your account and download the Windows version of the game, which also includes the Linux binary.

Install using Docker

The easiest way to install acweb is to use Docker:

  1. install Docker on your (Linux) server
  2. pull the latest release:
docker pull kugel/acweb
  1. install MySQL or Postgres on your server or use a docker image
  2. create the database schema (schema/<mysql/postgres>/schema.sql + all migration scripts in appropriate order)
  3. start the Docker container (adjust the parameters to your needs):
# expose the same port you start the server on: -p PORT:${ACWEB_HOST}
# and the ports used by Assetto Corsa (9600 TCP/UPD and 8081 for example)
docker run -d -p 80:8080 -p 9600:9600/tcp -p 9600:9600/udp -p 8081:8081 --name acweb \
    -e ACWEB_DB_TYPE=mysql \
    -e ACWEB_DB_USER=root \
    -e ACWEB_DB_PASSWORD=password \
    -e ACWEB_DB_HOST="tcp(127.0.0.1:3306)" \
    -e ACWEB_DB=acweb \
    -v /ac/install/path:/ac \
    -v /log/dir/path:/logs \
    kugel/acweb

# make sure its running
docker ps acweb

This will use a MySQL/Postgres database installed on your host machine. To use a MySQL/Postgres database running in a container, please rever to the official MySQL image. Note that you cannot simply access your database on localhost using Docker. Please refer to the Docker documentation on how you can connect to it. To start the server, you can also use a docker-compose file. I recommend to enable SSL using letsencrypt and a reverse proxy. To run server instances, you need to mount the Assetto Corsa installation directory (containing the binary) to /ac. In the UI set the execution path (Settings -> AC server folder) to /ac. To save the instance logs outside of the Docker container, you can mount /instance_logs.

Manual installation

This instruction supposes you to use Linux. On Windows you basically need to perform the same steps. You need a MySQL or Postgres database and rights to upload and execute applications. I recommend to create a user for your web interface installation with limit access to file system resources.

  1. download the latest release of acweb
  2. upload it to your server and unzip it
  3. create the database schema (schema/<mysql/postgres>/schema.sql + all migration scripts in appropriate order)
  4. set the environment variables to configure your server (use set on Windows):
# acweb host, to make it accessible from the outside use 0.0.0.0:PORT
export ACWEB_HOST=localhost:8080

# optional log file location (will be created if it doesn't exist)
export ACWEB_LOGDIR=

# optional log level (debug, info or empty for warnings and higher)
export ACWEB_LOGLEVEL=info

# log directory for server instances, must be set
export ACWEB_INSTANCE_LOGDIR=instance_logs

# config file directory for tracks.json and cars.json, default is configs (config for Docker)
export ACWEB_CONFIG_DIR=config

# path to TLS private key file
export ACWEB_TLS_PRIVATE_KEY=

# path to TLS cert file
export ACWEB_TLS_CERT=

# database type mysql or postgres, default is mysql
export ACWEB_DB_TYPE=mysql

# database user
export ACWEB_DB_USER=root

# database password
export ACWEB_DB_PASSWORD=

# database host (most likely tcp(localhost:3306))
export ACWEB_DB_HOST=

# database name:
export ACWEB_DB=acweb

# additional variables for postgres only:
export ACWEB_DB_PORT=5432
export ACWEB_DB_SSLMODE=disable
export ACWEB_DB_SSL_CERT=
export ACWEB_DB_SSL_KEY=
export ACWEB_DB_ROOT_CERT=
  1. start it ./acweb
  2. you can now visit your web interface

Updating

  1. download the latest release
  2. upload it to your server and unzip it
  3. update your MySQL database (migration scripts can be found in schema/<mysql/postgres> mig_FROMVERSION_TOVERSION.sql)
  4. start it

For Docker pull the latest release, execute the database migration script(s) and start it.

Login

On first startup, acweb creates a default user called "root" with password "root". Please change the password right after your first login!

Configuration

After your first login, you have to configure your server. To do that, switch to the "Settings" page and enter the Assetto Corsa server folder as well as the server executable (acServer for example).

Start a new server instance

Server instances can be started on the "Instances" page. You need to add configurations before and have your server configured on the "Settings" page. If you like to use plugins/tools which need additional script calls, like stracker or minorating, you can run a script before and after the actual execution of the Assetto Corsa server by adding the full script paths when starting a new instance. Note that only the script executed after the server has access to the server process ID. The pid is passed as the first argument to the script.

Adding tracks and cars

To add tracks and cars, from a mod for instance, you must add them to the cars.json and tracks.json configuration files to make them appear in the web interface:

[
    // a track
    {
        "name": "NAME",
        "config": "CONFIG_TRACK",
        "description": "Name",
        "max_slots": NUMBER_OF_SLOTS
    },
    // ...
[
    // a car
    {
        "name": "CAR_NAME",
        "description": "Car Name",
        "paintings": [
            "SKIN_0",
            "SKIN_1",
            // ...
        ]
    },
    // ...

The files can be found within the configs directory. To modify them using Docker, mount a volume to /config and copy the original files into it, then modify them.

Contribute

To contribute please open issues and pull requests. The frontend is build using VueJs, minvue and sass. The backend is build on Go (golang) and MySQL. For details please view the provided scripts within the main directory.

All Go code must be run through go fmt. The frontend and backend changes must be (manually) tested on your system. If you have issues running it locally open an issue. Unit tests are not required yet, but that's something I'll may add in the future.

Contributors (alphabetical)

macedot, vinyii

Links

License

MIT

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6