Compare commits

...

10 commits

Author SHA1 Message Date
Mark Randall Havens
9a3d46c5ec Forgejo metadata link commit at 2025-06-11 04:03:33 — 9cb4349c6d 2025-06-11 04:03:33 -05:00
Mark Randall Havens
9cb4349c6d Post-Radicle sync at 2025-06-11T09:03:20Z 2025-06-11 04:03:31 -05:00
Mark Randall Havens
ba93e0746e Update Radicle metadata at 2025-06-11 04:03:31 — 692994bbad 2025-06-11 04:03:31 -05:00
Mark Randall Havens
692994bbad Post-Local sync at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
266c50aaf3 Generated docs/integrity.sha256 at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
37af02766c Generated docs/sitemap.xml at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
29a2dd4ed9 Generated docs/robots.txt at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
05631d0e83 Generated docs/.nojekyll at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
5b6d4432b5 Generated docs/README.md at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
Mark Randall Havens
a41860e8ce Generated docs/repos.json at 2025-06-11T09:03:20Z 2025-06-11 04:03:20 -05:00
15 changed files with 563 additions and 0 deletions

View file

@ -0,0 +1 @@
692994bbaddef034b29cf7a50288c8dcfa9db15d

13
.gitfield/pushed.log Normal file
View file

@ -0,0 +1,13 @@
# Push Log for cloudflare-tunnel-bootstrap
# Generated by gitfield-sync
[2025-06-11T09:03:20Z] Local: , Branch=master, Commit=unknown
Diff Summary:
docs/integrity.sha256 | 11 +++++++++++
1 file changed, 11 insertions(+)
[2025-06-11T09:03:31Z] Radicle: RID=rad:z3FEj7rF8gZw9eFksCuiN43qjzrex, Peer ID=z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz, Branch=master, Commit=unknown
CLI: rad inspect rad:z3FEj7rF8gZw9eFksCuiN43qjzrex # View project details
CLI: git ls-tree -r --name-only HEAD # View file structure
Diff Summary:
.gitfield/radicle.sigil.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)

View file

@ -0,0 +1,67 @@
# 🔗 Radicle Repository Link
- **Project Name**: `cloudflare-tunnel-bootstrap`
- **Radicle URN**: `rad://z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z`
- **Public Gateway**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z/tree/692994bbaddef034b29cf7a50288c8dcfa9db15d](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z/tree/692994bbaddef034b29cf7a50288c8dcfa9db15d)
- **Local Repo Path**: `/home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap`
- **Default Branch**: `master`
- **Repo Created**: `2025-06-11 04:03:31`
---
## 📦 Commit Info
- **This Commit Timestamp**: `2025-06-11 04:03:31`
- **Last Commit SHA**: `692994bbaddef034b29cf7a50288c8dcfa9db15d`
- **Last Commit Message**: `Post-Local sync at 2025-06-11T09:03:20Z`
- **Commit Author**: `Mark Randall Havens <mark.r.havens@gmail.com>`
- **Commit Date**: `Wed Jun 11 04:03:20 2025 -0500`
- **This Commit URL**: [https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z/tree/692994bbaddef034b29cf7a50288c8dcfa9db15d](https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z/tree/692994bbaddef034b29cf7a50288c8dcfa9db15d)
---
## 📊 Repo Status
- **Total Commits**: `21`
- **Tracked Files**: `26`
- **Uncommitted Changes**: `No`
- **Latest Tag**: `None`
---
## 🧭 Environment
- **Host Machine**: `samson`
- **Current User**: `mrhavens`
- **Time Zone**: `CDT`
- **Script Version**: `v1.0`
---
## 🧬 Hardware & OS Fingerprint
- **OS Name**: `Linux`
- **OS Version**: `Ubuntu 22.04.5 LTS`
- **Kernel Version**: `6.6.87.1-microsoft-standard-WSL2`
- **Architecture**: `x86_64`
- **Running in Docker**: `No`
- **Running in WSL**: `Yes`
- **Virtual Machine**: `wsl`
- **System Uptime**: `up 10 hours, 36 minutes`
- **MAC Address**: `00:15:5d:11:35:bd`
- **Local IP**: `172.28.107.95`
- **CPU Model**: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
- **Total RAM (GB)**: `23.44`
---
## 🌱 Radicle-Specific Metadata
- **Project ID**: `z3B11vcLJt6Fqw6H5u26MBDvfgZ5Z`
- **Peer ID**: `z6MkkKwiMBbXkoE4aL94Pmej2f3hZeKM9XspnQPQgYeDFK9L
z6MkkKwiMBbXkoE4aL94Pmej2f3hZeKM9XspnQPQgYeDFK9L`
- **Public Gateway Base**: `https://app.radicle.xyz/nodes/ash.radicle.garden`
---
_Auto-generated by `gitfield-radicle` push script._

