baseline: OpenMU upstream b5a0961 (fresh source)
This commit is contained in:
25
deploy/all-in-one-traefik/.dockerignore
Normal file
25
deploy/all-in-one-traefik/.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
1
deploy/all-in-one-traefik/.env.example
Normal file
1
deploy/all-in-one-traefik/.env.example
Normal file
@@ -0,0 +1 @@
|
||||
DOMAIN=domain.com
|
||||
2
deploy/all-in-one-traefik/.gitignore
vendored
Normal file
2
deploy/all-in-one-traefik/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
data-traefik/acme.json
|
||||
.env
|
||||
7
deploy/all-in-one-traefik/.htpasswd
Normal file
7
deploy/all-in-one-traefik/.htpasswd
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file contains the passwords for the admin panel and tracing.
|
||||
# Change these passwords in production!
|
||||
# default is admin:openmu, hashed with bcrypt.
|
||||
|
||||
admin:$2y$10$xYL2d/QEukwGmX0uNZubsunL0qcANuTYkpapRVdlu5q3ymCpvOEh.
|
||||
|
||||
# this file should always end with an empty line!
|
||||
140
deploy/all-in-one-traefik/README.md
Normal file
140
deploy/all-in-one-traefik/README.md
Normal file
@@ -0,0 +1,140 @@
|
||||
# All-in-one-traefik deployment
|
||||
|
||||
The all in one (with traefik) deployment is recommended, if you want to host
|
||||
on a small machine with a low amount of players and want to host your
|
||||
MuOnline Website on the same machine.
|
||||
|
||||
Once Traefik works as a Reverse Proxy, you can handle multiple websites
|
||||
without changing the default port to HTTP/HTTPS connections.
|
||||
|
||||
Adding a few labels to your container, you will tell Traefik how to
|
||||
handle incoming requests and it will redirect to the correct website.
|
||||
|
||||
```yaml
|
||||
services:
|
||||
admin-panel:
|
||||
...
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=proxy"
|
||||
- "traefik.http.routers.adm.entrypoints=websecure"
|
||||
- "traefik.http.routers.adm.rule=Host(`admin.domain.com`)"
|
||||
- "traefik.http.routers.adm.middlewares=auth"
|
||||
- "traefik.http.middlewares.auth.basicauth.usersfile=.htpasswd"
|
||||
|
||||
muonline-website:
|
||||
...
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=proxy"
|
||||
- "traefik.http.routers.muonline.entrypoints=websecure"
|
||||
- "traefik.http.routers.muonline.rule=Host(`muonline.domain.com`)"
|
||||
```
|
||||
|
||||
You can even add multiple domains and/or subdomains to your host label
|
||||
|
||||
``` yaml
|
||||
- "traefik.http.routers.muonline.rule=Host(`www.domain1.com`,`domain1.com`,`sub.domain1.com`)"
|
||||
```
|
||||
|
||||
In this case, all kinds of OpenMU subsystems (ConnectServer, GameServer, LoginServer,
|
||||
AdminPanel, ...) are running in one process, but you can run
|
||||
AdminPanel and other websites separately.
|
||||
|
||||
## Deployment with docker-compose
|
||||
|
||||
### Install GIT
|
||||
|
||||
See [https://github.com/git-guides/install-git](https://github.com/git-guides/install-git).
|
||||
|
||||
### Clone the repository
|
||||
|
||||
``` bash
|
||||
git clone https://github.com/MUnique/OpenMU.git
|
||||
```
|
||||
|
||||
It will create a new folder OpenMU with the repository contents inside.
|
||||
|
||||
### Navigate to the docker-compose files
|
||||
|
||||
Navigate to the folder `deploy/all-in-one-traefik`
|
||||
|
||||
``` bash
|
||||
cd deploy/all-in-one-traefik
|
||||
```
|
||||
|
||||
### Create a new docker network
|
||||
|
||||
You need to have communication between containers from different docker compose files
|
||||
|
||||
``` bash
|
||||
docker network create proxy
|
||||
```
|
||||
|
||||
### Option A - for local testing
|
||||
|
||||
To run the official docker image on your local traefik server, just run:
|
||||
|
||||
``` bash
|
||||
docker compose -f docker-compose.yml up -d
|
||||
```
|
||||
|
||||
And that's it. It's then available on your local computer through a loopback
|
||||
ip. Your AdminPanel URL is `http://admin.docker.localhost`. You can change it
|
||||
in the `docker-compose.yml` file.
|
||||
|
||||
However, if you want to make it available through the internet, you should choose
|
||||
Option B:
|
||||
|
||||
### Option B - with HTTPS
|
||||
|
||||
If you want to share your server with the world, it's recommended to set up HTTPS
|
||||
and Traefik can handle it for you. Otherwise, traffic from and to the admin
|
||||
panel is not encrypted.
|
||||
|
||||
#### Set your domain name as environment variable
|
||||
|
||||
Make a copy of `.env.example` called `.env` and edit the `.env` file with your
|
||||
domain/subdomain to the AdminPanel URL.
|
||||
|
||||
``` bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Make a copy of `data-traefik/acme.example.json` called `data-traefik/acme.json`
|
||||
and apply permission 600 to `acme.json`
|
||||
|
||||
``` bash
|
||||
cp data-traefik/acme.example.json data-traefik/acme.json
|
||||
chmod 600 data-traefik/acme.json
|
||||
```
|
||||
|
||||
#### Run it
|
||||
|
||||
``` bash
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
#### Important
|
||||
|
||||
Avoid editing the .htpasswd manually. Instead, access the admin panel
|
||||
and add a new user. If you are using the _all-in-one-traefik_ you
|
||||
need to restart Traefik after add a new user to it takes effect.
|
||||
|
||||
## What's next
|
||||
|
||||
The server is automatically started and initialized for Season 6. You can start
|
||||
playing, if you want :-)
|
||||
|
||||
Additionally, take a look at the AdminPanel.
|
||||
|
||||
If your containers run on docker at your local machine, you can simply go to `http://admin.docker.localhost/`.
|
||||
The default username is 'admin', the password 'openmu'. You should change that later.
|
||||
|
||||
If you want to run another game version, you can go to the setup page through
|
||||
the navigation menu, where you can select your desired game version,
|
||||
number of game servers (just the data of it), and if test accounts
|
||||
should be created.
|
||||
|
||||
If you click on 'Install', wait a bit until the database is set up and
|
||||
filled with the data and voila, OpenMU is ready to use.
|
||||
@@ -0,0 +1,26 @@
|
||||
# Dynamic configuration
|
||||
http:
|
||||
middlewares:
|
||||
nofloc:
|
||||
headers:
|
||||
customResponseHeaders:
|
||||
Permissions-Policy: "interest-cohort=()"
|
||||
secureHeaders:
|
||||
headers:
|
||||
sslRedirect: true
|
||||
forceSTSHeader: true
|
||||
stsIncludeSubdomains: true
|
||||
stsPreload: true
|
||||
stsSeconds: 31536000
|
||||
|
||||
tls:
|
||||
options:
|
||||
default:
|
||||
cipherSuites:
|
||||
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
||||
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
|
||||
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
|
||||
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
|
||||
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
|
||||
minVersion: VersionTLS12
|
||||
47
deploy/all-in-one-traefik/data-traefik/traefik.yml
Normal file
47
deploy/all-in-one-traefik/data-traefik/traefik.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
api:
|
||||
dashboard: true
|
||||
|
||||
entryPoints:
|
||||
web:
|
||||
address: :80
|
||||
http:
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
|
||||
websecure:
|
||||
address: :443
|
||||
http:
|
||||
middlewares:
|
||||
- secureHeaders@file
|
||||
- nofloc@file
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
|
||||
pilot:
|
||||
dashboard: false
|
||||
|
||||
providers:
|
||||
docker:
|
||||
endpoint: "unix:///var/run/docker.sock"
|
||||
exposedByDefault: false
|
||||
file:
|
||||
filename: /configurations/dynamic.yml
|
||||
|
||||
certificatesResolvers:
|
||||
letsencrypt:
|
||||
acme:
|
||||
email: admin@domain.com
|
||||
storage: acme.json
|
||||
keyType: EC384
|
||||
httpChallenge:
|
||||
entryPoint: web
|
||||
|
||||
buypass:
|
||||
acme:
|
||||
email: admin@domain.com
|
||||
storage: acme.json
|
||||
caServer: https://api.buypass.com/acme/directory
|
||||
keyType: EC256
|
||||
httpChallenge:
|
||||
entryPoint: web
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectVersion>2.1</ProjectVersion>
|
||||
<DockerTargetOS>Linux</DockerTargetOS>
|
||||
<ProjectGuid>4430d6a8-54b5-412b-9dba-07b3e3580af7</ProjectGuid>
|
||||
<DockerLaunchAction>None</DockerLaunchAction>
|
||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DockerServiceName>openmu-startup-traefik</DockerServiceName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".env.example" />
|
||||
<None Include="docker-compose.yml">
|
||||
</None>
|
||||
<None Include="docker-compose.prod.yml">
|
||||
</None>
|
||||
<None Include=".dockerignore" />
|
||||
<None Include=".gitignore" />
|
||||
<None Include=".htpasswd" />
|
||||
<None Include="README.md" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
71
deploy/all-in-one-traefik/docker-compose.prod.yml
Normal file
71
deploy/all-in-one-traefik/docker-compose.prod.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
services:
|
||||
openmu-startup:
|
||||
image: munique/openmu
|
||||
container_name: openmu-startup
|
||||
networks:
|
||||
- proxy
|
||||
ports:
|
||||
- "55901:55901"
|
||||
- "55902:55902"
|
||||
- "55903:55903"
|
||||
- "55904:55904"
|
||||
- "55905:55905"
|
||||
- "55906:55906"
|
||||
- "44405:44405"
|
||||
- "55980:55980"
|
||||
environment:
|
||||
DB_HOST: database
|
||||
working_dir: /app/
|
||||
volumes:
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
depends_on:
|
||||
- database
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=proxy"
|
||||
- "traefik.http.routers.openmu.entrypoints=websecure"
|
||||
- "traefik.http.routers.openmu.rule=Host(`${DOMAIN}`)"
|
||||
- "traefik.http.routers.openmu.middlewares=auth"
|
||||
- "traefik.http.middlewares.auth.basicauth.usersfile=.htpasswd"
|
||||
|
||||
database:
|
||||
image: postgres
|
||||
container_name: database
|
||||
environment:
|
||||
POSTGRES_PASSWORD: admin
|
||||
POSTGRES_DB: openmu
|
||||
POSTGRES_USER: postgres
|
||||
networks:
|
||||
- proxy
|
||||
ports:
|
||||
- "5432"
|
||||
volumes:
|
||||
- dbdata:/var/lib/postgresql #store data on volume
|
||||
|
||||
traefik:
|
||||
image: traefik
|
||||
container_name: traefik
|
||||
restart: always
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./data-traefik/traefik.yml:/traefik.yml:ro
|
||||
- ./data-traefik/acme.json:/acme.json
|
||||
- ./data-traefik/configurations:/configurations
|
||||
- "./.htpasswd:/.htpasswd"
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.docker.network=proxy"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
dbdata:
|
||||
68
deploy/all-in-one-traefik/docker-compose.yml
Normal file
68
deploy/all-in-one-traefik/docker-compose.yml
Normal file
@@ -0,0 +1,68 @@
|
||||
services:
|
||||
openmu-startup:
|
||||
image: munique/openmu
|
||||
container_name: openmu-startup
|
||||
networks:
|
||||
- proxy
|
||||
ports:
|
||||
- "55901:55901"
|
||||
- "55902:55902"
|
||||
- "55903:55903"
|
||||
- "55904:55904"
|
||||
- "55905:55905"
|
||||
- "55906:55906"
|
||||
- "44405:44405"
|
||||
- "55980:55980"
|
||||
environment:
|
||||
DB_HOST: database
|
||||
working_dir: /app/
|
||||
volumes:
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
depends_on:
|
||||
- database
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=proxy"
|
||||
- "traefik.http.routers.openmu.entrypoints=web"
|
||||
- "traefik.http.routers.openmu.rule=Host(`admin.docker.localhost`)"
|
||||
- "traefik.http.routers.openmu.middlewares=auth"
|
||||
- "traefik.http.middlewares.auth.basicauth.usersfile=.htpasswd"
|
||||
|
||||
database:
|
||||
image: postgres
|
||||
container_name: database
|
||||
environment:
|
||||
POSTGRES_PASSWORD: admin
|
||||
POSTGRES_DB: openmu
|
||||
POSTGRES_USER: postgres
|
||||
networks:
|
||||
- proxy
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- dbdata:/var/lib/postgresql #store data on volume
|
||||
|
||||
traefik:
|
||||
image: "traefik"
|
||||
container_name: "traefik"
|
||||
restart: always
|
||||
command:
|
||||
- "--log.level=DEBUG"
|
||||
- "--api.insecure=true"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--entrypoints.web.address=:80"
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "./.htpasswd:/.htpasswd"
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
dbdata:
|
||||
Reference in New Issue
Block a user