Commit Graph

278 Commits

Author SHA1 Message Date
uriel
12c48bb7e7 Script to add users. 2009-02-13 00:56:15 +00:00
uriel
5fe0d95b05 Add conf_enable_app to add items to $enabled_apps, used from conf_enable_xxx functions so one doesn't need to both add stuff to $eanbled_apps and then call conf_enable_xxx, and to avoid enabling the same app twice.
New conf_enable_wiki function to follow the interface of other apps.
2009-02-08 00:22:46 +00:00
uriel
965557e19b Convert fltr_cache into a function. Enable output buffering which had been commented out for unknwon reasons. 2009-02-06 22:09:32 +01:00
uriel
d5b18a461a Make fproc_cache take an optional second arg that can be a file or dir name, if provided that file/path will be used as input for the first argument removing the need for a temporary file. 2009-02-06 20:42:15 +01:00
uriel
f5f19776df Make conf_hide_path more flexible, and note a limitation in sitemap dirfilter handling. 2009-02-05 03:16:14 +00:00
uriel
a1d12138bb Reorg code in five source files: werc.rc, cgilib.rc, corehandlers.rc, wercconf.rc and werclib.rc. 2009-02-01 20:06:51 +01:00
uriel
1861c59707 Fix txt_handler that was broken due to idiotic overzealous 'optimization', thanks mycroftiv for finding and fixing this! 2009-01-30 16:19:48 +01:00
uriel
a2f4bea147 Replace $redirectPermanent with new conf_perm_redirect function. New notices_handler for error/note/success notification boxes. Rename hide_paths to conf_hide_paths. Reorder variable setting, all req-specifc vars are set after initrc and app sourcing, moved request handling code to its own function, this makes us ready to do scgi and other optimizations. 2009-01-30 16:18:07 +01:00
uriel
e80647ee52 Make http_redirect resolve non-absolute uris. Only allow safe chars for user names. Reliability fixes when checking $status (don't check $#status!). Check user suceeds always if user in admin group. 2009-01-30 16:13:06 +01:00
uriel
98d37b2283 Handle dir listing of site root. 2009-01-26 04:51:06 +01:00
uriel
b25406c592 Various changes:
- New generic http_redirect function, and two shortcuts for 303: post_redirect and 301: perm_redirect
- Allow get_lib_file to take a default value, and change where master_template is set.
- Fix bugs in auth code and properly trim ^M from post data.
- Other cosmetic/minor improvements.
2009-01-25 13:56:53 +01:00
uriel
4302232dd0 Add some comments and replace get_post_args with load_post_args 2009-01-24 07:11:39 +01:00
uriel
a8fd3560fd Two minor handler changes: tpl_handler now can take multiple templates, md_handler can only take one .md file. 2009-01-23 17:51:23 +01:00
uriel
ca0507992e Fix minor cosmetic bug in dir listing by passing req_path instead of local_path. 2009-01-23 17:48:09 +01:00
uriel
19fb976b75 Fix and simplify config loading process. 2009-01-23 16:46:48 +01:00
uriel
5c742826b7 New helpful dprintvars deubg function. 2009-01-23 16:46:25 +01:00
uriel
d349b81ee7 Move comment to where it belong and note deprecation. 2009-01-22 14:24:48 +01:00
uriel
dddc77d560 Rewrite http post parsing code, this should be faster and cleaner, added a
get_post_args function to keep backwards compat but it is not really needed.

Fix a silly bug in urldecode.
2009-01-22 14:21:40 +01:00
uriel
582c8efc8a Merge in werc.cat-v.org updates and css changes. 2009-01-22 09:24:10 +01:00
uriel
41c4279bd1 Change app loading to be done in two passes, first source app files, then call init for enabled apps.
This makes it possible to call app functions at config time.
Provide $conf_wd variable at config time, which can in turn be used by apps to determine where in the tree we are at config/setup time.
2009-01-22 09:22:15 +01:00
uriel
e87cc5e8bf Add comment about minnor bug. 2009-01-21 09:26:13 +00:00
uriel
3c0ef166e4 Fix debug printing of main handler. 2009-01-20 09:05:57 +00:00
uriel
8fc2f30a3d Allow to set optional dir listing sorting (ls) options with the config var: dir_listing_ls_opts 2009-01-20 06:55:17 +01:00
uriel
6271d7a81a Fix cookie parsing if more than one cookie present, add optional user/loggin-info sidebar 2009-01-17 03:43:05 +01:00
uriel
6aac4ce54c Make left sidebar into a list of handlers. 2009-01-17 03:05:19 +01:00
uriel
e8707b03af Add comment on future issue for apps with 'synthetic' dirs. 2009-01-16 03:18:10 +01:00
uriel
e4c517160f Proper 404 for dirs too 2009-01-16 01:24:58 +01:00
uriel
4eb1d92200 Fix handling of static /pub/ files. 2009-01-16 01:08:54 +01:00
uriel
c6ee6093f5 Add handling of static files for /pub/* 2009-01-14 00:36:32 +01:00
uriel
81ca7feb2d Get rid of response_format which was only used by blagh feeds anyway, and we can emulate by setting $headers to nil plus adding a $res_tail var. 2009-01-13 03:18:19 +01:00
uriel
679fefacac Various small cleanups: remove unused code, clarity and reliability fixes here and here, move code to more appropriate locations, improve some comments. 2009-01-12 02:07:31 +01:00
uriel
08d295a667 Move misplaced comment 2009-01-11 07:13:25 +01:00
uriel
912dea9e6e Fix blah to work with new handler interfaces.
Remove outdated app-framework code.
Clanup some of the fallback handler setting code.
2009-01-11 04:40:40 +01:00
uriel
bf16d2b4c8 Handler interface reorg, take oportunity to cleanup default_master.tpl and move comments bits to bridge app. 2009-01-11 04:03:46 +01:00
uriel
116d7c3931 - New static_file and select_mime functions.
- Minor improvements to get_post_args, set status unless one of the requested args is present.
2009-01-11 04:02:07 +01:00
uriel
bc051f1b27 Handle static files! (Should only be used as a fallback if static files are not handled by httpd) 2009-01-10 05:23:44 +01:00
uriel
65598e15d1 Move top header/title generation for werc.rc to default template. 2009-01-10 04:57:41 +01:00
uriel
86ba2b9392 Minor reorg of handler selection, move comment code to bridge app.
Bigger changes still to come.
2009-01-09 03:08:02 +01:00
uriel
09575c869f Awk_buffer does seem to improve things a bit, but changed the buffer side to an empirically determined value. 2009-01-09 02:06:41 +01:00
uriel
3e99d92b05 Delete some debug code in a function that is not used yet. 2009-01-09 02:03:36 +01:00
uriel
74f63b6698 Very minor style fixes, and obfuscate local var in ll_add. 2009-01-08 16:48:09 +01:00
uriel
900119d659 Add nested lists rc helper 2009-01-08 16:46:00 +01:00
uriel
cdaecd9238 Minor optimizations and reliability improvments to fproc_cache. 2009-01-07 23:50:49 +01:00
uriel
c09789caaf Make tabs/spaces indentation consistent. 2009-01-05 05:49:45 +01:00
uriel
50874c7dee Two other minor code formating changes for readability. 2009-01-05 05:48:23 +01:00
uriel
e0178ea762 Remove a debug tee(1) and split sidebar ls pipeline in three lines to make it more readable. 2009-01-05 05:46:37 +01:00
uriel
a9b49f9f61 Make perm redirect code a bit simpler and a bit less hideous. 2009-01-05 05:41:10 +01:00
uriel
efb5bdf499 Fix stupid bug in last commit. 2009-01-04 23:24:35 +01:00
uriel
69c02ecfb9 Simplify and optimize some of the canonical-url-redirections. 2009-01-04 23:21:55 +01:00
uriel
9478cec323 Simplify genbody/set_handler and reorg some env vars, including moving sitedirs/sitedir out of default initrc. 2009-01-04 22:49:05 +01:00
uriel
25a624318c Very minor dirfilter cleanups and some extra comments. 2009-01-04 07:57:13 +01:00
uriel
7e3a41152e Simplify .txt handler, and remove double spacing, if lines are too close we should use css to space them. 2009-01-04 03:59:52 +01:00
uriel
3f77822d0a More consistent use of dirfilter in sidebar code.
This shoudl allow dots in path elements to show up in sidebar properly!
2009-01-03 02:02:50 +01:00
uriel
63816db0c6 Delete some deprecated code left over from the old blog system. 2009-01-02 16:51:59 +01:00
uriel
ba1eea3078 Fix handling of _werc/config in domain root. 2009-01-01 08:14:38 +01:00
uriel
85e0153050 Move $local_path deffinition to a more correct place. 2008-12-31 00:16:47 +01:00
uriel
1e72e6499f Two small simplifications to app handling. Specially merge _test and _setup functions into a single _init. 2008-12-28 23:42:24 +01:00
uriel
1684a29bd2 Remove blog-related code from werc.rc
Make variable use more consistent:
    * $REQUEST_URI and $uri are replaced with $req_path
    * $body is replaced with $local_path
Other simplifications and cleanups.
2008-12-28 23:40:57 +01:00
uriel
08d6044274 Rename $baseuri to $base_url 2008-12-28 20:20:48 +01:00
uriel
cfd4940d06 Replace 404_handler with a direct call to tpl_handler. 2008-12-28 11:52:57 +01:00
uriel
713a591618 Minor comment cleanups. 2008-12-28 11:51:03 +01:00
uriel
de11460a52 Source _werc/config files with their container dir as working directory (allows for relative references in config variables, for example: blaghDirs=(../people/*/blog/)). NOTE: this require some config files to be updated, specially ones with blogDirs in them, $sitedir/ references and full paths are not required anymore.
Added two new global vars: $werc_root and $req_paths_list.
Change sidebar menu generation to use $req_paths_list.
2008-12-27 11:53:58 +01:00
uriel
921a67d8df New function to pick 'metadata' out of new .md convention for attributes. 2008-12-24 12:18:44 +01:00
uriel
b029c8774b Move app handler before default dir listing handler 2008-12-24 12:18:05 +01:00
uriel
c63cb84e94 Only call select_apps if enabled_apps is not null. 2008-12-21 09:47:08 +01:00
uriel
270c9999a0 Add sample 'hello world' app and enabled_apps config variable. 2008-12-21 09:37:40 +01:00
uriel
14c33b7110 Style consistency fixes around bin/aux/* and bin/contrib/* 2008-12-21 00:13:53 +01:00
uriel
8c10f7653a Explicitly call awk when running template.awk so we can use p9p's awk if available and improve portability to native Plan 9. 2008-12-21 00:08:49 +01:00
uriel
d052435688 New html_handler that replaces gnu/sed with awk by sqweek, sorry for taking so long and thanks! 2008-12-20 22:56:49 +01:00
uriel
b99d6ebf78 Add timezone to blog posts date, thanks to dho for the original patch.
Used the opportunity to provide the current date/time info in $current_date_time for any other similar uses.
2008-12-20 22:36:25 +01:00
uriel
c9c9a6f283 Tiny style fix. 2008-12-20 22:29:32 +01:00
uriel
200307d77f Reorg debug printouts a bit. 2008-12-20 13:31:19 +01:00
uriel
4c56c67284 Move trailing * executable market strpping to dirfilter.
All dirfilter users need it so far, and we should not allow * in file names anyway.
2008-12-20 13:15:56 +01:00
uriel
abb5df1d32 Make coding style more consistent. 2008-12-20 06:32:37 +01:00
uriel
6095d57ab8 A couple of minor code simplifications and add a comment about some code that probably should be killed. 2008-12-20 05:46:41 +01:00
uriel
4cd62ee394 Simplification of sidebar code: do away with fn menu, and merge code directly into gensidebar.
No need to run sidebar code in a subshell anymore.
2008-12-20 03:42:43 +01:00
uriel
bb189a3a74 Simplify dir listing handler, and deal better with corner cases. 2008-12-20 02:57:01 +01:00
uriel
8d8419cc24 Make sites/ dir configurable. 2008-12-20 02:18:11 +01:00
uriel
54bb58bef7 First bits of minimal 'modular' app framework, move some blog code out of werc.rc and other minnor code cleanups. 2008-12-20 02:08:12 +01:00
uriel
d396e90262 Merge 2008-12-16 08:12:49 +01:00
uriel
c857ea6d5a Add comment noting a possible bug in fproc. 2008-12-16 07:08:05 +00:00
uriel
7f48cf458a Make fproc more reliable (fool-proof).
For some reason I have found empty files showing up in cache dirs, this should at least clean them up.
2008-12-16 07:02:36 +00:00
uriel
ce17e73168 Fix and cleanup dir listing regexp. 2008-12-16 03:45:44 +01:00
uriel
2023d168c9 Fix: don't completely delete 'sort helper' delimiter, revert it back to a '/', and coalesce any extra '/' for tidiness 2008-12-13 16:16:10 +00:00
uriel
54e35210f9 Fix sortedBlogPostList to handle paths containing a '.', and strip the '/./' used as a sort delimiter from output 2008-12-13 16:58:08 +01:00
uriel
86c55df5ec Fix bug in crop_text, and allow to set the 'ellipsis' text ('...' by default) 2008-12-12 02:25:10 +01:00
uriel
4c77b804a6 Fix and simplify code that generates rss/atom urls. Now it handles urls in / properly. 2008-12-11 21:38:31 +00:00
uriel
9e734581e1 Improve dirfilter, simplified and made more reliable. Also strip trailing * from ls -F output (not sure if this should be added to dirfilter itself. 2008-11-29 16:20:08 +01:00
uriel
b99f989ccf Fix typo in dirfilter, thanks to soul9 for finding this! 2008-11-29 15:23:59 +01:00
uriel
757f051c52 Add atom feeds, still needs some cleanup, but seems to mostly work. 2008-11-26 04:56:39 +01:00
uriel
41940806db New helper function: crop_text 2008-11-26 04:50:03 +01:00
uriel
5eee46892e Allow to hide 'by line' in blog posts by setting blogAuthor to ''. 2008-11-23 22:31:07 +01:00
uriel
71f59e4ea1 Fix display of dir_listing_handler headers. Thanks to soul9 and mycroftiv for reporting this. 2008-11-20 05:21:15 +01:00
uriel
fdf008b7ce Update dirfilter to hide .html .txt and .tpl indexes from listing too. 2008-11-15 20:30:08 +01:00
uriel
def444ac29 New menu implementation, removes the recursive calls to rc/awk, also makes use of dirfilter more consistent and simplifies some code.
Other minnor cleanups.
2008-10-27 00:41:23 +01:00
uriel
a8f056f052 Use explicitly relative paths when sourcing now that . is not in path
Add comment about perf issues with menu()
2008-10-26 05:29:42 +01:00
uriel
8f59aebdcf Big cleanup of bin/, move external programs to contrib/, move minor useful scripts to aux/, and most important of all move controller.rc to werc.rc 2008-10-26 04:29:50 +01:00
uriel
f94838cdbd Mark gensitemaptxt.rc as deprecated 2008-10-26 03:37:52 +01:00
uriel
a42e7ad88b Improvements to auth code, now the interface and implemenation are much cleaner. 2008-10-22 09:18:55 +02:00
uriel
29e035ec53 Update comments code to use new comment dir format and the new user auth system 2008-10-22 09:17:08 +02:00