- Updated logo SVG files to use #111111 (50% darker) - Updated shared/_logo.html.erb with new color - Restored original landing page from git - Updated tailwind config with FloDoc brand colorspull/565/head
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@ -0,0 +1,150 @@
|
||||
# Ngrok Setup for FloDoc Testing
|
||||
|
||||
This guide explains how to make your FloDoc app accessible to other devices for testing email workflows.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Get Ngrok Auth Token
|
||||
1. Go to [ngrok.com](https://ngrok.com) and sign up for a free account
|
||||
2. Go to your dashboard: https://dashboard.ngrok.com/get-started/your-authtoken
|
||||
3. Copy your auth token
|
||||
|
||||
### 2. Configure Ngrok
|
||||
Run this command with your token:
|
||||
```bash
|
||||
~/bin/ngrok config add-authtoken YOUR_TOKEN_HERE
|
||||
```
|
||||
|
||||
Or add to your `.env` file:
|
||||
```bash
|
||||
NGROK_AUTH_TOKEN=your_token_here
|
||||
```
|
||||
|
||||
### 3. Start Testing
|
||||
Run the automated setup script:
|
||||
```bash
|
||||
./start_with_ngrok.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
- Start Rails on port 3001
|
||||
- Create a public ngrok tunnel
|
||||
- Update your APP_URL automatically
|
||||
- Show you the public URL
|
||||
|
||||
## Manual Testing (Alternative)
|
||||
|
||||
If you already have Rails running, just start ngrok:
|
||||
```bash
|
||||
./start_ngrok_only.sh
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
### The Complete Workflow
|
||||
|
||||
1. **Start the system:**
|
||||
```bash
|
||||
./start_with_ngrok.sh
|
||||
```
|
||||
|
||||
2. **You'll see output like:**
|
||||
```
|
||||
🎉 SETUP COMPLETE!
|
||||
==================
|
||||
|
||||
📱 Your FloDoc app is now publicly accessible!
|
||||
|
||||
🏠 Local URL: http://localhost:3001
|
||||
🌐 Public URL: https://abc123.ngrok.io
|
||||
|
||||
📧 Email links will use: https://abc123.ngrok.io
|
||||
```
|
||||
|
||||
3. **Test the email workflow:**
|
||||
- Go to `https://abc123.ngrok.io/templates`
|
||||
- Upload a PDF and create a template
|
||||
- Add recipient email addresses
|
||||
- Click "Send" to send invitation emails
|
||||
- Check your email inbox
|
||||
- Click the invitation link from **any device** (phone, tablet, another computer)
|
||||
|
||||
4. **The recipient will see:**
|
||||
- The document filling interface
|
||||
- Fields mapped from your PDF
|
||||
- A form they can complete and sign
|
||||
- Submit button to complete the workflow
|
||||
|
||||
### Email Links Format
|
||||
When you send invitations, the links will look like:
|
||||
```
|
||||
https://abc123.ngrok.io/s/abc123def456
|
||||
```
|
||||
|
||||
Anyone with this link can access the document, regardless of their location (as long as they have internet).
|
||||
|
||||
## Security Notes
|
||||
|
||||
⚠️ **Important Security Considerations:**
|
||||
|
||||
1. **Only for testing** - Never use ngrok for production or sensitive documents
|
||||
2. **Public access** - Anyone with the link can access your documents
|
||||
3. **Temporary** - Ngrok URLs change every time you restart
|
||||
4. **Rate limits** - Free tier has limitations (6 hours per tunnel, 20 connections/minute)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Ngrok auth token error
|
||||
```
|
||||
❌ Ngrok auth token not configured
|
||||
```
|
||||
**Solution:** Add your token to `.env` or run the ngrok auth command
|
||||
|
||||
### Rails not starting
|
||||
```
|
||||
❌ Rails failed to start
|
||||
```
|
||||
**Solution:** Check if port 3001 is available: `lsof -i :3001`
|
||||
|
||||
### Can't access from other devices
|
||||
```
|
||||
Connection refused
|
||||
```
|
||||
**Solution:** Make sure you're using the ngrok URL (https://xxx.ngrok.io), not localhost
|
||||
|
||||
### Email links not working
|
||||
```
|
||||
This site can't be reached
|
||||
```
|
||||
**Solution:** Check that ngrok is running: `~/bin/ngrok api tunnels list`
|
||||
|
||||
## Files Created
|
||||
|
||||
- `start_with_ngrok.sh` - Complete automated setup
|
||||
- `start_ngrok_only.sh` - Quick ngrok starter
|
||||
- `NGROK_SETUP.md` - This guide
|
||||
- Updated `.env` with ngrok configuration
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once you have ngrok working:
|
||||
1. Test the complete 3-party workflow
|
||||
2. Verify email delivery and link functionality
|
||||
3. Test from different devices (phone, tablet, etc.)
|
||||
4. Check that document filling works correctly
|
||||
5. Verify submission completion notifications
|
||||
|
||||
## Cleanup
|
||||
|
||||
To stop everything:
|
||||
```bash
|
||||
pkill -f "rails server"
|
||||
pkill -f "ngrok http"
|
||||
```
|
||||
|
||||
## Need Help?
|
||||
|
||||
Check the ngrok dashboard for live traffic monitoring:
|
||||
http://localhost:4040
|
||||
|
||||
This shows all requests going through your tunnel in real-time.
|
||||
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
@ -0,0 +1 @@
|
||||
Subproject commit 8cb45ba7c5ef3f4895de1537d5ea4f4505500c11
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Quick ngrok starter for when Rails is already running on port 3001
|
||||
|
||||
echo "🚀 Starting ngrok tunnel for FloDoc..."
|
||||
echo " (Make sure Rails is running on port 3001 first)"
|
||||
|
||||
# Kill existing ngrok
|
||||
pkill -f "ngrok http" 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
# Start ngrok
|
||||
~/bin/ngrok http 3001 &
|
||||
|
||||
sleep 5
|
||||
|
||||
# Get URL
|
||||
echo ""
|
||||
echo "📡 Your public URLs:"
|
||||
echo "===================="
|
||||
~/bin/ngrok api tunnels list 2>/dev/null | grep -o '"public_url":"[^"]*"' | cut -d'"' -f4 | while read url; do
|
||||
echo " $url"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "📊 View live traffic: http://localhost:4040"
|
||||
echo "🛑 Stop: pkill -f 'ngrok http'"
|
||||
@ -0,0 +1,149 @@
|
||||
#!/bin/bash
|
||||
|
||||
# FloDoc Ngrok Testing Script
|
||||
# This script starts Rails with ngrok for public testing of email workflows
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting FloDoc with Ngrok for Public Testing"
|
||||
echo "================================================"
|
||||
|
||||
# Check if ngrok is installed
|
||||
if ! command -v ~/bin/ngrok &> /dev/null; then
|
||||
echo "❌ Ngrok not found. Please install it first."
|
||||
echo " Run: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok/latest/linux-amd64.tgz | tar -xzf - && mv ngrok ~/bin/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
echo "✅ Loading environment variables from .env"
|
||||
source .env
|
||||
else
|
||||
echo "❌ .env file not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if ngrok auth token is set
|
||||
if [ "$NGROK_AUTH_TOKEN" = "your_ngrok_auth_token_here" ] || [ -z "$NGROK_AUTH_TOKEN" ]; then
|
||||
echo "❌ Ngrok auth token not configured"
|
||||
echo ""
|
||||
echo "To set up ngrok:"
|
||||
echo "1. Go to https://dashboard.ngrok.com/get-started/your-authtoken"
|
||||
echo "2. Sign up for a free account and get your auth token"
|
||||
echo "3. Run: ~/bin/ngrok config add-authtoken YOUR_TOKEN_HERE"
|
||||
echo "4. Or add NGROK_AUTH_TOKEN=your_token to your .env file"
|
||||
echo ""
|
||||
echo "Once you have your token, update .env with:"
|
||||
echo "NGROK_AUTH_TOKEN=your_actual_token_here"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Ngrok auth token found"
|
||||
|
||||
# Kill any existing ngrok processes
|
||||
echo "🧹 Cleaning up existing processes..."
|
||||
pkill -f "ngrok http" 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
# Start Rails server in background
|
||||
echo "🚀 Starting Rails server on port 3001..."
|
||||
bin/rails server -b 0.0.0.0 -p 3001 &
|
||||
RAILS_PID=$!
|
||||
echo " Rails PID: $RAILS_PID"
|
||||
|
||||
# Wait for Rails to start
|
||||
echo "⏳ Waiting for Rails to start..."
|
||||
sleep 10
|
||||
|
||||
# Check if Rails is running
|
||||
if ! curl -s http://localhost:3001 > /dev/null; then
|
||||
echo "❌ Rails failed to start"
|
||||
kill $RAILS_PID 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Rails is running on http://localhost:3001"
|
||||
|
||||
# Start ngrok
|
||||
echo "🚀 Starting ngrok tunnel..."
|
||||
~/bin/ngrok http 3001 > /dev/null &
|
||||
NGROK_PID=$!
|
||||
echo " Ngrok PID: $NGROK_PID"
|
||||
|
||||
# Wait for ngrok to establish connection
|
||||
echo "⏳ Waiting for ngrok tunnel to establish..."
|
||||
sleep 8
|
||||
|
||||
# Get ngrok URL
|
||||
echo "📡 Fetching ngrok public URL..."
|
||||
NGROK_URL=$(~/bin/ngrok api tunnels list 2>/dev/null | grep -o '"public_url":"[^"]*"' | cut -d'"' -f4 | head -1)
|
||||
|
||||
if [ -z "$NGROK_URL" ]; then
|
||||
echo "❌ Failed to get ngrok URL. Trying alternative method..."
|
||||
# Alternative method to get URL
|
||||
NGROK_URL=$(curl -s http://localhost:4040/api/tunnels 2>/dev/null | grep -o '"public_url":"[^"]*"' | cut -d'"' -f4 | head -1)
|
||||
fi
|
||||
|
||||
if [ -z "$NGROK_URL" ]; then
|
||||
echo "⚠️ Could not automatically retrieve ngrok URL"
|
||||
echo " You can manually check: http://localhost:4040"
|
||||
echo " Or run: ~/bin/ngrok api tunnels list"
|
||||
NGROK_URL="https://your-ngrok-url.ngrok.io" # Placeholder
|
||||
else
|
||||
echo "✅ Ngrok tunnel established: $NGROK_URL"
|
||||
fi
|
||||
|
||||
# Update APP_URL in environment
|
||||
echo "🔄 Updating APP_URL to: $NGROK_URL"
|
||||
export APP_URL="$NGROK_URL"
|
||||
|
||||
# Update .env file for future runs
|
||||
if grep -q "APP_URL=" .env; then
|
||||
sed -i "s|APP_URL=.*|APP_URL=$NGROK_URL|" .env
|
||||
else
|
||||
echo "APP_URL=$NGROK_URL" >> .env
|
||||
fi
|
||||
|
||||
# Restart Rails with new APP_URL
|
||||
echo "🔄 Restarting Rails with updated APP_URL..."
|
||||
kill $RAILS_PID 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
bin/rails server -b 0.0.0.0 -p 3001 &
|
||||
NEW_RAILS_PID=$!
|
||||
echo " New Rails PID: $NEW_RAILS_PID"
|
||||
|
||||
sleep 5
|
||||
|
||||
echo ""
|
||||
echo "🎉 SETUP COMPLETE!"
|
||||
echo "=================="
|
||||
echo ""
|
||||
echo "📱 Your FloDoc app is now publicly accessible!"
|
||||
echo ""
|
||||
echo "🏠 Local URL: http://localhost:3001"
|
||||
echo "🌐 Public URL: $NGROK_URL"
|
||||
echo ""
|
||||
echo "📧 Email links will use: $NGROK_URL"
|
||||
echo ""
|
||||
echo "🔗 Test the workflow:"
|
||||
echo " 1. Go to: $NGROK_URL/templates"
|
||||
echo " 2. Upload a PDF and create a template"
|
||||
echo " 3. Add recipients and send test email"
|
||||
echo " 4. Check your email and click the link"
|
||||
echo " 5. Test from any device - even your phone!"
|
||||
echo ""
|
||||
echo "📊 Monitor ngrok dashboard: http://localhost:4040"
|
||||
echo ""
|
||||
echo "🛑 To stop everything: pkill -f 'rails server' && pkill -f 'ngrok http'"
|
||||
echo ""
|
||||
echo "📝 Next steps:"
|
||||
echo " - Get your ngrok auth token from https://dashboard.ngrok.com"
|
||||
echo " - Update .env with: NGROK_AUTH_TOKEN=your_token"
|
||||
echo " - Run this script again for automatic setup"
|
||||
echo ""
|
||||
|
||||
# Keep script running and show status
|
||||
echo "Press Ctrl+C to stop everything..."
|
||||
wait
|
||||