#Regarding running grasscutter in a linux env (arch)

292 messages · Page 1 of 1 (latest)

mellow panther
#

#1037226581841694750 message

#

firstly, id like to ask if its common for grasscutter to use port 443 instead of an internal port Jean_Oh

#

like everything uses https

austere bison
#

Although the top line says port in use, the lower error is the real cause: permission denied. Depending on your environment you may just need to sudo start the server, or you may also instead change it off port 443 to something higher

#

Also yes grasscutter always binds to 443 for dispatch by default

mellow panther
#

ohh

mellow panther
austere bison
#

Yeah just edit config.json so that the bindPort for server is something else, probably not a common bind port would be better

mellow panther
#

if say i were to change the port from 443 to 6969, should i also sudo ufw allow 6969?

austere bison
#

Yeah that would be a good idea

mellow panther
#

les gooooooooooooo

#

thank you!

#

also, i now remember cultivation used localhost:443 by default

#

so instead of 443, id now have to connect the game to localhost:6969 but like...

#

how do i start the game?

#

right now,

#

im really sorry i have never run the game raw with grasscutter(without cultivation)

austere bison
#

You just need mitmproxy which you can run from the grasscutter folder with mitmdump -s proxy.py -k (since proxy.py is there), you will want to make sure your system proxy is on, and you may need to do this as well #1030999313209380934 message

mellow panther
#

thanks for the link, ill look into it rn!

mellow panther
#

also, the proxy doesnt seem to work

#

is it this?

austere bison
# mellow panther mitmproxy is also using port 443 by default

Ah right you'll need to edit proxy_config (in grasscutter folder) so that remote port is the same as the one your server is now hosting on. As for the environment variables, those should be for the system environment variables (you may just need to look up how to set those for your environment)

mellow panther
#

heya, i am not in arch right now but i yesterday i managed to run grasscutter in port 443(stopped the nginx.service) and then hit a hardblock while running mitmproxy

#

ill boot into arch later and try to document the current situation

mellow panther
#

didnt have to change the port since i got grasscutter running on 443

#

im able to access grasscutter from mongodb compass

#

but the proxy doesnt seem to be working

austere bison
mellow panther
austere bison
#

the arch documentation has info on setting those variables in the 'Proxy server ' page

mellow panther
#

i see, ill search and try to troubleshoot

mellow panther
#

export http_proxy=http://10.203.0.1:5187/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy export rsync_proxy=$http_proxy

what must i set the http_proxy as? TeriDumb

#

sorry this is my the first time ever dealing with proxies TeriDerp

austere bison
#

http://127.0.0.1:8080/ would be my best guess, though to be fair I haven't set the env variables in arch for proxy before

mellow panther
#

i shall try and get back ForYou

#

is this normal

austere bison
#

well what are you trying to access? 8080 is just where the proxy is listening at

mellow panther
#

grasscutter is running in the background

#

and

austere bison
#

yeah you access grasscutter on 443

mellow panther
#

if mitmdump is not running, i shouldve just got not reachable i assumed... (i might be gravely wrong)

austere bison
#

your mitm should be good if you set the environment variables, I don't use mitm but on fiddler you would just get the loopback service if you went to localhost:8080

mellow panther
#

im pretty sure its a firefox problem?

mellow panther
austere bison
#

you could but I'm pretty sure the traffic issue is due to arch itself (since the applications use the env settings for proxy) and not what proxy you use, though no harm in trying if you can

mellow panther
austere bison
#

yeah that should be good, have you tried logging in to the game with mitmdump and grasscutter running since you set that?

mellow panther
mellow panther
#

this isnt going through the proxy

#

so the game shouldnt work right?

austere bison
#

that may be the case, you might want to change the http_proxy to be http://localhost:8080/ instead in that case first, just to see

#

Though some domains are specifically blocked rather than redirected/accepted

#

such as data uploads

austere bison
#

yeah

mellow panther
#

just noticed some activity

#

ill just try and launch the game at this point

austere bison
#

is your system proxy also on?

mellow panther
#

no only mitmdump is that system proxy? Jean_Oh

