diff --git a/src/lang/en/manage.json b/src/lang/en/manage.json index bd5407a893..957552ac4c 100644 --- a/src/lang/en/manage.json +++ b/src/lang/en/manage.json @@ -22,7 +22,8 @@ "docs": "Documentation", "offline_download": "Offline Download", "ldap": "LDAP", - "s3": "S3" + "s3": "S3", + "ftp": "FTP" }, "title": "AList Manage", "not_admin": "You are not admin user, please login with admin account.", diff --git a/src/lang/en/settings.json b/src/lang/en/settings.json index 1e5cba0b1f..5ba1db30a2 100755 --- a/src/lang/en/settings.json +++ b/src/lang/en/settings.json @@ -104,5 +104,12 @@ "version": "Version", "video_autoplay": "Video autoplay", "video_types": "Video types", - "webauthn_login_enabled": "Webauthn login enabled" + "webauthn_login_enabled": "Webauthn login enabled", + "ftp_public_host": "Public IP/Host", + "ftp_pasv_port_map": "Passive transfer port mapping", + "ftp_proxy_user_agent": "HTTP proxy user agent", + "ftp_mandatory_tls": "Enable mandatory TLS", + "ftp_implicit_tls": "Enable implicit TLS (implies mandatory TLS)", + "ftp_tls_private_key_path": "Path to TLS private key file", + "ftp_tls_public_cert_path": "Path to TLS certificate file" } diff --git a/src/lang/en/users.json b/src/lang/en/users.json index dfa0481cf8..ce3a93b8d1 100644 --- a/src/lang/en/users.json +++ b/src/lang/en/users.json @@ -9,7 +9,9 @@ "copy": "Copy", "delete": "Delete", "webdav_read": "Webdav read", - "webdav_manage": "Webdav manage" + "webdav_manage": "Webdav manage", + "ftp_read": "FTP read", + "ftp_manage": "FTP manage" }, "username": "Username", "password": "Password", diff --git a/src/pages/manage/sidemenu_items.tsx b/src/pages/manage/sidemenu_items.tsx index 4d6aa573fe..5999292cb9 100644 --- a/src/pages/manage/sidemenu_items.tsx +++ b/src/pages/manage/sidemenu_items.tsx @@ -12,6 +12,7 @@ import { BsCloudUploadFill, BsSearch, BsBucket, + BsHddNetwork, } from "solid-icons/bs" import { FiLogIn } from "solid-icons/fi" import { SiMetabase } from "solid-icons/si" @@ -84,6 +85,12 @@ export const side_menu_items: SideMenuItem[] = [ to: "/@manage/settings/s3", component: lazy(() => import("./settings/S3")), }, + { + title: "manage.sidemenu.ftp", + icon: BsHddNetwork, + to: "/@manage/settings/ftp", + component: () => , + }, { title: "manage.sidemenu.other", icon: BsMedium, diff --git a/src/types/setting.ts b/src/types/setting.ts index f5acefa166..44860020f2 100644 --- a/src/types/setting.ts +++ b/src/types/setting.ts @@ -11,6 +11,7 @@ export enum Group { SSO, LDAP, S3, + FTP, } export enum Flag { PUBLIC, diff --git a/src/types/user.ts b/src/types/user.ts index 54529b198c..9d033650f5 100644 --- a/src/types/user.ts +++ b/src/types/user.ts @@ -27,14 +27,18 @@ export const UserPermissions = [ "delete", "webdav_read", "webdav_manage", + "ftp_read", + "ftp_manage", ] as const export const UserMethods = { is_guest: (user: User) => user.role === UserRole.GUEST, is_admin: (user: User) => user.role === UserRole.ADMIN, is_general: (user: User) => user.role === UserRole.GENERAL, - can: (user: User, permission: number) => - UserMethods.is_admin(user) || ((user.permission >> permission) & 1) == 1, + can: (user: User, permission: number) => { + let adminPrivilege = UserMethods.is_admin(user) && permission < 10 + return adminPrivilege || ((user.permission >> permission) & 1) == 1 + }, // can_see_hides: (user: User) => // UserMethods.is_admin(user) || (user.permission & 1) == 1, // can_access_without_password: (user: User) =>