Skip to content

Commit

Permalink
🎨 Repository cleanup (#26)
Browse files Browse the repository at this point in the history
* Update alpine Docker tag to v3.11.6

* 🔥 removing unused lib folder, moved tools folder to dedicated repository

* 🔧 moved script to dedicated folder, updated doc and Docekrfile

* 🎨 add an editor config

Co-authored-by: Renovate Bot <[email protected]>
  • Loading branch information
bgauduch and renovate-bot authored Apr 24, 2020
1 parent 868493f commit e6d7797
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# manually include files that need to be copied
!bin/
!entrypoint.sh
!scripts/entrypoint.sh
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = spaces
insert_final_newline = true
trim_trailing_whitespace = true
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY bin/cod2_lnxded_1_3_nodelay_va_loc /bin/cod2_lnxded
RUN chmod +x /bin/cod2_lnxded

# Copy entrypoint and make it runnable
COPY entrypoint.sh /entrypoint.sh
COPY scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Runtime stage
Expand All @@ -55,7 +55,7 @@ COPY --from=build /bin/cod2_lnxded /server/cod2_lnxded
# Copy the entrypoint from build stage
COPY --from=build /entrypoint.sh /entrypoint.sh

# Expose server ports
# Exposed server ports
EXPOSE 20500/udp 20510/udp 28960/tcp 28960/udp

# Set the server dir
Expand All @@ -65,4 +65,4 @@ WORKDIR /server
VOLUME [ "/server/main" ]

# Launch server at container startup, using libcod library
ENTRYPOINT [ "/entrypoint.sh"]
ENTRYPOINT [ "/entrypoint.sh"]
63 changes: 37 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
# Call of Duty 2 server meets docker
Launch a minimal & lightweight containarized [Call of Duty 2](https://en.wikipedia.org/wiki/Call_of_Duty_2) multiplayer game server.

## Supported tags and respective `Dockerfile` links
## 📦 Supported tags and respective `Dockerfile` links
* `bgauduch/cod2server:latest` - [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/master/Dockerfile)
* `bgauduch/cod2server:1.0` - [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/v1.0/Dockerfile)

## What's inside
## 🔧 What's inside
Currently it use:

* The `cod2_lnxded_1_3_nodelay_va_loc` server binary from [Killtube](https://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)) by **Kung Foo Man**, **Mitch** and anyone that contributed;
* The [custom `libcod`](https://github.com/voron00/libcod) from **Voron00**, follow the repository forks for a complete list of creators and contributors.
* The `cod2_lnxded_1_3_nodelay_va_loc` server binary from [Killtube](https://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)) by [Kung Foo Man](https://github.com/kungfooman), [Mitch](https://github.com/M-itch) and anyone that contributed;
* The [custom `libcod`](https://github.com/voron00/libcod) from [Voron00](https://github.com/voron00), follow the repository forks for a complete list of creators and contributors.

Full credits goes to them for their awesome work !

## Prerequisites
## 📝 Requirements
You will need the following things:

1. The orginal game, as it's contents are used by the dedicated server;
1. A host machine of your choice with x86_64 architecture;
1. [Docker](https://docs.docker.com/install/linux/docker-ce/debian/) and [Docker Compose](https://docs.docker.com/compose/install/) installed and configured on your host machine, minimal knowledge in using both is recommended.

## Setup
## 🚀 Usage

### Launch the server
Clone or download the repository and follow theses steps to get the server up and running:

1. Copy the required data from the game to the server:
Expand All @@ -37,10 +38,10 @@ Clone or download the repository and follow theses steps to get the server up an
``` bash
docker-compose up -d
```
1. Depending on your setup, you might have some port-forwarding and firewalling to do in order to make your server publicly available.
1. Depending on your setup, you might have some port-forwarding and firewalling to do in order to make your server publicly available (see required open ports in the `EXPOSE` section of the [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/master/Dockerfile)).
1. And "voila" ! Availables server commands are listed in [/doc/readme.md](doc/readme.md).

## Server interaction
### Server interactions
From the project root, you can:

* Restart the server (to pick up config change for instance):
Expand All @@ -57,42 +58,52 @@ From the project root, you can:
docker-compose down
```

## Development guidelines
## 💻 Development guidelines
If you wish to [contribute to and improve](#contribution) this project, you can do so by cloning it and then follow theses guidelines :

### Launch the service locally
In order to test your changes, you can use this command to build the local Docker image and launch the service:
```bash
./dev-up.sh
```
> Remember that you will need the game files in the main folder, as specified in the ["prerequisite"](#prerequisites) section.
### Launch the server locally
In order to test your changes, you can use this script to build the local Docker image and launch the service:
```sh
./scripts/dev-up.sh
```
> Remember that you will need the game files in the main folder, as specified in the ["Requirements"](#requirements) section.

### Show server logs
You can use this script to display and follow the server logs:
```sh
./scripts/dev-logs.sh
```

### Cleanup
To remove everything once your tests are over, you can do the following:
```bash
./dev-down.sh
You can use this script to remove everything once your tests are over:
```sh
./scripts/dev-down.sh
```

## Notes
## 🗂️ Notes & resources

* Threads on setting up a cod2 server are availables on [Killtube](https://killtube.org/forum.php):
* [on ubuntu 14.04](https://killtube.org/showthread.php?2454-Work-in-progress-Setup-CoD2-on-your-ubuntu-14-04-server) by IzNoGoD
* [using Docker](https://killtube.org/showthread.php?3167-CoD2-Setup-CoD2-with-Docker) by Lonsofore
* There is a similar repository on github proposing a Call of Duty 2 server based on CentOS: [hberntsen/docker-cod2](https://github.com/hberntsen/docker-cod2)
* A thread on setting up a cod2 server on ubuntu 14.04 is available [on killtube](https://killtube.org/showthread.php?2454-Work-in-progress-Setup-CoD2-on-your-ubuntu-14-04-server)
* This setup was tested on an ubuntu server 18.04.3 LTS x86_64 architecture and should work on any platform with the same architecture.
* This setup was tested on an ubuntu server 18.04.3 LTS x86_64 and should work on any platform with the same architecture.
* You might want to use a separated user to launch your docker containers for security purpose. In this case do not forget to add him to the docker group. On Ubuntu for instance:
```bash
```sh
# add user to docker group
sudo gpasswd -a USER_NAME docker
# restart docker dameon
sudo service docker restart
```
* Original and cracked server binaries can be found in the [`bin`](https://github.com/bgauduch/call-of-duty-2-docker-server/tree/master/bin) folder, have a look at the `readme`
* The gcc3 library can be found in the [`lib`](https://github.com/bgauduch/call-of-duty-2-docker-server/tree/master/lib) folder, have a look at the `readme`
* If you need to use iptables in conjonction with Docker, please follow the [official documentation tips](https://docs.docker.com/network/iptables/)

## Roadmap
## 🚧 Roadmap
Project roadmap & issues can be tracked on the [project page](https://github.com/bgauduch/call-of-duty-2-docker-server/projects/2).

## Contribution
## 🙏 Contribution
Any contribution to this project is welcome ! Feel free to [open an issue](https://github.com/bgauduch/call-of-duty-2-docker-server/issues/new) to ask for help or a new feature, and it will be discussed there.

If you wish to contribute to the code, start by reading the [development guidelines](#development-guidelines) and then feel free to [open a pull-request](https://github.com/bgauduch/call-of-duty-2-docker-server/pulls).

## 📖 License
This project is under the [MIT License](https://choosealicense.com/licenses/mit/).
Binary file removed lib/gcc3-libs.tar.bz2
Binary file not shown.
4 changes: 0 additions & 4 deletions lib/readme.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion dev-logs.sh → scripts/dev-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -euo pipefail

# tail stack logs
docker-compose logs -f
docker-compose logs -f cod2_server
File renamed without changes.
File renamed without changes.
39 changes: 0 additions & 39 deletions tools/cat.go

This file was deleted.

21 changes: 0 additions & 21 deletions tools/readme.md

This file was deleted.

0 comments on commit e6d7797

Please sign in to comment.