diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-10-07 12:22:54 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-10-07 12:22:54 +0200 |
commit | 80b15f5d2db8b90fd9b29f94e6bd8652340df4f0 (patch) | |
tree | b4826cbb03c64b0e5ffb6d0a72f21e0f6b9d9ac8 /doc/md | |
parent | 1ea88ae7d1b7fb13e18f543e7c2ad99c4ccde19a (diff) | |
parent | a01437f9e1e4fb5a098877b243828bf6f4936562 (diff) | |
download | Shaarli-80b15f5d2db8b90fd9b29f94e6bd8652340df4f0.tar.gz Shaarli-80b15f5d2db8b90fd9b29f94e6bd8652340df4f0.tar.zst Shaarli-80b15f5d2db8b90fd9b29f94e6bd8652340df4f0.zip |
Merge branch 'master' into v0.9
Diffstat (limited to 'doc/md')
-rw-r--r-- | doc/md/Download-and-Installation.md | 6 | ||||
-rw-r--r-- | doc/md/Plugin-System.md | 4 | ||||
-rw-r--r-- | doc/md/Plugins.md | 2 | ||||
-rw-r--r-- | doc/md/Release-Shaarli.md | 6 | ||||
-rw-r--r-- | doc/md/Security.md | 3 | ||||
-rw-r--r-- | doc/md/Shaarli-configuration.md | 8 | ||||
-rw-r--r-- | doc/md/Unit-tests-Docker.md | 56 | ||||
-rw-r--r-- | doc/md/docker/docker-101.md | 78 | ||||
-rw-r--r-- | doc/md/index.md | 13 |
9 files changed, 165 insertions, 11 deletions
diff --git a/doc/md/Download-and-Installation.md b/doc/md/Download-and-Installation.md index 135f0633..e5e929ef 100644 --- a/doc/md/Download-and-Installation.md +++ b/doc/md/Download-and-Installation.md | |||
@@ -18,13 +18,13 @@ Get the latest released version from the [releases](https://github.com/shaarli/S | |||
18 | 18 | ||
19 | **Download our *shaarli-full* archive** to include dependencies. | 19 | **Download our *shaarli-full* archive** to include dependencies. |
20 | 20 | ||
21 | The current latest released version is `v0.9.0` | 21 | The current latest released version is `v0.9.1` |
22 | 22 | ||
23 | Or in command lines: | 23 | Or in command lines: |
24 | 24 | ||
25 | ```bash | 25 | ```bash |
26 | $ wget https://github.com/shaarli/Shaarli/releases/download/v0.9.0/shaarli-v0.9.0-full.zip | 26 | $ wget https://github.com/shaarli/Shaarli/releases/download/v0.9.1/shaarli-v0.9.1-full.zip |
27 | $ unzip shaarli-v0.9.0-full.zip | 27 | $ unzip shaarli-v0.9.1-full.zip |
28 | $ mv Shaarli /path/to/shaarli/ | 28 | $ mv Shaarli /path/to/shaarli/ |
29 | ``` | 29 | ``` |
30 | 30 | ||
diff --git a/doc/md/Plugin-System.md b/doc/md/Plugin-System.md index 30f0ae74..cbec04c0 100644 --- a/doc/md/Plugin-System.md +++ b/doc/md/Plugin-System.md | |||
@@ -49,10 +49,10 @@ hook_<plugin_name>_<hook_name>($data, $conf) | |||
49 | 49 | ||
50 | Parameters: | 50 | Parameters: |
51 | 51 | ||
52 | - data: see [$data section](https://github.com/shaarli/Shaarli/wiki/Plugin-System#plugins-data) | 52 | - data: see [$data section](https://shaarli.readthedocs.io/en/master/Plugin-System/#plugins-data) |
53 | - conf: the `ConfigManager` instance. | 53 | - conf: the `ConfigManager` instance. |
54 | 54 | ||
55 | For exemple, if my plugin want to add data to the header, this function is needed: | 55 | For example, if my plugin want to add data to the header, this function is needed: |
56 | 56 | ||
57 | hook_demo_plugin_render_header | 57 | hook_demo_plugin_render_header |
58 | 58 | ||
diff --git a/doc/md/Plugins.md b/doc/md/Plugins.md index 7d40637f..463dae17 100644 --- a/doc/md/Plugins.md +++ b/doc/md/Plugins.md | |||
@@ -72,4 +72,4 @@ Usage of each plugin is documented in it's README file: | |||
72 | 72 | ||
73 | #### Third party plugins | 73 | #### Third party plugins |
74 | 74 | ||
75 | See [Community & related software](https://github.com/shaarli/Shaarli/wiki/Community-%26-Related-software#third-party-plugins) | 75 | See [Community & related software](https://shaarli.readthedocs.io/en/master/Community-&-Related-software/) |
diff --git a/doc/md/Release-Shaarli.md b/doc/md/Release-Shaarli.md index 974a7438..e22eabc9 100644 --- a/doc/md/Release-Shaarli.md +++ b/doc/md/Release-Shaarli.md | |||
@@ -46,6 +46,12 @@ TBA | |||
46 | 46 | ||
47 | 47 | ||
48 | ## Increment the version code, update docs, create and push a signed tag | 48 | ## Increment the version code, update docs, create and push a signed tag |
49 | ### Update the list of Git contributors | ||
50 | ```bash | ||
51 | $ make authors | ||
52 | $ git commit -s -m "Update AUTHORS" | ||
53 | ``` | ||
54 | |||
49 | ### Create and merge a Pull Request | 55 | ### Create and merge a Pull Request |
50 | This one is pretty straightforward ;-) | 56 | This one is pretty straightforward ;-) |
51 | 57 | ||
diff --git a/doc/md/Security.md b/doc/md/Security.md index 36f629af..65db4225 100644 --- a/doc/md/Security.md +++ b/doc/md/Security.md | |||
@@ -1,9 +1,6 @@ | |||
1 | ## Client browser | 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 | 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 | 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 | 4 | ## Server and sessions |
8 | - Directories are protected using `.htaccess` files | 5 | - Directories are protected using `.htaccess` files |
9 | - Forms are protected against XSRF (Cross-site requests forgery): | 6 | - Forms are protected against XSRF (Cross-site requests forgery): |
diff --git a/doc/md/Shaarli-configuration.md b/doc/md/Shaarli-configuration.md index 188a3c09..99b25ba7 100644 --- a/doc/md/Shaarli-configuration.md +++ b/doc/md/Shaarli-configuration.md | |||
@@ -55,6 +55,7 @@ _These settings should not be edited_ | |||
55 | - **links_per_page**: Number of shaares displayed per page. | 55 | - **links_per_page**: Number of shaares displayed per page. |
56 | - **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). | 56 | - **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). |
57 | - **enabled_plugins**: List of enabled plugins. | 57 | - **enabled_plugins**: List of enabled plugins. |
58 | - **default_note_title**: Default title of a new note. | ||
58 | 59 | ||
59 | ### Security | 60 | ### Security |
60 | 61 | ||
@@ -90,7 +91,10 @@ _These settings should not be edited_ | |||
90 | 91 | ||
91 | - **default_private_links**: Check the private checkbox by default for every new link. | 92 | - **default_private_links**: Check the private checkbox by default for every new link. |
92 | - **hide_public_links**: All links are hidden while logged out. | 93 | - **hide_public_links**: All links are hidden while logged out. |
94 | - **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page. | ||
93 | - **hide_timestamps**: Timestamps are hidden. | 95 | - **hide_timestamps**: Timestamps are hidden. |
96 | - **remember_user_default**: Default state of the login page's *remember me* checkbox | ||
97 | - `true`: checked by default, `false`: unchecked by default | ||
94 | 98 | ||
95 | ### Feed | 99 | ### Feed |
96 | 100 | ||
@@ -192,7 +196,9 @@ _These settings should not be edited_ | |||
192 | "privacy": { | 196 | "privacy": { |
193 | "default_private_links": true, | 197 | "default_private_links": true, |
194 | "hide_public_links": false, | 198 | "hide_public_links": false, |
195 | "hide_timestamps": false | 199 | "force_login": false, |
200 | "hide_timestamps": false, | ||
201 | "remember_user_default": true | ||
196 | }, | 202 | }, |
197 | "thumbnail": { | 203 | "thumbnail": { |
198 | "enable_thumbnails": true, | 204 | "enable_thumbnails": true, |
diff --git a/doc/md/Unit-tests-Docker.md b/doc/md/Unit-tests-Docker.md new file mode 100644 index 00000000..c2de7cc7 --- /dev/null +++ b/doc/md/Unit-tests-Docker.md | |||
@@ -0,0 +1,56 @@ | |||
1 | ## Running tests inside Docker containers | ||
2 | |||
3 | Read first: | ||
4 | |||
5 | - [Docker 101](docker/docker-101.md) | ||
6 | - [Docker resources](docker/resources.md) | ||
7 | - [Unit tests](Unit-tests.md) | ||
8 | |||
9 | ### Docker test images | ||
10 | |||
11 | Test Dockerfiles are located under `docker/tests/<distribution>/Dockerfile`, | ||
12 | and can be used to build Docker images to run Shaarli test suites under common | ||
13 | Linux environments. | ||
14 | |||
15 | Dockerfiles are provided for the following environments: | ||
16 | |||
17 | - `alpine36` - [Alpine 3.6](https://www.alpinelinux.org/downloads/) | ||
18 | - `debian8` - [Debian 8 Jessie](https://www.debian.org/DebianJessie) (oldstable) | ||
19 | - `debian9` - [Debian 9 Stretch](https://wiki.debian.org/DebianStretch) (stable) | ||
20 | - `ubuntu16` - [Ubuntu 16.04 Xenial Xerus](http://releases.ubuntu.com/16.04/) (LTS) | ||
21 | |||
22 | What's behind the curtains: | ||
23 | |||
24 | - each image provides: | ||
25 | - a base Linux OS | ||
26 | - Shaarli PHP dependencies (OS packages) | ||
27 | - test PHP dependencies (OS packages) | ||
28 | - Composer | ||
29 | - the local workspace is mapped to the container's `/shaarli/` directory, | ||
30 | - the files are rsync'd to so tests are run using a standard Linux user account | ||
31 | (running tests as `root` would bypass permission checks and may hide issues) | ||
32 | - the tests are run inside the container. | ||
33 | |||
34 | ### Building test images | ||
35 | |||
36 | ```bash | ||
37 | # build the Debian 9 Docker image | ||
38 | $ cd /path/to/shaarli | ||
39 | $ cd docker/test/debian9 | ||
40 | $ docker build -t shaarli-test:debian9 . | ||
41 | ``` | ||
42 | |||
43 | ### Running tests | ||
44 | |||
45 | ```bash | ||
46 | $ cd /path/to/shaarli | ||
47 | |||
48 | # install/update 3rd-party test dependencies | ||
49 | $ composer install --prefer-dist | ||
50 | |||
51 | # run tests using the freshly built image | ||
52 | $ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_test | ||
53 | |||
54 | # run the full test campaign | ||
55 | $ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_all_tests | ||
56 | ``` | ||
diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md index b02dd149..a9c00b85 100644 --- a/doc/md/docker/docker-101.md +++ b/doc/md/docker/docker-101.md | |||
@@ -60,3 +60,81 @@ wheezy: Pulling from debian | |||
60 | Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe | 60 | Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe |
61 | Status: Downloaded newer image for debian:wheezy | 61 | Status: Downloaded newer image for debian:wheezy |
62 | ``` | 62 | ``` |
63 | |||
64 | Docker re-uses layers already downloaded. In other words if you have images based on Alpine or some Ubuntu version for example, those can share disk space. | ||
65 | |||
66 | ### Start a container | ||
67 | A container is an instance created from an image, that can be run and that keeps running until its main process exits. Or until the user stops the container. | ||
68 | |||
69 | The simplest way to start a container from image is ``docker run``. It also pulls the image for you if it is not locally available. For more advanced use, refer to ``docker create``. | ||
70 | |||
71 | Stopped containers are not destroyed, unless you specify ``--rm``. To view all created, running and stopped containers, enter: | ||
72 | ```bash | ||
73 | $ docker ps -a | ||
74 | ``` | ||
75 | |||
76 | Some containers may be designed or configured to be restarted, others are not. Also remember both network ports and volumes of a container are created on start, and not editable later. | ||
77 | |||
78 | ### Access a running container | ||
79 | A running container is accessible using ``docker exec``, or ``docker copy``. You can use ``exec`` to start a root shell in the Shaarli container: | ||
80 | ```bash | ||
81 | $ docker exec -ti <container-name-or-id> bash | ||
82 | ``` | ||
83 | Note the names and ID's of containers are listed in ``docker ps``. You can even type only one or two letters of the ID, given they are unique. | ||
84 | |||
85 | Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``. | ||
86 | |||
87 | You can view the console output of the main container process too: | ||
88 | ```bash | ||
89 | $ docker logs -f <container-name-or-id> | ||
90 | ``` | ||
91 | |||
92 | ### Docker disk use | ||
93 | Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. | ||
94 | |||
95 | If you care only about trying out docker and not about what is running or saved, the following commands should help you out quickly if you run low on disk space: | ||
96 | |||
97 | ```bash | ||
98 | $ docker rmi -f $(docker images -aq) # remove or mark all images for disposal | ||
99 | $ docker volume rm $(docker volume ls -q) # remove all volumes | ||
100 | ``` | ||
101 | |||
102 | ### Systemd config | ||
103 | Systemd is the process manager of choice on Debian-based distributions. Once you have a ``docker`` service installed, you can use the following steps to set up Shaarli to run on system start. | ||
104 | |||
105 | ```bash | ||
106 | systemctl enable /etc/systemd/system/docker.shaarli.service | ||
107 | systemctl start docker.shaarli | ||
108 | systemctl status docker.* | ||
109 | journalctl -f # inspect system log if needed | ||
110 | ``` | ||
111 | |||
112 | You will need sudo or a root terminal to perform some or all of the steps above. Here are the contents for the service file: | ||
113 | ``` | ||
114 | [Unit] | ||
115 | Description=Shaarli Bookmark Manager Container | ||
116 | After=docker.service | ||
117 | Requires=docker.service | ||
118 | |||
119 | |||
120 | [Service] | ||
121 | Restart=always | ||
122 | |||
123 | # Put any environment you want in an included file, like $host- or $domainname in this example | ||
124 | EnvironmentFile=/etc/sysconfig/box-environment | ||
125 | |||
126 | # It's just an example.. | ||
127 | ExecStart=/usr/bin/docker run \ | ||
128 | -p 28010:80 \ | ||
129 | --name ${hostname}-shaarli \ | ||
130 | --hostname shaarli.${domainname} \ | ||
131 | -v /srv/docker-volumes-local/shaarli-data:/var/www/shaarli/data:rw \ | ||
132 | -v /etc/localtime:/etc/localtime:ro \ | ||
133 | shaarli/shaarli:latest | ||
134 | |||
135 | ExecStop=/usr/bin/docker rm -f ${hostname}-shaarli | ||
136 | |||
137 | |||
138 | [Install] | ||
139 | WantedBy=multi-user.target | ||
140 | ``` | ||
diff --git a/doc/md/index.md b/doc/md/index.md index b10e3cf4..2b7d0f00 100644 --- a/doc/md/index.md +++ b/doc/md/index.md | |||
@@ -22,6 +22,17 @@ It runs the latest development version of Shaarli and is updated/reset daily. | |||
22 | 22 | ||
23 | Login: `demo`; Password: `demo` | 23 | Login: `demo`; Password: `demo` |
24 | 24 | ||
25 | Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For example to start a temporary Shaarli at ``localhost:8000``, and keep session data (config, storage): | ||
26 | ``` | ||
27 | MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) | ||
28 | docker run -ti --rm \ | ||
29 | -p 8000:80 \ | ||
30 | -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ | ||
31 | shaarli/shaarli | ||
32 | ``` | ||
33 | |||
34 | A brief guide on getting starting using docker is given in [Docker 101](docker/docker-101). | ||
35 | To learn more about user data and how to keep it across versions, please see [Upgrade and Migration](Upgrade-and-migration) documentation. | ||
25 | 36 | ||
26 | ## Features | 37 | ## Features |
27 | 38 | ||
@@ -37,7 +48,7 @@ Login: `demo`; Password: `demo` | |||
37 | - daily RSS feed | 48 | - daily RSS feed |
38 | - permalinks for easy reference | 49 | - permalinks for easy reference |
39 | - links can be public or private | 50 | - links can be public or private |
40 | - extensible through [plugins](https://github.com/shaarli/Shaarli/wiki/Plugins#plugin-usage) | 51 | - extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage) |
41 | 52 | ||
42 | ### Tag, view and search your links! | 53 | ### Tag, view and search your links! |
43 | - add a custom title and description to archived links | 54 | - add a custom title and description to archived links |