Coder Social home page Coder Social logo

Masterlist about cod4-docker HOT 33 CLOSED

qdm12 avatar qdm12 commented on August 22, 2024 2
Masterlist

from cod4-docker.

Comments (33)

Freekers avatar Freekers commented on August 22, 2024 1

What are the steam_api.so and steamclient.so files used for?

xbase_00.iwd is obsolete and can be removed: https://cod4x.me/index.php?/forums/topic/1013-xiceops_00iwd/&tab=comments#comment-5217

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024 1

It should work now with

docker pull qmcgaw/cod4:steam

And add the Docker tag :steam to your config file.

Although, @Freekers did the master list even worked initially with the older Docker image?

That steam Docker image uses the steam files downloaded but it's 300MB+ vs 21MB, so ideally if we find a way to make it work on Alpine that would be nice πŸ‘

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024 1
docker pull qmcgaw/cod4:steam

It works thank you!

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024 1

Ok i think the issue is fixed.

Note that I added this morning a built in HTTP server listening on port 8000 for mods and usermaps (iwd and ff files only, the rest are blocked). Instructions are here. Feel free to open another issue if you need help setting it up with your reverse proxy / port forwarding.

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Nice, many thanks! I'll definitely add it to the readme. Although it would be nice to somehow make it work in bridge mode, but it may be impossible.

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

I'm not sure. I tried several approaches and this was the only one that worked for me in order to get the server to show up on the Activision Masterlist.

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

I still can't register to cod4x master server 😒
Meanwhile, another (bad, with precompiled files) image I created works ..
Here my stack:

version: "3"
services:
  cod4-server:
    image: qmcgaw/cod4:latest
    container_name: cod4x-server-standard
    volumes:
      - /opt/cod4x/server/main:/home/user/cod4/main
      - /opt/cod4x/server/zone:/home/user/cod4/zone:ro
      - /opt/cod4x/server/mods:/home/user/cod4/mods
      - /opt/cod4x/server/usermaps:/home/user/cod4/usermaps:ro
      - /opt/cod4x/logs/standard:/home/user/.callofduty4
    network_mode: host
    stdin_open: true
    tty: true
    ports:
      - 28960:28960/udp
    command:
      [
        "+set dedicated 2",
        "+sv_authtoken mytoken",
        "+set sv_punkbuster 0",
        "+set rcon_password mypassword",
        "+set sv_maxclients 24",
        "+set ui_maxclients 32",
        "+set net_ip mypublicipv4",
        "+set net_port 28960",
        "+exec server.cfg",
        "+map_rotate",
      ]
    restart: unless-stopped

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

Your docker-compose looks fine to me, but you can remove the following lines:

    stdin_open: true
    tty: true
    ports:
      - 28960:28960/udp

Ports are not used in network_mode host.

Looking at the date of the image on Docker Hub, I suspect the image of @qdm12 has to be rebuild because it doesn't have the sv_authtoken variable incorporated yet, which is now enforced to be listed on the cod4x.me master. Judging from the announcement post on the cod4x.me forums, they incorporated that into their code just Γ‘fter the last build of the @qdm12 Docker image.

Source: https://cod4x.me/index.php?/forums/topic/2814-new-requirement-for-cod4-x-servers-to-get-listed-on-masterserver/

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

I use -it so I can attach to the process and launch commands

Correct me if I'm wrong but it should work with $@ passing any parameter from command

./cod4x18_dedrun +set fs_homepath /home/user/cod4"$@"

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

I'm not sure how that relates to what I said above.

The COD4x version in qdm12's Docker image needs to be updated in order to support the new token requirement by COD4x for their masterserver. This is done by updating the version number in the Dockerfile and rebuilding the image:

ARG COD4X_VERSION=v17.7.2

For example, try the fork of skrtheboss, which uses an update COD4x version: https://github.com/skrtheboss/cod4-docker

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

Oh sorry now I got it, @qdm12 is working on the new Dockerfile

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Hello all, sorry for not answering earlier. So I just created that issue in order to have releases, because the image is based on Alpine to keep a small size and so we need to build the binary from source.

I just made a v17.7.2 release with its corresponding Docker tag v17.7.2 (Alpine 3.11, cod4x v17.7.2 and shell entrypoint).

