Commit Graph

53 Commits

Author SHA1 Message Date
Tomasz Sowa ee6500ac65 added: some more orphans to polish default locale
added: new options to the config:
  url_proto: default: http://
  url_ssl_proto: default: https://
  use_ssl, use_ssl_static, use_ssl_common (whether or not to use SSL protocol)
  use_ssl_only_for_logged_users
  now we are able to use SSL encryption (https) together with normal connections
removed: config option: base_server




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@755 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-08-17 23:09:47 +00:00
Tomasz Sowa c37c1ff812 fixed: as we have insert_page ezc function now
we cannot delete ezc patterns when PatternCacher::GetPattern() method is called
       because we can delete a pattern which is in use
       now deleting is performed at the end of a request


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@751 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-07-15 02:09:02 +00:00
Tomasz Sowa 06f42dd9cb changed: winix 'upload' function is a file manager now
we're using an jquery upload plugin
added:   Item struct has new rows: hash, hash_type, file_size, sort_index
added:   css mount parameter
         you can specify css files there, and javascript wysiwyg editors
         (ckeditor, tinymce) can make use of it
changed: post parsers can parse post variables with the same name
         (a postfix is added in such a case)
added:   common_dir parameter to the config
         this is a path to common directory (directory with common static files)
         it is needed to the 'css' mount parameter
         


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@746 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-24 20:53:21 +00:00
Tomasz Sowa c49c35cfbd added: a new mount type: static
some path in winix can be redirected to a specified static directory


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@738 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-14 23:45:42 +00:00
Tomasz Sowa 18ecd46a01 changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null
added:   DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result)
         it reads binary (bytea) data
added:   DbTextStream can handle 'bool' types now
         (is puts 'true' of 'false' to the stream)
changed: now passwords can be stored either as plain text, a hash or can be encrypted
         with RSA
         currently we have following hashes:
         md4, md5, sha1, sha224, sha256, sha384, sha512
         we are using openssl to manage them
         (look at config options for more info)
changed: winix version to 0.4.7         
added:   class Run - you can run any program from os and send a buffer to its standard input
         and read what the program put on its standard output
added:   class Crypt (in System) - calculating hashes, and crypting/decrypting




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-09 21:22:08 +00:00
Tomasz Sowa af8fbdae72 added: now winix will not log post parameters with 'pass' in names (at the beginning)
changed: only first few characters are logged (from POST)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@733 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-06 22:47:34 +00:00
Tomasz Sowa 426beae796 renamed: config option 'html_filter_break_lines' to 'html_filter_break_word'
added:   config option 'html_filter_wrap_line'
         this wraps the whole line (line calculated with html tags as well)
changed: orphans (for html filter) are read from locale files now
         ('language_orphans' value )



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@728 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-04-16 08:42:22 +00:00
Tomasz Sowa aadf12c7b3 added support for gzip compression
new config option: compression_encoding (integer)
 1  - use deflate if available (or raw deflate for Internet Explorer) or don't compress
 2  - use gzip if available or don't compress
 10 - prefer deflate -- use deflate (or raw deflate for IE) if both deflate and gzip are available
 20 - prefer gzip    -- use gzip if both deflate and gzip are available
 default: 20

		   


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@727 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-04-02 00:10:16 +00:00
Tomasz Sowa ba63c8c661 changed: removed Languages::Land enum
now we set the languages in the config file: option locale_files, sample:
  locale_files = ( en, pl )
it represents the name of locale files (those from locale_dir directory)
renamed config option: locale to locale_default


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@722 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-02-24 17:06:12 +00:00
Tomasz Sowa 8154c403d8 we can create links (hard links, symbolic links) now
added winix functions: ln

winix function 'default' can be used without redirecting now

added new tickets types: TypeProgress, TypeString, TypeMultistring, TypeImages, TypeFiles
now tickets are combined with files
added winix functions: showtickets

fixed mountpoints:
when the default root mount was created its parameter table was empty
and it caused accessing to a non-existing objects

