isle-portable icon indicating copy to clipboard operation
isle-portable copied to clipboard

Docker container for the web version

Open alehel opened this issue 9 months ago • 1 comments

I very much enjoyed playing the web version, and I was wondering if there are any plans to offer it as a docker container? Then one could supply the game assets, and a save file location through config. That way I could play my own copy regardless of which of my devices I'm currently using.

alehel avatar Jun 30 '25 07:06 alehel

No immediate plans right now, but it's a good idea so I'm hoping to add it at some point

The main thing it would have to do is accept path to assets, path to save files. It should then compile the game to emscripten and expose a web server that will run the game if you open it.

foxtacles avatar Jun 30 '25 19:06 foxtacles

https://github.com/isledecomp/isle-portable/wiki/Installation#emscripten

foxtacles avatar Jul 01 '25 22:07 foxtacles

Wow. That was quick! I managed to get it working by mounting an ISO of the game disc. I wasn't able to get it working by copying the content of the iso to a local folder however. Is there a reason these two methods don't work the same?

Method for mounting the ISO sudo mount -o loop isle.iso /mnt/isle

Method for unpacking the ISO 7z x isle.iso -o/docker/isle/assets

alehel avatar Jul 02 '25 12:07 alehel

They should work the same, it accepts an arbitrary path. in my tests I used a local copy on disk. Do you see any errors in the browser / developer console?

foxtacles avatar Jul 02 '25 12:07 foxtacles

Ah, my mistake. Not sure why I thought it was working. They are both stuck at 0% and the console is stating

192.168.2.2/:1 The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header.
(index):1055 OPFS not available or permission denied. TypeError: Cannot read properties of undefined (reading 'getDirectory')
    at Object.getFileHandle ((index):1052:62)
    at Object.loadConfig ((index):1136:47)
    at Object.init ((index):1046:32)
    at HTMLDocument.<anonymous> ((index):1185:27)
getFileHandle @ (index):1055
Vivaldi: Prohibitted blocking overflowing/scrolling of the document.

My docker-compose.yml

services:
  isle-portable:
    image: ghcr.io/isledecomp/isle-portable-emscripten:master
    ports:
      - "6931:6931"
    volumes:
      - ./assets:/assets

And the permissions on my assets folder

Image Image

alehel avatar Jul 02 '25 12:07 alehel

Ok, I guess the answer is here:

192.168.2.2/:1 The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header.

Are you using localhost to open the site? It looks like it will require SSL for any other host. I was hoping to avoid that setup for a local test environment but I may add it as an option.

Or if you are using docker compose you could probably also put a HTTPS proxy server in front of it.

foxtacles avatar Jul 02 '25 12:07 foxtacles

Of course. Didn't even occur to me that this isn't the same machine. I'm so used to SSHing into my home server that I didn't think about it. But yes, I was attempting to run it on my home server, and then playing it from my laptop which is on the same network.

Thanks for pointing that out.

alehel avatar Jul 02 '25 12:07 alehel

There might be another issue due to file cases, i.e. the Lego folder in the assets would have to be renamed to LEGO. This is a bit tricky because we can't do file discovery through a web server in general. The original game ran on Windows which is case insensitive, so file casing was all over the place and different for different versions of the assets. Now we need the proper case though to address the files. I'll look into automatically detecting this even for a webserver.

foxtacles avatar Jul 02 '25 13:07 foxtacles

I've updated the Docker setup and the instructions: https://github.com/isledecomp/isle-portable/wiki/Installation#web-port-emscripten

It has an example on how to set up SSL/HTTPS as well. This should now work out of the box for all setups

foxtacles avatar Jul 02 '25 15:07 foxtacles

Hmm. I'm getting handshake errors using that config. No time to troubleshoot it now unfortunately, but i'll give it a go tonight.

alehel avatar Jul 03 '25 09:07 alehel