Commit Graph

5498 Commits

Author SHA1 Message Date
Aleks-Daniel Jakimenko
2894a4b381 latex.pl: correct eval usage 2015-05-02 04:19:09 +03:00
Aleks-Daniel Jakimenko
3a57912585 No more undefined map behaviour in scalar context (now in modules) 2015-05-02 04:11:36 +03:00
Aleks-Daniel Jakimenko
4b49c1d326 No more variables declared in conditional statements (in modules) 2015-05-02 04:03:30 +03:00
Aleks-Daniel Jakimenko
37da9c4f2c No more pointless nested subroutines
Fixes the following warning:
"Declaring a named sub inside another named sub does not prevent the
inner sub from being global."
2015-05-02 03:56:04 +03:00
Aleks-Daniel Jakimenko
d83106faa4 No more bareword filehandles in modules 2015-05-02 03:49:07 +03:00
Aleks-Daniel Jakimenko
f3fcf0a176 No more masking of earlier declarations 2015-05-02 03:44:07 +03:00
Aleks-Daniel Jakimenko
26b0853e13 No more two-arg open 2015-05-02 03:19:25 +03:00
Aleks-Daniel Jakimenko
0c0de3b838 Fixed warning about not defined sort behaviour in scalar context
Actually, we don't really care about these functions being called in scalar
context, but I fixed it so that the output of perlcritic is clean.
2015-05-02 00:34:07 +03:00
Aleks-Daniel Jakimenko
a57e296531 No more side effects when modifying $_ in map 2015-05-02 00:27:36 +03:00
Aleks-Daniel Jakimenko
a9d764aa94 No more variables declared in conditional statements 2015-05-02 00:22:43 +03:00
Aleks-Daniel Jakimenko
7b681bc1cd No more bareword filehandles 2015-05-02 00:04:29 +03:00
Aleks-Daniel Jakimenko
5ef2e2f5a9 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-01 23:49:14 +03:00
Aleks-Daniel Jakimenko
cd124f9c3a UTF-8 instead of utf8. See [[Refactoring]] for explanation. 2015-05-01 23:47:54 +03:00
Alex Schroeder
fa95f57fd0 oddmuse-curl.el: fixing buffer name issues
I had code in my init file that added an entry to auto-mode-alist for
oddmuse-mode. This resulted in oddmuse-mode being called twice. I'm
locally binding it to nil, now. I also used to call write-file at the
end of oddmuse-edit. This would change the buffer-name after I had
just changed it in oddmuse-mode. Now I'm using basic-save-buffer and
moved the call to oddmuse-mode to the end of oddmuse-edit.
2015-05-01 19:35:52 +02:00
Alex Schroeder
0949b1556d Makefile: move test target up 2015-05-01 19:33:14 +02:00
Alex Schroeder
eb94e8a0d6 search-freetext.pl deleted 2015-05-01 19:18:17 +02:00
Aleks-Daniel Jakimenko
636800a42c Undo the mess and uncry the tears 2015-05-01 13:32:51 +03:00
Aleks-Daniel Jakimenko
a8c0ae3e3e Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-30 03:22:04 +02:00
Alex Schroeder
82e46bc541 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse
Conflicts:
	css/wiki.css
