Change default server port from 3000 to 8080
Updates the default PORT across backend, Dockerfile, README docs, the Android client's fallback URLs/placeholders, and the frontend dev proxy. Touched files also pick up line-ending normalization (CRLF->LF) with no other content changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
84a32fe6b4
commit
f84907eb9b
11 files changed
+21
-21
No files matched your search
@@ -42,8 +42,8 @@ The app includes a Settings screen where you can configure the server URL:
|
||||
3. Tap "Save"
|
||||
|
||||
**Default URLs:**
|
||||
- Android Emulator: `http://10.0.2.2:3000/api/`
|
||||
- Physical Device: `http://YOUR_COMPUTER_IP:3000/api/` (replace YOUR_COMPUTER_IP with your actual IP address)
|
||||
- Android Emulator: `http://10.0.2.2:8080/api/`
|
||||
- Physical Device: `http://YOUR_COMPUTER_IP:8080/api/` (replace YOUR_COMPUTER_IP with your actual IP address)
|
||||
|
||||
**Note:** Make sure to include `/api/` at the end of the URL.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import retrofit2.converter.gson.GsonConverterFactory
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
object ApiClient {
|
||||
private var baseUrl: String = "http://10.0.2.2:3000/api/" // Default for Android emulator
|
||||
private var baseUrl: String = "http://10.0.2.2:8080/api/" // Default for Android emulator
|
||||
private var retrofit: Retrofit? = null
|
||||
private var context: Context? = null
|
||||
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ class PreferencesManager(
|
||||
private const val KEY_HAS_PROMPTED_NOTIFICATIONS = "has_prompted_notifications"
|
||||
private const val COLUMN_WIDTHS_PREFIX = "column_widths_" // + listId
|
||||
private const val COLUMN_ALIGN_PREFIX = "column_align_" // + listId
|
||||
private const val DEFAULT_SERVER_URL = "http://10.0.2.2:3000/api/"
|
||||
private const val DEFAULT_SERVER_URL = "http://10.0.2.2:8080/api/"
|
||||
private const val DEFAULT_SYNC_POLL_INTERVAL_MS = 250L
|
||||
private const val MIN_SYNC_POLL_INTERVAL_MS = 250L
|
||||
private const val MAX_SYNC_POLL_INTERVAL_MS = 600_000L // 10 minutes
|
||||
|
||||
+3
-3
@@ -159,7 +159,7 @@ fun ServerSetupScreen(onSetupComplete: () -> Unit) {
|
||||
viewModel.clearValidationState()
|
||||
},
|
||||
label = { Text("Server Hostname") },
|
||||
placeholder = { Text("example.com or 10.0.2.2:3000") },
|
||||
placeholder = { Text("example.com or 10.0.2.2:8080") },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
enabled = !isValidating,
|
||||
isError = validationError != null,
|
||||
@@ -170,7 +170,7 @@ fun ServerSetupScreen(onSetupComplete: () -> Unit) {
|
||||
text = validationError ?: "",
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
else -> Text("Server address (e.g. 192.168.1.5:3000)")
|
||||
else -> Text("Server address (e.g. 192.168.1.5:8080)")
|
||||
}
|
||||
},
|
||||
trailingIcon = {
|
||||
@@ -246,7 +246,7 @@ fun ServerSetupScreen(onSetupComplete: () -> Unit) {
|
||||
}
|
||||
|
||||
Text(
|
||||
text = "Tip: Emulator host 10.0.2.2:3000 · Physical device uses your PC IP",
|
||||
text = "Tip: Emulator host 10.0.2.2:8080 · Physical device uses your PC IP",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ class ServerSetupViewModel(
|
||||
}
|
||||
val localOnlyHosts = setOf("localhost", "127.0.0.1", "host.docker.internal", "10.0.2.2")
|
||||
if (!isEmulator && host != null && host in localOnlyHosts) {
|
||||
_validationError.value = "On a physical device, use your computer's LAN IP (e.g., 192.168.x.x:3000) instead of '$host'."
|
||||
_validationError.value = "On a physical device, use your computer's LAN IP (e.g., 192.168.x.x:8080) instead of '$host'."
|
||||
_isValidating.value = false
|
||||
return@launch
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ The device-sync API token (generated from the dashboard's Settings page, used by
|
||||
|----------|----------|---------|--------------|
|
||||
| `DATABASE_URL` | Yes | — | PostgreSQL connection string (bring your own instance) |
|
||||
| `AUTHGUARD_URL` | No | unset (auth disabled) | Base URL of the AuthGuard identity service. Leaving it unset disables authentication entirely rather than falling back to local auth. |
|
||||
| `PORT` | No | `3000` | HTTP listen port |
|
||||
| `PORT` | No | `8080` | HTTP listen port |
|
||||
| `APP_VERSION` | No | `dev` | Version label shown on the dashboard's About page |
|
||||
| `COOKIE_SECURE` | No | `false` | Set `true` once served over HTTPS, to mark cookies `Secure` |
|
||||
| `DB_INIT_RETRY_INTERVAL_MS` | No | `5000` | Delay between database-connection retry attempts at startup |
|
||||
@@ -60,13 +60,13 @@ docker build -t collabtable:local -f docker/Dockerfile .
|
||||
docker run -d \
|
||||
--name collabtable \
|
||||
--restart unless-stopped \
|
||||
-p 3000:3000 \
|
||||
-p 8080:8080 \
|
||||
-e DATABASE_URL="postgresql://user:password@host:5432/collabtable" \
|
||||
-e AUTHGUARD_URL="https://auth.example.com" \
|
||||
collabtable:local
|
||||
```
|
||||
|
||||
Open **http://\<host\>:3000**, complete setup (this registers the first account against AuthGuard), then generate a device-sync API token from the dashboard's Settings page for the Android app.
|
||||
Open **http://\<host\>:8080**, complete setup (this registers the first account against AuthGuard), then generate a device-sync API token from the dashboard's Settings page for the Android app.
|
||||
|
||||
---
|
||||
|
||||
@@ -100,7 +100,7 @@ Other frontend scripts: `npm run build`, `npm run format`.
|
||||
|
||||
### Android
|
||||
|
||||
Open `CollabTableAndroid` in Android Studio, let Gradle sync, and run on an emulator or device. In the app's Settings, point it at the backend (`http://10.0.2.2:3000/api/` for an emulator) with the API token generated from the dashboard.
|
||||
Open `CollabTableAndroid` in Android Studio, let Gradle sync, and run on an emulator or device. In the app's Settings, point it at the backend (`http://10.0.2.2:8080/api/` for an emulator) with the API token generated from the dashboard.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#################################################################
|
||||
# Server
|
||||
#################################################################
|
||||
PORT=3000
|
||||
PORT=8080
|
||||
APP_VERSION=dev
|
||||
|
||||
# Set to "true" once served over HTTPS - marks the admin session cookie Secure.
|
||||
|
||||
+3
-3
@@ -21,14 +21,14 @@ Svelte dashboard and the Android synchronization API from one container.
|
||||
cd ..
|
||||
docker build -f docker/Dockerfile -t collabtable-server .
|
||||
docker run -d --name collabtable-server --restart unless-stopped \
|
||||
-p 3000:3000 \
|
||||
-p 8080:8080 \
|
||||
-e DATABASE_URL=postgres://user:password@host:5432/collabtable \
|
||||
-e AUTHGUARD_URL=https://auth.example.com \
|
||||
-e COOKIE_SECURE=false \
|
||||
collabtable-server
|
||||
```
|
||||
|
||||
Open `http://localhost:3000` to create the first account. Generate an API token from
|
||||
Open `http://localhost:8080` to create the first account. Generate an API token from
|
||||
the dashboard's Settings menu and enter it in the Android app.
|
||||
|
||||
## Local development
|
||||
@@ -108,7 +108,7 @@ unrelated to AuthGuard (see below), hashed at rest, and shown only when generate
|
||||
|
||||
## Environment variables
|
||||
|
||||
- `PORT` — HTTP port, default `3000`
|
||||
- `PORT` — HTTP port, default `8080`
|
||||
- `APP_VERSION` — optional version displayed in the dashboard, default `dev`
|
||||
- `COOKIE_SECURE` — set to `true` when served over HTTPS
|
||||
- `DATABASE_URL` — PostgreSQL connection string, required
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ type Server struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
port := envOrDefault("PORT", "3000")
|
||||
port := envOrDefault("PORT", "8080")
|
||||
connectionString := strings.TrimSpace(os.Getenv("DATABASE_URL"))
|
||||
if connectionString == "" {
|
||||
fmt.Fprintln(os.Stderr, "DATABASE_URL environment variable is required")
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ FROM scratch
|
||||
COPY --from=builder /app/server /server
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
USER 65534:65534
|
||||
EXPOSE 3000
|
||||
EXPOSE 8080
|
||||
VOLUME ["/data"]
|
||||
ENV PORT=3000
|
||||
ENV PORT=8080
|
||||
ENTRYPOINT ["/server"]
|
||||
@@ -36,8 +36,8 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/web': 'http://localhost:3000',
|
||||
'/health': 'http://localhost:3000',
|
||||
'/web': 'http://localhost:8080',
|
||||
'/health': 'http://localhost:8080',
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user