Files
AudioManager/build.gradle.kts
T
TapTap 44b75c4d4d
CI / chart (push) Successful in 3s
CI / test (push) Successful in 2m20s
CI / chart-push (push) Successful in 6s
CI / image (push) Successful in 3m39s
feat: accept, store and expose client diagnostics
- V11 client_logs table with per-user storage and retention/pruning
- POST/GET/DELETE /logs with batch validation, rate limit and admin access
- redact bearer tokens, Authorization headers and query/JSON secrets twice
- add X-Request-Id to responses and include it in the server log pattern
- report client error entries immediately in the server log
- scripts/logs.sh for source-side retrieval and clearing
- chart knobs CLIENT_LOG_RETENTION_DAYS and CLIENT_LOG_MAX_ROWS_PER_USER
2026-11-20 13:43:05 +00:00

113 lines
3.2 KiB
Kotlin

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm") version "2.1.20"
kotlin("plugin.serialization") version "2.1.20"
application
id("com.gradleup.shadow") version "8.3.6"
}
group = "win.taptap"
version = "0.1.0"
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(21)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
application {
mainClass.set("win.taptap.musicmanager.ApplicationKt")
}
dependencies {
// Ktor
implementation("io.ktor:ktor-server-core-jvm:3.1.2")
implementation("io.ktor:ktor-server-netty-jvm:3.1.2")
implementation("io.ktor:ktor-server-content-negotiation-jvm:3.1.2")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:3.1.2")
implementation("io.ktor:ktor-server-partial-content-jvm:3.1.2")
implementation("io.ktor:ktor-server-status-pages-jvm:3.1.2")
implementation("io.ktor:ktor-server-call-logging-jvm:3.1.2")
implementation("io.ktor:ktor-server-auto-head-response-jvm:3.1.2")
implementation("io.ktor:ktor-server-cors-jvm:3.1.2")
implementation("io.ktor:ktor-server-call-id-jvm:3.1.2")
// Database
implementation("org.jetbrains.exposed:exposed-core:0.60.0")
implementation("org.jetbrains.exposed:exposed-jdbc:0.60.0")
implementation("org.jetbrains.exposed:exposed-java-time:0.60.0")
implementation("org.xerial:sqlite-jdbc:3.49.1.0")
implementation("com.zaxxer:HikariCP:6.2.1")
implementation("org.flywaydb:flyway-core:11.8.2")
// Media
implementation("net.jthink:jaudiotagger:3.0.1")
implementation("net.coobird:thumbnailator:0.4.20")
// Config & logging
implementation("org.yaml:snakeyaml:2.7")
implementation("ch.qos.logback:logback-classic:1.5.17")
implementation("io.github.oshai:kotlin-logging-jvm:7.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
// Tests
testImplementation("io.ktor:ktor-server-test-host-jvm:3.1.2")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
/**
* Prepares a local development checkout: creates the data/media directories and
* copies the example users file when it is missing. Existing files are never
* overwritten.
*/
val setupLocal by tasks.registering {
group = "application"
description = "Create local data folders and copy the example users config if missing."
doLast {
project.mkdir("data/media")
project.mkdir("data/downloads")
val target = project.file("config/users.yaml")
val example = project.file("config/users.example.yaml")
if (!target.exists()) {
target.parentFile.mkdirs()
example.copyTo(target)
println("Created config/users.yaml from config/users.example.yaml")
} else {
println("Keeping existing config/users.yaml")
}
}
}
tasks.named("run") {
dependsOn(setupLocal)
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
tasks.shadowJar {
archiveClassifier.set("all")
mergeServiceFiles()
}
tasks.build {
dependsOn(tasks.shadowJar)
}