Small OCD fixes to documentation

This commit is contained in:
rr- 2016-03-08 21:54:29 +01:00
parent 818d9ac3c8
commit 0a58e12827
2 changed files with 71 additions and 66 deletions

View file

@ -1,28 +1,28 @@
Prerequisites Prerequisites
------------- -------------
In order to run szurubooru, you need to have installed following software: In order to run `szurubooru`, you need to have installed following software:
- Apache2 - `Apache2`
- mod_rewrite - `mod_rewrite`
- mod_mime_magic (recommended) - `mod_mime_magic` (recommended)
- PHP 5.6.0 - `PHP` 5.6.0
- pdo_sqlite - `pdo_sqlite`
- imagick or gd - `imagick` or `gd`
- composer (PHP package manager) - `composer` (`PHP` package manager)
- npm (node.js package manager) - `npm` (`node.js` package manager)
Optional modules: Optional software:
- dump-gnash or swfrender for flash thumbnails - `dump-gnash`, `swfrender` or `ffmpeg` for Flash thumbnails
- ffmpegthumbnailer or ffmpeg for video thumbnails - `ffmpegthumbnailer` or `ffmpeg` for video thumbnails
Fetching dependencies Fetching dependencies
--------------------- ---------------------
To fetch dependencies that szurubooru needs in order to run, enter following To fetch dependencies that `szurubooru` needs in order to run, enter following
commands in the terminal: commands in the terminal:
composer update composer update
@ -30,11 +30,11 @@ commands in the terminal:
Running grunt tasks Running `grunt` tasks
------------------- -------------------
Szurubooru uses grunt to run tasks like database ugprades and tests. In order `szurubooru` uses `grunt` to run tasks like database upgrades and tests. In
to use grunt from the terminal, you can use: order to use `grunt` from the terminal, you can use:
node_modules/grunt-cli/bin/grunt [TASK] node_modules/grunt-cli/bin/grunt [TASK]
@ -43,16 +43,16 @@ administrator:
npm install -g grunt-cli npm install -g grunt-cli
This will add "grunt" to your PATH, making things much more human-friendly. This will add `grunt` to your PATH, making things much more human-friendly.
grunt [TASK] grunt [TASK]
Enabling required modules in PHP Enabling required modules in `PHP`
-------------------------------- ----------------------------------
Enable required modules in php.ini (or other configuration file, depending on Enable required modules in `php.ini` (or other configuration file, depending on
your setup): your setup):
;Linux ;Linux
@ -61,7 +61,7 @@ your setup):
;Windows ;Windows
extension=php_pdo_sqlite.dll extension=php_pdo_sqlite.dll
In order to draw thumbnails, szurubooru needs either imagick or gd2: In order to draw thumbnails, `szurubooru` needs either `Imagick` or `gd2`:
;Linux ;Linux
extension=imagick.so extension=imagick.so
@ -86,12 +86,13 @@ following grunt task in the terminal:
Creating virtual server in Apache Creating virtual server in Apache
--------------------------------- ---------------------------------
In order to make Szurubooru visible in your browser, you need to create a In order to make `szurubooru` visible in your browser, you need to create a
virtual server. This guide focuses on Apache2 web server. Note that although it virtual server. This guide focuses on `Apache` web server. Note that although
should be also possible to host szurubooru with nginx, you'd need to manually it should be also possible to host `szurubooru` with `nginx`, you'd need to
translate the rules inside public_html/.htaccess into nginx configuration. manually translate the rules inside `public_html/.htaccess` into `nginx`
configuration.
Creating virtual server for Apache comes with no surprises, basically all you Creating virtual server for `Apache` comes with no surprises, basically all you
need is the most basic configuration: need is the most basic configuration:
<VirtualHost *:80> <VirtualHost *:80>
@ -99,28 +100,28 @@ need is the most basic configuration:
DocumentRoot /path/to/szurubooru/public_html/ DocumentRoot /path/to/szurubooru/public_html/
</VirtualHost> </VirtualHost>
ServerName specifies the domain under which szurubooru will be hosted. `ServerName` specifies the domain under which `szurubooru` will be hosted.
DocumentRoot should point to the public_html/ directory. `DocumentRoot` should point to the `public_html/` directory.
Enabling required modules in Apache Enabling required modules in Apache
----------------------------------- -----------------------------------
Enable required modules in httpd.conf (or other configuration file, depending Enable required modules in `httpd.conf` (or other configuration file, depending
on your setup): on your setup):
LoadModule rewrite_module mod_rewrite.so ;Linux LoadModule rewrite_module mod_rewrite.so ;Linux
LoadModule rewrite_module modules/mod_rewrite.so ;Windows LoadModule rewrite_module modules/mod_rewrite.so ;Windows
Enable PHP support: Enable `PHP` support:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so ;Linux LoadModule php5_module /usr/lib/apache2/modules/libphp5.so ;Linux
LoadModule php5_module /path/to/php/php5apache2_4.dll ;Windows LoadModule php5_module /path/to/php/php5apache2_4.dll ;Windows
AddType application/x-httpd-php .php AddType application/x-httpd-php .php
PHPIniDir /path/to/php/ PHPIniDir /path/to/php/
Enable MIME auto-detection (not required, but recommended - szurubooru doesn't Enable MIME auto-detection (not required, but recommended - `szurubooru` doesn't
use file extensions, and reporting correct Content-Type to browser is always a use file extensions, and reporting correct Content-Type to browser is always a
good thing): good thing):
@ -140,7 +141,7 @@ good thing):
Creating administrator account Creating administrator account
------------------------------ ------------------------------
By now, you should be able to view szurubooru in the browser. Registering By now, you should be able to view `szurubooru` in the browser. Registering
administrator account is simple - the first user to create an account administrator account is simple - the first user to create an account
automatically becomes administrator and doesn't need e-mail activation. automatically becomes administrator and doesn't need e-mail activation.
@ -149,9 +150,9 @@ automatically becomes administrator and doesn't need e-mail activation.
Overwriting configuration Overwriting configuration
------------------------- -------------------------
Everything that can be configured is stored in data/config.ini file. In order Everything that can be configured is stored in `data/config.ini` file. In order
to make changes there, copy the file and name it local.ini. Make sure you don't to make changes there, copy the file and name it `local`.ini. Make sure you
edit the file itself, especially if you want to contribute. don't edit the file itself, especially if you want to contribute.
@ -165,9 +166,9 @@ smallest possible packages, run following command:
grunt build grunt build
This should create public_html/app.min.js, public_html/app.min.css and This should create `public_html/app.min.js`, `public_html/app.min.css` and
public_html/app.min.html. .htaccess is configured so that if these files exist, `public_html/app.min.html`. `.htaccess` is configured so that if these files
it will load them instead of development environment. To delete these exist, it will load them instead of development environment. To delete these
conveniently, you can run: conveniently, you can run:
grunt clean grunt clean
@ -177,9 +178,9 @@ conveniently, you can run:
Troubleshooting Troubleshooting
--------------- ---------------
1. Problems with Apache virtual servers 1. Problems with `Apache` virtual servers
After reloading Apache configuration, if you find yourself unable to After reloading `Apache` configuration, if you find yourself unable to
connect to the server, make sure that connections are open, for example, connect to the server, make sure that connections are open, for example,
like this: like this:
@ -187,37 +188,38 @@ Troubleshooting
Require all granted Require all granted
</Directory> </Directory>
(Note that Apache versions prior to 2.4 used "Allow from all" directive.) (Note that `Apache` versions prior to 2.4 used `Allow from all` directive.)
Additionally, in order to access virtual host from your machine, make sure Additionally, in order to access the virtual host from your machine, make
the domain name "example.com" supplied in <VirtualHost/> section is sure the domain name `example.com` supplied in `<VirtualHost/>` section is
included in your hosts file (usually /etc/hosts on Linux and included in your `hosts` file (usually `/etc/hosts` on Linux and
C:/windows/system32/drivers/etc/hosts in Windows). `C:/windows/system32/drivers/etc/hosts` on Windows).
If the site doesn't work for you, make sure Apache can parse .htaccess If the site doesn't work for you, make sure `Apache` can parse `.htaccess`
files. If it can't, you need to set AllowOverride option to "yes", for files. If it can't, you need to set `AllowOverride` option to `yes`, for
example by putting following snippet inside <VirtualHost/> section: example by putting following snippet inside the `<VirtualHost/>` section:
<Directory /path/to/szurubooru/public_html/> <Directory /path/to/szurubooru/public_html/>
AllowOverride All AllowOverride All
</Directory> </Directory>
2. Problems with PHP modules or registration 2. Problems with `PHP` modules or registration
Make sure your php.ini path is correct. Make sure all the modules are Make sure your `php.ini` path is correct. Make sure all the modules are
actually loaded by inspecting phpinfo - create small file containing: actually loaded by inspecting results of `phpinfo()` call - create small
file containing:
<?php phpinfo(); ?> <?php phpinfo(); ?>
Then, run it in your browser and inspect the output, looking for missing Then, run it in your browser and inspect the output, looking for missing
modules that were supposed to be loaded. modules that were supposed to be loaded.
3. "Attempt to write to read-only database" 3. `Attempt to write to read-only database`
Make sure Apache has permission to access the database file AND directory Make sure `Apache` has permission to access the database file **and**
it's stored in. (SQLite writes temporary journal files to the parent directory it's stored in. (SQLite writes temporary journal files to the
database directory). If you're the only user of the system, you can run parent database directory). If you're the only user of the system, you can
these commands without worrying too much: run these commands without worrying too much:
chmod 0777 data/ chmod 0777 data/
chmod 0777 data/db.sqlite chmod 0777 data/db.sqlite

