diff options
author | nodiscc <nodiscc@gmail.com> | 2017-01-26 18:52:54 +0100 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2017-06-18 00:19:49 +0200 |
commit | 53ed6d7d1e678d7486337ce67a2f17b30bac21ac (patch) | |
tree | f8bef0164a70bd03d2b9781951c01bdd018f1842 /doc/md/Security.md | |
parent | d5d22a6d07917865c44148ad76f43c65a929a890 (diff) | |
download | Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.gz Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.zst Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.zip |
Generate HTML documentation using MkDocs (WIP)
MkDocs is a static site generator geared towards building project documentation.
Documentation source files are written in Markdown, and configured with a single YAML file.
* http://www.mkdocs.org/
* http://www.mkdocs.org/user-guide/configuration/
Ref. #312
* remove pandoc-generated HTML documentation
* move markdown doc to doc/md/,
* mkdocs.yml:
* generate HTML doc in doc/html
* add pages TOC/ordering
* use index.md as index page
* Makefile: remove execute permissions from generated files
* Makefile: rewrite htmlpages GFM to markdown conversion using sed:
awk expression aslo matched '][' which causes invalid output on complex links with images or code blocks
* Add mkdocs.yml to .gitattributes, exclude this file from release archives
* Makefile: rename: htmldoc -> doc_html target
* run make doc: pull latest markdown documentation from wiki
* run make htmlpages: update html documentation
Diffstat (limited to 'doc/md/Security.md')
-rw-r--r-- | doc/md/Security.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/md/Security.md b/doc/md/Security.md new file mode 100644 index 00000000..aec37fa0 --- /dev/null +++ b/doc/md/Security.md | |||
@@ -0,0 +1,27 @@ | |||
1 | ## Client browser | ||
2 | * Shaarli relies on `HTTP_REFERER` for some functions (like redirects and clicking on tags). If you have disabled or masqueraded `HTTP_REFERER` in your browser, some features of Shaarli may not work | ||
3 | |||
4 | ## PHP | ||
5 | * `magic_quotes` is an horrible option of PHP which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with `magic_quotes` on, so you should not be bothered even on crappy hosts. | ||
6 | |||
7 | ## Server and sessions | ||
8 | * Directories are protected using `.htaccess` files | ||
9 | * Forms are protected against XSRF (Cross-site requests forgery): | ||
10 | * Forms which act on data (save,deleteā¦) contain a token generated by the server. | ||
11 | * Any posted form which does not contain a valid token is rejected. | ||
12 | * Any token can only be used once. | ||
13 | * Tokens are attached to the session and cannot be reused in another session. | ||
14 | * Sessions automatically expire after 60 minutes. | ||
15 | * Sessions are protected against hijacking: the session ID cannot be used from a different IP address. | ||
16 | |||
17 | ## Shaarli datastore and configuration | ||
18 | * The password is salted, hashed and stored in the data subdirectory, in a PHP file, and protected by htaccess. Even if the webserver does not support htaccess, the hash is not readable by URL. Even if the .php file is stolen, the password cannot deduced from the hash. The salt prevents rainbow-tables attacks. | ||
19 | * Links are stored as an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a `.php` file. | ||
20 | * Even if the server does not support `.htaccess` files, the data file will still not be readable by URL. | ||
21 | * The database looks like this: | ||
22 | ```php | ||
23 | <?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o... | ||
24 | ...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?> | ||
25 | ``` | ||
26 | |||
27 | * Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg. `20110923_150523`) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only `A-Z a-z 0-9 - _` and `@`. | ||