#Mac OS Caddy Install
1 messages · Page 1 of 1 (latest)
You'll always get an error with https://localhost as it can't have a valid cert. Try curl http://localhost
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?
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
lot of stuff! what am I looking for?
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
Hm. According to some stuff I found, Caddyfile should reside in a home brew directory.
Let me find it right quick
Try curl "http://localhost:2019/config/"
and lets see what it actually has in the caddyfile
in /opt/homebrew/etc/Caddyfile
That sounds about right
It's been a few years since I've used homebrew, but it always puts configs in a weird place
_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
hm
So do nano /opt/homebrew/etc/Caddyfile
see if it has the default config in it which is usually a :80 directive
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
i did. they're good.
Then it's being served
I can get to the foundry instance. It just doesn't seem to want to load anything.
k
30000, 443 and 80 are open.
lets try this
and i can get to it from outside my home network, too.
do you want to log in as a tester and see the errors?
I'll PM you the log in details
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
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
that looks right
oh boy how do you run with 165 active modules! No wonder the pi was melting
lol.
ok. when I log in as localhost:30000 there are no 502 errors. so this is def a caddy thing, right?
on the browser?
hm. i just cleared the cache in chrome and logged back in via foundry.azthir-terra.com and they came right back up.
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
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
i don't. I've already tried that and it loads clean
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
yeah, tons of modules are throwing errors.
You have about 60 I see that aren't even updated to v9
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
Was it the same v9.242?
I am surprise the pi didn't crash with this many modules running ot be honest
it kind of did on Sunday in a big battle.
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
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?
do a tracert on foundry.azthir-terra.com
see if it just reports 127.0.01
traceroute foundry.azthir-terra.com
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
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
it shouldn't make a big difference
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
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
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
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
i wonder what the issue is. I just copied the whole foundrydata directory from the pi onto the mac.
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
no, it was running in my user directory.
when you say "user:user" you mean my account name right?
yeah
if you were starting the server with sudo it would have messed up permissions too
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
Didn't expect it to really
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?
Yeah you just would point to the mac ip:30000
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
}
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
# 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```
and the port forwarding for foundry would be for the mac's IP address, right? not the Pi's
You want the port forwarding to go to whatever is running caddy. So you'd port forward to the pi
even the 30000?
30000 i'd point to the mac
and the 443 and 80?
80 and 443 to the pi
you'll also need to update your hosts file to point the domain to the pi's address
hosts on the mac, right?