View file

@ -5,19 +5,21 @@ szurubooru
## What is it? ## What is it?
Szurubooru is a Danbooru-style board, a gallery where users can upload, browse, `szurubooru` is a Danbooru-style board, a gallery where users can upload,
tag and comment images, video clips and flash animations. browse, tag and comment images, video clips and flash animations.
Its name have its roots in Polish language and has onomatopoeic meaning of Its name have its roots in Polish language and has onomatopoeic meaning of
scraping or scrubbing. It is pronounced *"shoorubooru"* [ˌʃuruˈburu]. scraping or scrubbing. It is pronounced *"shoorubooru"* [ˌʃuruˈburu].
## Licensing ## Licensing
Please see the file named [`LICENSE`](https://github.com/rr-/szurubooru/blob/master/LICENSE). Please see the file named
[`LICENSE`](https://github.com/rr-/szurubooru/blob/master/LICENSE).
## Installation ## Installation
Please see the file named [`INSTALL.md`](https://github.com/rr-/szurubooru/blob/master/INSTALL.md). Please see the file named
[`INSTALL.md`](https://github.com/rr-/szurubooru/blob/master/INSTALL.md).
## Bugs and feature requests ## Bugs and feature requests
@ -29,8 +31,8 @@ please do following:
to your problem, comment on that issue instead of opening a new one. to your problem, comment on that issue instead of opening a new one.
2. If you found an issue and the issue is closed, feel free to reopen it. 2. If you found an issue and the issue is closed, feel free to reopen it.
3. If you're reporting a bug, create an isolated and reproducible scenario. 3. If you're reporting a bug, create an isolated and reproducible scenario.
4. If you're filing a feature request, provide examples - what might be obvious 4. If you're filing a feature request, provide examples - what might be
to you, might not be so obvious to the developers. obvious to you, might not be so obvious to the developers.
## Contributing the code ## Contributing the code
@ -40,22 +42,23 @@ Here are some guidelines on how to contribute:
- Respect coding standards - be consistent with existing code base. - Respect coding standards - be consistent with existing code base.
- Watch your whitespace - don't leave any characters at the end of the lines. - Watch your whitespace - don't leave any characters at the end of the lines.
- Always run tests before pushing. - Always run tests before pushing.
- Before starting, see [`INSTALL.md`](https://github.com/rr-/szurubooru/blob/master/INSTALL.md). - Before starting, see
[`INSTALL.md`](https://github.com/rr-/szurubooru/blob/master/INSTALL.md).
- Use `grunt` to do automatic tasks like minifying Javascript files or running - Use `grunt` to do automatic tasks like minifying Javascript files or running
tests. Run `grunt --help` to see full list of available tasks. tests. Run `grunt --help` to see full list of available tasks.
## API ## API
Szurubooru from version 0.9+ uses REST API. Currently there is no formal `szurubooru` from version 0.9+ uses REST API. Currently there is no formal
documentation; source code behind REST layer lies in `src/Controllers/` documentation; source code behind REST layer lies in `src/Controllers/`
directory. In order to use the API, bear in mind that you need to: directory. In order to use the API, bear in mind that you need to:
1. Have actual user account on the server to do most things (depending on 1. Have actual user account on the server to do most things (depending on
privileges). privileges).
2. Authenticate your requests: 2. Authenticate your requests:
1. Send user credentials to `/auth`. You'll receive authentication token in 1. Send user credentials to `/auth`. You'll receive authentication token in
return. return.
2. Send this token in X-Authorization-Token header on subsequent requests. 2. Send this token in X-Authorization-Token header on subsequent requests.
Developers reserve right to change API at any time with neither prior notice Developers reserve right to change API at any time with neither prior notice
nor keeping backwards compatibility. nor keeping backwards compatibility.