Commit Graph

437 Commits

Author SHA1 Message Date
Tomasz Sowa ba7d55b7c1 added: config parameters:
bool log_check_proxy_ip_header;
       // check whether there is a 'log_proxy_ip_header' header
       // and if so then log the IP address from it
       // default: false

       std::wstring log_proxy_ip_header;
       // proxy header representing the real IP address of a client
       // default: X-Real-IP





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1104 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-05-01 10:43:20 +00:00
Tomasz Sowa 6252a0e732 added: Request::post_in (PT::Space) for input when application/json content type is used
from the client




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1102 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-26 18:56:31 +00:00
Tomasz Sowa ca14b1a427 added: Request::header_in (Space) http input headers (without cookies)
added: config parameter: log_env_http_variables (bool) (for logging http headers)
added: support for DELETE http method, added method FunctionBase::MakeDelete()
changed: winix version incremented to 0.6.6




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1100 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-25 19:48:47 +00:00
Tomasz Sowa b01db89942 added config parameter: db_postgresql_smaller_than_10
default false
if true then we are not using ROW() statements in sql queries




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1099 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-25 09:37:56 +00:00
Tomasz Sowa fd421c54e3 changed: Makefile (added Logger from pikotools)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1096 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-23 14:29:58 +00:00
Tomasz Sowa 55992b5066 added: std::wstring * Request::ParamValuep(const wchar_t * param_name)
for taking a pointer (can be null) to a parameter value
added: bool System::IsSSLRequired(bool try_to_use_ssl)
       returns true if we should use ssl
       try_to_use_ssl is to be meant: config->use_ssl, config->use_ssl_static, config->use_ssl_common
       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1094 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-22 21:26:56 +00:00
Tomasz Sowa a5dfc9974f added: a virtual dctor() for BaseThread class
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1080 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-16 22:44:59 +00:00
Tomasz Sowa 7b4a17c934 changed: makefile dep
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1076 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-23 19:27:32 +00:00
Tomasz Sowa c2a1097dd5 added: dependency on the morm project
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1074 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-13 22:34:59 +00:00
Tomasz Sowa ccf78dcb02 updated to the new Pikotools API
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1071 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-01-06 18:12:53 +00:00
Tomasz Sowa 3eff400d88 added: "assume_connection_is_through_ssl" config parameter
winix is testing an environment variable "HTTPS" for the value "on"
       to think that the connection is made via SSL
       you can set assume_connection_is_through_ssl to true for the winix
       to not testing any environment variables but just think the connection
       was made by https (useful when using proxy)
       default: false




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1069 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-01-01 00:14:02 +00:00
Tomasz Sowa 5ab816b5be fixed: in progresql 10 we have to use ROW() expression to construct
a row where only one item is given



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1068 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-01-01 00:12:33 +00:00
Tomasz Sowa e57840faed fixed: static files loaded to /var such as /var/ckeditor_winix.js were not properly returned
(html filter was used but they are mostly javascript files)
added: new Item::ContentType: ct_other
       if an item has ct_other then the html filter is not used for the content





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1040 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-07-13 13:13:56 +00:00
Tomasz Sowa 240bf4dc5d changed: the way how raw template is set
option for setting raw template from 'emacs' function has been removed
         now we have index_raw.html template and it can be set from 'template' function
removed: template index_fullscreen.html
changed: some work in miscspace (changed: space_list_tab, space_list_tab_value and space_list_tab_has_next)
fixed:   main index template could not be set through 'template' function





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1039 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-04-04 16:02:36 +00:00
Tomasz Sowa abd1500f07 changed: some refactoring in miscspace
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1036 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-23 15:20:42 +00:00
Tomasz Sowa 42144bb31c some refactoring in miscspace(.h|.cpp)
space() renamed to space_value() and takes a third parameter: escape (bool)
space_noescape() removed

space_tab() renamed to space_list_tab()
space_tab_value() renamed to space_list_tab_value()
space_tab_has_next() renamed to space_list_tab_has_next()





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1035 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-22 14:53:43 +00:00
Tomasz Sowa 7ed41a03ae fixed: some paths in Makefile.dep were not relative
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1031 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-18 08:56:19 +00:00
Tomasz Sowa 1286ceeddf changed: winix project has been moved to 'winixd' subdirectory
in Makefiles we are caltulating relative paths now (by using relative_path program)
	 



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1030 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-17 13:46:20 +00:00
Tomasz Sowa 145efe937c moved winix directories to winixdsubdirectory
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1028 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-17 08:26:02 +00:00
Tomasz Sowa ed5adb3f23 moved winix directories to winixd subdirectory
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1027 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-17 08:24:59 +00:00
Tomasz Sowa 7d0508961e added: log info about what html template is used
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1026 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-03-16 14:11:47 +00:00
Tomasz Sowa e53e2e6af9 added: some work in RegisterMail plugin
(added looking for files in a config directory)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1024 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-02-03 18:10:40 +00:00
Tomasz Sowa 4fafd2a478 changed: Makefile
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1023 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-02-01 11:12:54 +00:00
Tomasz Sowa f15da4d049 fixed: in FunctionParser we do not treat '+' as a space
added: some work in MailRegister plugin
       (adding mails to db, showing mails)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1021 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-02-01 10:15:23 +00:00
