#Mac OS Caddy Install

1 messages · Page 1 of 1 (latest)

tawny comet
#

Moving us in here as we're going to be cluttering things up

lusty stirrup
#

thanks for your help on this.

#

indeed. than kyou.

tawny comet
#

You'll always get an error with https://localhost as it can't have a valid cert. Try curl http://localhost

lusty stirrup
#

nothing. just returns the CL prompt

#

this is what I get when I try to check the config: ```curl -v https://localhost:2019/config [15:13:34]

  • Trying 127.0.0.1:2019...
  • Connected to localhost (127.0.0.1) port 2019 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • error:1408F10B:SSL routines:ssl3_get_record:wrong version number
  • Closing connection 0
    curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number```
#

maybe a cert issue?

tawny comet
#

shouldn't be as caddy manages it's certs automatically

#

I am guessing caddy isn't even running and instead you're running apache which is installed on osx by default

#

so lets try this

#

run sudo lsof -i :443

#

it should spit out a list of something running on port 443

lusty stirrup
#

lot of stuff! what am I looking for?

tawny comet
#

paste a screenshot

#

shouldn't be lots of stuff lol

lusty stirrup
#

caddy is in there

tawny comet
#

ah it's showing all the outbound connections too. Caddy is listed there as running so that's good

#

So changes are localhost isn't in your caddyfile which is why it's erroring

lusty stirrup
#

Hm. According to some stuff I found, Caddyfile should reside in a home brew directory.

#

Let me find it right quick

tawny comet
#

Try curl "http://localhost:2019/config/"

#

and lets see what it actually has in the caddyfile

lusty stirrup
#

in /opt/homebrew/etc/Caddyfile

tawny comet
#

That sounds about right

#

It's been a few years since I've used homebrew, but it always puts configs in a weird place

lusty stirrup
#

says "jq" is not a valid command

#

should it be _jq?

tawny comet
#

yeah probably

#

mac keeps renaming things lol

lusty stirrup
#
_arguments:comparguments:325: can only be called from completion function
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    43  100    43    0     0  16183      0 --:--:-- --:--:-- --:--:-- 43000
curl: (23) Failed writing body
tawny comet
#

hm

lusty stirrup
#

gibberish to me.

#

lol

tawny comet
#

So do nano /opt/homebrew/etc/Caddyfile

#

see if it has the default config in it which is usually a :80 directive

lusty stirrup
#

I've already modified this file. It's this content: ```# A CONFIG SECTION FOR YOUR IP AND HOSTNAME
{
default_sni 192.168.5.61
}

192.168.5.61 {
# PROXY ALL REQUEST TO PORT 30000
tls internal
reverse_proxy localhost:30000
encode zstd gzip
}

foundry.azthir-terra.com {
reverse_proxy localhost:30000
encode zstd gzip
}

Refer to the Caddy docs for more information:

https://caddyserver.com/docs/caddyfile

#

that ip address is reserved for the mac and doesn't change. ports are open. router can handle hairpin NAT

tawny comet
#

so that does load

#

You did update your port forward rules already?

lusty stirrup
#

i did. they're good.

tawny comet
#

Then it's being served

lusty stirrup
#

I can get to the foundry instance. It just doesn't seem to want to load anything.

tawny comet
#

k

lusty stirrup
#

30000, 443 and 80 are open.

tawny comet
#

lets try this

lusty stirrup
#

and i can get to it from outside my home network, too.

tawny comet
#

I pulled it up myself

#

2 questions for you

lusty stirrup
#

do you want to log in as a tester and see the errors?

tawny comet
#

sure

#

Did you edit your hosts file at any point to point to the pi on the FQDN?

lusty stirrup
#

I'll PM you the log in details

tawny comet
#

Most routers don't see themselves on the internet and will give weird errors such as this when trying to access your own WAN address

lusty stirrup
#

hosts file is as follow: ```##

Host Database

localhost is used to configure the loopback interface

when the system is booting. Do not change this entry.

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.5.61 foundry.azthir-terra.com

Added by Docker Desktop

To allow the same kube context to work on the host and the container:

127.0.0.1 kubernetes.docker.internal

End of section

tawny comet
#

that looks right

#

oh boy how do you run with 165 active modules! No wonder the pi was melting

lusty stirrup
#

lol.

#

ok. when I log in as localhost:30000 there are no 502 errors. so this is def a caddy thing, right?

tawny comet
#

I have no 502 errors myself

#

I think it's a cache thing

lusty stirrup
#

on the browser?

tawny comet
#

Yep

#

You have a couple module errors, but no 502 errors

lusty stirrup
#

let me try another browser

#

nope. same issue.

#

so it's only happening when I log in from my internal network and hit the domain instead of localhost:3000

tawny comet
#

The host file should be preventing that

#

but basically your router is having a hard time seeing itself

#

First thing I'd do is make a backup of your world, then load in safe configuration

#

And see if you still get any 502 errors

lusty stirrup
#

i don't. I've already tried that and it loads clean

tawny comet
#

Then it's a module causing your problems and I can tell you it's more than one

#

Uncaught (in promise) TypeError: ConditionalVisibility.INSTANCE is undefined [Detected 6 packages: conditional-visibility, lib-wrapper, levels, smarttarget, monks-active-tiles, zoom-pan-options] are all throwing errors

lusty stirrup
#

yeah, tons of modules are throwing errors.

tawny comet
#

