|
#ifndef CONFIG_H
|
|
#define CONFIG_H
|
|
|
|
#include "nwedav.h"
|
|
|
|
typedef struct {
|
|
char bind_address[64];
|
|
uint16_t port;
|
|
uint16_t ssl_port;
|
|
size_t max_connections;
|
|
int connection_timeout;
|
|
int keepalive_timeout;
|
|
size_t max_request_size;
|
|
int worker_threads;
|
|
|
|
struct {
|
|
int enabled;
|
|
char cert_file[PATH_MAX];
|
|
char key_file[PATH_MAX];
|
|
char ca_file[PATH_MAX];
|
|
int verify_client;
|
|
char min_protocol[16];
|
|
char ciphers[512];
|
|
} ssl;
|
|
|
|
struct {
|
|
char root_path[PATH_MAX];
|
|
char temp_path[PATH_MAX];
|
|
char database_path[PATH_MAX];
|
|
char properties_path[PATH_MAX];
|
|
char locks_path[PATH_MAX];
|
|
} storage;
|
|
|
|
struct {
|
|
auth_method_t method;
|
|
char realm[128];
|
|
int session_timeout;
|
|
int max_failed_attempts;
|
|
int lockout_duration;
|
|
} auth;
|
|
|
|
struct {
|
|
uint64_t default_quota;
|
|
int enforce;
|
|
int warning_threshold;
|
|
} quota;
|
|
|
|
struct {
|
|
log_level_t level;
|
|
char file[PATH_MAX];
|
|
char access_log[PATH_MAX];
|
|
size_t max_size;
|
|
int rotate_count;
|
|
} logging;
|
|
|
|
struct {
|
|
int enabled;
|
|
size_t min_threads;
|
|
size_t max_threads;
|
|
size_t scale_up_threshold;
|
|
size_t scale_down_threshold;
|
|
int scale_up_step;
|
|
int scale_down_step;
|
|
int idle_timeout_ms;
|
|
int check_interval_ms;
|
|
} scaling;
|
|
} config_t;
|
|
|
|
void config_set_defaults(config_t *config);
|
|
int config_load(const char *path, config_t *config);
|
|
int config_validate(config_t *config);
|
|
void config_dump(config_t *config);
|
|
|
|
#endif
|