2018-12-10 14:58:39 +01:00
|
|
|
Vervis is still in early development and the build process gets updates once in
|
|
|
|
a while, but this file tries to keep up and list the latest instructions for
|
|
|
|
running a Vervis instance.
|
2016-03-05 04:55:06 +01:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
At the time of writing, you can get a running Vervis instance if you follow the
|
|
|
|
steps below.
|
2016-01-28 15:15:54 +01:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
# (1) System libraries
|
2018-11-29 23:01:12 +01:00
|
|
|
|
2018-05-12 11:42:00 +02:00
|
|
|
Install dependency library development packages. It's very likely you already
|
|
|
|
have them all installed, and if you're missing some, the build process will
|
|
|
|
inform you. But it's still nice to have a list here. The list below isn't a
|
|
|
|
complete list, it's just libraries that people have found missing while
|
|
|
|
building, and let me know.
|
|
|
|
|
|
|
|
- PostgreSQL client library
|
|
|
|
- ZLib
|
2018-12-10 14:58:39 +01:00
|
|
|
- libssl
|
2018-05-12 11:42:00 +02:00
|
|
|
|
|
|
|
On Debian based distros, installation can be done like this:
|
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
$ sudo apt install libpq-dev zlib1g-dev libssl-dev
|
|
|
|
|
|
|
|
# (2) The Stack build tool
|
2018-05-12 11:42:00 +02:00
|
|
|
|
|
|
|
Install stack. To install stack, go to its [website](https://haskellstack.org)
|
2018-12-10 14:58:39 +01:00
|
|
|
and follow the instructions.
|
|
|
|
|
|
|
|
# (3) Version control systems Darcs and Git
|
2018-03-24 16:09:22 +01:00
|
|
|
|
|
|
|
Install Darcs. You can grab it from your distro, e.g.:
|
|
|
|
|
|
|
|
$ sudo apt install darcs
|
|
|
|
|
|
|
|
If you're going to create a Git repository on Vervis, you'll need Git too, you
|
|
|
|
can install it from a distro package too, e.g.:
|
|
|
|
|
|
|
|
$ sudo apt install git
|
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
# (4) The Vervis source code
|
|
|
|
|
2018-03-24 16:09:22 +01:00
|
|
|
Clone the Vervis repo:
|
|
|
|
|
2018-06-11 14:39:06 +02:00
|
|
|
$ darcs clone https://dev.angeley.es/s/fr33domlover/r/vervis
|
2016-01-28 15:15:54 +01:00
|
|
|
$ cd vervis
|
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
Clone dependency libraries:
|
2018-05-14 17:19:58 +02:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
$ ./clone-deps.sh
|
2018-05-14 17:19:58 +02:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
# (5) Configuration and database
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2016-03-07 01:33:59 +01:00
|
|
|
Generate a new SSH key with a blank password:
|
|
|
|
|
2016-03-07 01:37:07 +01:00
|
|
|
$ ssh-keygen -t rsa -f config/ssh-host-key
|
2016-03-07 01:33:59 +01:00
|
|
|
|
2016-03-06 12:58:48 +01:00
|
|
|
Install PostgreSQL. You'll need the server and the client library development
|
|
|
|
files.
|
|
|
|
|
2018-11-28 09:20:45 +01:00
|
|
|
$ sudo apt install postgresql libpq-dev
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-04-01 00:29:00 +02:00
|
|
|
Switch to `postgres` system user:
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-04-01 00:29:00 +02:00
|
|
|
$ sudo su - postgres
|
|
|
|
|
|
|
|
Create a PostgreSQL user.
|
|
|
|
|
|
|
|
With password:
|
|
|
|
|
|
|
|
$ createuser --no-createdb --no-createrole --no-superuser --encrypted --pwprompt vervis
|
|
|
|
|
|
|
|
No password (if you run Vervis as a user by the same name as the DB user):
|
|
|
|
|
|
|
|
$ createuser --no-createdb --no-createrole --no-superuser vervis
|
|
|
|
|
|
|
|
Create a PostgreSQL database:
|
|
|
|
|
|
|
|
$ createdb --encoding=UTF8 --owner=vervis vervis
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-04-01 00:40:32 +02:00
|
|
|
Update the settings to specify correct database connection details and other
|
|
|
|
settings.
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-04-01 00:40:32 +02:00
|
|
|
$ cp config/settings-default.yaml config/settings.yml
|
2018-03-24 16:09:22 +01:00
|
|
|
$ vim config/settings.yml
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
# (6) GHC Haskell compiler
|
|
|
|
|
|
|
|
`stack` can automatically install the correct GHC version for you, in an
|
|
|
|
isolated location that doesn't conflict with any system packages. Unless you
|
|
|
|
have a specific reason to get GHC in some other way, getting it through `stack`
|
|
|
|
is recommended.
|
|
|
|
|
|
|
|
If you'd like to install GHC manually (from a distro package, from a PPA,
|
|
|
|
etc.), this is the time to do so. And I trust you to arrange things such that
|
|
|
|
`stack` uses your manually download GHC. Otherwise, simply proceed to the next
|
|
|
|
step.
|
|
|
|
|
|
|
|
# (7) Build Vervis
|
|
|
|
|
|
|
|
Build. This will also automatically install GHC.
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-03-24 16:09:22 +01:00
|
|
|
$ stack build
|
2016-03-06 12:58:48 +01:00
|
|
|
|
2018-12-10 14:58:39 +01:00
|
|
|
# (8) Development and deployment
|
|
|
|
|
2018-10-25 22:28:06 +02:00
|
|
|
For convenience, at least on actual deployments, you may wish to run the Vervis
|
|
|
|
SSH server on port 22, so that people don't have to specify a custom port. For
|
|
|
|
that to work, the user that runs the Vervis server needs to get permission to
|
|
|
|
bind to ports below 1024. There are several ways to do that. One of them is to
|
|
|
|
use file capabilities to give the Vervis executable the permission to bind to
|
|
|
|
such ports (if you prefer not to trust the code, try one of the other methods,
|
|
|
|
such as sudo):
|
|
|
|
|
|
|
|
$ sudo setcap CAP_NET_BIND_SERVICE=+ep `stack exec which vervis`
|
|
|
|
|
2016-03-06 12:58:48 +01:00
|
|
|
Run.
|
|
|
|
|
|
|
|
$ stack exec vervis
|
2016-01-28 15:15:54 +01:00
|
|
|
|
2018-03-24 16:09:22 +01:00
|
|
|
Browse to `http://localhost:3000` and have fun!
|
|
|
|
|
|
|
|
`yesod devel` is another way to run the application, useful for rapid
|
|
|
|
development, but I haven't been using it and I'm not sure it works, possibly I
|
|
|
|
broke something along the way. But feel free to try!
|
2018-12-10 14:58:39 +01:00
|
|
|
|
|
|
|
I have a little script for deploying Vervis on my server. I just haven't
|
|
|
|
published it yet and haven't explained how it works. If you're interested, ask
|
|
|
|
me about it, and it will motivate me to write about it sooner :)
|