Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running locally fails #54

Open
nvram93 opened this issue Oct 23, 2024 · 14 comments
Open

Running locally fails #54

nvram93 opened this issue Oct 23, 2024 · 14 comments

Comments

@nvram93
Copy link

nvram93 commented Oct 23, 2024

hi, it's currently not possible for me to build sour locally (ubuntu 24.04)
when i try to run ./serve it tells me that there are no versions for cpp, emscripten and go specified in ./Earthfile and also that "the image for the service i'm trying to create has been removed".

i'm not experienced with earthly and coding in general, i just try to deploy this in the intranet of my company so we can have a little fun during lunch breaks. i need to host it completly local, since there is no internet connection for clients, only intranet/lan (the server i'm trying to host sour on has internet uplink through a proxy).

would you kindly provide some kind of solution, so my colleagues and me can play sour during our breaks?

thanks in advance :)

@cfoust
Copy link
Owner

cfoust commented Oct 23, 2024

have you tried running the docker images? sour's build has been broken for a while, but theoretically pulling the image from GitHub should still work:

docker run --rm -it -p 1234:1234 -p 28785:28785/udp ghcr.io/cfoust/sour

honestly I've been meaning to get back and fix this for a while, i've been neglecting sour!

@nvram93
Copy link
Author

nvram93 commented Oct 23, 2024

i tried it with docker first, but that didn't work. that's why i tried to build it locally.
i can't remember the error exactly, but i think it made the client (browser) try to access something outside our intranet, which isn't possible in our network, so it failed to load. there were also some errors in the server console.
i'll try again tomorrow and let you know asap

@cfoust
Copy link
Owner

cfoust commented Oct 23, 2024

Woops, my apologies, I missed the fact that you're on an intranet! I have been meaning to make a static build of sour that ships as a single executable for a while. I'll see if I can peel off some time for this soon.

@nvram93
Copy link
Author

nvram93 commented Oct 24, 2024

hello again, i get the following error on the server console:
FTL asset fetcher failed to initialize error="Get \"https://static.sourga.me/blobs/6481/.index.source\": dial tcp 188.114.96.3:443: i/o timeout"

i guess this is caused by the non existing proxy config for docker, which is my fault. should be fixable by myself.

regarding the client: it tries to access the same file: https://static.sourga.me/blobs/6481/.index.source - would it be possible to simply download this file and host it locally on my apache in the intranet by editing the part of the code where it loads this file or is this a more complex situation where you need to update bigger parts of the code for it to work?

@cfoust
Copy link
Owner

cfoust commented Oct 27, 2024

Yeah, some portion of the game assets are hosted on static.sourga.me. This is a tough problem; I spent some time on this this morning and managed to get the repo building again, but it's going to take me a bit to get you a general solution that you can just download. Will try to get to this as soon as I can.

@cfoust
Copy link
Owner

cfoust commented Oct 27, 2024

So I realized there is a temporary fix for this that will allow you to disable the asset sources that pull from static.sourga.me. Sour supports custom configurations, which you can mount into the docker container at /sour/config.yaml. Sour uses this configuration to decide what assets to serve, among other things, all unfortunately undocumented for now. If you have the ability to build and run your own Sour docker image, this will work for you.

You can put the following in a config.yaml file on your system:

client:
  assets:
    - "mobile:#origin/assets/mobile/.index.source"
    - "#origin/assets/desktop/.index.source"

cluster:
  assets:
    - "http://localhost:1234/assets/desktop/.index.source"

You can then run Sour using the (modified) original docker run command:

docker run -d -it \
   --mount type=bind,source="$(pwd)"/config.yaml,target=/sour/config.yaml,readonly \
   -p 1234:1234 \
   -p 28785:28785/udp \
   ghcr.io/cfoust/sour

@nvram93
Copy link
Author

nvram93 commented Oct 30, 2024

thanks for your work, i finally had some time to test it, sadly it doesn't work. this time there no error on server, just on clientside:
index.js:1 Uncaught SyntaxError: Unexpected token ';'
there are also some warnings, but i guess they're caused by the error above
also there is no index.js getting loaded on clientside

@cfoust
Copy link
Owner

cfoust commented Oct 30, 2024

Sorry about that! I have actually been furiously working on Sour this week to make this work for you. The end goal is to do away with Docker and just compile Sour down to a single executable. Things are nearly done, actually, but I'll have to get releases/builds/etc working properly before it will be downloadable. Stay tuned.

@nvram93
Copy link
Author

nvram93 commented Oct 31, 2024

thanks man, you're a legend for this. can't wait to play some sour with my colleagues

@cfoust
Copy link
Owner

cfoust commented Nov 3, 2024

Most of this is squared away, but I'm still hunting down a few bugs. Will try to get this finished as soon as I can.

@cfoust
Copy link
Owner

cfoust commented Nov 3, 2024

OK! So, after a week of hard work I was able to refresh Sour's build process and runtime requirements. It's now just a single executable (along with some assets) and can run completely offline after installation. Check out the latest release and the (admittedly still primitive) installation and usage docs. Let me know if you have trouble trying this out on Linux.

@nvram93
Copy link
Author

nvram93 commented Nov 5, 2024

thank you very much for effort! works flawless when installed with brew.

when done manually by downloading and unpacking the executable it just says "no maps found" and closes itself, same thing happens when i try to load the "brew version" of the game at system startup with a systemd service (ExecStart=/bin/bash -c 'sour'). but i guess that's just some kind of layer 8 error by me.

@cfoust
Copy link
Owner

cfoust commented Nov 5, 2024

I'm thrilled this is working for you! I realize now that the docs I wrote are far from sufficient to describe why this happens. On startup, the sour executable searches for game assets in the current working directory (literally for a file at the path ./assets/index.source) and also at $HOMEBREW_PREFIX/share/sour/assets/.index.source. So to start sour automatically, you just have to meet either condition. (The easiest is probably setting the $HOMEBREW_PREFIX.) I'd like to revisit this for sure, was just trying to get it out the door as fast as possible!

@cfoust
Copy link
Owner

cfoust commented Nov 7, 2024

I figured out the issue with reading assets! This is fixed in 0.2.5. Thank you for your patience in all this and thanks for prodding me to finally fix Sour! I'm sure a lot of folks will appreciate it. Please let me know if you have any other feedback; I still have a few things I'd like to fix before putting Sour on the back burner again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants