Skip to content

Commit

Permalink
MORE-1010: Document Development-Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-fra committed Jul 13, 2023
1 parent fa62754 commit f350927
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# MORE Limesurvey
MORE-Specific Repackaging of Limesurvey

---
## Development

This repository contains a `docker-compose.yaml` to launch Limesurvey locally for development and testing.

After starting the Compose using `docker compose up -d`, Limesurvey is available at http://localhost:8080.
To access the configuration backend, login via http://localhost:8080/index.php/admin/authentication/sa/login.

## Authentication

For authentication in MORE we use SSO based on OAuth with Keycloak.
With the plugin https://github.com/BDSU/limesurvey-oauth2, we can use our account we use for the
MORE studymanager to sign into Limesurvey.
MORE Study-Manager to sign in to Limesurvey.

The OAuth-plugin is shipped within this docker-image, but needs to be "loaded" before it can be
enabled and configured.
Expand All @@ -31,12 +39,15 @@ it can be added as a global role for new users.

Finally, enable the plugin in the Overview.

**NOTE**: Even if you enable OAuth2 as the _default login_ mechanism, you can always switch to the default
(local database) login by directly going to `${BASE_URL}/index.php/admin/authentication/sa/login/authMethod/Authdb`.

## Limesurvey API (Remote Control)

Limesurvey uses JSON-RPC. This has to be enabled first before it can be used in
`Configuration > Settings > Global > Interfaces` as such:

<img width="422" alt="image" src="https://user-images.githubusercontent.com/73277803/217238637-d8830d9f-791e-41f3-bad8-2e1d17246c64.png">
<img width="422" alt="JSON-RPC Configuration" src="doc/img/json-rpc.png">

To use the API, you first need to get a session key. Only then you can use it. The most important
requests for us are:
Expand Down
Binary file added doc/img/json-rpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: more-limesurvey

services:
limesurvey:
image: ghcr.io/more-platform/limesurvey:develop
build:
context: .
ports:
- '8080:8080'
depends_on:
database:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "curl -sfI -m5 http://localhost:8080 || exit 1"]
interval: 15s
timeout: 5s
retries: 3
environment:
DB_TYPE: pgsql
DB_PORT: 5432
DB_HOST: database
DB_PASSWORD: lime
DB_NAME: lime
DB_USERNAME: lime
ADMIN_NAME: Super-Admin
ADMIN_USER: admin
# Initial Password, will be changed on setup
ADMIN_PASSWORD: admin

database:
image: postgres:14-alpine
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ]
interval: 10s
timeout: 1s
retries: 5
environment:
POSTGRES_USER: lime
POSTGRES_DB: lime
POSTGRES_PASSWORD: lime

0 comments on commit f350927

Please sign in to comment.