feat: device label defaults to Build.MODEL; 3-word passphrase token

- SettingsRepository: deviceLabel fallback changed from "android" to
  Build.MODEL so fresh installs show the actual device name (e.g. "Pixel 8")
- server/main.py: _generate_passphrase() replaces secrets.token_hex(32).
  Picks 3 words from a 512-word embedded list, hyphen-separated
  (e.g. "coral-drift-lamp"). ~27 bits entropy, readable at a glance.
  Existing token.txt files are unaffected — only new generation changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 08:27:38 -04:00
parent fca3ea6f60
commit 628a28a775
2 changed files with 69 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package me.hgsky.synq.data
import android.content.Context
import android.os.Build
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
@@ -28,7 +29,7 @@ class SettingsRepository(private val context: Context) {
SynqSettings(
serverUrl = prefs[KEY_URL] ?: "http://jeeves.mother:8765",
token = prefs[KEY_TOKEN] ?: "",
deviceLabel = prefs[KEY_DEVICE] ?: "android",
deviceLabel = prefs[KEY_DEVICE] ?: Build.MODEL,
syncIntervalMinutes = prefs[KEY_INTERVAL] ?: 15,
)
}