Skip to content

Lasokki/omanet

Repository files navigation

Opiskelijamajoitus.net

description of the service here

Installation instructions for Ubuntu Server 17.04

Follow these steps to start developing. (Ignore the $ signs – they’re there just to denote the beginning of an unprivileged user’s shell line.)

System upgrade

Make sure you’re running on the latest packages

$ sudo apt-get update && sudo apt-get dist-upgrade -y

External dependencies

$ sudo apt-get install -y postgresql postgresql-server-dev-9.6 haskell-stack git pwgen zlib1g-dev

Download the webapp by cloning this repository

$ git clone https://github.com/Lasokki/omanet.git
$ cd omanet

Set up variables and generate a password

$ ./initialise.py
$ APP_PASSWORD=$(egrep password config/secret.yml | head -1 | cut -d'"' -f 2 | cut -d":" -f 3)
$ APP_USER=$(egrep user config/secret.yml | head -1 | cut -d'"' -f 2 | cut -d":" -f 3)

Configuring postgresql

Create the user and two databases

$ sudo -u postgres createuser $APP_USER
$ sudo -u postgres psql -c "ALTER USER $APP_USER WITH PASSWORD '$APP_PASSWORD';"
$ sudo -u postgres createdb --owner=$APP_USER omanet_dev
$ sudo -u postgres createdb --owner=$APP_USER omanet_test

Stack stuff

Get GHC and build the dependencies

$ stack build yesod-bin cabal-install --install-ghc

If the stack CDN is ultra slow, use sshuttle to proxy your https:

$ sudo apt-get install -y sshuttle
$ sshuttle -r yourusername@an.ssh.host.you.can.connect.to 0.0.0.0/0 -vv

Build the libraries

$ stack build

Run tests

$ stack test

Starting the development server

Launch the development server

$ stack exec -- yesod devel

The first run will do things. After it’s done, press enter to rebuild. Then view your development site at http://localhost:3000/

Adding a new handler

We are building on top of the yesod scaffolding. To add a new handler, quite many places have to be touched. use

$ stack exec -- yesod add-handler

to make it easier.

About

Opiskelijamajoitus.net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors