Notifications: staff turn them on per device from a new Notifications page, pick each type (bans, gags, mutes and silences added or lifted, server down and back up) and quiet hours. A watcher polls SimpleAdmin's tables, so in-game penalties are sent too. Web Push with VAPID and RFC 8291 encryption in internal/push, standard library only. Tables in sql/push.sql, created at startup; the VAPID key is made on first start and kept in saw_settings. Penalty notifications link to the public list searching for the player (#bans?q=<steamid64>). The Android app delegates notifications (versionCode 3). Caching: pages, scripts and styles are served with Cache-Control: no-cache and an ETag, so a deploy shows up at once instead of after Cloudflare's default 4-hour browser cache.
53 lines
1.7 KiB
Groovy
53 lines
1.7 KiB
Groovy
plugins {
|
|
id "com.android.application"
|
|
}
|
|
|
|
// The site the app opens. It must serve /.well-known/assetlinks.json naming this app's package and
|
|
// signing key, or Chrome shows its URL bar over the app (see SAW_ANDROID_* in example.env).
|
|
def siteURL = "https://cs2.zio.sh"
|
|
def startPath = "/"
|
|
|
|
android {
|
|
namespace "sh.zio.cs2"
|
|
compileSdk 36
|
|
|
|
defaultConfig {
|
|
// Never change applicationId once installed anywhere: Android treats it as a different app.
|
|
applicationId "sh.zio.cs2"
|
|
minSdk 24
|
|
targetSdk 36
|
|
// Bump versionCode for every APK you hand out, or Android refuses to update over the old one.
|
|
versionCode 3
|
|
versionName "1.0"
|
|
|
|
resValue "string", "launch_url", siteURL + startPath
|
|
resValue "string", "asset_statements",
|
|
"[{\\\"relation\\\": [\\\"delegate_permission/common.handle_all_urls\\\"], \\\"target\\\": {\\\"namespace\\\": \\\"web\\\", \\\"site\\\": \\\"" + siteURL + "\\\"}}]"
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
storeFile file(System.getenv("KEYSTORE_FILE") ?: "/keystore/release.jks")
|
|
storePassword System.getenv("KEYSTORE_PASSWORD")
|
|
keyAlias "release"
|
|
keyPassword System.getenv("KEYSTORE_PASSWORD")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt")
|
|
signingConfig signingConfigs.release
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "com.google.androidbrowserhelper:androidbrowserhelper:2.7.3"
|
|
}
|