| app | ||
| config | ||
| embedded | ||
| gup | ||
| src | ||
| static | ||
| templates | ||
| test | ||
| .dir-locals.el | ||
| .dockerignore | ||
| .gitignore | ||
| default.nix | ||
| Dockerfile | ||
| fill-db.hs | ||
| ghci.sh | ||
| models | ||
| package.yaml | ||
| README.md | ||
| routes | ||
| shell.nix | ||
| stack.nix | ||
| stack.yaml | ||
| start.sh | ||
| uniworx.sublime-project | ||
| uniworx.sublime-workspace | ||
Quick Start Guide
Assuming Ubuntu or similar
LDAP
install:
sudo apt-get install slapd ldap-utils
PostgreSQL
install:
sudo apt-get install postgresql
switch to user postgres (got created during installation):
sudo -i -u postgres
add db user uniworx:
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:
createdb uniworx
to access the database as user uniworx you now need to add a new linux-user called uniworx:
sudo adduser uniworx
log-in as new user uniworx:
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:
INSERT INTO user (plugin, ident, matrikelnummer, email, display_name) VALUES ('LDAP', '[YOUR_EMAIL_ADDRESS]', null, '[YOUR_EMAIL_ADDRESS]', '[YOUR_NAME]');
stack
Install with:
curl -sSL https://get.haskellstack.org/ | sh
setup stack and install dependencies:
stack setup
There might be packages missing during setup. You most probably simply need to install them and try again.
Instructions are easy to find via search engine of your choice and the specific error you got.
Example from experience: For LDAP ldab and lber header files were missing.
Build the app:
stack build
Run the app (with environment variable DUMMY_LUGIN set to true):
env DUMMY_LOGIN=true stack exec -- yesod devel
Devel application launched: http://localhost:3000
means you are good to go.
Sources and more infos
PostgreSQl:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
stack:
https://docs.haskellstack.org/en/stable/README/#how-to-install