refracta / dcss-server

Containerized DCSS Server
https://crawl.nemelex.cards
2 stars 0 forks source link

First run guide commands don't quite work. #43

Closed Rytisgit closed 3 weeks ago

Rytisgit commented 4 weeks ago

I tried to run the first time commands. The issues I saw on a fresh ubuntu 22.04 WSL install are these:

 Enabling module rewrite.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 restart
dcss-1  | Site 000-default disabled.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 reload
dcss-1  | Enabling site httpd.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 reload
dcss-1  | Your MPM seems to be threaded. Selecting cgid instead of cgi.
dcss-1  | Enabling module cgid.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 restart
dcss-1  |  * Reloading Apache httpd web server apache2                           *
dcss-1  |  * Starting nginx nginx                                        [ OK ]
dcss-1  | /docker-entrypoint.sh: line 28: spawn-fcgi: command not found
dcss-1  | no crontab for root
dcss-1  | "/root/crontab.txt":1: bad minute
dcss-1  | errors in crontab file, can't install.
dcss-1  | Cron jobs have been set up:
dcss-1  | no crontab for root
dcss-1  |  * Starting OpenBSD Secure Shell server sshd                   [ OK ]
dcss-1  |  * Stopping webtiles server webtiles                           [ OK ]
dcss-1  |  * Starting webtiles server webtiles                           [ OK ]
dcss-1  |     write_pidfile()
dcss-1  |   File "/crawl-master/webserver/webtiles/server.py", line 161, in write_pidfile
dcss-1  |     with open(pidfile, "w") as f:
dcss-1  |          ^^^^^^^^^^^^^^^^^^
dcss-1  | PermissionError: [Errno 13] Permission denied: '/crawl-master/webserver/run/webtiles.pid'
dcss-1  | 2024-06-08 21:01:17,460 ERROR: Failed to delete pidfile!
dcss-1  | 2024-06-08 21:04:04,716 INFO: Loaded server configuration from: /crawl-master/webserver/config.py
dcss-1  | 2024-06-08 21:04:04,716 INFO: Reading 113 games from base config
dcss-1  | 2024-06-08 21:04:04,716 WARN: Skipping game definitions in `games.d/` based on config
dcss-1  | 2024-06-08 21:04:04,727 INFO: Listening on http://0.0.0.0:8080
dcss-1  | 2024-06-08 21:04:04,727 ERROR: Server startup failed!
dcss-1  | Traceback (most recent call last):
dcss-1  |   File "/crawl-master/webserver/webtiles/server.py", line 817, in run
dcss-1  |     write_pidfile()
dcss-1  |   File "/crawl-master/webserver/webtiles/server.py", line 161, in write_pidfile
dcss-1  |     with open(pidfile, "w") as f:
dcss-1  |          ^^^^^^^^^^^^^^^^^^
dcss-1  | PermissionError: [Errno 13] Permission denied: '/crawl-master/webserver/run/webtiles.pid'
dcss-1  | 2024-06-08 21:04:04,728 ERROR: Failed to delete pidfile!
Rytisgit commented 4 weeks ago

you might need to chown the downloaded files inside the docker container, similarly to this: https://stackoverflow.com/questions/39397548/how-to-give-non-root-user-in-docker-container-access-to-a-volume-mounted-on-the

Rytisgit commented 4 weeks ago

also according to the error "/root/crontab.txt":1: bad minute the crontab might be set in a wrong format?

Rytisgit commented 4 weeks ago

after running build-trunk the webserver works, then running the download and starting the server again other versions seem to work as well.

refracta commented 4 weeks ago

(1), (2): I will correct the requirements and the wrongly specified command. Thank you for pointing it out.

(3): I also incorrectly wrote the ccache command. The correct command is:

./release.sh download -p data/ccache -n ccache

I will correct this as well.

(4): If you're using the NTFS file system instead of the Linux volume part of WSL, there might be issues with permissions. Did you try cloning and running it from a Linux volume? The environments I'm primarily testing are Ubuntu 24.04 LTS and the GitHub Action Ubuntu 24.04 image.

(5): I'm currently testing support for CGI Perl scripts for the apache and nginx servers. I am aware of some issues, including the spawn-fcgi related messages.

(6): As far as I know, the tar compression utility preserves the characteristics of the Linux file system and permissions as much as possible. I haven't encountered permission issues with downloaded game binaries in the environment used by GitHub Action and my server. If you can provide more detailed feedback on this part, I might be able to make corrections.

