mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Update default permissions
This commit is contained in:
parent
ee3d8916ed
commit
2968ca3562
@ -12,8 +12,8 @@ AUTHENTICATION_SECRET=4c@mraGB!KRfF@kpS8739y9FcHemKxBsqqxLbdR?
|
|||||||
# You can input multiple api keys separated by a ,
|
# You can input multiple api keys separated by a ,
|
||||||
KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3
|
KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3
|
||||||
|
|
||||||
DEFAULT_PERMISSIONS=overall.read
|
DEFAULT_PERMISSIONS=overall.read,overall.play
|
||||||
UNLOGGED_PERMISSIONS=overall.read
|
UNLOGGED_PERMISSIONS=overall.read,overall.play
|
||||||
|
|
||||||
THEMOVIEDB_APIKEY=
|
THEMOVIEDB_APIKEY=
|
||||||
PUBLIC_BACK_URL=http://localhost:5000
|
PUBLIC_BACK_URL=http://localhost:5000
|
||||||
|
@ -40,6 +40,7 @@ namespace Kyoo.Authentication.Models
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Enum.GetNames<Group>()
|
return Enum.GetNames<Group>()
|
||||||
|
.Where(x => x != nameof(Group.None))
|
||||||
.SelectMany(group =>
|
.SelectMany(group =>
|
||||||
Enum.GetNames<Kind>().Select(kind => $"{group}.{kind}".ToLowerInvariant())
|
Enum.GetNames<Kind>().Select(kind => $"{group}.{kind}".ToLowerInvariant())
|
||||||
)
|
)
|
||||||
@ -50,12 +51,12 @@ namespace Kyoo.Authentication.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default permissions that will be given to a non-connected user.
|
/// The default permissions that will be given to a non-connected user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] Default { get; set; } = { "overall.read" };
|
public string[] Default { get; set; } = { "overall.read", "overall.play" };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Permissions applied to a new user.
|
/// Permissions applied to a new user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] NewUser { get; set; } = { "overall.read" };
|
public string[] NewUser { get; set; } = { "overall.read", "overall.play" };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of available ApiKeys.
|
/// The list of available ApiKeys.
|
||||||
|
@ -44,6 +44,9 @@ namespace Kyoo.Postgresql.Migrations
|
|||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.SetNull
|
onDelete: ReferentialAction.SetNull
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// language=PostgreSQL
|
||||||
|
migrationBuilder.Sql("update users set permissions = ARRAY_APPEND(permissions, 'overall.play');");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -2,6 +2,7 @@ package src
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
@ -16,6 +17,7 @@ func Extract(path string, sha string, route string) (<-chan struct{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer printExecTime("Starting extraction of %s", path)()
|
||||||
info, err := GetInfo(path, sha, route)
|
info, err := GetInfo(path, sha, route)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
extracted.Remove(sha)
|
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(attachment_path, 0o644)
|
||||||
os.MkdirAll(subs_path, 0o755)
|
os.MkdirAll(subs_path, 0o755)
|
||||||
|
|
||||||
fmt.Printf("Extract subs and fonts for %s", path)
|
|
||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
"-dump_attachment:t", "",
|
"-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
|
cmd.Stdout = nil
|
||||||
err = cmd.Run()
|
err = cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user