Coder Social home page Coder Social logo

ric866 / openttd-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreashauschild/openttd-server

0.0 0.0 0.0 2.61 MB

License: Apache License 2.0

Shell 0.30% JavaScript 0.29% Java 23.06% PowerShell 0.15% TypeScript 25.49% HTML 49.90% Dockerfile 0.53% SCSS 0.28%

openttd-server's Introduction

Build OpenTTD Server Release OpenTTD Server
Docker Pulls Docker Stars Docker Image Size Github stars Github forks Github issues Github last-commit

Welcome to OpenTTD Server

This Docker container allows you to host multiple instances of OpenTTD dedicated servers in a single container, providing an efficient and convenient environment for hosting these servers.

This documentation expect a basic knowledge of docker (expose ports and volumes).

The current state of this Project is BETA. Hosting works and every function was tested but as you now a developer should not test his own software. Please create an issue if something needs to be fixed.

It provides the following features:

  • Login protected admin gui
  • Managing multiple dedicated OpenTTD server instance. You just need to expose the needed ports on container startup.
  • Upload/Download of save games and configuration files
  • Password protection for dedicated servers
  • Auto save of running servers
  • Auto pause and unpause on inactive servers. If no player is playing the server is running but paused. Server unpauses if a player joins a company.
  • Simple terminal to send commands directly to the dedicated server

Versions

The following table shows which docker image contains which OpenTTD version. For now, I will only support final versions (no beta).

Container OpenTTD
hauschi86/openttd-server:latest 14.0
hauschi86/openttd-server:v14.0.0 14.0
hauschi86/openttd-server:v13.4.0 13.4
hauschi86/openttd-server:v13.0.0 13.0
hauschi86/openttd-server:v12.2.2 12.2

Screenshots

Server Management

Dedicated Server Settings

Terminal

File Upload

Admin Login

Networking

By default, docker does not expose the containers on your network. This must be done manually with -p parameter (see here for more details on -p). For the container to work you need to expose at least 2 ports. The port 8080 for the web application and the port for your openttd dedicated server (default: 3979)

File Locations

All data and uploads within the container are saved in the /home/openttd/server directory. Opentdd is installed on /home/openttd/openttd-<version> directory.

Setup

When you start the Docker container for the OpenTTD server for the first time, it will log the password for the admin login. See fragment below. You can use the admin user to log in to the web app, which runs on http://localhost:8080 by default. Once logged in, you can access the web app's settings to change the admin password.

First startup log fragment with password

...
###########################################################################
### No initial password was set. A password for 'admin' will be generated.
### Copy it NOW, because it will never be shown again.
### Password: W!318Y-yBb
###########################################################################
...

Examples

Info: If you have a specific version of the container that you prefer to use, you can replace the example version with your chosen version. This will ensure that you are using the version of the container that best meets your needs and preferences.

Run OpenTTD Server with 1 exposed port. In this case you can host only 1 server.

docker run -d -p 8080:8080 -p 3979:3979/tcp -p 3979:3979/udp hauschi86/openttd-server:latest

Run OpenTTD Server with 20 exposed port. In this case you can host 20 server.

docker run -d -p 8080:8080 -p 3979-3999:3979-3999/tcp -p 3979-3999:3979-3999/udp hauschi86/openttd-server:latest

The container uses a simple file storage to store data. If you want to have persistent storage you should create a volume and bind it.

docker run -d -v openttd-server-volumne:/home/openttd/server -p 8080:8080 -p 3979-3999:3979-3999/tcp -p 3979-3999:3979-3999/udp hauschi86/openttd-server:latest

Usage Development Mode

Quarkus remote docker container development

Debug and develop in Quarkus Container:

  • Add properties to application.properties
quarkus.package.type=mutable-jar
quarkus.live-reload.password=Password_1
quarkus.live-reload.url=http://localhost:8080
  • Add env values to dockerfile expose debug port and add remote debug to startup:
EXPOSE 5005
ENV QUARKUS_LAUNCH_DEVMODE=true
ENV JAVA_ENABLE_DEBUG=true

CMD ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005", "-jar", "/deployments/quarkus-run.jar"]
  • Start dev environment in remote debug mode (but disable local debug):
    • mvn quarkus:remote-dev -Ddebug=false -Dquarkus.live-reload.url=http://localhost:8080

Helpful commands:

Description Command
Create Module with routing npx ng g m HomeIndex --flat --routing
Create Component and add to module npx ng g m LoginIndex --flat && npx ng g c LoginIndex --flat -m .\login-index.module.ts

Structure Based on:

openttd-server's People

Contributors

andreas-hauschild-inacta avatar andreashauschild avatar ric866 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.