diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 395f109..7d8f7da 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,33 +1,43 @@
# How to contribute
-We are really glad you're reading this, because all the contributions to this project are helpful.
+We are really glad you're reading this, because all the contributions to this
+project are helpful.
-If you haven't already, please open an issue. We will talk about your idea and we want you working on things you're excited about.
+If you haven't already, please open an issue. We will talk about your idea and
+we want you working on things you're excited about.
Here are some important resources:
-* [The official documentation](https://www.sonerezh.bzh/docs/en/)
-* [Our roadmap](https://roadmap.sonerezh.bzh/b/eCuz4jyhwjmxpxX8C/sonerezh-roadmap)
+* [The official documentation]
## Submitting changes
-Please send a [GitHub Pull Request to Sonerezh](https://github.com/Sonerezh/sonerezh/pull/new/development) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). Please, be sure you work on the ``development`` branch before ask for merge.
+Please send a [GitHub Pull Request to Sonerezh] with a clear list of what you've
+done (read more about [pull requests]).
-Always write a clear log message for your commits. One-line message are fine for small changes, but bigger changes should look like this:
+Always write a clear log message for your commits. One-line message are fine for
+small changes, but bigger changes should look like this:
$ git commit -m "A brief summary of the commit
>
> A paragaph describing what changed and its impact."
-The branch ``master`` is used for production and for new releases. All the development is done on the branch ``development``.
-
## Coding convention
-Start reading our code and you'll get the hang of it. We optimize for readability:
+Start reading our code and you'll get the hang of it. We optimize for
+readability:
* We indent using four spaces (no tabs)
-* As Sonerezh is built with CakePHP, we follow [their conventions](http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html)
-* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.
+* As Sonerezh is built with CakePHP, we follow [their conventions]
+* This is open source software. Consider the people who will read your code, and
+ make it look nice for them. It's sort of like driving a car: Perhaps you love
+ doing donuts when you're alone, but with passengers the goal is to make the
+ ride as smooth as possible.
Thanks,
-Guillaume and Thomas
\ No newline at end of file
+Guillaume and Thomas
+
+[The official documentation]: (https://www.sonerezh.bzh)
+[GitHub Pull Request to Sonerezh]: (https://github.com/Sonerezh/sonerezh/pulls)
+[pull requests]: (http://help.github.com/pull-requests/)
+[their conventions]: (http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html)
\ No newline at end of file
diff --git a/README.md b/README.md
index 3aa7200..b244dc2 100755
--- a/README.md
+++ b/README.md
@@ -1,17 +1,20 @@
-Sonerezh
-========
+# Sonerezh
-A self-hosted, web-based application to stream your music, everywhere.
+Sonerezh is a self-hosted web application which allows you to listen to your
+music, from anywhere.
-Some Handy Links
-----------------
+All you have to do is to specify where your music is stored, and Sonerezh will
+build its database based on the audio file's metadata. Then you can browse your
+music library through a simple and intuitive Web UI.
-[Sonerezh official website](https://www.sonerezh.bzh).
+Let's try the latest version on [sonerezh.bzh/demo]!
-[Sonerezh documentation](https://www.sonerezh.bzh/docs/).
+Follow us on [Twitter] if you like the project, and don't forget to [support it
+making a donation].
-[Sonerezh source code, on GitHub](https://github.com/sonerezh/sonerezh).
+The documentation is available on [sonerezh.bzh].
-[Sonerezh on Twitter](https://twitter.com/snrzh).
-
-Don't forget to [support us](https://www.sonerezh.bzh/support) !
+[sonerezh.bzh/demo]: (https://www.sonerezh.bzh/demo/login)
+[Twitter]: (https://twitter.com/snrzh)
+[support it making a donation]: (https://www.sonerezh.bzh/donate)
+[sonerezh.bzh]: (https://www.sonerezh.bzh)
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..70cfc24
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,36 @@
+# Sonerezh documentation
+
+This is the documentation for the Sonerezh project.
+
+## How to build it
+
+The documentation is built with [MkDocs], a static site generator that's geared
+towards building project documentation.
+
+Documentation source files are written in Markdown, and configured with a
+single YAML configuration file.
+
+### Install MkDocs
+
+On Debian or Ubuntu platforms, just run:
+
+```text
+$ pip install mkdocs
+```
+
+### Get the documentation and contribute
+
+Clone this repository wherever you want to, and start writing.
+
+```text
+$ git clone https://github.com/Sonerezh/sonerezh.git
+$ cd sonerezh
+$ mkdocs serve
+```
+
+Then MkDocs builds the doc, and serves it on ``http://127.0.0.1:8000``.
+
+_Note: the Sonerezh theme for MkDocs just replaces the Google Analytics header
+with Matomo (formerly Piwik)_
+
+[MkDocs]: (https://www.mkdocs.org)
diff --git a/docs/about/license.md b/docs/about/license.md
new file mode 100644
index 0000000..f3a3ea6
--- /dev/null
+++ b/docs/about/license.md
@@ -0,0 +1,11 @@
+# License
+
+Legal stuff.
+
+---
+
+## Sonerezh license (AGPL-3.0)
+
+Sonerezh is generously offered under the GNU Affero General Public License v3.0.
+
+[View license](https://github.com/Sonerezh/sonerezh/blob/master/LICENCE.txt).
diff --git a/docs/css/style.css b/docs/css/style.css
new file mode 100644
index 0000000..76e4f5b
--- /dev/null
+++ b/docs/css/style.css
@@ -0,0 +1,25 @@
+@font-face {
+ font-family:'Glyphicons Halflings';
+ src:url("../fonts/glyphicons-halflings-regular.eot");
+ src:url("../fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/glyphicons-halflings-regular.woff2") format("woff2"), url("../fonts/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/glyphicons-halflings-regular.ttf") format("truetype"), url("../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
+}
+
+div.col-md-9 h1:first-of-type {
+ text-align: center;
+}
+
+div.col-md-9>p:first-of-type {
+ text-align: center;
+}
+
+.icon {
+ font-family:'Glyphicons Halflings';
+}
+
+.icon.heart::before {
+ content:"\e005";
+}
+
+footer .icon {
+ color:red;
+}
diff --git a/docs/downloads/empty b/docs/downloads/empty
new file mode 100644
index 0000000..e69de29
diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot
new file mode 100755
index 0000000..b93a495
Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.eot differ
diff --git a/docs/fonts/glyphicons-halflings-regular.svg b/docs/fonts/glyphicons-halflings-regular.svg
new file mode 100755
index 0000000..94fb549
--- /dev/null
+++ b/docs/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,288 @@
+
+
+
\ No newline at end of file
diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf
new file mode 100755
index 0000000..1413fc6
Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.ttf differ
diff --git a/docs/fonts/glyphicons-halflings-regular.woff b/docs/fonts/glyphicons-halflings-regular.woff
new file mode 100755
index 0000000..9e61285
Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff differ
diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2
new file mode 100755
index 0000000..64539b5
Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff2 differ
diff --git a/docs/img/install.png b/docs/img/install.png
new file mode 100644
index 0000000..180f3e1
Binary files /dev/null and b/docs/img/install.png differ
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..d47a4cf
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,91 @@
+# Sonerezh
+
+A self-hosted, web-based application to stream your music, everywhere.
+
+---
+
+## Overview
+
+Sonerezh is a self-hosted, web-based audio streaming application allowing you
+to access your music from anywhere, using your favorite web browser.
+
+**Automatic import**
+
+Tell Sonerezh where your music is stored and that's all. It will parse and
+extract the metadata of each files to built its own database. We currently
+support MP3 and MP4, OGG/Vorbis (.ogg and .flac) files.
+
+**Beautiful Web-UI**
+
+Browse you favorite music through several beautiful views, sort your collection
+by band, album, date, etc.
+
+**2-clicks installation**
+
+Sonerezh is easy to install thanks to its automatic deployment tool. No
+headaches with configuration files.
+
+---
+
+## Installation
+
+Sonerezh is quite easy to install. All you need is:
+
+- A web server (Apache2, Nginx...)
+- PHP, with the following modules enabled: ``php-mysql`` and ``php-gd``
+ (with ``exif.so``)
+- A database (MySQL or MariaDB)
+- Optionally ``avconv`` or ``ffmpeg`` if you plan to use the conversion tool
+
+!!! Note
+
+ This documentation will **NOT** cover the installation of NGINX or PHP. A lot
+ of tutorials are already available on the web.
+
+ However, configuration samples are available for NGINX or Apache.
+
+### Get the latest stable release
+
+The releases are published on [GitHub], but you should download the latest
+stable release from _sonerezh.bzh_.
+
+```sh
+# Replace tar.gz with zip if needed.
+$ wget https://www.sonerezh.bzh/downloads/latest.tar.gz
+$ tar -zxf latest.tar.gz
+```
+
+### Prepare the database
+
+The database must be created before you access Sonerezh for the first time.
+A simple setup could be:
+
+```sql
+$ mysql -u root -p
+mysql> CREATE DATABASE sonerezh;
+mysql> GRANT ALL PRIVILEGES ON sonerezh.* TO 'sonerezh'@'localhost' IDENTIFIED BY '';
+mysql> FLUSH PRIVILEGES;
+exit;
+```
+
+Where ```` is the password used by the MySQL user.
+
+---
+
+## Getting started
+
+You may want to allow the web server system account to read this directory.
+Usually its ``www-data``.
+
+```sh
+$ sudo chown -R www-data: sonerezh
+```
+
+Now you can go to ``http://127.0.0.1/install`` (or whatever configured domain
+name) to set the database settings and create the first user.
+
+![Screenshot](img/install.png)
+
+If all goes well you should be redirected to the login page.
+
+[GitHub]: (https://github.com/Sonerezh/sonerezh/releases)
diff --git a/docs/sonerezh_theme/base.html b/docs/sonerezh_theme/base.html
new file mode 100644
index 0000000..b6c2c29
--- /dev/null
+++ b/docs/sonerezh_theme/base.html
@@ -0,0 +1,220 @@
+
+
+
+ {%- block site_meta %}
+
+
+
+ {% if page and page.is_homepage %}{% endif %}
+ {% if config.site_author %}{% endif %}
+ {% if page and page.canonical_url %}{% endif %}
+ {% if config.site_favicon %}
+ {% else %}{% endif %}
+ {%- endblock %}
+
+ {%- block htmltitle %}
+ {% if page and page.title and not page.is_homepage %}{{ page.title }} - {% endif %}{{ config.site_name }}
+ {%- endblock %}
+
+ {%- block styles %}
+
+
+
+ {%- if config.theme.highlightjs %}
+
+ {%- endif %}
+ {%- for path in config['extra_css'] %}
+
+ {%- endfor %}
+ {%- endblock %}
+
+ {%- block libs %}
+
+
+
+
+
+ {%- if config.theme.highlightjs %}
+
+ {%- for lang in config.theme.hljs_languages %}
+
+ {%- endfor %}
+
+ {%- endif %}
+ {%- endblock %}
+
+ {%- block analytics %}
+ {%- if config.matomo_analytics %}
+
+
+
+ {%- endif %}
+ {%- endblock %}
+
+ {%- block extrahead %} {% endblock %}
+
+
+
+
+
+
+
+
+
+ {%- if nav|length>1 or (page and (page.next_page or page.previous_page)) or config.repo_url %}
+
+
+ {%- endif %}
+
+ {%- block site_name %}
+ {{ config.site_name }}
+ {%- endblock %}
+
+
+
+
+{%- block scripts %}
+
+
+{%- for path in config['extra_javascript'] %}
+
+{%- endfor %}
+{%- endblock %}
+
+{% if 'search' in config['plugins'] %}{%- include "search-modal.html" %}{% endif %}
+{%- include "keyboard-modal.html" %}
+
+
+
+{% if page and page.is_homepage %}
+
+{% endif %}
diff --git a/docs/user-guides/apache-virtual-host.md b/docs/user-guides/apache-virtual-host.md
new file mode 100644
index 0000000..ec10d91
--- /dev/null
+++ b/docs/user-guides/apache-virtual-host.md
@@ -0,0 +1,29 @@
+# Apache virtual host
+
+This is a minimalist configuration sample for Apache2.
+
+```apacheconfig
+
+ ServerName demo.sonerezh.bzh
+ DocumentRoot /var/www/sonerezh
+
+
+ Options -Indexes
+ AllowOverride All
+
+ # Apache 2.2.x
+
+ Order Allow,Deny
+ Allow from all
+
+
+ # Apache 2.4.x
+
+ Require all granted
+
+
+
+ CustomLog /var/log/apache2/demo.sonerezh.bzh-access.log "Combined"
+ ErrorLog /var/log/apache2/demo.sonerezh.bzh-error.log
+
+```
\ No newline at end of file
diff --git a/docs/user-guides/cli-tool.md b/docs/user-guides/cli-tool.md
new file mode 100644
index 0000000..e49d0c1
--- /dev/null
+++ b/docs/user-guides/cli-tool.md
@@ -0,0 +1,59 @@
+# Command-line tool
+
+A simple tool available for automation.
+
+---
+
+Since version 1.1.0, a command-line tool is available to process big music
+libraries or add some automation. This tool is built on the [CakePHP Shell] and
+can be used as below.
+
+## Import songs with the CLI
+
+The CLI can be used to import a single audio file:
+
+```text
+sonerezh/app $ Console/cake sonerezh import /home/user/Music/file.mp3
+Welcome to CakePHP v2.8.1 Console
+---------------------------------------------------------------
+App : app
+Path: /var/www/sonerezh/app/
+---------------------------------------------------------------
+[INFO] You asked to import /home/user/Music/file.mp3. Continue? (yes/no)
+[yes] >
+[INFO] Run import: [100%] [#############################################]
+```
+
+It can also scan a directory:
+
+```text
+sonerezh/app $ Console/cake sonerezh import /home/user/Music/an-album
+Welcome to CakePHP v2.8.1 Console
+---------------------------------------------------------------
+App : app
+Path: /var/www/sonerezh/app/
+---------------------------------------------------------------
+[INFO] Scan /home/user/Music/an-album...
+[INFO] Found 13 audio files (0 already in the database). Continue? (yes/no)
+[yes] >
+[INFO] Run import: [100%] [#############################################]
+```
+
+Or you can scan a complete folder tree using the ``--recursive`` option:
+
+```text
+sonerezh/app $ Console/cake sonerezh import -r /home/user/Music
+Welcome to CakePHP v2.8.1 Console
+---------------------------------------------------------------
+App : app
+Path: /var/www/sonerezh/app/
+---------------------------------------------------------------
+[INFO] Scan /home/user/Music...
+[INFO] Found 614 audio files (13 already in the database). Continue? (yes/no)
+[yes] >
+[INFO] Run import: [100%] [#############################################]
+```
+
+The imported files are immediately available on the web interface.
+
+[CakePHP Shell]: http://book.cakephp.org/2.0/en/console-and-shells.html
\ No newline at end of file
diff --git a/docs/user-guides/how-to-upgrade.md b/docs/user-guides/how-to-upgrade.md
new file mode 100644
index 0000000..3abd272
--- /dev/null
+++ b/docs/user-guides/how-to-upgrade.md
@@ -0,0 +1,44 @@
+# Upgrading
+
+Just install it again…
+
+---
+
+We do not provide any automation tool to upgrade Sonerezh. The most efficient
+way is to move your existent installation to another directory
+(``sonerezh.old`` for instance), make a fresh installation and copy some
+configuration data from the old directory.
+
+Let's suppose our current installation is located into ``/srv/sonerezh``. First,
+we rename it.
+
+```text
+$ mv /src/sonerezh /srv/sonerezh.old
+```
+
+Then we can download the latest release and _untar_ it.
+
+```text
+$ wget https://www.sonerezh.bzh/downloads/latest.tar.gz
+$ tar -zxf latest.tar.gz
+```
+
+We need to copy:
+
+- The database configuration file (``database.php``)
+- The album artworks, and the user's avatars
+- If you used the email function, the email configuration files (``email.php``)
+
+```text
+$ cp -a /srv/sonerezh.old/app/Config/database.php /srv/sonerezh/app/Config/database.php
+$ cp -a /srv/sonerezh.old/webroot/img/thumbnails /srv/sonerezh.old/webroot/img/
+$ cp -a /srv/sonerezh.old/webroot/img/resized /srv/sonerezh.old/webroot/img/
+$ cp -a /srv/sonerezh.old/webroot/img/avatars /srv/sonerezh.old/webroot/img/
+$ cp -a /srv/sonerezh.old/app/Config/email.php /srv/sonerezh/app/Config/email.php
+```
+
+Don't forget to check the permissions on the new folders.
+
+```text
+$ chown -R www-data: /srv/sonerezh
+```
\ No newline at end of file
diff --git a/docs/user-guides/nginx-server-block.md b/docs/user-guides/nginx-server-block.md
new file mode 100644
index 0000000..ef78319
--- /dev/null
+++ b/docs/user-guides/nginx-server-block.md
@@ -0,0 +1,82 @@
+# NGINX server-block
+
+This is a minimalist configuration sample for NGINX.
+
+```nginx
+upstream php-fpm {
+ server unix:/var/run/php-fpm.sock;
+}
+
+server {
+ listen 80;
+ server_name demo.sonerezh.bzh;
+ root /var/www/sonerezh/app/webroot;
+
+ index index.php;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ expires 14d;
+ add_header Cache-Control 'public';
+ }
+
+ # The section below handle the thumbnails cache, on the client (browser)
+ # side (optional but recommended)
+ location ~* /([^/]+_[0-9]+x[0-9]+(@[0-9]+x)?\.[a-z]+)$ {
+ try_files /img/resized/$1 /index.php?$args;
+ add_header Cache-Control 'public';
+ expires 14d;
+ access_log off;
+ }
+
+ location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_index index.php;
+ fastcgi_pass php-fpm;
+ include fastcgi.conf;
+
+ # If fastcgi.conf is not available on your platform you may want to
+ # uncomment the following line
+ #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+}
+```
+
+To run Sonerezh on a subfolder instead of a subdomain, here is an other example.
+
+```nginx
+upstream php-fpm {
+ server unix:/var/run/php-fpm.sock;
+}
+
+server {
+ listen 80;
+ server_name demo.sonerezh.bzh/sonerezh;
+
+ index index.php;
+
+ location /sonerezh/ {
+ alias /var/www/sonerezh/app/webroot/;
+ try_files $uri $uri/ /sonerezh//sonerezh/index.php?$args;
+
+ # The section below handle the thumbnails cache, on the client (browser)
+ # side (optional but recommended)
+ location ~* /([^/]+_[0-9]+x[0-9]+(@[0-9]+x)?\.[a-z]+)$ {
+ try_files /img/resized/$1 /index.php?$args;
+ add_header Cache-Control 'public';
+ expires 14d;
+ access_log off;
+ }
+
+ location ~ ^/sonerezh/(.+\.php)$ {
+ alias /var/www/sonerezh/app/webroot/$1;
+ fastcgi_pass php-fpm;
+ include fastcgi.conf;
+
+ # If fastcgi.conf is not available on your platform you may want to
+ # uncomment the following line
+ #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+}
+```
diff --git a/docs/user-guides/settings.md b/docs/user-guides/settings.md
new file mode 100644
index 0000000..48f5681
--- /dev/null
+++ b/docs/user-guides/settings.md
@@ -0,0 +1,74 @@
+# Settings Reference
+
+Guide to all available configuration settings.
+
+---
+
+## About the configuration
+
+The settings can be configured on the ``/settings`` page. You will find some
+statistics related to the current installation and buttons used to manage the
+database and the caches.
+
+### Music root directory
+
+Here you can specify the absolute path of the folder in which Sonerezh must look
+for your music.
+
+!!! Note
+
+ Make sure Sonerezh can read this folder recursively.
+
+!!! Warning
+
+ We strongly recommend to **NOT** store any audio file into the Sonerezh
+ application directory.
+
+### Email notifications
+
+Sonerezh can send email to new users, or allow them to retrieve a forgotten
+password. Make sure PHP can send emails before enable this option.
+
+Just like the database configuration, email configuration can be centralized in
+a class called ``EmailConfig``, in ``app/Config/email.php``. The
+``app/Config/email.php.default`` has an example for this file.
+
+You can follow the [official CakePHP documentation] to configure the different
+transport methods to send email. The following configuration should work in most
+cases (if you already have a MTA available).
+
+```php
+class EmailConfig {
+ public $default = array(
+ 'transport' => 'Mail',
+ 'from' => 'no-reply@sonerezh.bzh',
+ 'charset' => 'utf-8',
+ 'headerCharset' => 'utf-8',
+ );
+}
+```
+
+In this example, Sonerezh will send email using the PHP function ``mail()``.
+
+### Automatic track conversion
+
+If your library contains tracks which can not be read by your browser, Sonerezh
+can convert them to OGG/Vorbis or MP3.
+
+!!! Note
+
+ Sonerezh requires ``avconv`` or ``ffmpeg`` to convert the tracks.
+
+### Database management
+
+The settings page allows you to make some maintenance operations on Sonerezh,
+its database and its caches:
+
+* Database update: run the import process. Useful if you have recently added new
+ songs
+* Clear the cache : empty the cache (converted tracks and resized covers)
+* Reset the database : reset the database. All songs and playlists
+ **WILL BE LOST**. Don't panic, Sonerezh will never modify or delete any file
+ on the filesystem
+
+[official CakePHP documentation]: http://book.cakephp.org/2.0/en/core-utility-libraries/email.html
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..d55b711
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,35 @@
+site_name: Sonerezh
+site_url: https://www.sonerezh.bzh
+site_description: The Sonerezh project documentation.
+site_author: The Sonerezh team.
+
+repo_url: https://github.com/Sonerezh/sonerezh
+
+nav:
+- Home: index.md
+- User Guides:
+ - How-to upgrade: user-guides/how-to-upgrade.md
+ - Command-line Tool: user-guides/cli-tool.md
+ - Settings Reference: user-guides/settings.md
+ - Nginx server-block: user-guides/nginx-server-block.md
+ - Apache virtual host: user-guides/apache-virtual-host.md
+- About:
+ - License: about/license.md
+- Download Sonerezh: downloads/latest.tar.gz
+- Demo: demo/
+
+extra_css:
+- css/style.css
+
+theme:
+ name: mkdocs
+ custom_dir: docs/sonerezh_theme/
+
+matomo_analytics: 1
+
+use_directory_urls: false
+
+markdown_extensions:
+- admonition
+
+copyright: 'Made in Brittany (FR) with by Guillaume & Thomas - hey [at] sonerezh [dot] bzh'