forked from UtrechtUniversity/davrods
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.h
102 lines (78 loc) · 3.07 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* \file
* \brief Davrods configuration.
* \author Chris Smeele, Simon Tyrrell
* \copyright Copyright (c) 2016, Utrecht University
*
* This file is part of Davrods.
*
* Davrods is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Davrods is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Davrods. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DAVRODS_CONFIG_H_
#define _DAVRODS_CONFIG_H_
#include "mod_davrods.h"
/* forawrd declaration */
struct HtmlTheme;
typedef enum {
// Need to have something other than a bool to recognize an 'unset' state.
DAVRODS_TMPFILE_ROLLBACK_YES = 1,
DAVRODS_TMPFILE_ROLLBACK_NO,
} TmpFileBehaviour;
typedef enum {
DAVRODS_AUTH_NATIVE = 1,
DAVRODS_AUTH_PAM,
} RodsAuthScheme;
typedef enum {
// rods_exposed_root conf value => actual path used
// ------------------------------------------------------------------------------
DAVRODS_ROOT_CUSTOM_DIR = 1, // <path> => <path>
DAVRODS_ROOT_ZONE_DIR, // Zone => /<zone>
DAVRODS_ROOT_HOME_DIR, // Home => /<zone>/home (not the user's home collection!)
DAVRODS_ROOT_USER_DIR, // User => /<zone>/home/<user>
} RodsExposedRootType;
/**
* \brief Davrods per-directory config structure.
*/
typedef struct davrods_dir_conf {
const char *rods_host;
uint16_t rods_port;
const char *rods_zone;
const char *rods_default_resource;
const char *rods_env_file;
const char *rods_exposed_root; // Note: This is not necessarily a path, see below.
size_t rods_tx_buffer_size;
size_t rods_rx_buffer_size;
TmpFileBehaviour tmpfile_rollback;
const char *locallock_lockdb_path;
RodsAuthScheme rods_auth_scheme;
int rods_auth_ttl; // In hours.
RodsExposedRootType rods_exposed_root_type;
int themed_listings;
struct HtmlTheme *theme_p;
const char *davrods_api_path_s;
const char *davrods_public_username_s;
const char *davrods_public_password_s;
apr_table_t *exposed_roots_per_user_p;
const char *eirods_dav_views_path_s;
} davrods_dir_conf_t;
extern const command_rec davrods_directives[];
void *davrods_create_dir_config(apr_pool_t *p, char *dir);
void *davrods_merge_dir_config( apr_pool_t *p, void *base, void *overrides);
#define DAVRODS_PROP_MERGE(_prop) \
conf_p->_prop = child_p->_prop \
? child_p->_prop \
: parent_p->_prop \
? parent_p->_prop \
: conf_p->_prop
#endif /* _DAVRODS_CONFIG_H_ */