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
Gregor Kleen 7544d2fc34 Merge branch 'master' into 'live'
Revert setting modal non-scrolling

See merge request !102
2018-11-20 19:35:05 +01:00
.vscode Single submission assign corrector 2018-11-12 17:12:24 +01:00
app Fix build 2018-10-13 16:48:11 +02:00
config environmental instance id 2018-11-15 12:16:35 +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
hlint Fix some hlint 2018-11-02 00:25:44 +01:00
messages SheetCorrectorSubmissionsTip 2018-11-19 14:47:33 +01:00
src Fix #235 2018-11-19 14:26:31 +01:00
static get rid of glyphicons 2018-07-01 23:02:03 +02:00
templates Revert setting modal non-scrolling 2018-11-20 19:28:28 +01:00
test Refactor db.hs 2018-11-09 16:12:30 +01:00
testdata Bugfix: deletion deletes files now. 2018-10-17 14:49:53 +02: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 Fixes #223, number of submission buddies, no longer ignore .vscode 2018-11-09 10:01:39 +01:00
.hlint.yaml Address hlint 2018-11-02 19:57:42 +01:00
build.sh Fix build 2018-10-31 15:10:06 +01:00
ChangeLog.md Ratings are now validated, some refactoring 2018-11-09 13:59:14 +01:00
Datenschutznotizen.txt Datenschutznotizen & Load -> Rational 2018-03-21 09:59:18 +01:00
db.sh Refactor db.hs 2018-11-09 16:12:30 +01:00
default.nix Nix build harness 2017-10-02 20:17:33 +02:00
deploy.sh Hinweis zur Löschung aller Daten 2018-07-04 15:41:56 +02:00
FragenSJ.txt New Rights Managament compiles and seems to work (apart from TODOs); Problem with ASIDENAV 2018-05-28 18:27:30 +02:00
ghci.sh Overhaul auth-predicates 2018-11-14 14:20:32 +01:00
models Single submission assign corrector 2018-11-12 17:12:24 +01:00
package.yaml Overhaul auth-predicates 2018-11-14 14:20:32 +01:00
README.md more beautifully signalled shell commands in README 2018-11-11 23:24:18 +01:00
routes Fix tags 2018-11-14 17:08:52 +01:00
run.sh Favourites working now (without PageActions). 2018-04-10 10:38:21 +02:00
shell.nix Address hlint 2018-11-02 19:57:42 +01:00
stack.nix Better error messages, Store config in db 2018-10-27 22:24:43 +02:00
stack.yaml reset flags 2018-11-02 22:09:39 +01:00
start.sh Overhaul auth-predicates 2018-11-14 14:20:32 +01:00
test.sh Overhaul auth-predicates 2018-11-14 14:20:32 +01:00
uniworx.sublime-project Initial PostgreSQL Template 2017-09-11 09:53:42 +02:00
uniworx.sublime-workspace Initial attempt; does not type 2018-09-03 13:58:08 +02:00

Quick Start Guide

The following Description applies to Ubuntu or similar.

Clone repository

Clone this repository and navigate into

$ git clone https://gitlab.cip.ifi.lmu.de/jost/UniWorX.git && cd UniWorX

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:` - uniworx
Shall the new role be a superuser? (y/n)` - [not exactly sure. Guess not?]
Password: uniworx
...

create database uniworx:

$ createdb uniworx

after you added the database switch back to your own user with Ctrl + D.

to access the database as user uniworx you now need to add a new linux-user called uniworx. when you get asked for a password enter 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.

stack

Install with:

$ curl -sSL https://get.haskellstack.org/ | sh

setup stack and install dependencies:

$ stack setup

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

$ sudo apt-get install libsasl2-dev libldap2-dev

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. Go ahead an install libpq-dev with

$ sudo apt-get install libpq-dev

Other packages you might need to install during this process:

$ sudo apt-get install pkg-config
sudo apt-get install libsodium-dev

Build the app:

$ stack build

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:

$ ./db.sh -f

Run the app:

$ ./start.sh
...
Devel application launched: http://localhost:3000

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

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/

Instead of run.sh, use: stack build --flag uniworx:dev --flag uniworx:library-only


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: TABLE "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