From d3fee4f40b87d18ba8009244e57e2d91c3cd3c6e Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Wed, 23 Aug 2017 01:22:07 +0200 Subject: documentation: update installation instructions for 0.9.1 Signed-off-by: VirtualTam --- doc/md/Download-and-Installation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') 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 **Download our *shaarli-full* archive** to include dependencies. -The current latest released version is `v0.9.0` +The current latest released version is `v0.9.1` Or in command lines: ```bash -$ wget https://github.com/shaarli/Shaarli/releases/download/v0.9.0/shaarli-v0.9.0-full.zip -$ unzip shaarli-v0.9.0-full.zip +$ wget https://github.com/shaarli/Shaarli/releases/download/v0.9.1/shaarli-v0.9.1-full.zip +$ unzip shaarli-v0.9.1-full.zip $ mv Shaarli /path/to/shaarli/ ``` -- cgit v1.2.3 From cc8f572bc063aa1e9d0368c8a8361f15efe04c9b Mon Sep 17 00:00:00 2001 From: Willi Eggeling Date: Sat, 26 Aug 2017 09:40:57 +0200 Subject: migrated Github wiki links to readthedocs --- doc/md/Plugin-System.md | 4 ++-- doc/md/Plugins.md | 2 +- doc/md/index.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'doc') 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__($data, $conf) Parameters: -- data: see [$data section](https://github.com/shaarli/Shaarli/wiki/Plugin-System#plugins-data) +- data: see [$data section](https://shaarli.readthedocs.io/en/master/Plugin-System/#plugins-data) - conf: the `ConfigManager` instance. -For exemple, if my plugin want to add data to the header, this function is needed: +For example, if my plugin want to add data to the header, this function is needed: hook_demo_plugin_render_header 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: #### Third party plugins -See [Community & related software](https://github.com/shaarli/Shaarli/wiki/Community-%26-Related-software#third-party-plugins) +See [Community & related software](https://shaarli.readthedocs.io/en/master/Community-&-Related-software/) diff --git a/doc/md/index.md b/doc/md/index.md index b10e3cf4..24ada6c7 100644 --- a/doc/md/index.md +++ b/doc/md/index.md @@ -37,7 +37,7 @@ Login: `demo`; Password: `demo` - daily RSS feed - permalinks for easy reference - links can be public or private -- extensible through [plugins](https://github.com/shaarli/Shaarli/wiki/Plugins#plugin-usage) +- extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage) ### Tag, view and search your links! - add a custom title and description to archived links -- cgit v1.2.3 From 94c035ff717c4c836bb76109b013ffaa78f64ef1 Mon Sep 17 00:00:00 2001 From: Willi Eggeling Date: Sat, 26 Aug 2017 11:27:18 +0200 Subject: removed doc and code references to magic quotes - removed all references to magic quotes - magic quotes are not supported on PHP >= 5.4 (https://secure.php.net/manual/en/security.magicquotes.php) - Shaarli does not support PHP < 5.5 --- doc/md/Security.md | 3 --- 1 file changed, 3 deletions(-) (limited to 'doc') 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 @@ ## Client browser - 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 -## PHP -- `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. - ## Server and sessions - Directories are protected using `.htaccess` files - Forms are protected against XSRF (Cross-site requests forgery): -- cgit v1.2.3 From 2e07e77573a379f9af006b2c523117eef9fdf9b2 Mon Sep 17 00:00:00 2001 From: Willi Eggeling Date: Sat, 26 Aug 2017 09:27:10 +0200 Subject: new setting: default value for 'remember me' checkbox - the default state for the login page's 'remember me' checkbox can now be configured - adapted the default and vintage theme to consider the new setting - added documentation for the new setting --- doc/md/Shaarli-configuration.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/md/Shaarli-configuration.md b/doc/md/Shaarli-configuration.md index 188a3c09..d90e95eb 100644 --- a/doc/md/Shaarli-configuration.md +++ b/doc/md/Shaarli-configuration.md @@ -91,6 +91,8 @@ _These settings should not be edited_ - **default_private_links**: Check the private checkbox by default for every new link. - **hide_public_links**: All links are hidden while logged out. - **hide_timestamps**: Timestamps are hidden. +- **remember_user_default**: Default state of the login page's *remember me* checkbox + - `true`: checked by default, `false`: unchecked by default ### Feed @@ -192,7 +194,8 @@ _These settings should not be edited_ "privacy": { "default_private_links": true, "hide_public_links": false, - "hide_timestamps": false + "hide_timestamps": false, + "remember_user_default": true }, "thumbnail": { "enable_thumbnails": true, -- cgit v1.2.3 From dc37a482edd7d164de4a0f5458de4c7f65ebc763 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 29 Aug 2017 19:46:23 +0200 Subject: Documentation+Makefile: update AUTHORS generation Fixes https://github.com/shaarli/Shaarli/issues/935 Signed-off-by: VirtualTam --- doc/md/Release-Shaarli.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') 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 ## Increment the version code, update docs, create and push a signed tag +### Update the list of Git contributors +```bash +$ make authors +$ git commit -s -m "Update AUTHORS" +``` + ### Create and merge a Pull Request This one is pretty straightforward ;-) -- cgit v1.2.3 From 27e21231e168e5a2a89563b2538a4f86df24e582 Mon Sep 17 00:00:00 2001 From: Willi Eggeling Date: Thu, 31 Aug 2017 00:39:15 +0200 Subject: added option to redirect all anonymous users to login page - new setting *force_login* added and documented - if both, *force_login* and *hide_public_links* are set to true, all requests (except for the feeds) are redirected to the login page --- doc/md/Shaarli-configuration.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/md/Shaarli-configuration.md b/doc/md/Shaarli-configuration.md index d90e95eb..37486414 100644 --- a/doc/md/Shaarli-configuration.md +++ b/doc/md/Shaarli-configuration.md @@ -90,6 +90,7 @@ _These settings should not be edited_ - **default_private_links**: Check the private checkbox by default for every new link. - **hide_public_links**: All links are hidden while logged out. +- **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page. - **hide_timestamps**: Timestamps are hidden. - **remember_user_default**: Default state of the login page's *remember me* checkbox - `true`: checked by default, `false`: unchecked by default @@ -194,6 +195,7 @@ _These settings should not be edited_ "privacy": { "default_private_links": true, "hide_public_links": false, + "force_login": false, "hide_timestamps": false, "remember_user_default": true }, -- cgit v1.2.3 From d691604080cc920e7d1d7ad5c98f4e3fae779524 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 30 May 2017 23:45:17 +0200 Subject: docker: add alpine,debian,ubuntu test images Relates to https://github.com/shaarli/Shaarli/issues/843 Added: - Makefile target to run commands in a Docker test context - Docker images to run Shaarli test suites: - Alpine 3.6 - Debian 8 - Debian 9 - Ubuntu 16.04 - Documentation Signed-off-by: VirtualTam --- doc/md/Unit-tests-Docker.md | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 doc/md/Unit-tests-Docker.md (limited to 'doc') 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 @@ +## Running tests inside Docker containers + +Read first: + +- [Docker 101](docker/docker-101.md) +- [Docker resources](docker/resources.md) +- [Unit tests](Unit-tests.md) + +### Docker test images + +Test Dockerfiles are located under `docker/tests//Dockerfile`, +and can be used to build Docker images to run Shaarli test suites under common +Linux environments. + +Dockerfiles are provided for the following environments: + +- `alpine36` - [Alpine 3.6](https://www.alpinelinux.org/downloads/) +- `debian8` - [Debian 8 Jessie](https://www.debian.org/DebianJessie) (oldstable) +- `debian9` - [Debian 9 Stretch](https://wiki.debian.org/DebianStretch) (stable) +- `ubuntu16` - [Ubuntu 16.04 Xenial Xerus](http://releases.ubuntu.com/16.04/) (LTS) + +What's behind the curtains: + +- each image provides: + - a base Linux OS + - Shaarli PHP dependencies (OS packages) + - test PHP dependencies (OS packages) + - Composer +- the local workspace is mapped to the container's `/shaarli/` directory, +- the files are rsync'd to so tests are run using a standard Linux user account + (running tests as `root` would bypass permission checks and may hide issues) +- the tests are run inside the container. + +### Building test images + +```bash +# build the Debian 9 Docker image +$ cd /path/to/shaarli +$ cd docker/test/debian9 +$ docker build -t shaarli-test:debian9 . +``` + +### Running tests + +```bash +$ cd /path/to/shaarli + +# install/update 3rd-party test dependencies +$ composer install --prefer-dist + +# run tests using the freshly built image +$ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_test + +# run the full test campaign +$ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_all_tests +``` -- cgit v1.2.3 From 722caa209005a23b0cfba31aa10cd34a45880cec Mon Sep 17 00:00:00 2001 From: Mark Gerarts Date: Sun, 1 Oct 2017 14:19:57 +0200 Subject: Allow setting of a default note title, see #963 --- doc/md/Shaarli-configuration.md | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/md/Shaarli-configuration.md b/doc/md/Shaarli-configuration.md index 37486414..99b25ba7 100644 --- a/doc/md/Shaarli-configuration.md +++ b/doc/md/Shaarli-configuration.md @@ -55,6 +55,7 @@ _These settings should not be edited_ - **links_per_page**: Number of shaares displayed per page. - **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). - **enabled_plugins**: List of enabled plugins. +- **default_note_title**: Default title of a new note. ### Security -- cgit v1.2.3 From 02ff7897c0bcb48521ddd0c494f346b6df275ab4 Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Tue, 3 Oct 2017 00:23:34 +0200 Subject: Added docker quickstart example, with user-data volume --- doc/md/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/md/index.md b/doc/md/index.md index 24ada6c7..5f10227f 100644 --- a/doc/md/index.md +++ b/doc/md/index.md @@ -22,6 +22,18 @@ It runs the latest development version of Shaarli and is updated/reset daily. Login: `demo`; Password: `demo` +Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For an example to start a temporary Shaarli at ``localhost:8000``, and to keeps the data you create (config, storage) during the session: +``` +MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) +docker run -ti --rm \ + -p 8000:80 \ + -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ + shaarli/shaarli +``` + +A brief guide on getting starting using docker is given in [Docker 101](docker/docker-101). + +To learn more about user data and how to keep it across versions, please see [Upgrade and Migration](Upgrade-and-migration) documentation. ## Features -- cgit v1.2.3 From 22a30602cb31f9b1e36aabae4259561625b7ffe3 Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Tue, 3 Oct 2017 00:24:23 +0200 Subject: Docker 101: container start and cleanup --- doc/md/docker/docker-101.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'doc') diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md index b02dd149..d12a1324 100644 --- a/doc/md/docker/docker-101.md +++ b/doc/md/docker/docker-101.md @@ -60,3 +60,40 @@ wheezy: Pulling from debian Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe Status: Downloaded newer image for debian:wheezy ``` + +Docker re-uses layers already downloaded. Iow. if you have only images based on some Alpine or Ubuntu version for example, those can share disk space. + +### Start a container +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. + +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``. + +Note that stopped containers are not destroyed, unless you specify ``--rm``. +To view all created, running and stopped containers, enter: + +```bash +$ docker ps -a +``` + +Some containers may be designed or configured to be restarted, others are not. Note that both network ports and volumes of a container are created on start, and not editable later. + +### Access a running container +A running container is accessible using ``docker exec``, or ``docker copy``. +You can use ``exec`` to start a root shell in the Shaarli container: +```bash +$ docker exec -ti bash +``` +Note the names and ID's of containers are list in ``docker ps``. You an even type only one or two letters of the ID, given they are unique. + +Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``. + +### Docker disk use +Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. + +If you care only about trying out docker and not about what is running or saved, +the following commands should help you out quickly: + +```bash +$ docker rmi -f $(docker images -aq) # remove or mark all images for disposal +$ docker volume rm $(docker volume ls -q) # remove all volumes +``` -- cgit v1.2.3 From 60ed9b8f4142e99114661b5b8a5562aa75bffb48 Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Tue, 3 Oct 2017 00:33:39 +0200 Subject: Typo's, unified structure a bit. - Fixes inevitable typo that crept in. - Removed some blank lines, newlines, to match established whitespace use better. - Minor grammar improvement. --- doc/md/docker/docker-101.md | 12 ++++-------- doc/md/index.md | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md index d12a1324..271dcd5b 100644 --- a/doc/md/docker/docker-101.md +++ b/doc/md/docker/docker-101.md @@ -61,16 +61,14 @@ Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe Status: Downloaded newer image for debian:wheezy ``` -Docker re-uses layers already downloaded. Iow. if you have only images based on some Alpine or Ubuntu version for example, those can share disk space. +Docker re-uses layers already downloaded. Iow. if you have images based only Alpine or some Ubuntu version for example, those can share disk space. ### Start a container 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. 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``. -Note that stopped containers are not destroyed, unless you specify ``--rm``. -To view all created, running and stopped containers, enter: - +Note that stopped containers are not destroyed, unless you specify ``--rm``. To view all created, running and stopped containers, enter: ```bash $ docker ps -a ``` @@ -78,8 +76,7 @@ $ docker ps -a Some containers may be designed or configured to be restarted, others are not. Note that both network ports and volumes of a container are created on start, and not editable later. ### Access a running container -A running container is accessible using ``docker exec``, or ``docker copy``. -You can use ``exec`` to start a root shell in the Shaarli container: +A running container is accessible using ``docker exec``, or ``docker copy``. You can use ``exec`` to start a root shell in the Shaarli container: ```bash $ docker exec -ti bash ``` @@ -90,8 +87,7 @@ Access can also be through one or more network ports, or disk volumes. Both are ### Docker disk use Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. -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 care only about trying out docker and not about what is running or saved, the following commands should help you out quickly: ```bash $ docker rmi -f $(docker images -aq) # remove or mark all images for disposal diff --git a/doc/md/index.md b/doc/md/index.md index 5f10227f..f83d1702 100644 --- a/doc/md/index.md +++ b/doc/md/index.md @@ -22,7 +22,7 @@ It runs the latest development version of Shaarli and is updated/reset daily. Login: `demo`; Password: `demo` -Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For an example to start a temporary Shaarli at ``localhost:8000``, and to keeps the data you create (config, storage) during the session: +Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For an example to start a temporary Shaarli at ``localhost:8000``, and keep the data you create (config, storage) during the session: ``` MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) docker run -ti --rm \ @@ -32,7 +32,6 @@ docker run -ti --rm \ ``` A brief guide on getting starting using docker is given in [Docker 101](docker/docker-101). - To learn more about user data and how to keep it across versions, please see [Upgrade and Migration](Upgrade-and-migration) documentation. ## Features -- cgit v1.2.3 From 62a8b0ff6eafddcd091e3f6676b258f44b5f9e5c Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Tue, 3 Oct 2017 00:57:46 +0200 Subject: Docker-101: added working systemd config example --- doc/md/docker/docker-101.md | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'doc') diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md index 271dcd5b..35a68774 100644 --- a/doc/md/docker/docker-101.md +++ b/doc/md/docker/docker-101.md @@ -84,6 +84,11 @@ Note the names and ID's of containers are list in ``docker ps``. You an even typ Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``. +You can view the console output of the main container process too: +```bash +$ docker logs -f +``` + ### Docker disk use Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. @@ -93,3 +98,45 @@ If you care only about trying out docker and not about what is running or saved, $ docker rmi -f $(docker images -aq) # remove or mark all images for disposal $ docker volume rm $(docker volume ls -q) # remove all volumes ``` + +### SystemD config +Systemd is the process manager of choice on ubuntu. Once you have a ``docker`` service installed, you can add use the following steps to set up Shaarli to run on system start. + +```bash +systemctl enable /etc/systemd/system/docker.shaarli.service +systemctl start docker.shaarli +systemctl status docker.* +journalctl -f # inspect system log if needed +``` + +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: +``` +[Unit] +Description=Shaarli Bookmark Manager Container +After=docker.service +Requires=docker.service + + +[Service] +Restart=always + +# Put any environment you want in here, like $host- or $domainname in this example +EnvironmentFile=/etc/sysconfig/box-environment + +# It's just an example.. +ExecStart=/usr/bin/docker run \ + -p 28010:80 \ + --name ${hostname}-shaarli \ + --hostname shaarli.${domainname} \ + \ + -v /srv/docker-volumes-local/shaarli-data:/var/www/shaarli/data:rw \ + -v /etc/localtime:/etc/localtime:ro \ + \ + shaarli/shaarli:latest + +ExecStop=/usr/bin/docker rm -f ${hostname}-shaarli + + +[Install] +WantedBy=multi-user.target +``` -- cgit v1.2.3 From 2f65b3dd532be9f7a7054095ba3e8fd06be45883 Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Tue, 3 Oct 2017 01:03:27 +0200 Subject: Docker quickstart: one more grammar mistake. Made it a bit more terse. --- doc/md/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/md/index.md b/doc/md/index.md index f83d1702..2b7d0f00 100644 --- a/doc/md/index.md +++ b/doc/md/index.md @@ -22,7 +22,7 @@ It runs the latest development version of Shaarli and is updated/reset daily. Login: `demo`; Password: `demo` -Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For an example to start a temporary Shaarli at ``localhost:8000``, and keep the data you create (config, storage) during the session: +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): ``` MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) docker run -ti --rm \ -- cgit v1.2.3 From df8becac4fc810d78917a9896dc72a1f7b336fb9 Mon Sep 17 00:00:00 2001 From: "B. van Berkum" Date: Fri, 6 Oct 2017 00:25:50 +0200 Subject: Minor docker-101 doc updates, typos fixed #983 --- doc/md/docker/docker-101.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'doc') diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md index 35a68774..a9c00b85 100644 --- a/doc/md/docker/docker-101.md +++ b/doc/md/docker/docker-101.md @@ -61,26 +61,26 @@ Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe Status: Downloaded newer image for debian:wheezy ``` -Docker re-uses layers already downloaded. Iow. if you have images based only Alpine or some Ubuntu version for example, those can share disk space. +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. ### Start a container 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. 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``. -Note that stopped containers are not destroyed, unless you specify ``--rm``. To view all created, running and stopped containers, enter: +Stopped containers are not destroyed, unless you specify ``--rm``. To view all created, running and stopped containers, enter: ```bash $ docker ps -a ``` -Some containers may be designed or configured to be restarted, others are not. Note that both network ports and volumes of a container are created on start, and not editable later. +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. ### Access a running container A running container is accessible using ``docker exec``, or ``docker copy``. You can use ``exec`` to start a root shell in the Shaarli container: ```bash $ docker exec -ti bash ``` -Note the names and ID's of containers are list in ``docker ps``. You an even type only one or two letters of the ID, given they are unique. +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. Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``. @@ -92,15 +92,15 @@ $ docker logs -f ### Docker disk use Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. -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 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: ```bash $ docker rmi -f $(docker images -aq) # remove or mark all images for disposal $ docker volume rm $(docker volume ls -q) # remove all volumes ``` -### SystemD config -Systemd is the process manager of choice on ubuntu. Once you have a ``docker`` service installed, you can add use the following steps to set up Shaarli to run on system start. +### Systemd config +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. ```bash systemctl enable /etc/systemd/system/docker.shaarli.service @@ -120,7 +120,7 @@ Requires=docker.service [Service] Restart=always -# Put any environment you want in here, like $host- or $domainname in this example +# Put any environment you want in an included file, like $host- or $domainname in this example EnvironmentFile=/etc/sysconfig/box-environment # It's just an example.. @@ -128,11 +128,9 @@ ExecStart=/usr/bin/docker run \ -p 28010:80 \ --name ${hostname}-shaarli \ --hostname shaarli.${domainname} \ - \ -v /srv/docker-volumes-local/shaarli-data:/var/www/shaarli/data:rw \ -v /etc/localtime:/etc/localtime:ro \ - \ - shaarli/shaarli:latest + shaarli/shaarli:latest ExecStop=/usr/bin/docker rm -f ${hostname}-shaarli -- cgit v1.2.3