mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-08-05 08:40:04 -04:00
Updating packets to their new version
This commit is contained in:
parent
c037270d33
commit
dacccb9e06
219
angular.json
219
angular.json
@ -1,111 +1,112 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
"kyoo": {
|
"kyoo": {
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"schematics": {
|
"schematics": {
|
||||||
"@schematics/angular:component": {
|
"@schematics/angular:component": {
|
||||||
"style": "scss"
|
"style": "scss"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "",
|
"root": "",
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist",
|
"outputPath": "dist",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"polyfills": "src/polyfills.ts",
|
"polyfills": "src/polyfills.ts",
|
||||||
"tsConfig": "tsconfig.json",
|
"tsConfig": "tsconfig.json",
|
||||||
"aot": false,
|
"aot": false,
|
||||||
"assets": [
|
"buildOptimizer": false,
|
||||||
"src/assets",
|
"assets": [
|
||||||
{
|
"src/assets",
|
||||||
"input": "node_modules/libass-wasm/dist/js",
|
{
|
||||||
"glob": "subtitles-octopus-worker*",
|
"input": "node_modules/libass-wasm/dist/js",
|
||||||
"output": "."
|
"glob": "subtitles-octopus-worker*",
|
||||||
}
|
"output": "."
|
||||||
],
|
}
|
||||||
"styles": [
|
],
|
||||||
"src/styles.scss"
|
"styles": [
|
||||||
],
|
"src/styles.scss"
|
||||||
"scripts": [
|
],
|
||||||
"./node_modules/jquery/dist/jquery.min.js",
|
"scripts": [
|
||||||
"./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js",
|
"./node_modules/jquery/dist/jquery.min.js",
|
||||||
"./node_modules/hls.js/dist/hls.js"
|
"./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js",
|
||||||
],
|
"./node_modules/hls.js/dist/hls.js"
|
||||||
"stylePreprocessorOptions": {
|
],
|
||||||
"includePaths": ["src"]
|
"stylePreprocessorOptions": {
|
||||||
}
|
"includePaths": ["src"]
|
||||||
},
|
}
|
||||||
"configurations": {
|
},
|
||||||
"production": {
|
"configurations": {
|
||||||
"fileReplacements": [
|
"production": {
|
||||||
{
|
"fileReplacements": [
|
||||||
"replace": "src/environments/environment.ts",
|
{
|
||||||
"with": "src/environments/environment.prod.ts"
|
"replace": "src/environments/environment.ts",
|
||||||
}
|
"with": "src/environments/environment.prod.ts"
|
||||||
],
|
}
|
||||||
"optimization": true,
|
],
|
||||||
"outputHashing": "all",
|
"optimization": true,
|
||||||
"sourceMap": false,
|
"outputHashing": "all",
|
||||||
"namedChunks": false,
|
"sourceMap": false,
|
||||||
"aot": true,
|
"namedChunks": false,
|
||||||
"extractLicenses": true,
|
"aot": true,
|
||||||
"vendorChunk": false,
|
"extractLicenses": true,
|
||||||
"buildOptimizer": true,
|
"vendorChunk": false,
|
||||||
"budgets": [
|
"buildOptimizer": true,
|
||||||
{
|
"budgets": [
|
||||||
"type": "initial",
|
{
|
||||||
"maximumWarning": "3mb",
|
"type": "initial",
|
||||||
"maximumError": "5mb"
|
"maximumWarning": "3mb",
|
||||||
},
|
"maximumError": "5mb"
|
||||||
{
|
},
|
||||||
"type": "anyComponentStyle",
|
{
|
||||||
"maximumWarning": "6kb",
|
"type": "anyComponentStyle",
|
||||||
"maximumError": "10kb"
|
"maximumWarning": "6kb",
|
||||||
}
|
"maximumError": "10kb"
|
||||||
]
|
}
|
||||||
}
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"serve": {
|
},
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"serve": {
|
||||||
"options": {
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"browserTarget": "kyoo:build"
|
"options": {
|
||||||
},
|
"browserTarget": "kyoo:build"
|
||||||
"configurations": {
|
},
|
||||||
"production": {
|
"configurations": {
|
||||||
"browserTarget": "kyoo:build:production"
|
"production": {
|
||||||
}
|
"browserTarget": "kyoo:build:production"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extract-i18n": {
|
},
|
||||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
"extract-i18n": {
|
||||||
"options": {
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"browserTarget": "kyoo:build"
|
"options": {
|
||||||
}
|
"browserTarget": "kyoo:build"
|
||||||
},
|
}
|
||||||
"lint": {
|
},
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"lint": {
|
||||||
"options": {
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
"tsConfig": "tsconfig.json",
|
"options": {
|
||||||
"exclude": [
|
"tsConfig": "tsconfig.json",
|
||||||
"**/node_modules/**",
|
"exclude": [
|
||||||
"dist"
|
"**/node_modules/**",
|
||||||
]
|
"dist"
|
||||||
}
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"defaultProject": "kyoo",
|
},
|
||||||
"cli": {
|
"defaultProject": "kyoo",
|
||||||
"analytics": false
|
"cli": {
|
||||||
}
|
"analytics": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
56767
package-lock.json
generated
56767
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
106
package.json
106
package.json
@ -1,55 +1,55 @@
|
|||||||
{
|
{
|
||||||
"name": "kyoo",
|
"name": "kyoo",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"lint": "ng lint"
|
"lint": "ng lint"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"> 0.5%",
|
"> 0.5%",
|
||||||
"last 2 versions",
|
"last 2 versions",
|
||||||
"Firefox ESR",
|
"Firefox ESR",
|
||||||
"not dead",
|
"not dead",
|
||||||
"not IE 9-11"
|
"not IE 9-11"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^11.2.6",
|
"@angular/animations": "^12.1.4",
|
||||||
"@angular/cdk": "^11.2.5",
|
"@angular/cdk": "^12.1.4",
|
||||||
"@angular/common": "^11.2.6",
|
"@angular/common": "^12.1.4",
|
||||||
"@angular/compiler": "^11.2.6",
|
"@angular/compiler": "^12.1.4",
|
||||||
"@angular/core": "^11.2.6",
|
"@angular/core": "^12.1.4",
|
||||||
"@angular/forms": "^11.2.6",
|
"@angular/forms": "^12.1.4",
|
||||||
"@angular/material": "^11.2.5",
|
"@angular/material": "^12.1.4",
|
||||||
"@angular/platform-browser": "^11.2.6",
|
"@angular/platform-browser": "^12.1.4",
|
||||||
"@angular/platform-browser-dynamic": "^11.2.6",
|
"@angular/platform-browser-dynamic": "^12.1.4",
|
||||||
"@angular/router": "^11.2.6",
|
"@angular/router": "^12.1.4",
|
||||||
"angular-auth-oidc-client": "11.6.4",
|
"angular-auth-oidc-client": "^12.0.2",
|
||||||
"bootstrap": "^4.6.0",
|
"bootstrap": "^5.0.2",
|
||||||
"detect-browser": "^5.2.0",
|
"detect-browser": "^5.2.0",
|
||||||
"hls.js": "^1.0.1",
|
"hls.js": "^1.0.7",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"libass-wasm": "AnonymusRaccoon/JavascriptSubtitlesOctopus",
|
"libass-wasm": "AnonymusRaccoon/JavascriptSubtitlesOctopus",
|
||||||
"ngx-infinite-scroll": "^10.0.1",
|
"ngx-infinite-scroll": "^10.0.1",
|
||||||
"popper.js": "^1.16.1",
|
"popper.js": "^1.16.1",
|
||||||
"rxjs": "^6.6.7",
|
"rxjs": "^6.6.7",
|
||||||
"zone.js": "^0.11.4"
|
"zone.js": "^0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^0.1102.5",
|
"@angular-devkit/build-angular": "^12.1.4",
|
||||||
"@angular/cli": "^11.2.5",
|
"@angular/cli": "^12.1.4",
|
||||||
"@angular/compiler-cli": "^11.2.6",
|
"@angular/compiler-cli": "^12.1.4",
|
||||||
"@angular/language-service": "^11.2.6",
|
"@angular/language-service": "^12.1.4",
|
||||||
"@types/bootstrap": "^5.0.9",
|
"@types/bootstrap": "^5.0.17",
|
||||||
"@types/hls.js": "^0.13.3",
|
"@types/hls.js": "^0.13.3",
|
||||||
"@types/jquery": "^3.5.5",
|
"@types/jquery": "^3.5.6",
|
||||||
"@types/node": "^14.14.41",
|
"@types/node": "^16.4.10",
|
||||||
"@types/video.js": "^7.3.15",
|
"@types/video.js": "^7.3.26",
|
||||||
"codelyzer": "^6.0.1",
|
"codelyzer": "^6.0.2",
|
||||||
"ts-node": "~9.1.1",
|
"ts-node": "~10.1.0",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"typescript": "<4.2"
|
"typescript": "4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule } from "@angular/common";
|
||||||
import { HTTP_INTERCEPTORS, HttpClient } from "@angular/common/http";
|
import { HTTP_INTERCEPTORS, HttpClient } from "@angular/common/http";
|
||||||
import { APP_INITIALIZER, NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
import { FormsModule } from "@angular/forms";
|
import { FormsModule } from "@angular/forms";
|
||||||
import { MatButtonModule } from "@angular/material/button";
|
import { MatButtonModule } from "@angular/material/button";
|
||||||
import { MatCardModule } from "@angular/material/card";
|
import { MatCardModule } from "@angular/material/card";
|
||||||
@ -16,7 +16,7 @@ import { MatSliderModule } from "@angular/material/slider";
|
|||||||
import { MatTabsModule } from "@angular/material/tabs";
|
import { MatTabsModule } from "@angular/material/tabs";
|
||||||
import { MatTooltipModule } from "@angular/material/tooltip";
|
import { MatTooltipModule } from "@angular/material/tooltip";
|
||||||
import { RouterModule } from "@angular/router";
|
import { RouterModule } from "@angular/router";
|
||||||
import { AuthModule as OidcModule, LogLevel, OidcConfigService } from "angular-auth-oidc-client";
|
import { AuthModule as OidcModule, LogLevel } from "angular-auth-oidc-client";
|
||||||
import { tap } from "rxjs/operators";
|
import { tap } from "rxjs/operators";
|
||||||
import { AccountComponent } from "./account/account.component";
|
import { AccountComponent } from "./account/account.component";
|
||||||
import { LogoutComponent } from "./logout/logout.component";
|
import { LogoutComponent } from "./logout/logout.component";
|
||||||
@ -25,27 +25,6 @@ import { AuthGuard } from "./misc/authenticated-guard.service";
|
|||||||
import { AuthorizerInterceptor } from "./misc/authorizer-interceptor.service";
|
import { AuthorizerInterceptor } from "./misc/authorizer-interceptor.service";
|
||||||
import { UnauthorizedComponent } from "./unauthorized/unauthorized.component";
|
import { UnauthorizedComponent } from "./unauthorized/unauthorized.component";
|
||||||
|
|
||||||
export function loadConfig(oidcConfigService: OidcConfigService): () => Promise<any>
|
|
||||||
{
|
|
||||||
return () => oidcConfigService.withConfig({
|
|
||||||
stsServer: window.location.origin,
|
|
||||||
redirectUrl: "/",
|
|
||||||
postLogoutRedirectUri: "/logout",
|
|
||||||
clientId: "kyoo.webapp",
|
|
||||||
responseType: "code",
|
|
||||||
triggerAuthorizationResultEvent: false,
|
|
||||||
scope: "openid profile offline_access kyoo.read kyoo.write kyoo.play kyoo.admin",
|
|
||||||
silentRenew: true,
|
|
||||||
silentRenewUrl: "/silent.html",
|
|
||||||
useRefreshToken: true,
|
|
||||||
startCheckSession: true,
|
|
||||||
|
|
||||||
forbiddenRoute: "/forbidden",
|
|
||||||
unauthorizedRoute: "/unauthorized",
|
|
||||||
logLevel: LogLevel.Warn
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AuthPipe,
|
AuthPipe,
|
||||||
@ -69,20 +48,31 @@ export function loadConfig(oidcConfigService: OidcConfigService): () => Promise<
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
OidcModule.forRoot(),
|
OidcModule.forRoot({
|
||||||
|
config: {
|
||||||
|
authority: window.location.origin,
|
||||||
|
redirectUrl: "/",
|
||||||
|
postLogoutRedirectUri: "/logout",
|
||||||
|
clientId: "kyoo.webapp",
|
||||||
|
responseType: "code",
|
||||||
|
triggerAuthorizationResultEvent: false,
|
||||||
|
scope: "openid profile offline_access kyoo.read kyoo.write kyoo.play kyoo.admin",
|
||||||
|
silentRenew: true,
|
||||||
|
silentRenewUrl: "/silent.html",
|
||||||
|
useRefreshToken: true,
|
||||||
|
startCheckSession: true,
|
||||||
|
|
||||||
|
forbiddenRoute: "/forbidden",
|
||||||
|
unauthorizedRoute: "/unauthorized",
|
||||||
|
logLevel: LogLevel.Warn
|
||||||
|
}
|
||||||
|
}),
|
||||||
RouterModule
|
RouterModule
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
AccountComponent
|
AccountComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
OidcConfigService,
|
|
||||||
{
|
|
||||||
provide: APP_INITIALIZER,
|
|
||||||
useFactory: loadConfig,
|
|
||||||
deps: [OidcConfigService],
|
|
||||||
multi: true
|
|
||||||
},
|
|
||||||
AuthGuard.guards,
|
AuthGuard.guards,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
import { OidcSecurityService } from "angular-auth-oidc-client";
|
import { LoginResponse, OidcSecurityService } from "angular-auth-oidc-client";
|
||||||
import { Account } from "../models/account";
|
import { Account } from "../models/account";
|
||||||
import {HttpClient} from "@angular/common/http";
|
import { HttpClient } from "@angular/common/http";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: "root"
|
providedIn: "root"
|
||||||
@ -14,20 +14,20 @@ export class AuthService
|
|||||||
constructor(private oidcSecurityService: OidcSecurityService, private http: HttpClient)
|
constructor(private oidcSecurityService: OidcSecurityService, private http: HttpClient)
|
||||||
{
|
{
|
||||||
this.oidcSecurityService.checkAuth()
|
this.oidcSecurityService.checkAuth()
|
||||||
.subscribe((auth: boolean) => this.isAuthenticated = auth);
|
.subscribe((auth: LoginResponse) => this.isAuthenticated = auth.isAuthenticated);
|
||||||
this.oidcSecurityService.userData$.subscribe(x =>
|
this.oidcSecurityService.userData$.subscribe(x =>
|
||||||
{
|
{
|
||||||
if (x == null)
|
if (x?.userData == null)
|
||||||
{
|
{
|
||||||
this.account = null;
|
this.account = null;
|
||||||
this.isAuthenticated = false;
|
this.isAuthenticated = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.account = {
|
this.account = {
|
||||||
email: x.email,
|
email: x.userData.email,
|
||||||
username: x.username,
|
username: x.userData.username,
|
||||||
picture: x.picture,
|
picture: x.userData.picture,
|
||||||
permissions: x.permissions?.split(",") ?? []
|
permissions: x.userData.permissions?.split(",") ?? []
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ export class AuthPipe implements PipeTransform
|
|||||||
{
|
{
|
||||||
if (this.oidcSecurity === undefined)
|
if (this.oidcSecurity === undefined)
|
||||||
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
||||||
const token: string = this.oidcSecurity.getToken();
|
const token: string = this.oidcSecurity.getAccessToken();
|
||||||
if (!token)
|
if (!token)
|
||||||
return uri;
|
return uri;
|
||||||
const headers: HttpHeaders = new HttpHeaders({Authorization: "Bearer " + token});
|
const headers: HttpHeaders = new HttpHeaders({Authorization: "Bearer " + token});
|
||||||
|
@ -22,7 +22,7 @@ export class AuthorizerInterceptor implements HttpInterceptor
|
|||||||
return next.handle(request);
|
return next.handle(request);
|
||||||
if (this.oidcSecurity === undefined)
|
if (this.oidcSecurity === undefined)
|
||||||
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
||||||
const token: string = this.oidcSecurity.getToken();
|
const token: string = this.oidcSecurity.getAccessToken();
|
||||||
if (token)
|
if (token)
|
||||||
request = request.clone({setHeaders: {Authorization: "Bearer " + token}});
|
request = request.clone({setHeaders: {Authorization: "Bearer " + token}});
|
||||||
return next.handle(request);
|
return next.handle(request);
|
||||||
|
@ -244,7 +244,7 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
this.oidcSecurity = this.injector.get(OidcSecurityService);
|
||||||
this.hlsPlayer.config.xhrSetup = xhr =>
|
this.hlsPlayer.config.xhrSetup = xhr =>
|
||||||
{
|
{
|
||||||
const token: string = this.oidcSecurity.getToken();
|
const token: string = this.oidcSecurity.getAccessToken();
|
||||||
if (token)
|
if (token)
|
||||||
xhr.setRequestHeader("Authorization", "Bearer " + token);
|
xhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||||
};
|
};
|
||||||
|
@ -12,8 +12,8 @@ $theme-colors: (
|
|||||||
"textPrimary": #ffffff
|
"textPrimary": #ffffff
|
||||||
);
|
);
|
||||||
|
|
||||||
$body-bg: theme-color("primary");
|
$body-bg: map-get($theme-colors, "primary");
|
||||||
$body-color: theme-color("textPrimary");
|
$body-color: map-get($theme-colors, "textPrimary");
|
||||||
$font-family-base: "Roboto", Arial, sans-serif;
|
$font-family-base: "Roboto", Arial, sans-serif;
|
||||||
|
|
||||||
p
|
p
|
||||||
@ -95,8 +95,8 @@ mat-icon
|
|||||||
|
|
||||||
.snackError
|
.snackError
|
||||||
{
|
{
|
||||||
background-color: theme-color("accentColor");
|
background-color: map-get($theme-colors, "accentColor");
|
||||||
color: theme-color("textPrimary");
|
color: map-get($theme-colors, "textPrimary");
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroll-row
|
.scroll-row
|
||||||
|
Loading…
x
Reference in New Issue
Block a user