Skip to content

Commit cc5e13b

Browse files
author
novnc
committed
feat: Update TCP port from 9999 to 8099 across configuration, documentation, and Docker setup
1 parent 13abe9c commit cc5e13b

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ RUN mkdir -p pastes logs && \
4545
USER nclip
4646

4747
# Expose ports
48-
EXPOSE 8080 9999
48+
EXPOSE 8080 8099
4949

5050
# Health check
5151
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
5252
CMD curl -f http://localhost:8080/health || exit 1
5353

5454
# Default configuration
5555
ENV NCLIP_HTTP_PORT=8080 \
56-
NCLIP_TCP_PORT=9999 \
56+
NCLIP_TCP_PORT=8099 \
5757
NCLIP_LOG_LEVEL=info \
5858
NCLIP_STORAGE_TYPE=filesystem \
5959
NCLIP_OUTPUT_DIR=/app/pastes

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ docker-build: ## Build Docker image
109109

110110
docker-run: docker-build ## Build and run Docker container
111111
@echo "🐳 Running Docker container..."
112-
docker run --rm -p 8080:8080 -p 9999:9999 nclip:latest
112+
docker run --rm -p 8080:8080 -p 8099:8099 nclip:latest
113113

114114
# Release preparation
115115
release-check: clean check build-all ## Run all checks for release
@@ -129,7 +129,7 @@ docker-build:
129129
docker build -t nclip:$(VERSION) .
130130

131131
docker-run:
132-
docker run -p 9999:9999 -p 8080:8080 -v $(PWD)/data:/data nclip:$(VERSION)
132+
docker run -p 8099:8099 -p 8080:8080 -v $(PWD)/data:/data nclip:$(VERSION)
133133

134134
# Development setup
135135
dev-setup:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A modern, high-performance netcat-to-clipboard service written in Go, inspired b
1111
## Overview
1212

1313
nclip is a dual-input clipboard service that accepts content via:
14-
- **netcat (nc)** - Traditional command-line input: `echo "text" | nc localhost 9999`
14+
- **netcat (nc)** - Traditional command-line input: `echo "text" | nc localhost 8099`
1515
- **HTTP/curl** - Modern web API: `echo "text" | curl -d @- http://localhost:8080`
1616
- **HTTP/curl** - Web API with multilines support: `ps | curl --data-binary @- http://localhost:8080`
1717
- **Web UI** - Browser interface at `http://localhost:8080`
@@ -47,7 +47,7 @@ go build -o nclip .
4747
./nclip
4848

4949
# Using netcat (traditional)
50-
echo "Hello World!" | nc localhost 9999
50+
echo "Hello World!" | nc localhost 8099
5151

5252
# Using curl (modern)
5353
echo "Hello World!" | curl -d @- http://localhost:8080
@@ -61,10 +61,10 @@ open http://localhost:8080
6161
### Command Line
6262
```bash
6363
# Share a file via netcat
64-
cat myfile.txt | nc localhost 9999
64+
cat myfile.txt | nc localhost 8099
6565

6666
# Share command output
67-
ls -la | nc localhost 9999
67+
ls -la | nc localhost 8099
6868

6969
# Share via HTTP with curl
7070
echo "Secret message" | curl -d @- http://localhost:8080
@@ -76,7 +76,7 @@ curl -d @myfile.txt http://localhost:8080
7676
### Configuration
7777
```bash
7878
# Custom ports and domain
79-
./nclip -domain paste.example.com -tcp-port 9999 -http-port 8080
79+
./nclip -domain paste.example.com -tcp-port 8099 -http-port 8080
8080

8181
# Use MongoDB storage
8282
./nclip -storage-type mongodb -mongodb-uri mongodb://localhost:27017
@@ -102,7 +102,7 @@ cd nclip
102102
docker-compose up -d
103103