You have about 60 I see that aren't even updated to v9

lusty stirrup
#

i've tried changing the permissions on the foundrydata folder.

#

this was working ok on the pi. Just a bit slowly.

#

i could access it internally, it ran with all the modules, etc.

#

i just wanted to try to give it some oomph

tawny comet
#

Was it the same v9.242?

lusty stirrup
#

yeah.

#

do you think i should try a reinstall?

tawny comet
#

I am surprise the pi didn't crash with this many modules running ot be honest

lusty stirrup
#

it kind of did on Sunday in a big battle.

tawny comet
#

No you should update and trim your module list to use modules designed for the version of foundry you're running

#

or roll back to 0.8.9 if you can't live without them

lusty stirrup
#

not sure I can roll back since the actors have all been migrated... hm..

#

i wonder why i can run it fine with localhost:30000 but not the domain name?

tawny comet
#

see if it just reports 127.0.01

#

traceroute foundry.azthir-terra.com

lusty stirrup
#

traceroute to foundry.azthir-terra.com (192.168.5.61), 64 hops max, 52 byte packets 1 foundry.azthir-terra.com (192.168.5.61) 0.252 ms 0.027 ms 0.025 ms

tawny comet
#

Are you playing from the mini?

#

you said localhost:30000 works?

#

if so I'd change the host file to 127.0.0.1 foundry.azthir-terra.com

lusty stirrup
#

yeah, i'm on the mini.

#

lemme try that.

tawny comet
#

it shouldn't make a big difference

lusty stirrup
#

i can always play from localhost:30000. I'm just concerned the players will have issues.

#

since they're hitting it from outside my home network

tawny comet
#

I didn't have any 502 errors. I only had module runtime errors

#

I think at this point you're in #modules land as disabling and cleaning modules fixes your issue. Module errors could cause other modules to stop loading which could cause the 502 error as well

#

Your path forward really is module upkeep or a rollback

lusty stirrup
#

hm. ok. thank you! I really appreicate your help.

#

is this an example of a runtime error? Uncaught ReferenceError: CONFIG is not defined [Detected 1 package: unknown:quick-encounters] at EncounterNote.js:71:15

tawny comet
#

That is one yeah. I was getting hundreds of errors from something that kept trying to do something it couldn't, but I've since closed the page

#

The ones in red are the import ones. Yellow you can ignore

lusty stirrup
#

i wonder what the issue is. I just copied the whole foundrydata directory from the pi onto the mac.

tawny comet
#

you can run a chown -r user:user on your data folder and see if that helps

#

if you were being naughty and running the pi server as root it might help

lusty stirrup
#

no, it was running in my user directory.

#

when you say "user:user" you mean my account name right?

tawny comet
#

yeah

#

if you were starting the server with sudo it would have messed up permissions too

lusty stirrup
#

nope. not doing that either

#

using pm2

tawny comet
#

depends how you moved the files. tar preserves permissions and owner, but a zip wont. So if you zipped it and extracted it then it's not likely a permissions thing

lusty stirrup
#

lemme try that.

#

nope. no difference

tawny comet
#

Didn't expect it to really

lusty stirrup
#

this is maddening. I think i'll just go back to the pi and live with it.

#

thanks for your patient help, though. i really appreciate it.

#

quick question: Would it be possible to run caddy on the pi while running foundry on the mac? If i changed the caddyfile on the pi to point to the mac?

tawny comet
#

Yeah you just would point to the mac ip:30000

lusty stirrup
#

maybe that's the easiest thing to do then! would the caddyfile be: ```# This replaces the existing content in /etc/caddy/Caddyfile

A CONFIG SECTION FOR YOUR IP AND HOSTNAME

{
default_sni mac.ip
}

mac.ip {
# PROXY ALL REQUEST TO PORT 30000
tls internal
reverse_proxy localhost:30000
encode zstd gzip
}

foundry.azthir-terra.com {

PROXY ALL REQUEST TO PORT 30000

reverse_proxy localhost:30000
encode zstd gzip

}

Refer to the Caddy docs for more information:

https://caddyserver.com/docs/caddyfile

This replaces the existing content in /etc/caddy/Caddyfile

A CONFIG SECTION FOR YOUR IP AND HOSTNAME

#

and that would live on the pi at /etc/caddy/Caddyfile, right?

#

because the pi is also handling the dnynamic dns

#

through route53

tawny comet
#

# A CONFIG SECTION FOR YOUR IP AND HOSTNAME

foundry.azthir-terra.com {
   # PROXY ALL REQUEST TO PORT 30000
    reverse_proxy macIP:30000
    encode zstd gzip
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

# This replaces the existing content in /etc/caddy/Caddyfile

# A CONFIG SECTION FOR YOUR IP AND HOSTNAME```
lusty stirrup
#

and the port forwarding for foundry would be for the mac's IP address, right? not the Pi's

tawny comet
#

You want the port forwarding to go to whatever is running caddy. So you'd port forward to the pi

lusty stirrup
#

even the 30000?

tawny comet
#

30000 i'd point to the mac

lusty stirrup
#

and the 443 and 80?

tawny comet
#

80 and 443 to the pi

#

you'll also need to update your hosts file to point the domain to the pi's address

lusty stirrup
#

hosts on the mac, right?

tawny comet
#

ya

#

Your setup is basically outside of what you can expect for support at this point. You may want to consider looking at something like oracle free or aws if you keep having issues