Tomasz Sowa 057607f9e5 start working on a new plugin: mailregister
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1020 e52654a7-88a9-db11-a3e9-0013d4bc506e
2016-01-31 19:52:17 +00:00
Tomasz Sowa c433b3fd41 updated to the new Ezc API
[ezc stream] has gone, now we have [ezc out] and [out]
the output streams have names now: it's a std::map, before we have a std::vector
and the streams are serialized to "out" space in json
Request::out_streams[] are split into Request::out_main_stream and Request::out_streams class



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1017 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-11-15 22:23:36 +00:00
Tomasz Sowa 632b49ab90 fixed: meta and admin meta information were not saved in memory (in system.dirs)
when 'meta' winix function was used
added: to DbItemsQuery
       sort_index_asc and sort_index_date
       different sort type can be made by 'index' and by 'date'
		     



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1013 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-06-16 02:37:07 +00:00
Tomasz Sowa f54df8d600 updated: to the new EZC api (ezc functions can be methods of some special objects)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1012 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-06-14 18:24:08 +00:00
Tomasz Sowa d8451ceaa0 fixed: checking for ssl redirect
we should take into account cur.request->function->need_ssl too



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1010 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-05-29 09:46:29 +00:00
Tomasz Sowa 62f178c2ee fixed: in App::CheckIfNeedSSLredirect()
winix made an incorrect redirect from/to SSL



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1009 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-05-29 09:24:43 +00:00
Tomasz Sowa eb4e7343e7 changed: now 'emacs' winix function uses CodeMirror editor
currently only htmlmixed mode is implemented


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1008 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-04-18 18:50:39 +00:00
Tomasz Sowa 5274e8e8ff added: "server_mode" config option (std::wstring)
you can assign any string to it such as "production" "dev"
       this value is not used by winix itself
       you can refer to it from [server_mode] and [server_mode_is] ezc functions





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1007 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-04-16 14:43:52 +00:00
Tomasz Sowa ae2a885d6c fixed: rm winix function returned incorrectly formated json when using jquery upload (delete file button)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1006 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-03-20 11:00:22 +00:00
Tomasz Sowa 901663b145 updated: to the new ezc api
added:   following ezc functions: ezc_and_not, ezc_any_not, ezc_or_not, ezc_one_not, is, is_not, is_empty, is_not_empty





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1005 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-03-08 23:22:05 +00:00
Tomasz Sowa dc301d4c50 changed: editors (emacs, ckeditor...) doesn't set an item's title now (if it was empty)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1003 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-03-02 21:23:29 +00:00
Tomasz Sowa 34f0535a26 added: some ezc functions for displaying current date
current_sec, current_min, current_hour, current_year, ...



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1002 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-02-22 10:23:52 +00:00
Tomasz Sowa af0e2a778d changed: some refactoring in System: in IsMemberOfGroup method
changed: some log messages at startup (about non existing empty group for uploads directory)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1001 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-01-02 08:18:06 +00:00
Tomasz Sowa 904f1e70f2 fixed: compiling on Debian (it has no MSG_EOF flag)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1000 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-01-02 07:15:22 +00:00
Tomasz Sowa ddf7ef30ad fixed: compiling od Debian
sockaddr_un has no sun_len member



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@999 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-01-02 07:14:15 +00:00
Tomasz Sowa 0a43870e76 fixed: the way how winix is closing
beforehand we made a http connection from the special thread
       now we just send a fastcgi packet to the unix socket

       the old way was broken because it requires the http server to work
       and if the operating system is going to shutdown/reboot then the http server
       can be first closed and consequently the winix cannot wake up from
       the main thread (and will be terminated SIGKILL by the os)
       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@998 e52654a7-88a9-db11-a3e9-0013d4bc506e
2015-01-02 07:01:08 +00:00
Tomasz Sowa f875bd2944 changed: when a client doesn't send a session cookie we can instead of ban just use a temporary session
added: config option:
	// the way we behave when no_session_cookie_treshold limit is exceeded
 	// 0 - if a client doesn't send a session cookie again then use a temporary session
 	//     (other sessions from this IP address are not affected)
 	// 1 - add this IP address to ban list and create a temporary session
 	//     (this will block other sessions from this IP address too)
 	// default: 0
 	int no_session_cookie_ban_mode;




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@996 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-25 12:02:22 +00:00
Tomasz Sowa c9bf20201b added: possibility to ban if a session cookie is incorrect (when we are using encoded cookies)
added:   possibility to ban if a client tries to hijack the session cookie
added:   possibility to ban if a client did not send a session cookie
renamed: ezc functions:
         login_cannot_login -> ipban_is_login_allowed_from_this_ip  (and the return value was changed)
         login_when_available_login -> ipban_current_ip_expires_time
