Ajout d'un script pour installation automatique du produit
Some checks failed
E2E Tests / e2e (push) Failing after 19s
Build & Push Images / build (brain) (push) Successful in 45s
Build & Push Images / build (core) (push) Successful in 1m16s
Build & Push Images / build (web) (push) Successful in 1m26s

Ajout d'une partie mise à jour automatique : plus besoin de docker pull en ligne de commande ; on peut passer par l'interface
Refactoring partie Java pour respecter d'avantage le DDD : plus de jackson dans la partie domain

Passage version 0.6.6
This commit is contained in:
2026-04-25 13:24:32 +02:00
parent 550078268c
commit 41fda9aeee
58 changed files with 1859 additions and 812 deletions

View File

@@ -8,11 +8,12 @@ import { firstValueFrom } from 'rxjs';
*/
export interface PublicConfig {
demoMode: boolean;
updateCheckEnabled: boolean;
}
@Injectable({ providedIn: 'root' })
export class ConfigService {
private config: PublicConfig = { demoMode: false };
private config: PublicConfig = { demoMode: false, updateCheckEnabled: false };
constructor(private http: HttpClient) {}
@@ -28,4 +29,8 @@ export class ConfigService {
get demoMode(): boolean {
return this.config.demoMode;
}
get updateCheckEnabled(): boolean {
return this.config.updateCheckEnabled;
}
}

View File

@@ -0,0 +1,62 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject, Observable, catchError, of, tap } from 'rxjs';
/**
* Reflet de UpdateCheckService.UpdateStatus cote backend.
*/
export interface ImageStatus {
image: string;
localDigest: string | null;
remoteDigest: string | null;
updateAvailable: boolean;
}
export interface UpdateStatus {
enabled: boolean;
updateAvailable: boolean;
images: ImageStatus[];
checkedAt: string;
}
/**
* Service de detection / declenchement des mises a jour des conteneurs
* LoreMind. Endpoints proteges par HTTP Basic (admin) — withCredentials
* comme pour SettingsService.
*
* `updateAvailable$` est un signal global consomme par la sidebar pour
* afficher un badge. Il est rafraichi via {@link checkNow}.
*/
@Injectable({ providedIn: 'root' })
export class UpdatesService {
private readonly apiUrl = '/api/admin/updates';
private readonly authOptions = { withCredentials: true };
private readonly _updateAvailable$ = new BehaviorSubject<boolean>(false);
readonly updateAvailable$ = this._updateAvailable$.asObservable();
constructor(private http: HttpClient) {}
/**
* Interroge le backend. Met a jour `updateAvailable$` au passage.
* Renvoie `null` en cas d'erreur (pas authentifie, feature off, etc.)
* pour ne pas faire crasher l'UI au boot.
*/
checkNow(): Observable<UpdateStatus | null> {
return this.http.get<UpdateStatus>(`${this.apiUrl}/check`, this.authOptions).pipe(
tap(s => this._updateAvailable$.next(!!s?.updateAvailable)),
catchError(() => {
this._updateAvailable$.next(false);
return of(null);
})
);
}
apply(): Observable<{ status: string; message: string } | null> {
return this.http.post<{ status: string; message: string }>(
`${this.apiUrl}/apply`, null, this.authOptions
).pipe(
catchError(() => of(null))
);
}
}