104104
# Access the service
105-
echo "Hello Docker!" | nc localhost 9999
105+
echo "Hello Docker!" | nc localhost 8099
106106
```
107107

108108
### Kubernetes

docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ services:
3939
# Application Configuration
4040
NCLIP_URL: http://localhost:8080
4141
NCLIP_HTTP_PORT: 8080
42-
NCLIP_TCP_PORT: 9999
43-
NCLIP_EXPIRE_DAYS: 30
44-
NCLIP_LOG_LEVEL: info
45-
NCLIP_ENABLE_METRICS: "true"
46-
NCLIP_ENABLE_WEBUI: "true"
47-
NCLIP_RATE_LIMIT: "20/min"
42+
NCLIP_TCP_PORT: 8099
43+
NCLIP_EXPIRE_DAYS: 30
44+
NCLIP_LOG_LEVEL: info
45+
NCLIP_ENABLE_METRICS: "true"
46+
NCLIP_ENABLE_WEBUI: "true"
47+
NCLIP_RATE_LIMIT: "20/min"
4848
ports:
4949
- "8080:8080" # HTTP interface
50-
- "9999:9999" # TCP netcat interface
50+
- "8099:8099" # TCP netcat interface
5151
depends_on:
5252
mongodb:
5353
condition: service_healthy

docs/DOCKER_KUBERNETES_DEPLOYMENT.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
build: .
3636
ports:
3737
- "8080:8080"
38-
- "9999:9999"
38+
- "8099:8099"
3939
environment:
4040
- NCLIP_STORAGE_TYPE=mongodb
4141
- NCLIP_MONGODB_URI=mongodb://mongo:27017
@@ -111,7 +111,7 @@ RUN adduser -D -s /bin/sh nclip
111111
USER nclip
112112

113113
# Expose ports
114-
EXPOSE 8080 9999
114+
EXPOSE 8080 8099
115115

116116
# Run the application
117117
CMD ["./nclip"]
@@ -246,7 +246,7 @@ spec:
246246
image: your-registry/nclip:latest
247247
ports:
248248
- containerPort: 8080
249-
- containerPort: 9999
249+
- containerPort: 8099
250250
env:
251251
- name: NCLIP_STORAGE_TYPE
252252
value: "mongodb"
@@ -296,8 +296,8 @@ spec:
296296
port: 80
297297
targetPort: 8080
298298
- name: tcp
299-
port: 9999
300-
targetPort: 9999
299+
port: 8099
300+
targetPort: 8099
301301
type: LoadBalancer
302302

303303
---

docs/DOCKER_KUBERNETES_STORAGE_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ docker-compose up -d
4242

4343
**Access:**
4444
- Application: http://localhost:8080
45-
- Netcat: `echo "test" | nc localhost 9999`
45+
- Netcat: `echo "test" | nc localhost 8099`
4646
- MongoDB Admin: http://localhost:8081 (admin/admin123)
4747

4848
### Option 2: Kubernetes (Production)
@@ -79,7 +79,7 @@ docker-compose up --build
7979

8080
# Test
8181
echo "Hello MongoDB!" | curl -d @- http://localhost:8080
82-
echo "Hello MongoDB!" | nc localhost 9999
82+
echo "Hello MongoDB!" | nc localhost 8099
8383
```
8484

8585
### 2. Filesystem (Simple development)

docs/PARAMETER_REFERENCE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ nclip supports configuration via:
1616
| Parameter | Type | Default | Environment Variable | Description |
1717
|-----------|------|---------|---------------------|-------------|
1818
| `--url` | string | `http://localhost:8080/` | `NCLIP_URL` | Base URL template for generated paste URLs |
19-
| `--tcp-port` | int | `9999` | `NCLIP_TCP_PORT` | TCP port for netcat connections |
19+
| `--tcp-port` | int | `8099` | `NCLIP_TCP_PORT` | TCP port for netcat connections |
2020
| `--http-port` | int | `8080` | `NCLIP_HTTP_PORT` | HTTP port for web interface |
2121

