A Fudge Dice rolling room programmed in Go.
Find a file
riomoo 62daab494a
feat and dev merging (#2)
- Plus and Minus button added for modifier
- better WS:// and WSS:// implementation
- dev: readme adjusted

Reviewed-on: #2
Co-authored-by: riomoo <alister@kamikishi.net>
Co-committed-by: riomoo <alister@kamikishi.net>
2026-01-13 09:21:39 -05:00
app/gofudge feat and dev merging (#2) 2026-01-13 09:21:39 -05:00
scripts-bash feat and dev merging (#2) 2026-01-13 09:21:39 -05:00
.gitattributes init commit 2025-10-20 09:25:55 -04:00
Containerfile feat and dev merging (#2) 2026-01-13 09:21:39 -05:00
go.mod Full packaged app 2025-10-20 11:51:35 -04:00
go.sum Full packaged app 2025-10-20 11:51:35 -04:00
LICENSE Full packaged app 2025-10-20 11:51:35 -04:00
README.md feat and dev merging (#2) 2026-01-13 09:21:39 -05:00

GoFudge

A Fudge Dice rolling room programmed in Go

License

Custom badge

Prerequisites

Go

  • The version of Go used to test the code in this repository is 1.25.3.

Get started

  • run the following commands: go mod tidy; go build -o bin/main ./app/gofudge/main.go then ./bin/main to start the server on port 8080.

  • Visit http://localhost:8080 in your browser.

  • Upon visiting the URL you will be created with a username entry and Create room button. After that you will be in the room.

  • (If you are hosting this publicly) You can copy the room link in the top right hand corner and share it to anyone. They will be prompted to also pick a username.

  • From there you may increase/decrease the modifier as needed for the skill you are rolling for.

Podman/Docker

  • If you want to use this with Docker, replace all podman commands in run.sh instances with docker
  • Use run.sh script which will start the site on port 12007 and to make it public change the 8080 port in the NGINX config to 12007 or change the port in the run.sh script how you like.
  • To use it locally, same as above but visit http://localhost:12007 instead.

Config for NGINX to use as a website:

upstream gofudge {
        server 127.0.0.1:8080;
        #server 127.0.0.1:12007; #For Podman instead
        server [::1]:8080;
        #server [::1]:12007; #For Podman instead
}
server {
        listen 80;
        listen [::1]:80;
        server_name fudge.example.com;
        location /ws {
                proxy_pass http://gofudge;
                proxy_http_version 1.1;
                
                # WebSocket upgrade headers
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                
                # Standard proxy headers
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                
                # WebSocket timeout settings (increase for long-lived connections)
                proxy_connect_timeout 7d;
                proxy_send_timeout 7d;
                proxy_read_timeout 7d;
                
                # Disable buffering for WebSocket
                proxy_buffering off;
                
                # Security headers
                add_header X-Content-Type-Options nosniff;
                add_header X-Frame-Options DENY;
                add_header X-XSS-Protection "1; mode=block";
                add_header Referrer-Policy "strict-origin-when-cross-origin";
        }
        location / {
                proxy_pass http://gofudge;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;

                # Connection keep-alive for better performance
                proxy_http_version 1.1;
                proxy_set_header Connection "";

                # Timeouts optimized for your simple site
                proxy_connect_timeout 5s;
                proxy_send_timeout 10s;
                proxy_read_timeout 10s;

                # Enable buffering for better compression
                proxy_buffering on;
                proxy_buffer_size 4k;
                proxy_buffers 8 4k;

                # Security headers
                add_header X-Content-Type-Options nosniff;
                add_header X-Frame-Options DENY;
                add_header X-XSS-Protection "1; mode=block";
                add_header Referrer-Policy "strict-origin-when-cross-origin";
        }
}

Software Used but not included

Arch Vim Git Forgejo