[Support] fithwum - FoundryVTT


Recommended Posts

On 11/13/2020 at 11:34 PM, Aiorus said:

Thanks for the docker!

 

But I'm having an issue, hope someone can help me. For some reason, the WebSocket connections are not being handled/done, they have a 400 error code. I'm using CloudFlare, in case it helps.

 

Thanks!

I had this same problem.  My buddy who also runs a similar setup managed to get it working by commenting out the lines in the nginx proxy-conf file for Foundry that looks like this:

 

 # These are important to support WebSockets
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

 

After I did that and restarted swag/letsencrypt every thing worked like normal.

 

I think it has something to do with cloudflare.  I recently switched configs to use cloudflare's dns authentication.

Edited by imit8r
  • Thanks 1
Link to comment

I am trying to get the built in voice chat to work with foundry.  After some tinkering I was able to follow some of the guides associated with this on foundry's site.  I still can't make it work, and I am pretty sure it has something to do with the certs.  I tried mounting the cert directory from swag in the foundry docker.  When I try pointing the foundry setup for where the certs are it can never find them.  Not sure what I am doing wrong, but I would love some help.

Link to comment

like i said you could try a different service

 

Top Alternatives to Cloudflare

Amazon CloudFront.

Fastly.

Microsoft Azure CDN.

Imperva Cloud Application Security.

KeyCDN.

Sucuri.

Akamai.

StackPath CDN.

 

This is the list Goole gives fo other options

Edited by fithwum
Link to comment
On 9/9/2020 at 4:31 AM, Brawbag said:

When i start the container, i get this error message:

 

INFO ! Starting FoundryVTT-0.6.5

internal/modules/cjs/loader.js:969
throw err;
^

Error: Cannot find module '/foundry/fvtt/resources/app/main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

 

I'm not too sure where to go from this!!

 

EDIT:  SOLVED - seems to have resolved by adding the /vtt folder in the container variables, differing from the picture in an earlier post!

I am having the same issue.
Can you or anyone post a screenshot of your working Docker config.
Thanks

Also i see this in the log

Current FoundryVTT Release version is 0.7.5.
However i have downloaded version is 0.7.7 from the foundry website.

Edited by Rothan
Link to comment
  • 3 weeks later...

I was also getting the websocket error:

WebSocket connection to 'wss://...' failed: Error during WebSocket handshake: Unexpected response code: 400

After following @imit8r's suggestion and removing those lines it is all working! 


Below is my nginx proxy conf if anyone else has the same issue. This is running on https behind Cloudflare on a subdomain using Cloudflare's DNS
and so far no problem.

Quote

## Version 2020/12/22
# make sure that your dns has a cname set for foundry and that your foundry container is not using a base url

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name foundry.*;

    include /config/nginx/ssl.conf;

    # Sets the Max Upload size to 300 MB
    client_max_body_size 300M;

    location / {
        include /config/nginx/proxy.conf;

        resolver 127.0.0.11 valid=30s;
        set $upstream_app foundryvtt;
        set $upstream_port 30000;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    }
}

 

Here is my options.json from the foundry/Config directory:

Quote

{
  "port": 30000,
  "upnp": true,
  "fullscreen": false,
  "hostname": "foundry.server.com",
  "routePrefix": null,
  "sslCert": null,
  "sslKey": null,
  "awsConfig": null,
  "dataPath": "/foundry/data",
  "proxySSL": true,
  "proxyPort": 443,
  "minifyStaticFiles": true,
  "updateChannel": "release",
  "language": "en.core",
  "world": null
}

 

Thanks for setting this up @fithwum!

  • Thanks 1
Link to comment
  • 2 weeks later...

sounds like a reverse proxy error that i ran into.

 

This is my proxy config that works with swag.

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name foundryvtt.*;
	
    # Listen on port 443 using SSL certificates
    ssl_certificate         "/etc/letsencrypt/live/"PUT URL HERE"/fullchain.pem";
    ssl_certificate_key     "/etc/letsencrypt/live/"PUT URL HERE"/privkey.pem";

    include /config/nginx/ssl.conf;
	#add_header Referrer-Policy "same-origin" always;
	#add_header Access-Control-Allow-Origin https://foundryvtt."PUT URL HERE" always;

    client_max_body_size 1024M;
	fastcgi_buffers 64 4K;

    location / {
        #enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        #enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

		# Set proxy headers
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # These are important to support WebSockets
        # proxy_set_header Upgrade $http_upgrade;
        # proxy_set_header Connection "Upgrade";

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app FoundryVTT;
		proxy_max_temp_file_size 1024m;
        proxy_pass http://$upstream_app:30000;
	}
}