View file

@ -0,0 +1,59 @@
# 🔗 Forgejo Repository Link
- **Repo Name**: `cloudflare-tunnel-bootstrap`
- **Forgejo User**: `mrhavens`
- **Remote URL**: [https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap](https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap)
- **Local Repo Path**: `/home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap`
- **Remote Label**: `remember`
- **Default Branch**: `master`
- **Repo Created**: `2025-06-11 04:03:33`
---
## 📦 Commit Info
- **This Commit Timestamp**: `2025-06-11 04:03:33`
- **Last Commit SHA**: `9cb4349c6dca180c4ac1583cdf5579c16a40a919`
- **Last Commit Message**: `Post-Radicle sync at 2025-06-11T09:03:20Z`
- **Last Commit Author**: `Mark Randall Havens <mark.r.havens@gmail.com>`
- **Last Commit Date**: `Wed Jun 11 04:03:31 2025 -0500`
- **This Commit URL**: [https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap/commit/9cb4349c6dca180c4ac1583cdf5579c16a40a919](https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap/commit/9cb4349c6dca180c4ac1583cdf5579c16a40a919)
---
## 📊 Repo Status
- **Total Commits**: `23`
- **Tracked Files**: `28`
- **Uncommitted Changes**: `No`
- **Latest Tag**: `None`
---
## 🧭 Environment
- **Host Machine**: `samson`
- **Current User**: `mrhavens`
- **Time Zone**: `CDT`
- **Script Version**: `1.0`
---
## 🧬 Hardware & OS Fingerprint
- **OS Name**: `Linux`
- **OS Version**: `Ubuntu 22.04.5 LTS`
- **Kernel Version**: `6.6.87.1-microsoft-standard-WSL2`
- **Architecture**: `x86_64`
- **Running in Docker**: `No`
- **Running in WSL**: `Yes`
- **Virtual Machine**: `wsl`
- **System Uptime**: `up 10 hours, 36 minutes`
- **MAC Address**: `00:15:5d:11:35:bd`
- **Local IP**: `172.28.107.95`
- **CPU Model**: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
- **Total RAM (GB)**: `23.44`
---
_Auto-generated by `gitfield-remember` push script._

109
README.md Normal file
View file

