This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2018-03-21 09:59:18 +01:00
app Fix file structure for yesod devel 2017-10-04 14:12:19 +02:00
config Revert: fix development default values 2017-12-08 14:20:09 +01:00
embedded Move files around 2017-10-04 13:59:49 +02:00
gup Nix build harness 2017-10-02 20:17:33 +02:00
messages Sheet Editing/Delete working now 2018-03-19 23:33:59 +01:00
src Datenschutznotizen & Load -> Rational 2018-03-21 09:59:18 +01:00
static Add missing bootstrap file 2017-10-12 02:13:11 +02:00
templates Problem: getrennte get/post Handler funktionieren so nicht. Warum? 2018-03-19 22:57:24 +01:00
test Cleanup 2017-11-15 10:10:24 +01:00
.dir-locals.el Initial PostgreSQL Template 2017-09-11 09:53:42 +02:00
.directory Fixes to Course New/Edit handling. Update not yet working! 2018-03-14 18:34:42 +01:00
.dockerignore Cleanup build & fix development default values 2017-12-08 14:05:05 +01:00
.gitignore TermIdentifier -> TermId in routes 2018-02-19 17:58:55 +01:00
.kateproject Fixes to Course New/Edit handling. Update not yet working! 2018-03-14 18:34:42 +01:00
Datenschutznotizen.txt Datenschutznotizen & Load -> Rational 2018-03-21 09:59:18 +01:00
default.nix Nix build harness 2017-10-02 20:17:33 +02:00
Dockerfile Cleanup build & fix development default values 2017-12-08 14:05:05 +01:00
fill-db.hs Fix fill-db.hs for new model 2018-02-21 13:20:01 +01:00
FragenSJ.txt Datenschutznotizen & Load -> Rational 2018-03-21 09:59:18 +01:00
ghci.sh Make CryptoIDKey implicit using new cryptoids-class 2018-02-09 14:22:01 +01:00
models minor changes toward sheet saving 2018-03-16 09:05:29 +01:00
package.yaml Bump yesod-colonnade 2018-02-21 13:33:28 +01:00
README.md Fixes to Course New/Edit handling. Update not yet working! 2018-03-14 18:34:42 +01:00
routes Problem: getrennte get/post Handler funktionieren so nicht. Warum? 2018-03-19 22:57:24 +01:00
shell.nix Cleanup build 2018-02-21 13:02:27 +01:00
stack.nix Fix build on Nix 2018-01-30 15:09:44 +01:00
stack.yaml Bump yesod-colonnade 2018-02-21 13:33:28 +01:00
start.sh Cleanup 2018-01-13 23:02:08 +01:00
uniworx.sublime-project Initial PostgreSQL Template 2017-09-11 09:53:42 +02:00
uniworx.sublime-workspace termField stub created, needs to be moved to common utils 2017-10-06 11:22:43 +02:00

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_LOGIN 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

ldap:
https://wiki.ubuntuusers.de/OpenLDAP_ab_Precise/


PostgreSQL

Starten als Root:

systemctl start postgresql

find / -name postgresql.conf

cd /var/lib/pgsql/data/

su - postgres

psql -U uniworx -d uniworx -h 127.0.0.1 -w

--Zeige Tabellen \dt

--Zeige Tabellen Inhalt: TABEL "user"; -- Die Anführungszeichen können manchmal weggelassen werden, aber -- bei user sind sie notwendig, da es auch Schlüsselwort in sql ist.

--Lösche Tabelle "course" und alle davon abhängigen: DROP TABLE "course" CASCADE;

-- UserId 5 zum Lecturer in SchoolId 1 machen (27 ist laufende Nummer) INSERT INTO "user_lecturer" (id,"user",school) VALUES (27,5,1);

-- Beenden: \q

-- Hilfe: \help