diff --git a/.env.example b/.env.example index 715d611c..0f3d5f0a 100644 --- a/.env.example +++ b/.env.example @@ -12,8 +12,8 @@ AUTHENTICATION_SECRET=4c@mraGB!KRfF@kpS8739y9FcHemKxBsqqxLbdR? # You can input multiple api keys separated by a , KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3 -DEFAULT_PERMISSIONS=overall.read -UNLOGGED_PERMISSIONS=overall.read +DEFAULT_PERMISSIONS=overall.read,overall.play +UNLOGGED_PERMISSIONS=overall.read,overall.play THEMOVIEDB_APIKEY= PUBLIC_BACK_URL=http://localhost:5000 diff --git a/back/src/Kyoo.Authentication/Models/Options/PermissionOption.cs b/back/src/Kyoo.Authentication/Models/Options/PermissionOption.cs index 82d3054f..5c11131c 100644 --- a/back/src/Kyoo.Authentication/Models/Options/PermissionOption.cs +++ b/back/src/Kyoo.Authentication/Models/Options/PermissionOption.cs @@ -40,6 +40,7 @@ namespace Kyoo.Authentication.Models get { return Enum.GetNames() + .Where(x => x != nameof(Group.None)) .SelectMany(group => Enum.GetNames().Select(kind => $"{group}.{kind}".ToLowerInvariant()) ) @@ -50,12 +51,12 @@ namespace Kyoo.Authentication.Models /// /// The default permissions that will be given to a non-connected user. /// - public string[] Default { get; set; } = { "overall.read" }; + public string[] Default { get; set; } = { "overall.read", "overall.play" }; /// /// Permissions applied to a new user. /// - public string[] NewUser { get; set; } = { "overall.read" }; + public string[] NewUser { get; set; } = { "overall.read", "overall.play" }; /// /// The list of available ApiKeys. diff --git a/back/src/Kyoo.Postgresql/Migrations/20240217143306_AddIssues.cs b/back/src/Kyoo.Postgresql/Migrations/20240217143306_AddIssues.cs index f4763cf6..be94c043 100644 --- a/back/src/Kyoo.Postgresql/Migrations/20240217143306_AddIssues.cs +++ b/back/src/Kyoo.Postgresql/Migrations/20240217143306_AddIssues.cs @@ -44,6 +44,9 @@ namespace Kyoo.Postgresql.Migrations principalColumn: "id", onDelete: ReferentialAction.SetNull ); + + // language=PostgreSQL + migrationBuilder.Sql("update users set permissions = ARRAY_APPEND(permissions, 'overall.play');"); } /// diff --git a/transcoder/src/extract.go b/transcoder/src/extract.go index 390c8a9c..55478dfc 100644 --- a/transcoder/src/extract.go +++ b/transcoder/src/extract.go @@ -2,6 +2,7 @@ package src import ( "fmt" + "log" "os" "os/exec" ) @@ -16,6 +17,7 @@ func Extract(path string, sha string, route string) (<-chan struct{}, error) { } go func() { + defer printExecTime("Starting extraction of %s", path)() info, err := GetInfo(path, sha, route) if err != nil { extracted.Remove(sha) @@ -27,7 +29,6 @@ func Extract(path string, sha string, route string) (<-chan struct{}, error) { os.MkdirAll(attachment_path, 0o644) os.MkdirAll(subs_path, 0o755) - fmt.Printf("Extract subs and fonts for %s", path) cmd := exec.Command( "ffmpeg", "-dump_attachment:t", "", @@ -47,7 +48,7 @@ func Extract(path string, sha string, route string) (<-chan struct{}, error) { ) } } - fmt.Printf("Starting extraction with the command: %s", cmd) + log.Printf("Starting extraction with the command: %s", cmd) cmd.Stdout = nil err = cmd.Run() if err != nil {