2015-04-30 15:02:34 +02:00
Alex Schroeder
4d73a37288 *** empty log message *** 2015-04-30 15:00:37 +02:00
Aleks-Daniel Jakimenko
047288bb53 Splitting huge subroutines (a bit of testing is probably required) 2015-04-30 03:22:04 +02:00
Aleks-Daniel Jakimenko
65dbdc576f wiki.css: max-width for images
Otherwise they blow up to full size.
95% value is arbitrary, maybe we can use calc() from CSS4 or provide a better
size for the surrounding container, hm.
2015-04-29 23:12:25 +03:00
Aleks-Daniel Jakimenko
302141de71 Do not modify $_ in map {} (actual bugs solved, I believe)
$_ is not a copy, it is an alias to the original value.
Therefore modifying it will mess with original list... That's
not what we want most of the time.
Also, using map to s/// two variables does not look right. What
a stupid race to save one line of code.
2015-04-28 02:21:03 +03:00
Aleks-Daniel Jakimenko
a615bedccf Fixed a bunch of stuff 2015-04-28 00:03:11 +03:00
Aleks-Daniel Jakimenko
10ca910c81 nosearch.pl: License notice 2015-04-27 18:20:48 +03:00
Aleks-Daniel Jakimenko
df87ff82c3 No more redundant 'package OddMuse;' 2015-04-27 17:41:59 +03:00
Aleks-Daniel Jakimenko
cdc499fd7a wiki.css: switched to web safe font "Palatino"
Sure, we can use any font on oddmuse.org, but I don't think that we should
treat some random font as the default and/or suggested one.
2015-04-25 06:46:30 +03:00
Aleks-Daniel Jakimenko
4a63d7e4df private-wiki.pl: done! Works great now 2015-04-25 06:17:08 +03:00
Aleks-Daniel Jakimenko
dc97c4c195 private-wiki.t: initial commit, does not work 2015-04-25 06:16:16 +03:00
Aleks-Daniel Jakimenko
8274d9054f wiki.css: whoops, fixed negative padding 2015-04-25 06:02:32 +03:00
Aleks-Daniel Jakimenko
aff58708b3 wiki.css: whitespace consistency 2015-04-25 05:58:57 +03:00
Aleks-Daniel Jakimenko
17234071cf wiki.css: autoindent, removed trailing whitespace 2015-04-25 05:54:07 +03:00
Aleks-Daniel Jakimenko
af2637cb3e wiki.css: Equal padding on gotobar links 2015-04-25 05:51:22 +03:00
Aleks-Daniel Jakimenko
85617ba255 GetHeader was split into GetHeader and GetHeaderDiv 2015-04-25 05:19:21 +03:00
Aleks-Daniel Jakimenko
9cfa86beec Increased password length limit from 50 to 64
Somehow the password form was limiting the number of characters to 50.
Private Wiki Extension relies on passwords that are 64 characters in length,
so I have increased the limit.
2015-04-25 05:00:12 +03:00
Aleks-Daniel Jakimenko
0f1486e4d7 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-24 16:31:36 +03:00
Aleks-Daniel Jakimenko
8b36bd14cb Fixed bug with max page name length, new option $PageNameLimit
It was checking if the number of utf8 characters is <= 120, but obviously utf8
characters could be up to 4 bytes in length. 120*4 is much greater than 255
(which is a limit on lots of file systems), so it attempted to write files
with illegal filenames. This is now fixed.

Additionally $PageNameLimit option was added. Now you can choose max page
name length yourself (which is very useful for extensions like mac.pl or
private-wiki.pl)
2015-04-24 16:26:33 +03:00
Alex Schroeder
e85f3e054b Improve feedback for the password page
If you have no password set, the password page will tell you as much
(instead of saying that it doesn't match).
2015-04-24 09:19:35 +02:00
Alex Schroeder
64aa833e95 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-24 08:50:41 +02:00
Alex Schroeder
bc4c26f26c test.pl: fix typo 2015-04-24 08:47:03 +02:00
Aleks-Daniel Jakimenko
5c47b84714 Splitting AllPagesList into smaller functions
And other small modifications regarding index file
2015-04-23 14:34:13 +03:00
Aleks-Daniel Jakimenko
10fbf17254 Removed debugging code
This key was used instead of using the password
2015-04-22 23:50:58 +03:00
Aleks-Daniel Jakimenko
2089fa60ea Regenerated russian translation 2015-04-21 23:05:15 +03:00
Aleks-Daniel Jakimenko
dbcc6d1459 "secure" and "httponly" flags for cookies (improved security)
These flags are essential for security. The problem we are trying to
solve is the following:
1) you visit a wiki using HTTPS and you set your password.
2) you accidentally visit the same website using plain HTTP
3) although you don't notice, your cookies are sent over the insecure
connection.
Even if that website has redirection, even it denies any insecure
traffic, your cookie is still leaked. That's how cookies work.

"secure" and "httponly" flags solve this. It means that these cookies
will only be sent over a secure connection. If you have set your
password using HTTPS and later you visit the same wiki using plain HTTP,
it will look like you are not logged in (because these cookies will not
be used when you access the website using a non-secure connection).

If you have HTTPS on your website -- ALWAYS make sure that you set your
password using it. Alternatively redirect all non-secure requests to
HTTPS - that's even better.

If you set your password using HTTP, the same cookie will be used for
both HTTP and HTTPS requests - this is done for compatibility with
HTTP-only wikis.

$ENV{'HTTPS'} returns 'on' or empty string. 'on' is truthy so it
should not create any problems, we can safely use it.

I've tested this, it works as expected.
2015-04-20 23:13:26 +03:00
Aleks-Daniel Jakimenko
b08a017a80 New module: private-wiki.pl (encrypt all data on the server) 2015-04-19 23:54:46 +03:00
Aleks-Daniel Jakimenko
195ed322d3 Another place where GetKeepDir should be used 2015-04-18 18:14:01 +03:00
Aleks-Daniel Jakimenko
864ba25b5b GetKeepFile chandged to use GetKeepDir (no duplicate logic) 2015-04-18 17:52:53 +03:00
Aleks-Daniel Jakimenko
5b731a61df No more trailing whitespace (I can do it, I can do it!) 2015-04-17 01:45:11 +03:00
Aleks-Daniel Jakimenko
7112f1c170 No more trailing whitespace (this time for sure) 2015-04-17 01:43:19 +03:00
Aleks-Daniel Jakimenko
c7bd5617ff No more trailing whitespace 2015-04-17 01:39:47 +03:00