Skip to content

Commit f3ea7bc

Browse files
committed
Refactor Docker Compose and README for clarity: remove healthcheck from Docker Compose, update environment variable instructions, and streamline API key and tailnet configuration details. Remove Settings page from frontend for improved user experience.
1 parent 996eea6 commit f3ea7bc

File tree

8 files changed

+39
-459
lines changed

8 files changed

+39
-459
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ jobs:
189189
cp -r frontend/dist tsflow-${{ github.ref_name }}/
190190
cp -r dist/* tsflow-${{ github.ref_name }}/
191191
cp docker-compose.yml tsflow-${{ github.ref_name }}/
192-
cp env.example tsflow-${{ github.ref_name }}/
193192
cp README.md tsflow-${{ github.ref_name }}/
194193
195194
tar -czf release/tsflow-${{ github.ref_name }}.tar.gz tsflow-${{ github.ref_name }}/
@@ -218,14 +217,12 @@ jobs:
218217
219218
**Quick Start:**
220219
```bash
221-
# Create environment file
222-
curl -o .env https://raw.githubusercontent.com/${{ github.repository }}/main/env.example
223-
# Edit .env with your Tailscale credentials
224-
225220
# Run with Docker
226221
docker run -d \
227222
-p 8080:8080 \
228-
--env-file .env \
223+
-e TAILSCALE_API_KEY=your-api-key \
224+
-e TAILSCALE_TAILNET=your-tailnet \
225+
-e ENVIRONMENT=production \
229226
--name tsflow \
230227
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:${{ github.ref_name }}
231228
```
@@ -237,9 +234,7 @@ jobs:
237234
tar -xzf tsflow-${{ github.ref_name }}.tar.gz
238235
cd tsflow-${{ github.ref_name }}
239236
240-
# Configure environment
241-
cp env.example .env
242-
# Edit .env with your credentials
237+
# Edit docker-compose.yml with your credentials
243238
244239
# Run with Docker Compose
245240
docker-compose up -d

README.md

Lines changed: 31 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,10 @@
22

33
A modern, real-time web application for visualizing and analyzing network traffic flows within Tailscale networks.
44

5-
## Features
6-
7-
**Network Topology Visualization**
8-
- Interactive force-directed graph showing device connections
9-
- Real-time traffic flow animation with D3.js
10-
- Multiple layout algorithms (force-directed, circular, grid, hierarchical)
11-
- Zoom and pan controls for detailed exploration
12-
13-
**Comprehensive Analytics**
14-
- Real-time traffic metrics and statistics
15-
- Protocol and port usage analysis (TCP, UDP, ICMP)
16-
- Device activity monitoring across your tailnet
17-
- Historical data visualization with customizable time ranges
18-
19-
**Advanced Filtering**
20-
- Flexible time range selection (5min, 1hour, 24hours, custom)
21-
- Protocol-based filtering (TCP, UDP, ICMP)
22-
- Traffic type filtering (virtual, subnet, physical)
23-
- IP category filtering (Tailscale, private, public)
24-
- Bandwidth and connection threshold filtering
25-
26-
**Device Management**
27-
- Real-time device status monitoring (online/offline)
28-
- Detailed device information and metadata
29-
- Operating system detection and iconography
30-
- Tag-based organization and filtering
31-
32-
**Modern Tech Stack**
33-
- Go (Gin) backend for high-performance API serving
34-
- React 18 with TypeScript for type safety
35-
- Vite for lightning-fast frontend development
36-
- Tailwind CSS for responsive design
37-
- D3.js for powerful network visualization
38-
- SWR for efficient data fetching and caching
395

406
## Quick Start
417
> **Important:** TSFlow requires the **Tailscale Network Flow Logs** feature. This is available on **Premium** and **Enterprise** plans and must be enabled in your Tailscale admin console. The application will not show any flow data otherwise.
428
43-
### Prerequisites
44-
- Tailscale API key with appropriate permissions
45-
- Network Flow Logs enabled in admin console
46-
- Docker
47-
489
### Run with Docker
4910

5011
The fastest way to get started using pre-built images:
@@ -54,48 +15,45 @@ docker run -d \
5415
--name tsflow \
5516
-p 8080:8080 \
5617
-e TAILSCALE_API_KEY=your-api-key \
57-
-e TAILSCALE_TAILNET=your-tailnet \
18+
-e TAILSCALE_TAILNET=your-organization \
5819
-e ENVIRONMENT=production \
5920
--restart unless-stopped \
6021
ghcr.io/rajsinghtech/tsflow:latest
6122
```
6223

63-
## Architecture Overview
24+
Navigate to `http://localhost:8080` to access the dashboard.
6425

65-
TSFlow uses a **Go backend + React frontend** architecture for optimal performance and security:
26+
## Configuration
6627

67-
```
68-
┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐
69-
│ React App │ │ Go Backend │ │ Tailscale API │
70-
│ (Frontend) │◄──►│ (Gin Server) │◄──►│ api.tailscale. │
71-
│ │ │ │ │ com │
72-
└─────────────────┘ └─────────────────┘ └──────────────────┘
73-
```
28+
### Tailscale API Setup
7429

75-
Navigate to `http://localhost:8080` to access the dashboard.
30+
1. Go to the [Logs tab](https://login.tailscale.com/admin/logs) in your Tailscale Admin Console and ensure that Network Flow Logs are **enabled**.
31+
2. Go to the [API keys page](https://login.tailscale.com/admin/settings/keys) and create a new API key. **Note**: This requires a **Premium** or **Enterprise** plan.
32+
3. Use this API key in your deployment configuration.
7633

77-
**Available image tags:**
78-
- `latest` - Latest stable release from main branch
79-
- `<version>` - Tagged releases (e.g., `v1.0.0`)
80-
- `<commit-sha>` - Specific commit builds
34+
### Finding Your Tailscale Credentials
8135

82-
## Deployment Options
36+
#### API Key
37+
1. Go to the [API keys page](https://login.tailscale.com/admin/settings/keys) in your Tailscale Admin Console
38+
2. Create a new API key with device read permissions
39+
3. Copy the generated API key (starts with `tskey-api-`)
8340

84-
### Using Docker Compose
41+
#### Organization Name
42+
1. Go to the [Settings page](https://login.tailscale.com/admin/settings/general) in your Tailscale Admin Console
43+
2. Your organization name is displayed in the Organization section (used by the Tailscale API)
44+
3. Use this exact organization name for the `TAILSCALE_TAILNET` variable
8545

86-
For more complex setups or persistent configuration:
46+
### Environment Variables
8747

88-
```bash
89-
# Create environment file
90-
cp env.example .env
91-
# Edit .env with your Tailscale credentials
48+
| Variable | Description | Required | Default |
49+
|----------|-------------|----------|---------|
50+
| `TAILSCALE_API_KEY` | Your Tailscale API key | Yes | - |
51+
| `TAILSCALE_TAILNET` | Your organization name | Yes | - |
52+
| `PORT` | Backend server port | No | `8080` |
9253

93-
# Run with Docker Compose
94-
docker-compose up -d
54+
## Deployment Options
9555

96-
# View logs
97-
docker-compose logs -f tsflow
98-
```
56+
### Using Docker Compose
9957

10058
Create a `docker-compose.yml` file:
10159

@@ -107,18 +65,10 @@ services:
10765
ports:
10866
- "8080:8080"
10967
environment:
110-
- TAILSCALE_API_KEY=${TAILSCALE_API_KEY}
111-
- TAILSCALE_TAILNET=${TAILSCALE_TAILNET}
68+
- TAILSCALE_API_KEY=your-api-key
69+
- TAILSCALE_TAILNET=your-organization
11270
- PORT=8080
113-
- ENVIRONMENT=production
114-
env_file:
115-
- .env
11671
restart: unless-stopped
117-
healthcheck:
118-
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
119-
interval: 30s
120-
timeout: 10s
121-
retries: 3
12272
```
12373
12474
**Commands:**
@@ -146,9 +96,7 @@ Deploy TSFlow on Kubernetes using the provided manifests:
14696
git clone https://github.com/rajsinghtech/tsflow.git
14797
cd tsflow/k8s
14898

149-
export TAILSCALE_API_KEY="your-api-key-here"
150-
export TAILSCALE_TAILNET="your-tailnet-name"
151-
99+
# Edit kustomization.yaml with your credentials
152100
kubectl apply -k .
153101
```
154102

@@ -164,7 +112,7 @@ kubectl apply -k .
164112
kubectl create secret generic tsflow \
165113
--namespace=tailscale \
166114
--from-literal=TAILSCALE_API_KEY="your-api-key" \
167-
--from-literal=TAILSCALE_TAILNET="your-tailnet"
115+
--from-literal=TAILSCALE_TAILNET="your-organization"
168116
```
169117

170118
3. Deploy the application:
@@ -195,17 +143,10 @@ For developers who want to build and run TSFlow locally:
195143
cd tsflow
196144
```
197145

198-
2. Configure environment:
146+
2. Set environment variables:
199147
```bash
200-
cp env.example .env
201-
```
202-
203-
Edit `.env` and add your Tailscale credentials:
204-
```env
205-
TAILSCALE_API_KEY=tskey-api-your-api-key-here
206-
TAILSCALE_TAILNET=your-tailnet-name
207-
PORT=8080
208-
ENVIRONMENT=development
148+
export TAILSCALE_API_KEY=tskey-api-your-api-key-here
149+
export TAILSCALE_TAILNET=your-organization-name
209150
```
210151

211152
3. Build and run the frontend:
@@ -235,25 +176,6 @@ For developers who want to build and run TSFlow locally:
235176
air # Auto-reloads on Go file changes
236177
```
237178

238-
## Configuration
239-
240-
### Tailscale API Setup
241-
242-
1. Go to the [Logs tab](https://login.tailscale.com/admin/logs) in your Tailscale Admin Console and ensure that Network Flow Logs are **enabled**.
243-
2. Go to the [API keys page](https://login.tailscale.com/admin/settings/keys) and create a new API key with the following permissions:
244-
- `devices:read` - To fetch device information
245-
- `logs:read` - To access network flow logs. **Note**: This requires a **Premium** or **Enterprise** plan.
246-
3. Copy the newly created API key to your `.env` file.
247-
248-
### Environment Variables
249-
250-
| Variable | Description | Required | Default |
251-
|----------|-------------|----------|---------|
252-
| `TAILSCALE_API_KEY` | Your Tailscale API key | Yes | - |
253-
| `TAILSCALE_TAILNET` | Your tailnet name | Yes | - |
254-
| `PORT` | Backend server port | No | `8080` |
255-
| `ENVIRONMENT` | Runtime environment | No | `development` |
256-
257179
**Example API calls:**
258180
```bash
259181
# Health check

backend/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ A Go-based backend server that provides a REST API for interacting with the Tail
1919

2020
1. **Set up environment variables**:
2121
```bash
22-
cp ../env.example ../.env
23-
# Edit .env with your Tailscale credentials
22+
export TAILSCALE_API_KEY=your-api-key
23+
export TAILSCALE_TAILNET=your-tailnet
2424
```
2525

2626
2. **Run in development mode**:
@@ -41,7 +41,6 @@ A Go-based backend server that provides a REST API for interacting with the Tail
4141
| `TAILSCALE_API_KEY` | Yes | - | Your Tailscale API key |
4242
| `TAILSCALE_TAILNET` | Yes | - | Your tailnet name |
4343
| `PORT` | No | `8080` | Server port |
44-
| `ENVIRONMENT` | No | `development` | Environment (development/production) |
4544

4645
## API Endpoints
4746

docker-compose.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@ services:
1111
env_file:
1212
- .env
1313
restart: unless-stopped
14-
healthcheck:
15-
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
16-
interval: 30s
17-
timeout: 10s
18-
retries: 3
19-
start_period: 40s
2014
volumes:
21-
# Optional: Mount config if you want persistent settings
2215
- tsflow_data:/app/data
2316
networks:
2417
- tsflow

frontend/src/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { SWRConfig } from 'swr'
33
import { ThemeProvider } from '@/contexts/ThemeContext'
44
import Dashboard from '@/pages/Dashboard'
55
import NetworkView from '@/pages/NetworkView'
6-
import Settings from '@/pages/Settings'
76
import Logs from './pages/Logs'
87
import { fetcher } from '@/lib/api'
98

@@ -22,7 +21,6 @@ function App() {
2221
<Route path="/" element={<Dashboard />} />
2322
<Route path="/network" element={<NetworkView />} />
2423
<Route path="/logs" element={<Logs />} />
25-
<Route path="/settings" element={<Settings />} />
2624
</Routes>
2725
</SWRConfig>
2826
</ThemeProvider>

frontend/src/components/Layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Link, useLocation } from 'react-router-dom'
2-
import { Network, Home, Settings, Menu, X, ZoomOut, FileText } from 'lucide-react'
2+
import { Network, Home, Menu, X, ZoomOut, FileText } from 'lucide-react'
33
import { useAppStore } from '@/lib/store'
44
import { clsx } from 'clsx'
55

@@ -23,7 +23,6 @@ export default function Layout({ children, networkStats, onResetZoom, onClearSel
2323
{ name: 'Dashboard', href: '/', icon: Home },
2424
{ name: 'Network View', href: '/network', icon: Network },
2525
{ name: 'Logs', href: '/logs', icon: FileText },
26-
{ name: 'Settings', href: '/settings', icon: Settings },
2726
]
2827

2928
const isCurrentPath = (path: string) => {
@@ -74,7 +73,6 @@ export default function Layout({ children, networkStats, onResetZoom, onClearSel
7473
</div>
7574
<div className="flex flex-col">
7675
<h1 className="text-xl font-bold text-gray-900 dark:text-gray-100">TSFlow</h1>
77-
<p className="text-xs text-gray-500 dark:text-gray-400">v2.0.0</p>
7876
</div>
7977
</div>
8078
<button

0 commit comments

Comments
 (0)