(7): The issue seems to have arisen after I changed the cron job to run every 15 minutes instead of at dawn (I think the cron expression might be incorrectly set). I was unaware of this, but I will fix this issue as well.

(8): Originally, after downloading the game-data and running without setting the COMMAND environment variable, a server with all versions available should be set up immediately (no need to run build-trunk).

refracta commented 4 weeks ago

Note: The develop branch is set as the default branch but it is very unstable. (Operations such as force push may be executed to organize commits by squashing, so it is recommended to clone again when running after modifications are made later.) The stable version will be released in the master branch.

Rytisgit commented 4 weeks ago

Thanks for the note on it being unstable, I'll make sure to pull in updates.

Regarding (8) - What I meant to say is that even though I had the error with webtiles.pid, I was able to work around it by first running build-trunk, then downloading the full data to the same data folder, then starting the server with all forks available as you say, without needing to wait for a long time to build-all and saw the server fully working.

Regarding the permission issue, I did run it in the linux volume. I will try to look into it more. From your testing have you done the full flow of cloning the git repo to a new folder and doing the download flow?

refracta commented 4 weeks ago
dcss-1  | Crawl version db //versionsdb/crawl-versions.db3 already exists, aborting.
dcss-1  | Crawl basedir to create: //crawl-master/crawl-git
dcss-1  | Crawl base directory already exists, aborting.
dcss-1  | Publishing DGL config files:
dcss-1  |
dcss-1  | These are the publish copy targets:
dcss-1  | 1) dgamelaunch.conf -> /etc (1 new: dgamelaunch.conf)
dcss-1  | 2) utils/auth-save-downloader.pl -> /usr/lib/cgi-bin (1 new: auth-save-downloader.pl)
dcss-1  | 3) utils/trigger-rebuild.pl -> /usr/lib/cgi-bin (1 new: trigger-rebuild.pl)
dcss-1  | 4) utils/webtiles -> /etc/init.d (1 new: webtiles)
dcss-1  | 5) config.py -> //crawl-master/webserver (no change)
dcss-1  | 6) games.d/*.{yml,yaml} (1 files) -> //crawl-master/webserver/games.d (no change)
dcss-1  | 7) chroot/data/menus/*.txt (10 files) -> //dgldir/data/menus (no change)
dcss-1  | 8) chroot/data/menus/games/*.txt (64 files) -> //dgldir/data/menus/games (no change)
dcss-1  | 9) chroot/data/*.{rc,macro} (60 files) -> //dgldir/data (no change)
dcss-1  | 10) chroot/bin/*.sh (4 files) -> //bin (4 new: crawl-git-launcher.sh crawl-stable-launcher.sh init-webtiles.sh savegame-backup.sh)
dcss-1  | 11) chroot/sbin/*.sh (5 files) -> //sbin (5 new: install-gcc.sh install-stable.sh install-trunk.sh remove-trunks.sh savegame-transfer.sh)
dcss-1  | Skipping optional files: config.yml banned_players.yml banned_players.txt
dcss-1  | Copying files:
dcss-1  | 1) dgamelaunch.conf -> /etc  [OK]
dcss-1  | 2) utils/auth-save-downloader.pl -> /usr/lib/cgi-bin  [OK]
dcss-1  | 3) utils/trigger-rebuild.pl -> /usr/lib/cgi-bin  [OK]
dcss-1  | 4) utils/webtiles -> /etc/init.d  [OK]
dcss-1  | 5) config.py -> //crawl-master/webserver  [OK]
dcss-1  | 6) games.d/base.yaml -> //crawl-master/webserver/games.d  [OK]
dcss-1  | 7) chroot/data/menus/experimental.txt chroot/data/menus/main_admin.txt chroot/data/menus/main_anon.txt chroot/data/menus/main_user.txt chroot/data/menus/select-forks.txt chroot/data/menus/select-stable-versions-0.1x.txt chroot/data/menus/select-stable-versions-0.2x.txt chroot/data/menus/select-stable-versions-0.3x.txt chroot/data/menus/select-stable-versions-0.x.txt chroot/data/menus/watchmenu_help.txt -> //dgldir/data/menus  [OK]
dcss-1  | 8) chroot/data/menus/games/crawl-0.11.txt chroot/data/menus/games/crawl-0.11_adv.txt chroot/data/menus/games/crawl-0.12.txt chroot/data/menus/games/crawl-0.12_adv.txt chroot/data/menus/games/crawl-0.13.txt chroot/data/menus/games/crawl-0.13_adv.txt chroot/data/menus/games/crawl-0.14.txt chroot/data/menus/games/crawl-0.14_adv.txt chroot/data/menus/games/crawl-0.15.txt chroot/data/menus/games/crawl-0.15_adv.txt chroot/data/menus/games/crawl-0.16.txt chroot/data/menus/games/crawl-0.16_adv.txt chroot/data/menus/games/crawl-0.17.txt chroot/data/menus/games/crawl-0.17_adv.txt chroot/data/menus/games/crawl-0.18.txt chroot/data/menus/games/crawl-0.18_adv.txt chroot/data/menus/games/crawl-0.19.txt chroot/data/menus/games/crawl-0.19_adv.txt chroot/data/menus/games/crawl-0.20.txt chroot/data/menus/games/crawl-0.20_adv.txt chroot/data/menus/games/crawl-0.21.txt chroot/data/menus/games/crawl-0.21_adv.txt chroot/data/menus/games/crawl-0.22.txt chroot/data/menus/games/crawl-0.22_adv.txt chroot/data/menus/games/crawl-0.23.txt chroot/data/menus/games/crawl-0.23_adv.txt chroot/data/menus/games/crawl-0.24.txt chroot/data/menus/games/crawl-0.24_adv.txt chroot/data/menus/games/crawl-0.25.txt chroot/data/menus/games/crawl-0.25_adv.txt chroot/data/menus/games/crawl-0.26.txt chroot/data/menus/games/crawl-0.26_adv.txt chroot/data/menus/games/crawl-0.27.txt chroot/data/menus/games/crawl-0.27_adv.txt chroot/data/menus/games/crawl-0.28.txt chroot/data/menus/games/crawl-0.28_adv.txt chroot/data/menus/games/crawl-0.29.txt chroot/data/menus/games/crawl-0.29_adv.txt chroot/data/menus/games/crawl-0.30.txt chroot/data/menus/games/crawl-0.30_adv.txt chroot/data/menus/games/crawl-0.31.txt chroot/data/menus/games/crawl-0.31_adv.txt chroot/data/menus/games/crawl-bcadrencrawl.txt chroot/data/menus/games/crawl-bcadrencrawl_adv.txt chroot/data/menus/games/crawl-bloatcrawl2.txt chroot/data/menus/games/crawl-bloatcrawl2_adv.txt chroot/data/menus/games/crawl-dcssca.txt chroot/data/menus/games/crawl-dcssca_adv.txt chroot/data/menus/games/crawl-git.txt chroot/data/menus/games/crawl-git_adv.txt chroot/data/menus/games/crawl-gnollcrawl.txt chroot/data/menus/games/crawl-gnollcrawl_adv.txt chroot/data/menus/games/crawl-gooncrawl.txt chroot/data/menus/games/crawl-gooncrawl_adv.txt chroot/data/menus/games/crawl-hellcrawl.txt chroot/data/menus/games/crawl-hellcrawl_adv.txt chroot/data/menus/games/crawl-kimchicrawl.txt chroot/data/menus/games/crawl-kimchicrawl_adv.txt chroot/data/menus/games/crawl-stoatsoup.txt chroot/data/menus/games/crawl-stoatsoup_adv.txt chroot/data/menus/games/crawl-testcrawl.txt chroot/data/menus/games/crawl-testcrawl_adv.txt chroot/data/menus/games/crawl-xcrawl.txt chroot/data/menus/games/crawl-xcrawl_adv.txt -> //dgldir/data/menus/games  [OK]
dcss-1  | 9) chroot/data/dgl-default.crawl-0.11.rc chroot/data/dgl-default.crawl-0.12.rc chroot/data/dgl-default.crawl-0.13.rc chroot/data/dgl-default.crawl-0.14.rc chroot/data/dgl-default.crawl-0.15.rc chroot/data/dgl-default.crawl-0.16.rc chroot/data/dgl-default.crawl-0.17.rc chroot/data/dgl-default.crawl-0.18.rc chroot/data/dgl-default.crawl-0.19.rc chroot/data/dgl-default.crawl-0.20.rc chroot/data/dgl-default.crawl-0.21.rc chroot/data/dgl-default.crawl-0.22.rc chroot/data/dgl-default.crawl-0.23.rc chroot/data/dgl-default.crawl-0.24.rc chroot/data/dgl-default.crawl-0.25.rc chroot/data/dgl-default.crawl-0.26.rc chroot/data/dgl-default.crawl-0.27.rc chroot/data/dgl-default.crawl-0.28.rc chroot/data/dgl-default.crawl-0.29.rc chroot/data/dgl-default.crawl-0.30.rc chroot/data/dgl-default.crawl-0.31.rc chroot/data/dgl-default.crawl-bcadrencrawl.rc chroot/data/dgl-default.crawl-bloatcrawl2.rc chroot/data/dgl-default.crawl-dcssca.rc chroot/data/dgl-default.crawl-gnollcrawl.rc chroot/data/dgl-default.crawl-gooncrawl.rc chroot/data/dgl-default.crawl-hellcrawl.rc chroot/data/dgl-default.crawl-kimchicrawl.rc chroot/data/dgl-default.crawl-stoatsoup.rc chroot/data/dgl-default.crawl-xcrawl.rc chroot/data/dgl-default.crawl-0.11.macro chroot/data/dgl-default.crawl-0.12.macro chroot/data/dgl-default.crawl-0.13.macro chroot/data/dgl-default.crawl-0.14.macro chroot/data/dgl-default.crawl-0.15.macro chroot/data/dgl-default.crawl-0.16.macro chroot/data/dgl-default.crawl-0.17.macro chroot/data/dgl-default.crawl-0.18.macro chroot/data/dgl-default.crawl-0.19.macro chroot/data/dgl-default.crawl-0.20.macro chroot/data/dgl-default.crawl-0.21.macro chroot/data/dgl-default.crawl-0.22.macro chroot/data/dgl-default.crawl-0.23.macro chroot/data/dgl-default.crawl-0.24.macro chroot/data/dgl-default.crawl-0.25.macro chroot/data/dgl-default.crawl-0.26.macro chroot/data/dgl-default.crawl-0.27.macro chroot/data/dgl-default.crawl-0.28.macro chroot/data/dgl-default.crawl-0.29.macro chroot/data/dgl-default.crawl-0.30.macro chroot/data/dgl-default.crawl-0.31.macro chroot/data/dgl-default.crawl-bcadrencrawl.macro chroot/data/dgl-default.crawl-bloatcrawl2.macro chroot/data/dgl-default.crawl-dcssca.macro chroot/data/dgl-default.crawl-gnollcrawl.macro chroot/data/dgl-default.crawl-gooncrawl.macro chroot/data/dgl-default.crawl-hellcrawl.macro chroot/data/dgl-default.crawl-kimchicrawl.macro chroot/data/dgl-default.crawl-stoatsoup.macro chroot/data/dgl-default.crawl-xcrawl.macro -> //dgldir/data  [OK]
dcss-1  | 10) chroot/bin/crawl-git-launcher.sh chroot/bin/crawl-stable-launcher.sh chroot/bin/init-webtiles.sh chroot/bin/savegame-backup.sh -> //bin  [OK]
dcss-1  | 11) chroot/sbin/install-gcc.sh chroot/sbin/install-stable.sh chroot/sbin/install-trunk.sh chroot/sbin/remove-trunks.sh chroot/sbin/savegame-transfer.sh -> //sbin  [OK]
dcss-1  |
dcss-1  | All done.
dcss-1  |  * Starting Apache httpd web server apache2                           AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.24.0.2. Set the 'ServerName' directive globally to suppress this message
dcss-1  |  *
dcss-1  | Enabling module rewrite.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 restart
dcss-1  | Site 000-default disabled.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 reload
dcss-1  | Enabling site httpd.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 reload
dcss-1  | Your MPM seems to be threaded. Selecting cgid instead of cgi.
dcss-1  | Enabling module cgid.
dcss-1  | To activate the new configuration, you need to run:
dcss-1  |   service apache2 restart
dcss-1  |  * Reloading Apache httpd web server apache2                           *
dcss-1  |  * Starting nginx nginx                                        [ OK ]
dcss-1  | /docker-entrypoint.sh: line 28: spawn-fcgi: command not found
dcss-1  | no crontab for root
dcss-1  | "/root/crontab.txt":1: bad minute
dcss-1  | errors in crontab file, can't install.
dcss-1  | Cron jobs have been set up:
dcss-1  | no crontab for root
dcss-1  |  * Starting OpenBSD Secure Shell server sshd                   [ OK ]
dcss-1  | rm: cannot remove '/crawl-master/webserver/run/webtiles.pid': No such file or directory
dcss-1  |  * Stopping webtiles server webtiles                           [ OK ]
dcss-1  |  * Starting webtiles server webtiles                           [ OK ]
dcss-1  | 2024-06-09 01:43:42,450 INFO: Loaded server configuration from: /crawl-master/webserver/config.py
dcss-1  | 2024-06-09 01:43:42,450 INFO: Reading 113 games from base config
dcss-1  | 2024-06-09 01:43:42,450 WARN: Skipping game definitions in `games.d/` based on config
dcss-1  | 2024-06-09 01:43:42,476 INFO: Listening on http://0.0.0.0:8080
dcss-1  | 2024-06-09 01:43:42,478 WARN: User database '/dgldir/dgamelaunch.db' didn't exist; creating it now.
dcss-1  | 2024-06-09 01:43:42,488 WARN: User settings database didn't exist at '/dgldir/user_settings.db3'; creating it now.
dcss-1  | 2024-06-09 01:43:42,492 DEBG: Using selector: EpollSelector
dcss-1  | 2024-06-09 01:43:42,508 INFO: DCSS Webtiles server started! (PID: 1547)
dcss-1  | 2024-06-09 01:43:42,508 INFO: Webtiles (0.32-a0-1358-gd719f66080) running with Tornado 6.4.1 and Python 3.12.3
TARGET_DIR=/disk/dcss
cd $TARGET_DIR
cd dcss-server/server
docker compose down
docker rmi refracta/dcss-server
docker builder prune -f
docker image prune -f
cd $TARGET_DIR
rm -rf dcss-server/
git clone https://github.com/refracta/dcss-server
cd dcss-server/server
./release.sh download -p data -n game-data
USE_DWEM=true USE_REVERSE_PROXY=true docker compose -f docker-compose.yml -f docker-compose.ports.yml up -d

Here are the logs I just ran on my server. It works correctly.

refracta commented 4 weeks ago

I used the root account for convenience while testing on the server. This might be related to the issue. I will resolve the apache2 and nginx issues, clean up the commit logs a bit, and then test the build in a WSL environment or with a non-root account that has Docker execution permissions. Since I have other tasks to handle first, it may take some time to get back with the test results.

refracta commented 4 weeks ago

(1), (2), (3): https://github.com/refracta/dcss-server/commit/4427df8142b6e63194832e62d3e0d11f1b11f9c1 (5): https://github.com/refracta/dcss-server/commit/0b553577c6b541897d5497569a6ca029676d8acc (7): https://github.com/refracta/dcss-server/commit/bebb883173c6d5f25e5921d0816f49dbd0acd611

These issues have been resolved. Once the upload-data action for the last commit is complete, the issues will likely be resolved.

refracta commented 4 weeks ago

image image Works without errors on Docker Desktop & WSL 2 & Ubuntu 22.04.2 LTS

cd ~
git clone https://github.com/refracta/dcss-server
cd dcss-server/server
./release.sh download -p data -n game-data
docker compose -f docker-compose.yml -f docker-compose.ports.yml up -d
Rytisgit commented 4 weeks ago

Seems like there is still some issue regarding permissions for me.

I rm -rf'ed the git repo to start fresh. Then tried to run the script you posted again. I am using a non-root user, the only thing I changed from stock ubuntu is update docker rights for this user to be able to run it according to this post: https://stackoverflow.com/questions/72528606/docker-rancher-permission-denied-when-using-docker-from-wsl

the webserver error message:

dcss-1  | 2024-06-09 10:08:40,340 ERROR: Server startup failed!
dcss-1  | Traceback (most recent call last):
dcss-1  |   File "/crawl-master/webserver/webtiles/server.py", line 817, in run
dcss-1  |     write_pidfile()
dcss-1  |   File "/crawl-master/webserver/webtiles/server.py", line 161, in write_pidfile
dcss-1  |     with open(pidfile, "w") as f:
dcss-1  |          ^^^^^^^^^^^^^^^^^^
dcss-1  | PermissionError: [Errno 13] Permission denied: '/crawl-master/webserver/run/webtiles.pid'
dcss-1  | 2024-06-09 10:08:40,341 ERROR: Failed to delete pidfile!

permission using Ubuntu non-root user:

sentei@CPC-rpetr-67N1K:~/dcss-server/server/data/crawl-master/webserver/run$ ls -al
total 12
drwxr-xr-x  2 sentei docker 4096 Jun  9 10:05 .
drwxr-xr-x 12 sentei docker 4096 Jun  9 10:08 ..
-rw-r--r--  1 root   root   1560 Jun  9 10:08 webtiles.log

permissions after execing to get inside the running container using root and crawl-dev(I believe crawl-dev should be the one which is starting the websever and thus failing to write the webtiles.pid):

root@a5d843cc8e85:/crawl-master/webserver/run# ls -al
total 12
drwxr-xr-x  2 ubuntu crawl 4096 Jun  9 10:18 .
drwxr-xr-x 12 ubuntu crawl 4096 Jun  9 10:08 ..
-rw-r--r--  1 root   root  1560 Jun  9 10:08 webtiles.log
root@a5d843cc8e85:/crawl-master/webserver/run# touch a
root@a5d843cc8e85:/crawl-master/webserver/run# su crawl-dev
$ ls -al
total 12
drwxr-xr-x  2 ubuntu crawl 4096 Jun  9 10:19 .
drwxr-xr-x 12 ubuntu crawl 4096 Jun  9 10:08 ..
-rw-r--r--  1 root   root     0 Jun  9 10:19 a
-rw-r--r--  1 root   root  1560 Jun  9 10:08 webtiles.log
$ touch b
touch: cannot touch 'b': Permission denied

So it can write with root inside the container but not with crawl-dev. I'm not sure how it is different when you start the container, perhaps my setup is wrong somehow but this should be as stock as it gets. I installed this wsl yesterday fresh to test this. I've only done apt-get install docker jq. Let me know if you have any questions.

refracta commented 4 weeks ago

image I confirmed the same error message when running as a non-root user.

refracta commented 4 weeks ago
root@dcss-webtiles:/disk/dcss/dcss-server/server/data/crawl-master/webserver/run# ls -al
total 20
drwxr-xr-x  2 1001 1001 4096 Jun  9 12:39 .
drwxr-xr-x 12 1001 1001 4096 Jun  9 12:39 ..
-rw-r--r--  1 1001 1001    0 Jun  9 20:03 status
-rw-r--r--  1 root root 4259 Jun  9 19:40 webtiles.log
-rw-r--r--  1 1001 1001    4 Jun  9 12:39 webtiles.pid

This is the permission status when running with the root account and everything worked correctly.

refracta commented 4 weeks ago

Here are the potential causes I have considered, though further testing is necessary:

  1. Containers run through a non-root user are executed as processes of that non-root user.
  2. The dcss-server image creates webtiles.log as the root user within the container.
  3. Files with root:root permissions in the mounted directory can only be accessed by programs running as the root process on the host.
  4. Therefore, the root user within the container, when the container is run through a non-root user, can access root:root files located in the container's volume filesystem but cannot access root:root files in the mounted host folder.
refracta commented 4 weeks ago

I'm not sure why dgamelaunch is built as root when crawl-dev is already included in the root group. (This was just a convention used from the dgamelaunch-config container, so I followed it.)

https://github.com/refracta/dcss-server/blob/4427df8142b6e63194832e62d3e0d11f1b11f9c1/server/Dockerfile#L94 Anyway, it might solve the problem if we modify it to use the crawl-dev user after setting up dgl.

refracta commented 4 weeks ago

When running the container with non-root user and starting with COMMAND=build-trunk without downloading the game data, it runs successfully and shows the following permissions:

total 16
drwxr-xr-x  2 1001 docker 4096 Jun  9 23:09 ./
drwxr-xr-x 12 1001 docker 4096 Jun  9 23:09 ../
-rw-r--r--  1 1001 docker    0 Jun  9 23:11 status
-rw-r--r--  1 root root    770 Jun  9 23:09 webtiles.log
-rw-r--r--  1 1001 docker    4 Jun  9 23:09 webtiles.pid

It seems that adjusting the permissions before attempting to create the tar.gz archive for release might resolve this issue.

Rytisgit commented 4 weeks ago

Yes, I also found that running build trunk does work.

refracta commented 3 weeks ago

After downloading game-data through the release utility and then extracting it, I confirmed that the original owner information was lost. Running the command sudo chmod -R 1001 data after the download worked correctly.

Upon investigation, I found that using the --same-owner flag when extracting the tar archive preserves the owner information. https://github.com/refracta/dcss-server/commit/0c3559e979dc49dd7e985cac74a8def5780edd0a

Therefore, I added an option to extract with this flag.

https://github.com/refracta/dcss-server/commit/b05376299682cd60012a882c45b504edecd8b628#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R19

The release download method for game data has been updated.

Rytisgit commented 3 weeks ago

Can confirm that it works now with keeping the same owner when extracting to have a working server. I also tested the full build using ccache, that also works. Good job.