From 2e1b1313962d979b6e15491c63d316d829638bf0 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 9 Mar 2023 01:29:48 +0100 Subject: Implement public file sharing An HTML form is now added next to each regular file, that generates a POST request. Then, slcl replies with a HTML document with a link to the public resource (which are implemented as symlinks). Limitations: - For now, only regular files can be shared i.e., sharing directories is not possible. While feasible, it still requires a larger refactor to list_dir and resource_layout, so that read-only access to the directory is provided to anonymous users. --- page.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'page.h') diff --git a/page.h b/page.h index 7ddce40..9df1eea 100644 --- a/page.h +++ b/page.h @@ -15,5 +15,7 @@ int page_forbidden(struct http_response *r); int page_bad_request(struct http_response *r); int page_resource(struct http_response *r, const char *dir, const char *root, const char *res, const struct page_quota *q); +int page_public(struct http_response *r, const char *res); +int page_share(struct http_response *r, const char *path); #endif /* PAGE_H */ -- cgit v1.2.3