@ -0,0 +1,109 @@
## 📄 README.md (First Version)
````markdown
# Cloudflare Tunnel Bootstrap 🌀
Expose any local Linux server to the internet securely using a Cloudflare Tunnel with Zero Configuration DNS routing. This setup allows resilient access to ports and services via subdomains like:
- `samson.thefoldwithin.earth`
- `forgejo.samson.thefoldwithin.earth`
- `rpc.samson.thefoldwithin.earth`
- `ssh.samson.thefoldwithin.earth`
## 🔧 Requirements
- A Linux server (bare metal, VM, or WSL)
- Domain managed by Cloudflare
- Installed: `cloudflared`, `git`, `bash`, `curl`
## 🚀 Quickstart
### 1. Clone the repo
```bash
git clone https://github.com/thefoldwithin/cloudflare-tunnel-bootstrap.git
cd cloudflare-tunnel-bootstrap
````
### 2. Install `cloudflared` (if needed)
```bash
./install-cloudflared.sh
```
### 3. Authenticate with Cloudflare
```bash
cloudflared tunnel login
```
### 4. Create a tunnel named after your host (e.g., `samson`)
```bash
cloudflared tunnel create samson
```
### 5. Auto-generate a full config file and DNS records
```bash
./bootstrap-tunnel.sh samson thefoldwithin.earth 8000
```
This will:
* Create `~/.cloudflared/config.yml`
* Route `samson.thefoldwithin.earth` to port 8000
* Create subdomains and restart the tunnel
### 6. Run the tunnel as a service
```bash
sudo cloudflared service install
sudo systemctl restart cloudflared
```
---
## 🛠 Included Scripts
| File | Description |
| ------------------------ | ------------------------------------------------------------------- |
| `install-cloudflared.sh` | Installs the latest `cloudflared` binary |
| `bootstrap-tunnel.sh` | Creates a tunnel config, routes subdomains, and writes `config.yml` |
| `config.template.yml` | Editable template for generating configs |
---
## 📜 Example Generated Config
```yaml
tunnel: abc123-abc123-abc123
credentials-file: /home/username/.cloudflared/abc123-abc123-abc123.json
ingress:
- hostname: samson.thefoldwithin.earth
service: http://localhost:8000
- service: http_status:404
```
---
## 🌐 Result
Access your local server at:
```
https://samson.thefoldwithin.earth
```
---
## 🧬 About
This repo is part of **The Fold** infrastructure initiative. It provides a resilient, mirrored, recursive service model for distributed digital sanctuaries.
---
> 🔒 Everything you run locally stays private — unless *you* decide to expose it.
---

63
bootstrap-tunnel.sh Executable file
View file

@ -0,0 +1,63 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# ──────────────────────────────────────────────────────────────
# Cloudflare Tunnel Bootstrap Script
# Usage: ./bootstrap-tunnel.sh <tunnel_name> <base_domain> <local_port>
# Example: ./bootstrap-tunnel.sh samson thefoldwithin.earth 8000
# ──────────────────────────────────────────────────────────────
if [[ $# -lt 3 ]]; then
echo "Usage: $0 <tunnel_name> <base_domain> <local_port>"
exit 1
fi
TUNNEL_NAME="$1"
BASE_DOMAIN="$2"
LOCAL_PORT="$3"
USER_HOME=$(eval echo ~"$USER")
CLOUDFLARED_DIR="$USER_HOME/.cloudflared"
# Path to tunnel credentials (auto-created if tunnel exists)
TUNNEL_ID=$(cloudflared tunnel list | grep "$TUNNEL_NAME" | awk '{print $1}')
if [[ -z "$TUNNEL_ID" ]]; then
echo "❌ Tunnel '$TUNNEL_NAME' not found. Please run: cloudflared tunnel create $TUNNEL_NAME"
exit 1
fi
CREDENTIALS_FILE="$CLOUDFLARED_DIR/${TUNNEL_ID}.json"
CONFIG_PATH="$CLOUDFLARED_DIR/config.yml"
echo "🧪 Tunnel ID: $TUNNEL_ID"
echo "📜 Writing config to $CONFIG_PATH"
cat > "$CONFIG_PATH" <<EOF
tunnel: $TUNNEL_ID
credentials-file: $CREDENTIALS_FILE
ingress:
- hostname: $TUNNEL_NAME.$BASE_DOMAIN
service: http://localhost:$LOCAL_PORT
- hostname: ssh.$TUNNEL_NAME.$BASE_DOMAIN
service: ssh://localhost:22
- hostname: rpc.$TUNNEL_NAME.$BASE_DOMAIN
service: http://localhost:8545
- service: http_status:404
EOF
echo "🔁 Creating DNS routes..."
cloudflared tunnel route dns "$TUNNEL_NAME" "$TUNNEL_NAME.$BASE_DOMAIN"
cloudflared tunnel route dns "$TUNNEL_NAME" "ssh.$TUNNEL_NAME.$BASE_DOMAIN"
cloudflared tunnel route dns "$TUNNEL_NAME" "rpc.$TUNNEL_NAME.$BASE_DOMAIN"
echo "🚀 Restarting cloudflared service..."
sudo systemctl restart cloudflared
echo "✅ Tunnel bootstrap complete!"
echo "🌐 Access: https://$TUNNEL_NAME.$BASE_DOMAIN"
echo "🔗 SSH: ssh.$TUNNEL_NAME.$BASE_DOMAIN"
echo "🔗 RPC: rpc.$TUNNEL_NAME.$BASE_DOMAIN"

19
config.template.yml Normal file
View file

@ -0,0 +1,19 @@
# ─────────────────────────────────────────────────────────────
# 🌐 Cloudflare Tunnel Configuration Template
# Rename to config.yml or generate from this template via script
# ─────────────────────────────────────────────────────────────
tunnel: INSERT_TUNNEL_ID_HERE
credentials-file: /home/YOUR_USERNAME/.cloudflared/INSERT_TUNNEL_ID_HERE.json
ingress:
- hostname: samson.thefoldwithin.earth
service: http://localhost:8000
- hostname: ssh.samson.thefoldwithin.earth
service: ssh://localhost:22
- hostname: rpc.samson.thefoldwithin.earth
service: http://localhost:8545
- service: http_status:404

0
docs/.nojekyll Normal file
View file

27
docs/README.md Normal file
View file

@ -0,0 +1,27 @@
# GitField /docs Directory
The directory hosts a public-facing, SEO-optimized canonical declaration for the `cloudflare-tunnel-bootstrap` repository, designed for GitHub Pages compatibility and enhanced discoverability.
## Files
- **index.html**: The canonical declaration page, including JSON-LD metadata and links to all mirrors.
- **style.css**: Minimal stylesheet for elegant, recursive branding.
- **repos.json**: Machine-readable list of the canonical URL and all mirror repositories.
- **canonical.meta**: Machine-readable JSON metadata declaring the canonical URL and mirrors.
- **canonical.md**: Human-readable Markdown summary of the canonical declaration.
- **index.json**: Machine-readable manifest of all remotes and sync details.
- **gitfield.json**: SEO-friendly JSON-LD metadata.
- **.well-known/gitfield.json**: SEO metadata mirror.
- **pushed.log**: Log of push operations across all platforms.
- **gitfield.README.txt**: Explanation of the GitField metadata structure.
- **README.md**: This file, explaining the purpose of the directory.
- **.nojekyll**: Bypasses Jekyll processing for GitHub Pages.
- **robots.txt**: Allows full indexing by search engine bots.
- **sitemap.xml**: Auto-generated sitemap for improved SEO.
- **integrity.sha256**: SHA-256 hash of all metadata files for integrity verification.
## Purpose
This directory ensures the `cloudflare-tunnel-bootstrap` project is discoverable via search engines and accessible to humans and bots. It declares the canonical repository at [https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap](https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap) and links to all mirrors, reinforcing the GitField recursive metadata strategy for sovereign publishing.
Generated by `gitfield-sync` at 2025-06-11T09:03:20Z (v1.4).

11
docs/integrity.sha256 Normal file
View file

@ -0,0 +1,11 @@
# SHA-256 Integrity Hashes for /docs Metadata Files
# Generated by gitfield-sync at 2025-06-11T09:03:20Z (v1.4)
039ba71caa61b9b7d9d5f0c021f84188e0c002ec2d7a38a856441b2187e007e6 /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/canonical.meta
af151f69cd1cda3d6d8186337fd60ba82b7d17729fc0d6f44cac16664cbcb615 /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/canonical.md
8a7c7a9fcab91feabd85f52e37ea4724730cea9e71086d58e76d7f0b1e655c67 /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/index.json
3138a10422f6b55395cc6235cdf7ec7b31bc7dfa947d97c624946f72a90aeb4f /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/gitfield.json
3138a10422f6b55395cc6235cdf7ec7b31bc7dfa947d97c624946f72a90aeb4f /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/.well-known/gitfield.json
8b55ac3e717ef765948248017444d02062f5d2968183fdb83efc5dcad501dafa /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/repos.json
57a4c2c637a0dc08621f12dfd2455f93d99b2f6cabcab0262e857e75d75e7f4d /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/pushed.log
7d7a407bebc079544cba0ab77d2137ca39006bffdb90ad1d075e9fc55089e386 /home/mrhavens/fieldwork/cloudflare-tunnel-bootstrap/docs/gitfield.README.txt

19
docs/repos.json Normal file
View file

@ -0,0 +1,19 @@
{
"canonical_url": "https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap",
"mirrors": [
"https://github.com/mrhavens/cloudflare-tunnel-bootstrap",
"https://gitlab.com/mrhavens/cloudflare-tunnel-bootstrap",
"https://bitbucket.org/thefoldwithin/cloudflare-tunnel-bootstrap",
"https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap",
"https://codeberg.org/mrhavens/cloudflare-tunnel-bootstrap",
"https://gitea.com/mrhavens/cloudflare-tunnel-bootstrap",
"rad:z3FEj7rF8gZw9eFksCuiN43qjzrex"
],
"radicle": {
"rid": "rad:z3FEj7rF8gZw9eFksCuiN43qjzrex",
"peer_id": "z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz"
},
"gpg_signatures": [
]
}

3
docs/robots.txt Normal file
View file

@ -0,0 +1,3 @@
User-agent: *
Allow: /
Sitemap: /sitemap.xml

99
docs/sitemap.xml Normal file
View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/index.html</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/canonical.meta</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/canonical.md</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/index.json</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/gitfield.json</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/.well-known/gitfield.json</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/repos.json</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/pushed.log</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap/docs/gitfield.README.txt</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://gitlab.com/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://bitbucket.org/thefoldwithin/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://remember.thefoldwithin.earth/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://codeberg.org/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://gitea.com/mrhavens/cloudflare-tunnel-bootstrap</loc>
<lastmod>2025-06-11T09:03:20Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>

40
install-cloudflared.sh Executable file
View file

@ -0,0 +1,40 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# ─────────────────────────────────────────────────────────────
# 🌐 Cloudflare Tunnel Binary Installer
# Installs the latest cloudflared (Linux x86_64)
# Cleans up any legacy APT sources
# ─────────────────────────────────────────────────────────────
CLOUDFLARED_BIN="/usr/local/bin/cloudflared"
RELEASE_URL="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64"
echo "🧹 Cleaning up legacy Cloudflare APT sources (if any)..."
LEGACY_LIST="/etc/apt/sources.list.d/cloudflared.list"
if [[ -f "$LEGACY_LIST" ]]; then
echo "⚠️ Found legacy APT source: $LEGACY_LIST"
sudo rm -f "$LEGACY_LIST"
sudo apt update
echo "✅ Removed deprecated source and updated package list."
fi
echo "🔍 Checking for existing cloudflared installation..."
if command -v cloudflared >/dev/null 2>&1; then
echo "✅ cloudflared already installed at: $(which cloudflared)"
echo "🔁 To reinstall, run: sudo rm $(which cloudflared) && ./install-cloudflared.sh"
exit 0
fi
echo "⬇️ Downloading latest cloudflared binary..."
wget -q --show-progress "$RELEASE_URL" -O cloudflared
echo "🔐 Making binary executable..."
chmod +x cloudflared
echo "🚚 Moving to /usr/local/bin (requires sudo)..."
sudo mv cloudflared "$CLOUDFLARED_BIN"
echo "✅ cloudflared installed at $CLOUDFLARED_BIN"
cloudflared --version

33
install-inbound-ssh.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# ─────────────────────────────────────────────────────────────
# SSH Server Bootstrap Script for Remote Access via Tunnel
# ─────────────────────────────────────────────────────────────
echo "🔐 Installing OpenSSH server..."
sudo apt update
sudo apt install -y openssh-server
echo "🛠 Configuring SSH..."
# Ensure sshd_config exists
SSHD_CONFIG="/etc/ssh/sshd_config"
# Enable password and public key auth
sudo sed -i 's/#*PasswordAuthentication .*/PasswordAuthentication yes/' "$SSHD_CONFIG"
sudo sed -i 's/#*PermitRootLogin .*/PermitRootLogin prohibit-password/' "$SSHD_CONFIG"
sudo sed -i 's/#*PubkeyAuthentication .*/PubkeyAuthentication yes/' "$SSHD_CONFIG"
# Optional: restrict to certain users (e.g., "mrhavens")
# echo "AllowUsers mrhavens" | sudo tee -a "$SSHD_CONFIG"
echo "🔁 Restarting SSH service..."
sudo systemctl restart ssh
sudo systemctl enable ssh
echo "✅ SSH server is installed and listening on port 22"
echo "🌐 You may now access this machine via your tunnel:"
echo " ssh user@ssh.samson.thefoldwithin.earth"