added: config options:
       // after how many broken encoded cookie we should ban the current IP
       // default: 2 (value in the range <0 - 65535>)
       size_t broken_encoded_cookie_treshold;

       // after how many incorrect session identifiers (or session indices) we should ban the current IP
       // do not set this value too low, as people connecting from the same IP address (from behind a NAT)
       // would be banned if they have an old session cookie remembered in the browser
       // default: 128 (value in the range <0 - 65535>)
       size_t session_hijacking_treshold;

       // after how many times a client will be banned if it did not send a session cookie
       // default: 1000 (value in the range <0 - 65535>)
       size_t no_session_cookie_treshold;








git-svn-id: svn://ttmath.org/publicrep/winix/trunk@995 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-24 20:22:30 +00:00
Tomasz Sowa 76314aab10 added: possibility to encode the session cookie (added files core/sessionidmanager.h and core/sessionidmanager.cpp)
added: config options:
       // whether or not we should encode the session cookie
       // (we have a special algorithm)
       // default: false
       bool session_cookie_encode;

       // if session_cookie_encode is true then you should provide
       // a file where AES keys will be stored
       std::wstring session_keys_file;

       // each session has an index -- an unsigned int value
       // this value is sent in the cookie string (is encoded)
       // and is incremented when session_index_time_increment time is passed since the last incrementing
       // if a client sent the cookie back the difference between
       // current index and the index in the cookie should be less than or equal to session_allow_index_difference
       // default: 8
       size_t session_allow_index_difference;

       // the time which should pass after the session index is incremented
       // default: 30
       // (session_allow_index_difference + 1) * session_index_time_increment should be less than a time
       // load of a page and all elements on it such as images (of course it depends on client's download too)
       time_t session_index_time_increment;

       // time in seconds after a new AES key pair should be generated
       // we have 256 pairs of keys so this time multiplied by 256 should not be less than
       // the max time of a session (session_remember_max_idle),
       // by default: 256 * 2 days = 512 days = 1.4 year > 3 months (session_remember_max_idle)
       // default: 172800 = 2 days (max: 2678400 = 1 month, min: 10)
       size_t session_key_renew_time;

changed: when printing the time of a request we print only two non-zero digits






git-svn-id: svn://ttmath.org/publicrep/winix/trunk@994 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-22 15:30:56 +00:00
Tomasz Sowa 3547d326b8 define AR macro in the main Makefile
this is for pikotools and tito libraries



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@993 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-12 04:14:16 +00:00
Tomasz Sowa 0ecb2ac70e added: to HtmlTextStream: Escape(bool) method
now the output html streams can be turn into no-escaping mode
       default true (set when a request is clearing)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@990 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-06 21:17:41 +00:00
Tomasz Sowa 8f8defe0de updated: to the new Ezc API
removed statements: [if-index ...] [is ...] [is-no ...]
added:   generic ezc functions:
         and, any (the same as and), or, one (the same as or), not, cmp, trim
         to_lower, to_upper, index
changed: in misc:
         added treat_new_line_as_white flag to IsWhite() SkipWhite() and TrimWhite()
         TrimWhite(), TrimFirst(), TrimLast(), Trim() are using only wide characters now
         (they were templates before)
         added: IsInt(), IsSize(), IsFloat()
changed: version to 0.6.4






git-svn-id: svn://ttmath.org/publicrep/winix/trunk@989 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-02 17:47:34 +00:00
Tomasz Sowa db5572e864 removed: svn:executable attribute from files
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@984 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-01 17:05:20 +00:00
Tomasz Sowa 1100cf75d7 updated: to the new Ezc API
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@983 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-28 19:14:46 +00:00
Tomasz Sowa 4fda06b547 fixed: PatternCacher incorrectly rebuilt the cache
some new Ezc::Pattern objects were inserted
       the storage container is std::map<long,...>
       but we traverse it as a std::vector e.g.:
       for(size_t i=0 ; i<pattern_tab.size() ; ++i)
           RebuildCache(pattern_tab[i].pattern);
       so eventually new patterns were added to the map
       (operator [])




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@980 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-21 07:27:21 +00:00
Tomasz Sowa fb18b2238e added: two options to the config:
ezc_error_prefix (string)
        ezc_error_postfix (string)
        // prefix and postfix used when there is an error in Ezc patterns
        // default:
        // prefix:  "<!-- "
        // postfix: " -->"
added:  Ezc::Blocks to templates
added:  although patterns have pointers to functions and blocks cached
        the Ezc::Generator should use SetFunctions() and SetBlocks() method
        in order to correctly recognize variables (aliases)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@978 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-19 21:20:09 +00:00