I will make another release using the latest commit available for now and name the Docker tag with the short commit. Both :latest and this docker tag will point to the latest source code from the cod4x repository.

I'm still working on making that fancy entrypoint (udp proxy + http static file server + launch cod4x, eventually restart it etc.), but it's not done unfortunately (all in 6MB extra). I will comment here once I've setup more releases/docker tags for you to try.

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

qmcgaw/cod4 and qmcgaw/cod4:v17.8 now use the commit corresponding to the version change to v17.8 for cod4xServer. Note that you might have to update your cod4 client. I'll dig into the masterlist issue in the coming days, but feel free to try with the newer image πŸ˜‰

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

Nice! I will try soon!

Here my working sketch FTP server (I had 15kb/s problem with HTTP)

  ftpd_server: # https://github.com/stilliard/docker-pure-ftpd
    image: stilliard/pure-ftpd
    container_name: cod4-ftpd
    ports:
      - "21:21"
      - "30000-30009:30000-30009"
    volumes: # mount only mods and usermaps
      - /opt/cod4x/server/mods:/home/username/mods:ro
      - /opt/cod4x/server/usermaps:/home/username/usermaps:ro
      - /opt/cod4x/passwd:/etc/pure-ftpd/passwd
    environment:
      PUBLICHOST: "localhost"
      FTP_USER_HOME: /home/username
      FTP_USER_NAME: cod4fdl
      FTP_USER_PASS: cod4fdl

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

I'll send my config for http, I use Caddy instead of apache and it works well on a single port. The 15KB/s must be the default fallback method transferring data over udp. Are you using your 80 (or 443) port for anything?

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

I used HTTP and HTTPS with valid cert under traefik2 but no luck, maybe it could be a client bug idk. With FTP server my friends are able to download fast, for me was fast-dl just the mod and not maps lol. (with HTTP/s always slow).
Ps. Still won't register to master server, does it work for you?

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

I meant that I use Caddy just to serve over http the files... to my other Caddy proxy (with https) haha. So it should work for you as Caddy > Traefik > clients instead of Apache > Traefik > clients. You could also bind mount and serve the files directly with Traefik though, and you would have to add a line in your cod4 server config file. I'll send you what I use.

I haven't had time to test the master list, I'll do it this weekend together with the newer entrypoint/supervising program.

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

@TheTrigger Are you running it on a VPS? If so, type ip a and tell me if your WAN IP is listed there.

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

@Freekers

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 96:00:00:22:a5:b0 brd ff:ff:ff:ff:ff:ff
    inet 116.203.122.91/32 brd 116.203.122.91 scope global eth0

My own docker-image is actually working (with port binding and bridge network), I tried bot your (freekers/docker-cod4x17a) and @qdm12 image, and wont register to master server for me. idk where I'm wrong

FROM ubuntu:18.04
EXPOSE 28960/udp

RUN mkdir -p /home/user/cod4
WORKDIR /home/user/cod4

RUN dpkg --add-architecture i386
RUN apt update && apt upgrade -y
RUN apt install -yq wget net-tools unzip libc6:i386 libstdc++6:i386

RUN mkdir -p main
RUN mkdir -p zone
RUN mkdir -p mods
RUN mkdir -p usermaps

COPY . .

RUN chmod +x cod4x18_dedrun
RUN chmod +x entrypoint.sh

ENTRYPOINT ["/home/user/cod4/entrypoint.sh"]

VOLUME ["/home/user/cod4/main"]
VOLUME ["/home/user/cod4/zone"]
VOLUME ["/home/user/cod4/mods"]
VOLUME ["/home/user/cod4/usermaps"]

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

The only thing I can think of is a firewall issue, but that doesn't make any sense since you stated your own image seems to be working fine, assuming you're deploying it on the same Docker host.... Sorry, I'm out of ideas for now...

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Ok there are several differences with my image and this Dockerfile

  • alpine:3.11 vs ubuntu:18.04 (so musl vs glibc)
  • static cod4x18_dedrun vs non statically built cod4x18_dedrun (depending on runtime/libstdc++.so.6)
  • what does COPY copy? From the downloaded zip file? If so, my image might be missing some files from there!
  • What's the entrypoint.sh?

I will dig into it now/tomorrow, maybe after I finish that newer entrypoint though.

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