austere bison
#

No I mean your actual system proxy settings, not sure where they're at in arch but should be in your network settings somewhere

mellow panther
#

i wasnt

#

also, i launched the game

#

and it connected to hoyo servers

#

installed gnome control center for now

#

got mitmproxy working

#

ill try launching the game

#

it auto logged into my burner account Jean_Oh

#

i got it working!!!!!!!!!!!!! all i had to add was these env variables in the anime launcher serttings

#

i got this error tho

#

i assume thats cuz of an unpached ua.dll

austere bison
#

Ahh nice

#

Yeah that's because of needing patch

mellow panther
#

ill get back to you ForYou

#

i did the thing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#

omfg

#

thank you soo much ForYou @austere bison GH_gigachad

austere bison
#

Glad it all worked out haha

mellow panther
mellow panther
mellow panther
empty dome
mellow panther
#

yes

#

but like

#

itll work with basically any settings manager

#

even without one if you can craft the required command

#

i was using dwm and i downloaded the full gnome suite

#

to make my life easier

empty dome
#

Yeah I known....but let's just say I haven't had great experiences with networking stuff

mellow panther
#

so.. if you require help with anything linux grasscutter related, how about making a new support post while referring to this ancient post so that the new one can be marked as completed. cuz there arent many support posts related to linux and the existent ones are an intertangled mess. 💀

empty dome
mellow panther
#

what error? Jean_Oh

#

make sure you use http only. for both http_proxy and https_proxy too. else if you use https for https_proxy, ill be treated as if you are using encryption which afsik, shouldnt be using when you are locally hosting grasscutter.

austere bison
#

you do indeed use encryption for local hosted grasscutter

#

only cultivation is the odd duckling that requires it disabled

mellow panther
#

ohh

#

ill try to understand why thats the case

austere bison
#

cultivation doesn't use ssl for local connections iirc

mellow panther
#

ohh

austere bison
#

so it has to be disabled server-side or you will always error

mellow panther
#

ssl issue

#

damn

#

if there's ever gonna be a cultivation binary for linux, i think it would be easy for the devs to implement ssl and let the encryption be enabled by default

austere bison
#

that's something to do with cultivation's proxy being made for culti, whereas existing proxy programs (mitm, fiddler) do use it so the server has encryption enabled (thus encryption enabled being default for the server)

empty dome
mellow panther
# empty dome

guess you gotta use https(since you are connecting to an external server)? i got no idea tbh

austere bison
#

https is required for any external servers

#

is that how the proxy works though? seems awfully wrong but WarShrug_Sestrar

mellow panther
austere bison
#

you only have to accept the root cert for cultivation, not mitm (unless you installed mitm)

#

that's what the cert popup in culti is at least, it's for "Cultivation"

empty dome
#

like this?

mellow panther
empty dome
#

Port needs to be specified?

austere bison
#

man I'm not sure how to tell you this but I'm 99% that is for your local system proxy

#