fixed logger:
modifiers (log1, log2, log3) were incorrectly treated
added modifier: log4 (debug info)

now we are moving threads to a new plugin 'thread'
created directory: plugins/thread
(not finished yet)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@704 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-05 21:24:11 +00:00
Tomasz Sowa 5d09eb149c added a special thread for making thumbnails (thumb.h thumb.cpp)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@700 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-12-11 22:55:48 +00:00
Tomasz Sowa 36c8822e6c changed organization of static files
removed: item.auth item.auth_path
added:   item.file_path, item.file_fs, item.file_type
now the path to a static file is a relative path
added: thumbnails (not finished yet)
fixed: db didn't correctly return the number of deleted items /DelItem() method/




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@696 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-12-10 21:07:01 +00:00
Tomasz Sowa 508f06339e added to config: session_max
how many sessions can be: default 1000000 (one milion)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@694 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-12-07 17:41:28 +00:00
Tomasz Sowa 35efed9fef - now the mess with threads has gone away
- we have a class BaseThread -- this is a base class -- we can inherit from it when
  creating a new thread
- others treads are correctly stopped (when signal comes) -- pthread_join
- we have a special thread only for signals



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-12-02 01:02:02 +00:00
Tomasz Sowa 518281e101 fixed: when signal comes winix properly exits
fixed:   when winix exits the session data were not properly destroyed (memory leak)
         we should set request.session pointer to each session when deleting sessions
         from session_container
         the session data were not properly destroyed when winix checked for 
         outdated sessions (and when it was removing them)
fixed:   performance (memcpy used too often)
         in some places there were reserve method used (on std::wstring/std::string objects)
         especially in AssignString() method and TextStream<> object
         if we add a new string we should check the new size
         and only call reserve() if the new size will be greater than existing one
         (plus some constant)
changed: fcgi objects moved to App class (from Request)
         now we use thread safe methods (e.g. FCGX_Accept_r)
added:   log_plugin_call option to the config
         default: false
         when true winix log when a plugin function is called
added:   winix parameter 'nostat' for not calculating statistics
         (useful when making performance tests)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@680 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-23 21:52:25 +00:00
Tomasz Sowa 8e72a820dd added support for UTF-8
now the UTF-8 is a default charset


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-21 00:19:17 +00:00
Tomasz Sowa c6473f20dc now winix can demonize itself
parameter in the config: demonize (default: true)
 


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@669 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-10-24 19:26:54 +00:00
Tomasz Sowa 9c34cb5862 winix can drop privileges now (if started as the root)
added parameters to the config:
 user (string)
 group (string)
 additional_groups (bool)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@668 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-10-24 17:49:38 +00:00
Tomasz Sowa c48241f78a fixed: there were mktime() used on some dirs Items
so sometimes the time of the dir was changed

now for converting tm into time_t use:
time_t Time(const tm & par);
time_t Time(const tm * par);
tm     Time(time_t par);
from core/misc.h

now winix internally use GMT time
only when printing it is converted to local user time
temporarily all users use the same local time (config: time_zone_offset)
(only logs are genereted with local system time)

added to system:
time_t LocalTime(time_t gmt_time);
tm     LocalTime(const tm * ptm);
tm     LocalTime(const tm & ptm);
they convert GMT time to local user time




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@666 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-10-23 23:12:47 +00:00
Tomasz Sowa a589e5a090 added: TextStream a class similar to std::ostringstream
but with a Clear() method
       the dynamic allocated buffer can be easily reused
added: DbTextStream a special version of a stream
       used to create a database string query
       everything is escaped by default
added: DbBase a base class with some basic methods for communicating
       with the database
