2008-12-10 05:42:49 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef headerfiledata
|
|
|
|
#define headerfiledata
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
2008-12-12 04:11:29 +01:00
|
|
|
#include <string.h>
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
#include "misc.h"
|
|
|
|
#include "item.h"
|
|
|
|
#include "error.h"
|
2008-12-21 22:17:09 +01:00
|
|
|
#include "dirs.h"
|
|
|
|
#include "users.h"
|
|
|
|
#include "groups.h"
|
2008-12-30 02:05:03 +01:00
|
|
|
#include "functions.h"
|
2009-04-16 03:59:42 +02:00
|
|
|
#include "lastcontainer.h"
|
2009-04-20 00:13:21 +02:00
|
|
|
#include "mounts.h"
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Data
|
|
|
|
{
|
|
|
|
public:
|
2008-12-11 03:46:16 +01:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------
|
|
|
|
// members read from a config file
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
// name of the config file (full path can be)
|
|
|
|
std::string config_file;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
// log file name
|
|
|
|
std::string log_file;
|
|
|
|
|
|
|
|
// 1 - minimum
|
|
|
|
// 2 - (default)
|
|
|
|
// 3 - maximum - all logs
|
|
|
|
int log_level;
|
|
|
|
|
|
|
|
// logging to stdout too
|
|
|
|
bool log_stdout;
|
|
|
|
|
|
|
|
|
|
|
|
// fast cgi: socket (unix domain)
|
|
|
|
std::string fcgi_socket;
|
|
|
|
|
|
|
|
// fast cgi: socket permissions
|
|
|
|
int fcgi_socket_chmod;
|
|
|
|
|
|
|
|
// fast cgi: owner of the socket
|
|
|
|
std::string fcgi_socket_user;
|
|
|
|
|
|
|
|
// fast cgi: group of the socket
|
|
|
|
std::string fcgi_socket_group;
|
|
|
|
|
|
|
|
std::string templates;
|
|
|
|
std::string default_index;
|
|
|
|
|
|
|
|
std::string db_database;
|
|
|
|
std::string db_user;
|
|
|
|
std::string db_pass;
|
|
|
|
std::string base_url;
|
|
|
|
std::string http_session_id_name;
|
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
// when the HOST_HTTP environment variable doesn't point into 'base_url' (the part 'http://' and the last slash is removed)
|
|
|
|
// the server will redirect into 'base_url' + 'REQUEST_URI'
|
|
|
|
// it's useful when you want to redirect from 'mydomain.tld' into 'www.mydomain.tld' etc.
|
|
|
|
bool base_url_redirect;
|
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
// if there is one item in a directory
|
|
|
|
// it will be showed
|
|
|
|
// (instead of showing directory contents)
|
2008-12-30 02:05:03 +01:00
|
|
|
// !! wywalic to, nie bedzie uzywane
|
2008-12-11 03:46:16 +01:00
|
|
|
bool one_item_is_showed;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
// string used in a place where is a user (or group) selected
|
|
|
|
std::string priv_no_user;
|
|
|
|
std::string priv_no_group;
|
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
// time in second when the user will be automatically logged out (iddle time)
|
|
|
|
int session_max_iddle;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
// end config members
|
|
|
|
// -----------------------------------------------------------------
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
|
|
|
|
// false at the beginning
|
|
|
|
bool stdout_is_closed;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
// true if there was SIGHUP signal
|
2008-12-11 03:46:16 +01:00
|
|
|
volatile bool signal_hup;
|
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
// contains current directories tree
|
2008-12-21 22:17:09 +01:00
|
|
|
Dirs dirs;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
// based on base_url
|
|
|
|
// set by SetAdditionalVariables()
|
|
|
|
std::string base_url_http_host;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
// call this method after the config file is read
|
|
|
|
void SetAdditionalVariables();
|
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
// users
|
|
|
|
Users users;
|
|
|
|
|
|
|
|
// groups
|
|
|
|
Groups groups;
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
// functions (ls, cat, etc)
|
|
|
|
Functions functions;
|
2009-04-16 03:59:42 +02:00
|
|
|
|
2009-04-20 00:13:21 +02:00
|
|
|
// for 'last' function
|
2009-04-16 03:59:42 +02:00
|
|
|
LastContainer last;
|
2008-12-30 02:05:03 +01:00
|
|
|
|
2009-04-20 00:13:21 +02:00
|
|
|
// mount points
|
|
|
|
Mounts mounts;
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
Data();
|
2008-12-12 04:11:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SetHttpHost();
|
2008-12-10 05:42:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern Data data;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|