fix: address performance and security findings
Lint / Lint (push) Successful in 26s
Tests / Go backend (push) Failing after 1m14s
Tests / Dashboard checks (push) Successful in 52s
Docker / Docker Build & Push (push) Successful in 3m41s

- Add PostgreSQL-backed backend and frontend tests to CI
- Harden Android API logging and disable app backups
- Update the performance report with resolved findings
This commit is contained in:
Gabriel20xx committed 2026-10-19 21:16:08 +00:00
1 parent a84a36349b
commit 937f51b4fb
35 files changed
+2566 -332

No files matched your search

@@ -8,7 +8,7 @@
<application
android:name=".CollabTableApplication"
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
@@ -3,6 +3,7 @@ package com.collabtable.app.data.api
import android.content.Context
import android.net.Uri
import android.os.Build
import com.collabtable.app.BuildConfig
import com.collabtable.app.data.preferences.PreferencesManager
import com.collabtable.app.utils.Logger
import okhttp3.Interceptor
@@ -17,9 +18,13 @@ object ApiClient {
private var retrofit: Retrofit? = null
private var context: Context? = null
// Bodies and the Authorization header carry the sync token and user data, so
// only debug builds log them, and the header is redacted in every build.
private val loggingInterceptor =
HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
level =
if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE
redactHeader("Authorization")
}
private val authInterceptor =
@@ -116,6 +121,18 @@ object ApiClient {
}
}
// Cleartext stays allowed so LAN servers work (see network_security_config.xml). The
// warning makes the trade-off visible: the sync token and data are not encrypted in transit.
private fun warnIfCleartext(url: String) {
if (url.startsWith("http://", ignoreCase = true)) {
Logger.w(
"HTTP",
"API base URL uses plain HTTP: the sync token and data are not encrypted in transit. " +
"Use HTTPS for any server outside your LAN.",
)
}
}
fun initialize(context: Context) {
this.context = context.applicationContext
val prefs = PreferencesManager.getInstance(context)
@@ -124,6 +141,7 @@ object ApiClient {
Logger.i("HTTP", "API base URL initialized to $baseUrl")
} catch (_: Exception) {
}
warnIfCleartext(baseUrl)
retrofit = buildRetrofit()
}
@@ -133,6 +151,7 @@ object ApiClient {
Logger.i("HTTP", "API base URL set to $baseUrl")
} catch (_: Exception) {
}
warnIfCleartext(baseUrl)
retrofit = buildRetrofit()
}