Public File Sharing (#72)
* Public File Sharing This implements public file sharing (read-only) with and without passwords (#57). It also fixes a problem with filenames including special characters like `#` not working properly (#71). You can share a directory or a single file, by using the new share icon on the right of the directories/files, and click on it to manage an existing file share (setting a new password, or deleting the file share). There is some other minor cleanup and other copy updates in the README. Closes #57 Fixes #71 * Hide UI elements when sharing isn't allowed
This commit is contained in:
14
lib/types.ts
14
lib/types.ts
@@ -93,6 +93,7 @@ export interface Directory {
|
||||
directory_name: string;
|
||||
has_write_access: boolean;
|
||||
size_in_bytes: number;
|
||||
file_share_id: string | null;
|
||||
updated_at: Date;
|
||||
created_at: Date;
|
||||
}
|
||||
@@ -103,6 +104,7 @@ export interface DirectoryFile {
|
||||
file_name: string;
|
||||
has_write_access: boolean;
|
||||
size_in_bytes: number;
|
||||
file_share_id: string | null;
|
||||
updated_at: Date;
|
||||
created_at: Date;
|
||||
}
|
||||
@@ -175,6 +177,8 @@ export interface Config {
|
||||
files: {
|
||||
/** The root-relative root path for files, i.e. "data-files" */
|
||||
rootPath: string;
|
||||
/** If true, public file sharing will be allowed (still requires a user to enable sharing for a given file or directory) */
|
||||
allowPublicSharing: boolean;
|
||||
};
|
||||
core: {
|
||||
/** dashboard and files cannot be disabled */
|
||||
@@ -221,3 +225,13 @@ export interface MultiFactorAuthMethod {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface FileShare {
|
||||
id: string;
|
||||
user_id: string;
|
||||
file_path: string;
|
||||
extra: {
|
||||
hashed_password?: string;
|
||||
};
|
||||
created_at: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user