King_DuckZ
2e4d869370
Individually log failure for non-vital missing POST variables.
2017-05-18 19:17:22 +01:00
King_DuckZ
71ec9925f4
Fix sent http status codes.
2017-05-18 19:17:22 +01:00
King_DuckZ
aaa28d3454
Assign the actual numbers to the HTTP status codes enum.
...
This allows me to get rid of a good deal of crap.
2017-05-18 19:17:22 +01:00
King_DuckZ
4eb4261f4a
This makes it quick to just delete the copy constructor.
...
Useful if you want to see where copy is done instead of move.
2017-05-18 19:17:22 +01:00
King_DuckZ
cdd23d35d0
Make on_process() return an HttpHeader.
...
Response type is now decided by on_process' return value.
2017-05-18 19:17:22 +01:00
King_DuckZ
c5f2bc055a
Append the protocol to the uri from the code.
...
This means if you set uri name to http://example.com in the
config file you will actually get base_uri to be
http://http://example.com .
2017-05-18 19:17:22 +01:00
King_DuckZ
59a5d35ee0
Try to fix redirect not working properly.
2017-05-17 00:03:43 +01:00
King_DuckZ
5a4794240b
Disable colouring when lang token is "colorless".
2017-05-16 23:07:00 +01:00
King_DuckZ
aa9e1f884f
Rename text html page to pastie and get rid of paste.
...
So confusing! :s
2017-05-16 23:01:19 +01:00
King_DuckZ
85f6781d81
Fix tawashi sending back an html response even for redirects.
2017-05-16 22:58:09 +01:00
King_DuckZ
f19d78222f
Clarify log entry
2017-05-16 22:16:33 +01:00
King_DuckZ
a1fa8cc1d2
Bugfix, don't redirect when the returned token is empty.
2017-05-16 22:06:36 +01:00
King_DuckZ
e77b9dafbb
Log when redirecting to the error page.
2017-05-16 21:52:48 +01:00
King_DuckZ
700dcc3049
Version bump to 0.1.7.
2017-05-16 20:59:30 +01:00
King_DuckZ
8345c300a8
Add some debug logging and change level to trace.
2017-05-16 19:14:22 +01:00
King_DuckZ
ed4a02f4bb
Setup the logger based on the log_file setting in tawashi.ini.
...
With this change I had to swap the order in which what settings
file as being loaded and the initialization of the logger itself.
This is because the logger now depends on the settings file,
so it can't be used before the setting file got parsed.
2017-05-16 19:11:09 +01:00
King_DuckZ
10da16051c
Organize exceptions so it's easy to log errors locally.
2017-05-16 18:54:00 +01:00
King_DuckZ
32eadfc64d
Pull some code out from main().
2017-05-16 18:52:34 +01:00
King_DuckZ
1769446a0e
Fix some missing bits in the html.
2017-05-16 18:51:57 +01:00
King_DuckZ
6145550ba0
Version bump to 0.1.6
2017-05-15 23:48:12 +01:00
King_DuckZ
75bd68c53e
More logging
2017-05-15 23:47:01 +01:00
King_DuckZ
34c23659e9
Log files that mustache is trying to open as info.
2017-05-15 23:45:13 +01:00
King_DuckZ
0c7d08e299
Use a smaller type for string lengths.
2017-05-15 23:41:47 +01:00
King_DuckZ
8585e5baf5
Calculate string lengths at build time.
2017-05-15 23:38:39 +01:00
King_DuckZ
00f32d43d3
Fix displaying error messages in error response.
2017-05-15 21:46:35 +01:00
King_DuckZ
ba1b417f07
Fix wrong parameter in redirect address.
2017-05-15 09:33:31 +01:00
King_DuckZ
9b28b2d274
Add a --show-paths switch to print hardcoded paths and info.
2017-05-15 09:26:29 +01:00
King_DuckZ
7fc7e2fba8
Remove test-only stuff that is not necessary anymore.
...
Env reads environment variables from the list it receives
from main(), so I can also pass it a forged list now
without needing extra classes with sometimes-virtual methods
or other cruft.
2017-05-15 09:18:11 +01:00
King_DuckZ
660d911539
Add a generated tawashi.ini for debug runs.
2017-05-15 09:09:06 +01:00
King_DuckZ
5baaa8c8a8
Move installable html into the website/ subdirectory.
2017-05-14 18:14:52 +01:00
King_DuckZ
c7545f27cf
Add some missing environment variables.
...
Also add a description of what they're for, at least
some of them.
2017-05-14 14:51:50 +01:00
King_DuckZ
72cadf20f2
Update html.
2017-05-14 14:50:16 +01:00
King_DuckZ
791902b8f0
Version bump to 0.1.5.
2017-05-14 03:43:48 +01:00
King_DuckZ
57dc0c7717
Add reason_code to string lookup.
2017-05-14 03:43:38 +01:00
King_DuckZ
ec80734625
Add http status codes and save dummy error into the mstch context.
2017-05-14 03:38:41 +01:00
King_DuckZ
4d31323bb1
Redirect to error.cgi when saving fails.
...
Not working yet, still getting there.
2017-05-12 22:46:54 +01:00
King_DuckZ
73707c2ad0
Revert "Pass the ResponseFactory object down to the Response itself."
...
This reverts commit 3bc6c56c03
.
2017-05-12 22:18:03 +01:00
King_DuckZ
3bc6c56c03
Pass the ResponseFactory object down to the Response itself.
2017-05-12 09:36:01 +01:00
King_DuckZ
10da75caf5
Remove parameters from Response's constructor.
...
They can safely be defaulted and derived classes can
change their preferences later inside their constructor
if they need to.
2017-05-12 09:18:49 +01:00
King_DuckZ
f286507edf
Delay fast subsequent pasties from the same IP.
2017-05-11 18:50:56 +01:00
King_DuckZ
9e63a648a1
Protect against fast flooding from the same ip.
2017-05-11 09:48:18 +01:00
King_DuckZ
f4991dfd5f
Get latest duckhandy
2017-05-11 09:37:28 +01:00
King_DuckZ
c790507d94
Version bump to 0.1.4.
2017-05-10 20:50:28 +01:00
King_DuckZ
0323fb0ba6
Add source-highlight to docs.
...
It's useful as reference.
2017-05-10 20:49:40 +01:00
King_DuckZ
d449781c40
Add unit test for utf8 sanitization.
2017-05-10 20:47:24 +01:00
King_DuckZ
13e46ab1e6
Replace nullchars with #.
...
There is also a glib-based implementation but I'm not
sure about it yet.
2017-05-10 20:45:26 +01:00
King_DuckZ
ed1343bd7b
Pass the istream to read_post instead of assuming std::cin.
2017-05-10 20:42:42 +01:00
King_DuckZ
c907e5dd49
Fix tawashi looking for the wrong config file.
2017-05-08 19:48:09 +01:00
King_DuckZ
9e1e18dcf0
Set default.lang if user's lang is not found.
2017-05-08 19:48:09 +01:00
King_DuckZ
07135f215c
Delete get_env, which confused me a lot.
...
Get raw environment variables directly from main().
Add code to split on '=' in cgi_environment_vars and only pick
the ones that are interesting, just as before.
2017-05-08 19:46:14 +01:00