added: DbConn a class for managing connection to the database
changed: some refactoring in Db class       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@655 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-18 00:51:12 +00:00
Tomasz Sowa 3b655f39e1 added: plugins_dir to config
small changes in makefiles


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@643 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-17 22:32:47 +00:00
Tomasz Sowa ca4e53bb0f html code in editors (emacs, ckeditor...) is filtered now for normal users
(root is allowed to use any html code)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@641 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-14 17:56:07 +00:00
Tomasz Sowa f3cd3b88b9 some improvement in templates
(now we have O(1) time for selecting the right html template)
added: winix function: template
for selecting a template for an item (file or dir)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@636 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-13 20:04:57 +00:00
Tomasz Sowa 9a199cd834 part II of rewriting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@635 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-12 19:10:12 +00:00
Tomasz Sowa 217cf1420b the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-10 16:12:50 +00:00
Tomasz Sowa 031ace3fe5 changed: the way how plugins work
all your plugin functions can have signature either:
void my_function(PluginInfo & info); or
void my_function();
only the main Init should have:
extern "C" void Init(PluginFunction & info);

added: directory 'plugins' for plugins
added: 'stats' plugin
		  


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@624 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-07-27 20:41:56 +00:00
Tomasz Sowa e4683b9a05 fixed: in htmlfilter: <area> should be treated as single tag
changed: ConfParser is abble to recognize lists


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@623 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-07-21 17:24:16 +00:00
Tomasz Sowa ebd868fa33 removed: Done class (core/done.h, core/done.cpp)
removed: from Session: done, done_status, timers



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@594 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-28 21:33:06 +00:00
Tomasz Sowa 71a63cc70e added: function adduser
changed: errors (removed enum, there are macros now)
added: error messages to locales (winix_err_NN)
removed: templates: err_abuse.html err_others.html


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@593 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-28 00:08:10 +00:00
Tomasz Sowa 3702efc5be added: parameter 'l' to 'ls' function
added: Db::ItemQuery struct for querying items
changed: some refactoring (renamed some config variables)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@589 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-22 22:52:09 +00:00
Tomasz Sowa 16e51cd4e5 added: to mount points: file systems
we have two file systems now:
       - simplefs - the files stored on the hard drive have the same structure as in the database (dir1/dir2/file)
       - hashfs - files are stored in special directories
extented: the mountparser can read file system 
added: function download
       this is a default function for items which have static content
  


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@588 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-18 23:30:22 +00:00
Tomasz Sowa fa8d8f9ea0 fixed: Config::Text() returned a reference to a local variable (std::string)
added: 'static' directory with *.css and images
       we have a default layout
moved: locale from data to templates       
       notification templates have its own locale object
added: reload function reloades locale now too
added: 'nice' form of item_info in templates



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@582 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-15 00:31:14 +00:00
Tomasz Sowa 796985472a added to config: parameter static_auth_dir_tmp
with a path to directory for tmp files (for upload functino)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@572 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-12 17:05:32 +00:00
Tomasz Sowa adf36e71ce added: functions: ckeditor, uptime
added: for function: login - a html pattern for GET request


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@567 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-11 20:56:52 +00:00
Tomasz Sowa ed9feaf542 changed: log is saved after some requests (config: log_request value) (performance)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@563 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-28 21:09:48 +00:00
Tomasz Sowa 09d427b4ba changed: rename cmslu to winix
changed: html templates are a part of winix now
         and the user can provide special html templates for its site
added:   locales
added:   html templates are using HtmlFilter now (locales)
changed: now we have html templates for each language



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@560 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-28 15:39:01 +00:00
Tomasz Sowa 3c95b84633 added: item content type: raw
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@549 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-11 14:47:52 +00:00
Tomasz Sowa 59943c87cd added: default values for variables read from the config file
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@547 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-07 14:45:00 +00:00
Tomasz Sowa 3f9a46b1f7 added: static_auth_dir to config
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@545 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-06 19:36:29 +00:00
Tomasz Sowa 81faca041a added: parser for multipart forms, files: postmultiparser.h postmultiparser.cpp
added: function: upload




