mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-22 22:48:04 +02:00
Serveur réécrit en Rust
Le serveur Dart (bin/) est remplacé par un serveur Rust (server/) : tokio + axum, reqwest/rustls, SQLite embarqué via rusqlite. Même API, mêmes routes et mêmes réponses : le front Flutter ne change pas. La base de production est reprise telle quelle : schéma, migrations et formats de dates (DateTime.toIso8601String de Dart) sont reproduits à l'identique, les sessions et hachages existants restent valides. Comportement conservé : cascade de routage, anti-SSRF, logs masqués, rate limits, transcodage HLS/turbo.ts avec repli GPU, quotas fournisseur, enregistrements (reprise, relances, fusion), season passes, EPG, logos de repli, arrêt gracieux sur SIGTERM. Tests Dart portés (132 tests Rust) ; la CI exécute fmt, test et clippy -D warnings, l'image Docker compile le serveur dans un étage rust:1.98.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f82c70ae05
commit
3ea6fa0ae3
109 files changed
+14008
-11047
No files matched your search
@@ -1,67 +0,0 @@
|
||||
class Playlist {
|
||||
final String id;
|
||||
final String userId;
|
||||
final String name;
|
||||
final String serverUrl;
|
||||
final String username;
|
||||
final String password;
|
||||
final String? dns;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
|
||||
Playlist({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
required this.name,
|
||||
required this.serverUrl,
|
||||
required this.username,
|
||||
required this.password,
|
||||
this.dns,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
|
||||
factory Playlist.fromMap(Map<String, dynamic> map) {
|
||||
return Playlist(
|
||||
id: map['id'] as String,
|
||||
userId: map['user_id'] as String,
|
||||
name: map['name'] as String,
|
||||
serverUrl: map['server_url'] as String,
|
||||
username: map['username'] as String,
|
||||
password: map['password'] as String,
|
||||
dns: map['dns'] as String?,
|
||||
createdAt: DateTime.parse(map['created_at'] as String),
|
||||
updatedAt: DateTime.parse(map['updated_at'] as String),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'userId': userId,
|
||||
'name': name,
|
||||
'serverUrl': serverUrl,
|
||||
'username': username,
|
||||
// Never expose the Xtream password to clients; the backend injects
|
||||
// credentials server-side (see xtream_api_handler.dart).
|
||||
'password': '',
|
||||
'dns': dns,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
'updatedAt': updatedAt.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'user_id': userId,
|
||||
'name': name,
|
||||
'server_url': serverUrl,
|
||||
'username': username,
|
||||
'password': password,
|
||||
'dns': dns,
|
||||
'created_at': createdAt.toIso8601String(),
|
||||
'updated_at': updatedAt.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user