updated quick start guide in README

This commit is contained in:
Felix Hamann 2018-03-20 19:42:19 +01:00
parent 9f059f9020
commit f13d7ebca6

View File

@ -1,21 +1,24 @@
# Quick Start Guide # Quick Start Guide
Assuming Ubuntu or similar The following Description applies to Ubuntu or similar.
## Clone repository
Clone this repository `git clone https://gitlab.cip.ifi.lmu.de/jost/UniWorX.git` and navigate into the new directory `cd UniWorX`.
## LDAP ## LDAP
install:<br> install:
`sudo apt-get install slapd ldap-utils` `sudo apt-get install slapd ldap-utils`
## PostgreSQL ## PostgreSQL
install:<br> install:
`sudo apt-get install postgresql` `sudo apt-get install postgresql`
switch to user *postgres* (got created during installation):<br> switch to user *postgres* (got created during installation):
`sudo -i -u postgres` `sudo -i -u postgres`
add db user *uniworx*:<br> add db user *uniworx*:
`createuser --interactive` `createuser --interactive`
you'll get a prompt: you'll get a prompt:
@ -24,49 +27,60 @@ Assuming Ubuntu or similar
Shall the new role be a superuser? (y/n)` - [not exactly sure. Guess not?] Shall the new role be a superuser? (y/n)` - [not exactly sure. Guess not?]
``` ```
create database *uniworx*:<br> create database *uniworx*:
`createdb uniworx` `createdb uniworx`
to access the database as user *uniworx* you now need to add a new linux-user called *uniworx*:<br> to access the database as user *uniworx* you now need to add a new linux-user called *uniworx*:
`sudo adduser uniworx` `sudo adduser uniworx`
log-in as new user *uniworx*:<br> log-in as new user *uniworx*:
`sudo -i -u uniworx` `sudo -i -u uniworx`
you can now use `psql uniworx` to execute SQL-commands and such. you can now use `psql uniworx` to execute SQL-commands and such.
you might for example want to add a test-account to be able to login on the page:<br>
`INSERT INTO user (plugin, ident, matrikelnummer, email, display_name) VALUES ('LDAP', '[YOUR_EMAIL_ADDRESS]', null, '[YOUR_EMAIL_ADDRESS]', '[YOUR_NAME]');`
## stack ## stack
Install with:<br> Install with:
`curl -sSL https://get.haskellstack.org/ | sh` `curl -sSL https://get.haskellstack.org/ | sh`
setup stack and install dependencies:<br> setup stack and install dependencies:
`stack setup` `stack setup`
There might be packages missing during setup. You most probably simply need to install them and try again.<br> During this step or the next you might get an error that says something about missing C libraries for `ldap` and `lber`. You can install these using
Instructions are easy to find via search engine of your choice and the specific error you got.<br> `sudo apt-get install libsasl2-dev libldap2-dev`
Example from experience: For LDAP `ldab` and `lber` header files were missing.
Build the app:<br> If you get an error that says *You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.*
`stack build` Go ahead an install `libpq-dev` with
`sudo apt-get install libpq-dev`
Run the app (with environment variable DUMMY_LUGIN set to true):<br> Build the app:
`env DUMMY_LOGIN=true stack exec -- yesod devel` `stack build`
`Devel application launched: http://localhost:3000`<br> This might take a few minutes if not hours... be prepared.
install yesod:
`stack install yesod-bin --install-ghc`
## Add Dumy-Data and run the app
After building the app you can prepare the database and add some dummy data:
`./fill-db.hs`
Run the app:
`./start.sh`
`Devel application launched: http://localhost:3000`
means you are good to go. means you are good to go.
If you followed the steps above you should now be able to login as user Gregor Kleen using `LDAP:g.kleen@ifi.lmu.de` as dummy login.
*** ***
# Sources and more infos # Sources and more infos
PostgreSQl: <br> PostgreSQl:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
stack:<br> https://docs.haskellstack.org/en/stable/README/#how-to-install stack: https://docs.haskellstack.org/en/stable/README/#how-to-install
ldap:<br>https://wiki.ubuntuusers.de/OpenLDAP_ab_Precise/ ldap: https://wiki.ubuntuusers.de/OpenLDAP_ab_Precise/
*** ***