2222
### **Storage Configuration**
@@ -155,7 +155,7 @@ All parameters can be set via environment variables with the `NCLIP_` prefix:
155155
# Server configuration
156156
export NCLIP_URL=https://paste.example.com/clips/
157157
export NCLIP_HTTP_PORT=8080
158-
export NCLIP_TCP_PORT=9999
158+
export NCLIP_TCP_PORT=8099
159159

160160
# Storage configuration
161161
export NCLIP_STORAGE_TYPE=mongodb
@@ -273,7 +273,7 @@ export AWS_SECRET_ACCESS_KEY=...
273273
### **Minimal Start**
274274
```bash
275275
./nclip
276-
# Starts on localhost:8080 (HTTP) and localhost:9999 (TCP)
276+
# Starts on localhost:8080 (HTTP) and localhost:8099 (TCP)
277277
# Returns URLs like: http://localhost:8080/abc12345
278278
```
279279

@@ -300,7 +300,7 @@ export AWS_SECRET_ACCESS_KEY=...
300300
| Setting | Default Value | Purpose |
301301
|---------|---------------|---------|
302302
| **Base URL** | `http://localhost:8080/` | Local development with HTTP |
303-
| **Ports** | `8080` (HTTP), `9999` (TCP) | Standard non-privileged ports |
303+
| **Ports** | `8080` (HTTP), `8099` (TCP) | Standard non-privileged ports |
304304
| **Storage** | `filesystem` | No dependencies |
305305
| **Expiration** | `1 day` | Serverless-friendly |
306306
| **Rate Limit** | `10/min` | Conservative rate limiting |

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func DefaultConfig() *Config {
4848
return &Config{
4949
// Server defaults
5050
BaseURL: "http://localhost:8080/",
51-
TCPPort: 9999,
51+
TCPPort: 8099,
5252
HTTPPort: 8080,
5353
StorageType: "filesystem",
5454
OutputDir: "./pastes",
@@ -112,7 +112,7 @@ func LoadFromFlags() (*Config, error) {
112112
fmt.Fprintf(os.Stderr, " # Start with default settings\n")
113113
fmt.Fprintf(os.Stderr, " %s\n\n", os.Args[0])
114114
fmt.Fprintf(os.Stderr, " # Custom URL and ports\n")
115-
fmt.Fprintf(os.Stderr, " %s -url https://paste.example.com/clips/ -tcp-port 9999 -http-port 8080\n\n", os.Args[0])
115+
fmt.Fprintf(os.Stderr, " %s -url https://paste.example.com/clips/ -tcp-port 8099 -http-port 8080\n\n", os.Args[0])
116116
fmt.Fprintf(os.Stderr, " # With custom storage and directory\n")
117117
fmt.Fprintf(os.Stderr, " %s -url https://paste.example.com/clips/ -storage-type mongodb -mongodb-uri mongodb://localhost:27017\n\n", os.Args[0])
118118
}

internal/config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ func TestDefaultConfig(t *testing.T) {
1515
t.Errorf("Expected default BaseURL 'http://localhost:8080/', got %s", cfg.BaseURL)
1616
}
1717

18-
if cfg.TCPPort != 9999 {
19-
t.Errorf("Expected default TCP port 9999, got %d", cfg.TCPPort)
18+
if cfg.TCPPort != 8099 {
19+
t.Errorf("Expected default TCP port 8099, got %d", cfg.TCPPort)
2020
}
2121

2222
if cfg.HTTPPort != 8080 {

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestLambdaFunctionTimeout(t *testing.T) {
176176
}()
177177

178178
// Set a test Lambda environment
179-
_ = os.Setenv("AWS_LAMBDA_RUNTIME_API", "localhost:9999")
179+
_ = os.Setenv("AWS_LAMBDA_RUNTIME_API", "localhost:8099")
180180

181181
// Create a channel to track if Lambda mode would be triggered
182182
done := make(chan bool, 1)

0 commit comments

Comments
 (0)