70 lines
2.0 KiB
Markdown
70 lines
2.0 KiB
Markdown
# Quick Start Guide
|
|
|
|
Assuming Ubuntu or similar
|
|
|
|
## LDAP
|
|
install:<br>
|
|
`sudo apt-get install slapd ldap-utils`
|
|
|
|
|
|
## PostgreSQL
|
|
install:<br>
|
|
`sudo apt-get install postgresql`
|
|
|
|
switch to user *postgres* (got created during installation):<br>
|
|
`sudo -i -u postgres`
|
|
|
|
add db user *uniworx*:<br>
|
|
`createuser --interactive`
|
|
|
|
you'll get a prompt:
|
|
|
|
```
|
|
Enter name of role to add:` - [enter 'uniworx']
|
|
Shall the new role be a superuser? (y/n)` - [not exactly sure. Guess not?]
|
|
```
|
|
|
|
create database *uniworx*:<br>
|
|
`createdb uniworx`
|
|
|
|
to access the database as user *uniworx* you now need to add a new linux-user called *uniworx*:<br>
|
|
`sudo adduser uniworx`
|
|
|
|
log-in as new user *uniworx*:<br>
|
|
`sudo -i -u uniworx`
|
|
|
|
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
|
|
Install with:<br>
|
|
`curl -sSL https://get.haskellstack.org/ | sh`
|
|
|
|
setup stack and install dependencies:<br>
|
|
`stack setup`
|
|
|
|
There might be packages missing during setup. You most probably simply need to install them and try again.<br>
|
|
Instructions are easy to find via search engine of your choice and the specific error you got.<br>
|
|
Example from experience: For LDAP `ldab` and `lber` header files were missing.
|
|
|
|
Build the app:<br>
|
|
`stack build`
|
|
|
|
Run the app (with environment variable DUMMY_LUGIN set to true):<br>
|
|
`env DUMMY_LOGIN=true stack exec -- yesod devel`
|
|
|
|
`Devel application launched: http://localhost:3000`<br>
|
|
means you are good to go.
|
|
|
|
***
|
|
|
|
# Sources and more infos
|
|
PostgreSQl: <br>
|
|
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
|
|
|
|
ldap:<br>https://wiki.ubuntuusers.de/OpenLDAP_ab_Precise/
|