eidolon/README.md

141 lines
4.3 KiB
Markdown
Raw Normal View History

2014-08-09 18:31:58 +00:00
#eidolon
2014-12-26 22:38:25 +00:00
##Introduction
2015-03-28 03:20:29 +00:00
A image gallery service written in Haskell as a yesod webapp.
2014-12-26 22:38:25 +00:00
2015-03-28 03:20:29 +00:00
Visit the test instance at [eidolon.nek0.eu][eidolon]
2015-01-11 17:04:55 +00:00
2014-12-26 22:38:25 +00:00
##Installation
###Dependencies
2015-10-18 02:33:02 +00:00
####Build dependencies
2016-03-02 13:59:28 +00:00
A working Haskell capable environment. For that you will need `haskell-stack` and `cabal-install`, which
you can install with:
2014-12-26 22:38:25 +00:00
2015-10-14 22:53:22 +00:00
```bash
sudo apt-get install haskell-stack cabal-install
```
Shouldn't stack be available through your package repositories you can get it [here][stack].
2016-03-02 13:59:28 +00:00
Now you can set up your stack with `stack setup` and follow its instructions. This will install the
latest GHC Haskell compiler on your system.
2015-10-14 22:53:22 +00:00
update your package list with
```bash
cabal update
```
and upgrade `cabal-install`, if necessary with the command
```bash
cabal install cabal-install
```
Now you should add `~/.cabal/bin` to your `PATH` environment variable.
2014-12-26 22:38:25 +00:00
Additionally to Haskell and its dependencies you will need the following software and libraries:
* alex
* happy
2016-01-05 01:26:20 +00:00
* libpq-dev
* postgresql
2016-05-08 22:09:39 +00:00
* libfftw3-dev
2014-12-26 22:38:25 +00:00
2015-10-14 22:53:22 +00:00
which can be installed through
```bash
cabal install alex happy
2016-01-05 01:26:20 +00:00
sudo apt-get install libmagick++-dev libpq-dev postgresql libmagickwand-dev
2015-10-14 22:53:22 +00:00
```
2015-10-18 02:33:02 +00:00
####Elasticsearch dependencies
2016-03-02 13:59:28 +00:00
Since version 0.0.5 there is an Elasticsearch integration for Eidolon. To Be able to run eidolon , you
need to install `elasticsearch` additionally with:
2015-10-18 02:33:02 +00:00
```bash
sudo apt-get install elasticsearch
```
On how to configure your elasticsearch server, look into the [elasticsearch documentation][elasticdocu].
2014-12-26 22:38:25 +00:00
###Building
get the source with
```bash
git clone https://github.com/nek0/eidolon.git
```
2016-01-05 00:57:32 +00:00
build the source with
2014-12-26 22:38:25 +00:00
```bash
2016-01-05 00:57:32 +00:00
stack build
2014-12-26 22:38:25 +00:00
```
##Deploying
2016-03-02 13:59:28 +00:00
After compiling you will find an executable called `eidolon` in
`.stack-work/dist/<arch>/Cabal-<version>/build/eidolon/`, where `<arch>` is your system architecture and
`<version>` your current cabal version. Copy or link it anywhere you want. The executable needs to be
accompanied by the folders `config` and `static` and their contents. It's best to copy them to your
desired destination.
2014-12-26 22:38:25 +00:00
2016-03-02 13:59:28 +00:00
Also check `config/settings.yml` and set the values there accrding to your configuration. Especially the
settings for elasticsearch are vital.
2014-12-26 22:38:25 +00:00
2016-03-02 13:59:28 +00:00
It may also be necessery to create a reverse proxy to your gallery. I would recommend using
[nginx](http://nginx.org/).
2014-12-26 22:38:25 +00:00
2015-01-18 01:55:49 +00:00
##Customizing
2016-03-02 13:59:28 +00:00
Unfortunately the gallery is not highly customizable, but you can change most of its appearance by
changing the files `static/css/style-*.css`. Especially the default background image can be changed by
replacing `static/css/img/bg.jpg`.
2015-01-18 01:55:49 +00:00
2014-12-26 22:38:25 +00:00
##Starting
2016-03-02 13:59:28 +00:00
You can start the gallery now by running the executable. You need to provide a settings file, normally
found in `config/settings.yml`
2014-12-26 22:38:25 +00:00
2016-03-02 13:59:28 +00:00
Since eidolon will block your console, I recommend wrapping a init-script around it. how you can do that
is written in my [blog](http://nek0.eu/posts/2014-10-23-Daemonize-a-yesod-app.html).
2015-01-18 19:44:41 +00:00
##Migrations
###0.0.3-0.0.4
* do not start or restart your eidolon service before migration
2015-09-28 17:58:49 +00:00
* run migration script from your run location (where your `static` folder with all the images is located)
2016-03-02 13:59:28 +00:00
* if you are building in a sandbox run
`runghc -package-db/full/path/to/sandbox/XXX-ghc-version-packages.conf.d
/path/to/eidolon/Migrations/0.0.3-0.0.4/Migration.hs`
2015-09-28 17:58:49 +00:00
* Note: No space between the option `-package-db` and its argument
* without sandbox: `runghc /path/to/eidolon/Migrations/0.0.3-0.0.4/Migration.hs`
* start or restart your eidolon service
2015-10-18 02:33:02 +00:00
###0.0.4-0.0.5
* run migration script from your run location (where your `static` folder with all the images is located)
2016-03-02 13:59:28 +00:00
* if you are building in a sandbox run `runghc
-package-db/full/path/to/sandbox/XXX-ghc-version-packages.conf.d
/path/to/eidolon/Migrations/0.0.4-0.0.5/Migration.hs`
2015-10-18 02:33:02 +00:00
* Note: No space between the option `-package-db` and its argument
* without sandbox: `runghc /path/to/eidolon/Migrations/0.0.4-0.0.5/Migration.hs`
* start or restart your eidolon service
2015-01-18 19:44:41 +00:00
##Acknowledgements:
2016-03-02 13:59:28 +00:00
* This software uses the web Framework "Yesod" by Michael Snoyman. See more at:
<http://www.yesodweb.com/>
2015-01-18 19:44:41 +00:00
* This software uses parts of the template "Parallelism" by n33co. see more at: <http://html5up.net/>
2015-03-28 03:20:29 +00:00
[eidolon]: http://eidolon.nek0.eu
2015-10-14 22:53:22 +00:00
[stack]: https://github.com/commercialhaskell/stack/releases
2015-10-18 02:33:02 +00:00
[elasticdocu]: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html