COPY:

  • main/server.cfg
  • main/xbase_00.iwd
  • cod4x18_dedrun
  • entrypoint.sh
  • steam_api.so
  • steamclient.so

Content of entrypoint.sh

#!/usr/bin/env bash

./cod4x18_dedrun +set dedicated 2+set sv_punkbuster 0+set rcon_password "password"+sv_authtoken token+set sv_maxclients 24+set ui_maxclients 32+set net_port "28960"+exec server.cfg+map_rotate

from cod4-docker.

TheTrigger avatar TheTrigger commented on August 22, 2024

xbase_00.iwd is obsolete and can be removed: https://cod4x.me/index.php?/forums/topic/1013-xiceops_00iwd/&tab=comments#comment-5217

Are you sure he doesn't indent xiceops_00.iwd is deprecated?
Actually if you download the bin of server, main/xbase_00.iwd is present, also steam_api.dll and steamclient.dll

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

Ah yes, I see. That seems more likely indeed. A bit confusing the way it's written down.

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

I'll add the two steam library files (hopefully they work on Alpine's musl though, otherwise I'll switch to a debian slim I guess), but these seem to be the only files missing. Maybe xbase_00.iwd changed although its size is the same as before, I didn't check with a hash if it changed though. Otherwise there are:

  • runtime/libstdc++.so.6 which is for non statically built cod4x18_dedrun binaries
  • cod4x18_dedrun_dbg is a debug run version of the standard binary program

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

So the steam files are closed source, non statically built files as I discussed in this issue ages ago (sorry forgot!) so they won't work on Alpine. What I'll do is have a Debian version with Steam (although it will likely be like 10 times bigger), but at least you can test it out see if this masterlist works

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

@qdm12 I honestly don't remember. I tried many different combinations/configurations, including my own Docker image... Sorry!

Regarding those steam .DLL files; aren't these only for Windows? Does Linux actually use them?

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Linux uses the same files but built for Linux using the .so file extension. It seems they are needed for authenticating users and quite likely needed for connecting to the master list.

I am still a bit confused where these steam library files are from and if they would be a way to use them without the 300MB of C++ libraries. There may be a way to handpick libraries needed by them (check with docker exec cod4 ldd steam_api.so for example) but I gave up πŸ˜„ I'll ask on the cod4xserver repo, maybe they have better ideas.

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

Linux uses the same files but built for Linux using the .so file extension. It seems they are needed for authenticating users and quite likely needed for connecting to the master list.

I am still a bit confused where these steam library files are from and if they would be a way to use them without the 300MB of C++ libraries. There may be a way to handpick libraries needed by them (check with docker exec cod4 ldd steam_api.so for example) but I gave up πŸ˜„ I'll ask on the cod4xserver repo, maybe they have better ideas.

Sorry, I got confused by this #8 (comment) of TheTrigger, where he is referring to .DLL files, which don't work on Linux, but I now see there's a Linux version available of those as well.

It looks like they are used for authentication indeed. Quote: 'This library is required for receiving screenshots, everything related to Steam and getting of players the playerid. It is required to auth players.' https://cod4x.me/index.php?/forums/topic/148-library-doing-playerauthentication-for-version-159/

BTW. Do you know how to find out which COD4x subversion is running?

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Yes indeed. Although I'm starting to wonder, I've seen an error message on the statically compiled program about invalid certificates for https access (and it cannot resolve hostnames), that might be a reason why the masterlist doesn't work. I'll reopen, maybe I can fix that so it works on the tinier image.

You can find the cod4x subversion running at the top of your logs if I'm not mistaken.

from cod4-docker.

Freekers avatar Freekers commented on August 22, 2024

Regarding the invalid certificates; try adding the 'ca-certificates' package.

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Yes I already tried, even placed ca/ca-bundle.crt next to the binary but it doesn't see it somehow. I think the statically compiled program is a bit messed up somehow, I'll try digging into it this week.

from cod4-docker.

qdm12 avatar qdm12 commented on August 22, 2024

Hey guys, just before closing this issue:

  1. I reworked the image now, it's now up to date at cod4x version 20.1
  2. I reduced the image size of the Debian image from 365MB to 125MB, therefore it will be the only image from now. Support and build for the Alpine based images are abandoned.
  3. Now :latest (and future releases) should work with all features, feel free to let me know if it doesn't for anything.

from cod4-docker.

Related Issues (19)

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.