config.h (1145B)
1 #ifndef CONFIG_H 2 #define CONFIG_H 3 4 #include <stddef.h> 5 #include <sys/types.h> 6 7 #define DEFAULT_REDIRECT_URI "./" 8 #define DEFAULT_STORAGE_ROOT "/storage" 9 #define DEFAULT_REPOSITORY "default" 10 #define DEFAULT_REPOSITORY_LOCK_DIR "/run/simplefiles/lock" 11 12 #define SIMPLEFILES_ROOT_DEFAULT "/simplefiles" 13 #define GLOBAL_CONFIG_FILENAME "/etc/simplefiles.conf" 14 15 #define UPLOAD_TEMPLATE_NAME "upload.html.template" 16 #define DELETE_TEMPLATE_NAME "delete.html.template" 17 #define LIST_TEMPLATE_NAME "list.html.template" 18 #define LIST_READONLY_TEMPLATE_NAME "list-readonly.html.template" 19 #define RENAME_TEMPLATE_NAME "rename.html.template" 20 21 #define DEFAULT_MAX_UPLOAD (100LL * 1024 * 1024) 22 #define DEFAULT_REPO_QUOTA (5LL * 1024 * 1024 * 1024) 23 #define DEFAULT_MIN_FREE (1LL * 1024 * 1024 * 1024) 24 25 #define DEBUG 0 26 27 #define CONFIG_FILENAME ".config" 28 #define CSRF_ORIGIN_MAX 256 29 30 const char *simplefiles_root(void); 31 off_t config_max_upload(void); 32 off_t config_repo_quota(void); 33 34 int global_config_string(const char *, char *, size_t); 35 int global_config_csrf_origin(char *, size_t); 36 37 int config_write_allowed(void); 38 int config_access_allowed(void); 39 40 #endif