# Optional, but recommend. Redirects all HTTP requests to HTTPS for you
server {
    if ($host = foundryvtt."PUT URL HERE") {
        return 301 https://$host$request_uri;
    }

    listen 80;
	listen [::]:80;

    server_name foundryvtt."PUT URL HERE";
    return 404;
}

 

Link to comment
  • 1 month later...

I found this error when i hit F12 on the page.

 

Firefox can't establish a connection to the server at wss://foundry.web.address/socket.io/?session=blahblah=3&transport=websocket.

 

My SWAG nginx file.

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name foundry.*;

    include /config/nginx/ssl.conf;
    add_header Referrer-Policy "same-origin" always;
    #add_header Access-Control-Allow-Origin https://foundryvtt.fithwum.tech always;

    client_max_body_size 2048M;
    fastcgi_buffers 64 4K;

    #enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    location / {
        #enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        #enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        # Set proxy headers
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # These are important to support WebSockets
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app foundry;
        set $upstream_port 30000;
		proxy_max_temp_file_size 2048m;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;        
    }
}

 

 

Looks like a websocket error.

Link to comment
  • 2 weeks later...
On 2/8/2021 at 11:09 AM, Rothan said:

I found this error when i hit F12 on the page.

 

Firefox can't establish a connection to the server at wss://foundry.web.address/socket.io/?session=blahblah=3&transport=websocket.

 

My SWAG nginx file.


server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name foundry.*;

    include /config/nginx/ssl.conf;
    add_header Referrer-Policy "same-origin" always;
    #add_header Access-Control-Allow-Origin https://foundryvtt.fithwum.tech always;

    client_max_body_size 2048M;
    fastcgi_buffers 64 4K;

    #enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    location / {
        #enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        #enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        # Set proxy headers
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # These are important to support WebSockets
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app foundry;
        set $upstream_port 30000;
		proxy_max_temp_file_size 2048m;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;        
    }
}

 

 

Looks like a websocket error.

looks like you might be using an old config that has a problem with swag if you scroll up a bit you should see another post i made with an updated one that works you just need to rill in the relevant info for your setup

Link to comment
  • 3 weeks later...

@fithwum Thank you for your container! I just stood one up today.

 

I would suggest replacing the addgroup and adduser in the Dockerfile with just this one add user command

 

RUN adduser -D -u 99 -G users -h /foundry -s /bin/bash foundry

 

Then in "Install_Script.sh"

replace

 

exec node /foundry/fvtt/resources/app/main.js --dataPath=/foundry/data

 

with

 

su foundry -c 'node /foundry/fvtt/resources/app/main.js --dataPath=/foundry/data'

 

That should... do everything in the start script as root (fixing permissions, ect) then run the app as "foundry" with the correct userid(99) and GroupID(100) that UnRaid expects for the nobody and users.

 

Then any New stuff created will inherit those permissions.

 

I have done this on my system by deleting the current foundry user then useing the above adduser from the console, then wastefully installing vim ;) and editing the Install_Script.sh. So for the changes work as expected.

  • Thanks 1
Link to comment
1 hour ago, Cyd said:

@fithwum Thank you for your container! I just stood one up today.

 

I would suggest replacing the addgroup and adduser in the Dockerfile with just this one add user command

 

RUN adduser -D -u 99 -G users -h /foundry -s /bin/bash foundry

 

Then in "Install_Script.sh"

replace

 

exec node /foundry/fvtt/resources/app/main.js --dataPath=/foundry/data

 

with

 

su foundry -c 'node /foundry/fvtt/resources/app/main.js --dataPath=/foundry/data'

 

That should... do everything in the start script as root (fixing permissions, ect) then run the app as "foundry" with the correct userid(99) and GroupID(100) that UnRaid expects for the nobody and users.

 

Then any New stuff created will inherit those permissions.

 

I have done this on my system by deleting the current foundry user then useing the above adduser from the console, then wastefully installing vim ;) and editing the Install_Script.sh. So for the changes work as expected.

worth a shot thanks for the info i will try it today and push out an update

 

EDIT: Seems to work well will try over the next few days but update is out now for the docker.

Edited by fithwum
Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.