git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@543 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-06 19:17:53 +00:00
Tomasz Sowa 60fccea703 fixed: dots in url-es (now only one dot is available in the whole name and it cannot be only one dot ".")
added:   cmslu can act as an authorizer (fast cgi authorize role)
added:   Item::static_auth we can have additional static content on the file system
         this content is authorized through cmslu (fastcgi authorizer mode)
changed: some changes in config
changed: the way how the www server is using cmslu
         added new virtuals: static static_auth
changed: cmslu returns correct http headers (200, 404, 403)
changed: in cookie parser: we get the last cookie (if the server has more than one cookie with the same name)



git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@540 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-30 20:46:12 +00:00
Tomasz Sowa 717eb526fb * added: class HTMLFilter
files: htmlfilter.h htmlfilter.cpp
         this is an html filter used to make the html output looking better
         this is a very lightweight filter
         (without using any dynamic memory - some memory is allocated only at the beginning - in ctors)
         this filter has O(n) complexity over the whole html string
* added: antyspamming method
         if the POST request is sent too fast after the GET
         it is treated as a spam
         only for no logged users and only in 'emacs' and 'createthread' functions
       


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@534 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-09 00:42:40 +00:00
Tomasz Sowa 4827c116f0 added: 'remember me' flag when logging
added: the session file
       sessions can still be available between starting and stopping the cmslu system


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@529 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-20 23:09:52 +00:00
Tomasz Sowa 378cfc0c3d added: plugin mechanism
files: core/plugin.h core/plugin.cpp core/pluginmsg.h
added: directory 'main' with main.cpp (moved from 'core' directory)
changed: the way of building
       nearly everything is in cmslu.so
       only main() is in cmslu and is dynamically linked with cmslu.so



git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@516 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-13 20:40:11 +00:00
Tomasz Sowa 85b678a8fb added: notifications to users' emails
(core/notify.h core/notify.cpp)
       templatesnotify directory
       all notifications are managed by a second thread


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@512 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-09-30 22:31:20 +00:00
Tomasz Sowa 9902ce2b78 added: support for output compression
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@511 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-09-21 23:05:05 +00:00
Tomasz Sowa 2dd3fc7df8 changed: the way of building
core.a content.a templates.a confparser.a have gone away
	 there is only: cmslu.a now (in the global directory 'cmslu')
changed: the way of building
         in Makefile(s) we dont longer use explicitly a variable 'o = file1.o file2.o...'
	 it was put into Makefile.o.dep and is generated automatically 
         when 'make depend' is invoked
changed: some #include "..." directives were put from *.h to *.cpp files
         fewer dependences


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@501 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-04-21 20:50:55 +00:00
Tomasz Sowa 7d73d048c8 added: SessionContainer special container used by SessionManager
sessions are indexed by id and time (last used time)
changed: old sessions are deleted
       parameter: session_max_iddle in the config file
added: function 'who'


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@483 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-01-31 06:53:36 +00:00
Tomasz Sowa 3e328932fc added: created directory 'content' which has Content:: files
added:   created directory 'templates' which has Templates:: and TemplatesFunctions:: files
changed: content.cpp split into many files (directory 'content')
changed: templates.cpp split into many files (directory 'templates')
added:   full permissions
changed: building of the program (GNU make is used now)
         Makefile and Makefile.dep added into directories
added:   a parser 'FunctionParser'
         is used to parse the GET string
         it recognizes directories, items, functions, functions parameters
added:   other classes: Function, Functions 
added:   function: ls, privileges
changed: function 'id' to 'node'
changed: version: to 0.2.0
added/changed: a lot of work have been done


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@469 e52654a7-88a9-db11-a3e9-0013d4bc506e
2008-12-30 01:05:03 +00:00
Tomasz Sowa fac60a197b changed: there is one dir called root (has parent_id -1)
(we have an owner, group, privileges etc of the root dir)
         the root.id of course is not -1 


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@468 e52654a7-88a9-db11-a3e9-0013d4bc506e
2008-12-22 16:03:03 +00:00