Skip to content

docs: add Cloudflare Tunnel guidance for self-hosting#87

Open
sure-admin wants to merge 1 commit into
mainfrom
docs/cloudflare-tunnel-self-hosting
Open

docs: add Cloudflare Tunnel guidance for self-hosting#87
sure-admin wants to merge 1 commit into
mainfrom
docs/cloudflare-tunnel-self-hosting

Conversation

@sure-admin

@sure-admin sure-admin commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a focused Cloudflare Tunnel section to the Docker self-hosting guide
  • document the required RAILS_ASSUME_SSL setting behind TLS termination
  • show a minimal cloudflared service and the http://web:3000 origin setting

Why

People self-hosting Sure commonly want remote access without opening router ports, and Cloudflare Tunnel is a practical path for that setup.

Summary by CodeRabbit

  • Documentation
    • Added a new optional section to the self-hosting guide covering Cloudflare Tunnel integration, including configuration steps for environment variables, Docker Compose updates, tunnel service setup, and hostname management with security recommendations.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds an optional Cloudflare Tunnel configuration section to the self-hosting documentation. The new content guides users through configuring tunnel credentials via environment variables, updating Docker Compose settings, deploying the cloudflared service, and routing public traffic to the internal web application while managing security considerations.

Changes

Cloudflare Tunnel Configuration Guide

Layer / File(s) Summary
Cloudflare Tunnel setup documentation
self-hosting.mdx
Adds optional Cloudflare Tunnel configuration steps covering environment variable setup (CLOUDFLARE_TUNNEL_TOKEN), Docker Compose updates (RAILS_ASSUME_SSL: "true"), cloudflared service definition with networking, public hostname routing to http://web:3000, startup commands, and security notes about internal HTTP communication and port exposure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tunnel through clouds, so snug and so neat,
Cloudflare's connectors make hosting complete!
No ports exposed, just sweet internal flow,
SSL assumed, and your service will glow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding Cloudflare Tunnel documentation to the self-hosting guide.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/cloudflare-tunnel-self-hosting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for optionally exposing a self-hosted Sure instance using a Cloudflare Tunnel. The review feedback suggests improving the documentation by providing more context for the RAILS_ASSUME_SSL environment variable in compose.yml, pinning a specific stable version for the cloudflared image instead of using latest, and explicitly advising users to remove the published ports from the web service to enhance security.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread self-hosting.mdx
Comment on lines +126 to +130
3. Edit `compose.yml` and set:

```yaml
RAILS_ASSUME_SSL: "true"
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make it clearer for users where to add this environment variable in their compose.yml, it is recommended to show the context of the web service environment block.\n\nFor example:\nyaml\nservices:\n web:\n environment:\n RAILS_ASSUME_SSL: "true"\n

Comment thread self-hosting.mdx
Comment on lines +137 to +138
cloudflared:
image: cloudflare/cloudflared:latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the latest tag for the cloudflared image is discouraged for production/self-hosting environments as it can introduce unexpected breaking changes when the image is updated. It is highly recommended to pin a specific, stable version of the image.\n\nFor example:\nyaml\n image: cloudflare/cloudflared:2024.12.2\n

Comment thread self-hosting.mdx
Comment on lines +173 to +175
<Warning>
If you only want Cloudflare Tunnel access, do not leave port `3000` broadly exposed to the internet. Keep the host firewall closed or bind the published port more narrowly.
</Warning>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When using a Cloudflare Tunnel, you can completely remove the ports section (e.g., - "3000:3000") from the web service in compose.yml. Since the cloudflared container and the web container share the same Docker network (sure_net), they can communicate internally. Removing the published ports ensures that the application is not exposed directly on the host, which is the primary security benefit of using a tunnel.\n\nConsider updating the warning to explicitly suggest removing the ports mapping from the web service.

@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@self-hosting.mdx`:
- Around line 126-132: The instruction is ambiguous about where to add
RAILS_ASSUME_SSL in compose.yml; update the docs to instruct users to add
RAILS_ASSUME_SSL: "true" inside the existing x-rails-env: &rails_env section
(the shared rails environment anchor) so the variable is applied to the Rails
service definitions that extend &rails_env; mention the anchor name x-rails-env:
&rails_env and the RAILS_ASSUME_SSL key so maintainers can find and place the
setting correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f51b0493-59fd-4ef3-81a5-4b4240a659db

📥 Commits

Reviewing files that changed from the base of the PR and between 9a6d71f and ed75f3d.

📒 Files selected for processing (1)
  • self-hosting.mdx

Comment thread self-hosting.mdx
Comment on lines +126 to +132
3. Edit `compose.yml` and set:

```yaml
RAILS_ASSUME_SSL: "true"
```

This tells Sure to generate HTTPS URLs correctly when Cloudflare terminates TLS before forwarding traffic to the container over HTTP.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify where in compose.yml to set RAILS_ASSUME_SSL.

The instruction "Edit compose.yml and set:" doesn't specify the location within the file. Based on the troubleshooting guide, this should be set in the x-rails-env: &rails_env section. Users unfamiliar with the compose file structure may not know where to place this configuration.

📝 Suggested improvement
-3. Edit `compose.yml` and set:
+3. Edit `compose.yml` in the `x-rails-env: &rails_env` section and set:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@self-hosting.mdx` around lines 126 - 132, The instruction is ambiguous about
where to add RAILS_ASSUME_SSL in compose.yml; update the docs to instruct users
to add RAILS_ASSUME_SSL: "true" inside the existing x-rails-env: &rails_env
section (the shared rails environment anchor) so the variable is applied to the
Rails service definitions that extend &rails_env; mention the anchor name
x-rails-env: &rails_env and the RAILS_ASSUME_SSL key so maintainers can find and
place the setting correctly.

@mintlify

mintlify Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sure 🟢 Ready View Preview Jun 12, 2026, 9:16 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant