Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
57a0c0e
fix: upgrade Next.js to 16.3.8 for GHSA-vcvr-r3jv-pc5j
operatoruplift Oct 2, 2026
e7eb931
feat: let signed-in people delete their account and its data
operatoruplift Oct 7, 2026
feb9287
feat: publish privacy and terms pages and describe the wallet connect…
operatoruplift Oct 7, 2026
3b2c369
chore: ship the Android shell in English only and document the signed…
operatoruplift Oct 7, 2026
a548a87
fix: keep the hero check mark with its wrapped note and label the leg…
operatoruplift Oct 8, 2026
08d00a0
docs: add the Solana dApp Store listing kit
operatoruplift Oct 8, 2026
9c64784
docs: drop the CLOCK IN hackathon checklist
operatoruplift Oct 8, 2026
41248aa
fix: key rate-limit hashes in the database and prune expired counters
operatoruplift Oct 8, 2026
41e11a1
fix: describe keyed IP hashing and counter retention in the privacy p…
operatoruplift Oct 8, 2026
3d29443
fix: date the privacy policy 8 October for the rate-limit change
operatoruplift Oct 8, 2026
ea57193
fix: meet Developer Agreement 10.6 and keep Android data off cloud ba…
operatoruplift Oct 14, 2026
e12706b
chore: fold the Next.js 16.3.8 upgrade (PR fix/next-16.3.8) into the …
operatoruplift Oct 17, 2026
d942344
chore(deps): apply non-breaking npm audit fixes
operatoruplift Oct 17, 2026
b07bfe0
fix(android): keep the shell up when a link has no handler, save down…
operatoruplift Oct 17, 2026
b0dc0ac
chore: fold the keyed rate-limit retention branch (PR fix/rate-limit-…
operatoruplift Oct 17, 2026
7e8f062
chore(db): align migration files with the hosted migration ledger
operatoruplift Oct 17, 2026
f95775a
fix(monitoring): claim checks fairly across owners and lease manual c…
operatoruplift Oct 18, 2026
45e320a
fix(monitoring): count failed worker-secret attempts and pause the wo…
operatoruplift Oct 18, 2026
750640f
fix(live): make the per-client limit primary, raise the instance ceil…
operatoruplift Oct 18, 2026
42f21c6
fix(reports): cap each account at 50 saved reports and 8 MiB in the d…
operatoruplift Oct 18, 2026
46cdb97
fix(legal): date the policy 24 October and describe only the contact …
operatoruplift Oct 24, 2026
9a67087
chore(deps): declare sharp and rolldown, which the dApp Store asset s…
operatoruplift Oct 24, 2026
bd272b9
fix(security): post the rate-limit secret only to the project's Supab…
operatoruplift Oct 24, 2026
2c1e4aa
fix(webhook): honour Retry-After as seconds or an HTTP-date, capped a…
operatoruplift Oct 24, 2026
1f1cdd6
chore(deps): Next.js 16.4.3 and the remaining non-breaking audit fixes
operatoruplift Oct 24, 2026
09e7e1b
chore(deps): vitest 5.0.5
operatoruplift Oct 25, 2026
28b05b7
fix(ui): raise the smallest text to 11 and 12 px on the app screens
operatoruplift Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=
# Set true only after SMTP, allowed redirects, and email confirmation/recovery are verified.
NEXT_PUBLIC_AUTH_EMAIL_READY=false
# Optional public support address shown on /privacy and /terms. When unset, both pages
# point to https://github.com/operatoruplift/buffer/issues instead.
# NEXT_PUBLIC_SUPPORT_EMAIL=
# Optional path for the durable local SQLite mock worker. Defaults to .local/alerts.sqlite.
# BUFFER_ALERT_STORE=
# Optional server-only distributed read-limit secret. Requires the protected consume_rate_limit RPC.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ jobs:
- run: npm run lint
- run: npm run typecheck
- run: npm test
- name: Verify alert migrations and owner isolation
- name: Verify migrations, owner isolation, account deletion and rate limits
run: |
npm install --prefix "$RUNNER_TEMP/buffer-pglite" --no-package-lock --no-audit --no-fund @electric-sql/[email protected]
export BUFFER_PGLITE_MODULE="$RUNNER_TEMP/buffer-pglite/node_modules/@electric-sql/pglite/dist/index.js"
node scripts/verify-alert-schema.mjs
node scripts/verify-hosted-monitoring.mjs
node scripts/verify-monitoring-scheduler.mjs
node scripts/verify-account-deletion.mjs
node scripts/verify-rate-limit.mjs
node scripts/verify-saved-report-quota.mjs
- run: npm run build

# Deterministic browser regressions block the release. External credentials
Expand Down
15 changes: 15 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ adb install -r app/build/outputs/apk/release/app-release.apk
- This project is a WebView-based Android shell, not a Trusted Web Activity.
- External links outside the configured host open in the system browser.
- Solana wallet intents are handled natively by the app shell.

## Links and downloads

The shell keeps the app inside the WebView and hands everything else to the system with a
guard around every launch, so a phone without a wallet or mail app shows a short message instead
of closing the app:

- `https` links off the app's host open in the system browser; `mailto:` opens the mail app;
`solana-wallet:` opens the wallet. `intent:` URLs lose their component, selector, extras and
URI grants and must be BROWSABLE before they are started. Every other scheme is blocked.
- Downloads are saved to the device's Downloads collection: `https` through the system
DownloadManager, `blob:` and `data:` (the JSON and CSV exports) through a two-method page
bridge named `WebShellDownloads` that only ever creates a new file.
- Mixed content is never allowed, third-party cookies and file or content access are off, popups
need a user gesture, and backup and device-transfer rules exclude everything.
5 changes: 5 additions & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ android {
compose = true
buildConfig = true
}
// Buffer is English only. Without this filter the AndroidX libraries add
// 85 more translated locales, which the dApp Store reads as language claims.
androidResources {
localeFilters += listOf("en")
}
}