unless you want to try to send your entire system traffic to cherrymint (you won't be getting anything working)

#

your proxy should be 127.0.0.1 on 8080, then your proxy (which is listening on 8080) determines that the game traffic specifically is sent to cherrymint (on 443)

empty dome
#

so i dont touch nothing on the gnome settings

#

and i set the lauch variables?

austere bison
#

you just need to send the game traffic to your proxy, which then sends it to the server specified instead of where it normally wants to go

mellow panther
# empty dome like this?

**try this: **

for system proxy:
http_proxy http://127.0.0.1:8080/
https_proxy https://127.0.0.1:8080/

for an-anime-game-launcher:
http_proxy http://cherrymint.live/
https_proxy https://cherrymint.live/

#

ayo no...

#

it looks wrong

austere bison
#

aren't you using mitm alongside the launcher?

#

change the ip in proxy_config.py

mellow panther
#

but it just looks wrong

austere bison
#

you were using mitm with that though right

#

looks right, the game traffic is sent to mitm which is listening at 127.0.0.1:8080 then mitm handles sending the traffic matching the script to the server and the rest is left alone to passthrough

empty dome
#

i got the python file ready

austere bison
empty dome
#

invalid data format

austere bison
# empty dome

what is this? It's called proxy config but that's not the actual proxy config file for grasscutter

austere bison
mellow panther
#

wait a sec, @austere bison , localhost:8080 is mitm and localhost:443 is grasscutter right?

austere bison
#

yes your proxy is on 8080, the server dispatch is on 443

#

you don't try to connect to the server on 8080

mellow panther
#

i think i get it now

austere bison
#

your proxy config is set to 8080 because that's where the proxy is at

#

the proxy application on your system (such as mitm)

austere bison
# empty dome

put the script above somewhere and then run mitmdump -s proxy.py -k where the file is, you may need to sudo

mellow panther
# empty dome

i dont think he needs to enable any system proxy.

i think this this worth a try:

in proxy_config.py:
REMOTE_HOST = "cherrymint.live"
REMOTE_PORT = 443

in the an-anime-game-launcher:
http_proxy http://127.0.0.1:8080/
https_proxy https://127.0.0.1:8080/

mellow panther
empty dome
#

i cant login

austere bison
#

#1025543438604710018
I get the feeling the error you get is here

#

perhaps at the very top of the list

mellow panther
austere bison
#

also that

mellow panther
empty dome
#

wrong hoyoverse id

mellow panther
#

screenshot?

#

cuz

austere bison
#

sounds like your proxy isn't on

mellow panther
empty dome
austere bison
#

ok cool but are you sending your traffic there

#

can't route the traffic if your traffic isn't going through it

mellow panther
#

but how tho?

#

wait

austere bison
#

that's what the env variables are for, pretty sure you need the system proxy on too though

mellow panther
#

yes

#

maybe

empty dome
#

there?

austere bison
#

well the env variables are just telling the application where the proxy is, no?

austere bison
#

just change both address boxes to localhost or 127.0.0.1

mellow panther
#

like in systemproxy, http_proxy = localhost & https_proxy = localhost

mellow panther
austere bison
#

in a normal setup that is exactly what happens

#

all traffic goes through the proxy, and the proxy script determines what passes through and what is redirected

mellow panther
mellow panther
#

cuz if thats right in the theory part, its just a matter of implementing it through vars

empty dome
#

all other apps are going throught the proxy

austere bison
#

yes that is correct, then your game launcher needs the http_proxy and https_proxy variables set to send the game traffic there as well

empty dome
austere bison
#

looks like you haven't trusted the cert yet though

mellow panther
mellow panther
empty dome
#

i understood that part....

#

the ssl cert

mellow panther
mellow panther
empty dome
#

ok...why i cant install now

mellow panther
#

ssl cert?

empty dome
#

yeah

mellow panther
#

maybe you have it already installed

#

check the trusted ca's in your system settings

empty dome
#

the directory in fedora was diferent

mellow panther
#

so you running gnome on fedora?

empty dome
#

yeah

#

networkfailure

mellow panther
#

try visiting localhost:8080 on your browser

austere bison
#

perhaps a network error of the code 4214?

mellow panther
#

i swear of thats the error...

#

#1025543438604710018

empty dome
mellow panther
#

sorry my bad

empty dome
#

Welcome to Grasscutter!

austere bison
#

should be visiting an mhy or genshin site

#

much easier than trying to go to the proxy host address

#

just try opening the genshin main site

mellow panther
mellow panther
#

my bad

empty dome
austere bison
#

go to genshin site

empty dome
mellow panther
# empty dome

hmmmm... try removing all of the http_proxy variables and just have the https_proxy variables only..?

empty dome
#

in the laucher?

mellow panther
# empty dome

yea proxy no work, problem with system not being able to route traffic through mitm

mellow panther
austere bison
#

you didn't turn it off?

empty dome
mellow panther
#

also, your launcher looks like the gtk version... so why do i have this smoolll feeling that its a bug with the gtk version of the anime game launcher? (since it worked for me using the stock aur version (i might be gravely wrong TeriDumb ))

austere bison
# empty dome

well it looks like it isn't on so you'll want to make sure it is, just like back here when your traffic was going through it

empty dome
#

i will be back

mellow panther
empty dome
#

well...fuck

#

late

mellow panther
#

ohh nooo...

#

also, have you confirmed that the private server was working when you were hosting gc locally?

empty dome
# mellow panther ohh nooo...

Yeah...I will try again after my job is done...
Anyways if your want a REAL CHALLENGE try running grasscuters/joining private servers on Ubuntu touch lololol

heavy knoll
#

Any possibility on potentially doing a writeup on how to get it working? Got a laptop with Linux installed, and I was considering doing some work on a MelonLoader plugin that I'm working on which seemingly requires a private server instance to work.

austere bison
#

Use AAGL, there are newer threads with better info already, including one in the pinned thread

#

This one pretty much covers it though, use AAGL, get the game good to go with that, set up mitmproxy, set proxy in environment variables in AAGL, launch mitm with command line (see grasscutters github if you don't know), launch game. For running Grasscutter, download a full build from #resources, extract it, and start it

heavy knoll
#

So I've set MangoDB up, alongside getting mitmproxy mostly working (more on that later), and getting Grasscutter working with a 44300 port (as 443 is taken by my web browser).

However, I'm having a bit of a problem with importing the needed SSL certificates for HTTPS URLs to connect properly. The mitmproxy site (mitm.it IIRC) shows up, it's just that the import instructions for the key doesn't seem to work with Fedora (Which I'm using instead of Ubuntu, which is seemingly what the instructions are geared towards). Also, if I have Steam open, mitmproxy refuses to start up, and I'm wondering if I can change the port of that somehow. mitmproxy launches, it just doesn't make the .py script needed to configure anything.

austere bison
#

Just look up how to import root certs for Fedora, though I'm not familiar with it I'm sure the documentation has info for something so used

heavy knoll
#

Okay. Thanks for the tip!

austere bison
#

Sure thing

heavy knoll
#

Yeah, my bad. I got that set up, and now when I enter in one of the URLs in the host in my web browser, it says "Welcome to Grasscutter". Now when I try and sign in, it doesn't let me agree to the Terms of Service.

#

nevermind about that last part

#

Got that fixed.

#

Anyways, I got it up and running now.

#

Okay, now that I actually log in, it's now giving me an error with the code 12-4301

#

Alright, yeah I used the anime game launcher. Restarting still gives me the error

austere bison
heavy knoll
#

On it.

#

Same error with the freshly created account.

#

Okay, Time to redownload the game.

#

I did move over my game data files from the RPM repository of the anime game launcher, as I figured out the dependency issues with the flatpak. So that might have caused problems.

#

Although when I'm using the 3.7 GC resource files from YuukiPS, it's trying to claim the game server version is 3.6.

#

I remember trying to download the resource files from the grasscutter wiki, and made an account and such to try and access it, but it wouldn't budge

austere bison
#

Resources have nothing to do with what version is displayed in the cmd, that's dependent on the jar

#

Yuuki resources are the correct ones to use

#

You're trying to use a 3.6 Grasscutter jar, so that's why that is displayed in the cmd

heavy knoll
#

The 1.5.0 jar in the releases section?

austere bison
#

If you're using the release on the github that is for 3.6 yes

#

It's the first line in the release notes changelog

#

If you want 3.7 then get the 3.7 commit build from actions or build from source

#

Any build from development branch after 3.7 commit will work too of course

heavy knoll
#

Thanks. Now it shows up right.

heavy knoll
#

Okay, redownloaded the game alongside updating the version of grasscutter, and it still prints out the same error code.

#

It gives me this in the logs for grasscutter:

20:40:06 <INFO:DefaultAuthenticators$SessionKeyAuthenticator> [Dispatch] Client [0:0:0:0:0:0:0:1] succeed to exchange combo token.```
#

Yeah, same error.

#

Tried making a new account.

shy lance
heavy knoll
#

No I don’t think so, will have to try again.

shy lance
#

Are you using VPS or LAN?

heavy knoll
#

LAN, but I had it set to connect via localhost.

#

As in I start the server on my main machine, and then connect to it with the same thing.

#

So like a listen server.