From 866c76cdf91ee96041ff502c381151a58218cffc Mon Sep 17 00:00:00 2001
From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com>
Date: Thu, 11 Jan 2024 16:27:09 -0500
Subject: [PATCH] Updated Proxy examples (markdown)
---
Proxy-examples.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/Proxy-examples.md b/Proxy-examples.md
index 1e6939e..daa8418 100644
--- a/Proxy-examples.md
+++ b/Proxy-examples.md
@@ -1098,6 +1098,72 @@ Example dashboard URL to find the settings: `https://dash.cloudflare.com/xxxxxx/
![Rules](https://github.com/dani-garcia/vaultwarden/assets/7784660/e27d9152-219b-4b6a-bf96-dcfce30ebd73)
+
+CloudFlare (after v1.29.0) (by @calvin-li-developer)
+
+`docker-compose.yml`:
+
+```yml
+version: '3'
+
+services:
+ vaultwarden:
+ container_name: vaultwarden
+ image: vaultwarden/server:latest
+ restart: unless-stopped
+ environment:
+ DOMAIN: "https://vaultwarden.example.com" # Your domain; vaultwarden needs to know it's https to work properly with attachments
+ volumes:
+ - ./vw-data:/data
+ networks:
+ - vaultwarden-network
+
+ cloudflared:
+ image: cloudflare/cloudflared:2024.1.2
+ container_name: vaultwarden-cloudflared
+ restart: unless-stopped
+ read_only: true
+ volumes:
+ - ./cloudflared-config:/root/.cloudflared/
+ command: [ "tunnel", "run", "${TUNNEL_ID}" ]
+ user: root
+ depends_on:
+ - vaultwarden
+ networks:
+ - vaultwarden-network
+```
+Contents in `cloudflared-config` folder:
+```sh
+config.yml aaaaa-bbbb-cccc-dddd-eeeeeeeee.json
+```
+Please use [this](https://thedxt.ca/2022/10/cloudflare-tunnel-with-docker/) guide to figure out the contents/values below for your cloudflare account.
+
Note: `aaaaa-bbbb-cccc-dddd-eeeeeeeee` is just a random tunnelID please use a real ID.
+
+`config.yml`:
+```
+tunnel: aaaaa-bbbb-cccc-dddd-eeeeeeeee
+credentials-file: /root/.cloudflared/aaaaa-bbbb-cccc-dddd-eeeeeeeee.json
+
+originRequest:
+ noHappyEyeballs: true
+ disableChunkedEncoding: true
+ noTLSVerify: true
+
+ingress:
+ - hostname: vault.example.com # change to your domain
+ service: http_status:404
+ path: admin
+ - hostname: vault.example.com # change to your domain
+ service: http://vaultwarden
+ - service: http_status:404
+```
+`aaaaa-bbbb-cccc-dddd-eeeeeeeee.json`:
+```
+{"AccountTag":"changeme","TunnelSecret":"changeme","TunnelID":"aaaaa-bbbb-cccc-dddd-eeeeeeeee"}
+```
+
+
+
Pound