dependencies {
Expand Down
6 changes: 5 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
# The page calls the download bridge by method name.
-keepclassmembers class com.operatoruplift.buffer.WebShellDownloads {
@android.webkit.JavascriptInterface <methods>;
}
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<application
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
Expand Down
88 changes: 88 additions & 0 deletions android/app/src/main/java/com/operatoruplift/buffer/LinkOpener.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.operatoruplift.buffer

import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.widget.Toast
import androidx.annotation.StringRes
import androidx.core.net.toUri

/**
* Hands the links the web app cannot show itself to the system, and never lets a missing
* handler or a crafted intent: URL take the shell down. Every launch is caught: a phone
* without a wallet or a mail app gets a short message instead of a crash.
*/
class LinkOpener(private val context: Context) {
private val mainHandler = Handler(Looper.getMainLooper())

/** Only https leaves the shell for the system browser. */
fun openInBrowser(uri: Uri): Boolean {
if (!uri.scheme.equals("https", ignoreCase = true)) return false
return start(Intent(Intent.ACTION_VIEW, uri), R.string.webshell_no_browser)
}

fun openWallet(uri: Uri): Boolean = start(Intent(Intent.ACTION_VIEW, uri), R.string.webshell_no_wallet_app)

fun openEmail(uri: Uri): Boolean = start(Intent(Intent.ACTION_SENDTO, uri), R.string.webshell_no_email_app)

/**
* intent: URLs are reduced to what a browser honours: no explicit component or selector
* (so a page cannot pick another app's exported activity), no extras, no URI permission
* grants, and only activities that declare themselves BROWSABLE. When nothing can open
* the result, the https browser_fallback_url is tried, and nothing else.
*/
fun openIntentUrl(url: String): Boolean {
val parsed = runCatching { Intent.parseUri(url, Intent.URI_INTENT_SCHEME) }.getOrNull() ?: return false
val fallback =
parsed.getStringExtra("browser_fallback_url")?.toUri()?.takeIf { it.scheme.equals("https", ignoreCase = true) }
val safe =
Intent(parsed).apply {
component = null
selector = null
replaceExtras(null as Bundle?)
addCategory(Intent.CATEGORY_BROWSABLE)
flags = flags and GRANT_FLAGS.inv()
}
if (start(safe, null)) return true
return fallback != null && openInBrowser(fallback)
}

fun toast(
@StringRes message: Int,
) {
mainHandler.post { Toast.makeText(context.applicationContext, message, Toast.LENGTH_SHORT).show() }
}

private fun start(
intent: Intent,
@StringRes message: Int?,
): Boolean {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return try {
context.startActivity(intent)
true
} catch (e: ActivityNotFoundException) {
Log.w(TAG, "No activity for ${intent.data?.scheme ?: intent.action}")
if (message != null) toast(message)
false
} catch (e: SecurityException) {
Log.w(TAG, "Launch refused for ${intent.data?.scheme ?: intent.action}: ${e.message}")
if (message != null) toast(message)
false
}
}

private companion object {
const val TAG = "WebShell"
const val GRANT_FLAGS =
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION or
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION or
Intent.FLAG_GRANT_PREFIX_URI_PERMISSION
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ fun WebShellScreen() {
var hasError by remember { mutableStateOf(false) }
var showSplash by remember { mutableStateOf(true) }

val opener = remember { LinkOpener(context) }
val downloads = remember(opener) { WebShellDownloads(context, opener) }

val webView =
remember {
WebView(context).apply {
Expand All @@ -91,13 +94,17 @@ fun WebShellScreen() {
settings.databaseEnabled = true
settings.loadWithOverviewMode = false
settings.useWideViewPort = false
settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
// The site is https only. localhost is a secure context in Chromium, so the
// Mobile Wallet Adapter websocket is not mixed content and still works.
settings.mixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW
settings.builtInZoomControls = true
settings.displayZoomControls = false
settings.setSupportZoom(true)
settings.javaScriptCanOpenWindowsAutomatically = true
settings.javaScriptCanOpenWindowsAutomatically = false
settings.setSupportMultipleWindows(true)
settings.offscreenPreRaster = true
settings.allowFileAccess = false
settings.allowContentAccess = false

val originalUa = settings.userAgentString
settings.userAgentString =
Expand All @@ -110,7 +117,7 @@ fun WebShellScreen() {
Log.i(TAG, "UA verify: ${settings.userAgentString}")
}

CookieManager.getInstance().setAcceptThirdPartyCookies(this, true)
CookieManager.getInstance().setAcceptThirdPartyCookies(this, false)

webChromeClient =
WebShellChromeClient(
Expand All @@ -120,10 +127,11 @@ fun WebShellScreen() {
isLoading = newProgress < 100
},
isDebug = BuildConfig.DEBUG,
opener = opener,
)

webViewClient =
object : WebShellViewClient(context, scopeHostProvider = { scopeHost }) {
object : WebShellViewClient(context, scopeHostProvider = { scopeHost }, opener = opener) {
override fun onPageFinished(
view: WebView,
url: String?,
Expand All @@ -147,6 +155,11 @@ fun WebShellScreen() {
}
}

addJavascriptInterface(downloads, WebShellDownloads.BRIDGE)
setDownloadListener { url, userAgent, contentDisposition, mimeType, _ ->
downloads.onDownloadStart(this, url, userAgent, contentDisposition, mimeType)
}

loadUrl(startUrl)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.operatoruplift.buffer

import android.content.Intent
import android.os.Message
import android.util.Log
import android.webkit.ConsoleMessage
Expand All @@ -12,6 +11,7 @@ import android.webkit.WebViewClient
class WebShellChromeClient(
private val onProgressChanged: (Int) -> Unit,
private val isDebug: Boolean,
private val opener: LinkOpener,
) : WebChromeClient() {
override fun onProgressChanged(
view: WebView,
Expand Down Expand Up @@ -45,17 +45,24 @@ class WebShellChromeClient(
isUserGesture: Boolean,
resultMsg: Message,
): Boolean {
// Handle window.open() and target="_blank" links (used by OAuth
// flows like Privy, social logins, etc.). Open the URL in the
// system browser so the user can complete the flow there.
// window.open() and target="_blank" open in the system browser, and only when the
// user asked for it: a page script cannot pop windows on its own.
if (!isUserGesture) return false
val newWebView = WebView(view.context)
newWebView.webViewClient =
object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: WebView,
request: WebResourceRequest,
): Boolean {
view.context.startActivity(Intent(Intent.ACTION_VIEW, request.url))
val url = request.url
when (url.scheme?.lowercase()) {
"https" -> opener.openInBrowser(url)
"http" -> opener.openInBrowser(url.buildUpon().scheme("https").build())
"mailto" -> opener.openEmail(url)
"solana-wallet" -> opener.openWallet(url)
"intent" -> opener.openIntentUrl(url.toString())
}
return true
}
}
Expand Down
Loading
Loading