Open Lobby Server
Project description
# Open Lobby Server
Open Lobby is register of lobby meetings. It’s being developed for and tested on [Czech Pirate Party](https://www.pirati.cz) but later it may be used by any party, organization, agency, …
_Open Lobby is in early beta version now. Not for production use._
This is core of the register - server with [GraphQL API](http://graphql.org). Over API are connected application interfaces. Default web application is available at [openlobby/openlobby-app](https://github.com/openlobby/openlobby-app).
Register is built on top of [Elasticsearch](https://www.elastic.co/products/elasticsearch). For now it’s intended for search in Czech language with custom Czech text analyzer. There is prepared Elasticsearch Docker container with Czech support at [openlobby/openlobby-es-czech](https://github.com/openlobby/openlobby-es-czech).
## Configuration
- Configuration is done by environment variables:
DEBUG - Set to any value to turn on debug mode. Don’t use in production!
SECRET_KEY - long random secret string (required if not in debug mode)
DATABASE_DSN - DSN of PostgreSQL database (default: postgresql://db:db@localhost:5432/openlobby)
ELASTICSEARCH_DSN - DSN of Elasticsearch cluster (default: http://localhost:9200)
SITE_NAME - site name for OpenID authentication (default: Open Lobby)
ES_INDEX - Elasticsearch indices prefix (default: openlobby)
- REDIRECT_URI - redirect URI used in OpenID Connect authentication (default: http://localhost:8010/login-redirect)
put there address where you run server, but keep there /login-redirect
this is the Redirect URI for static client registration at OpenID Provider
### Login shortcuts aka preregistered OpenID Clients
Some OpenID Providers does not allow dynamic client registration. You can still use them. Register client with REDIRECT_URI and save client’s credentials into database. You can do it in admin interface running at /admin. It’s standard Django admin (create superuser for yourself like ./manage.py createsuperuser).
## Docker
Docker image is at Docker Hub [openlobby/openlobby-server](https://hub.docker.com/r/openlobby/openlobby-server/). It exposes server on port 8010. You should provide it environment variables for configuration (at least SECRET_KEY).
## Demo
Demo of Open Lobby with instructions is in repository [openlobby/demo](https://github.com/openlobby/demo).
## Local run and development
### Prerequisites
You need to have Python 3 installed.
Run PostgreSQL database on localhost:5432 with user db, password db and database openlobby. You can provide different address in environment variable DATABASE_DSN.
Run Elasticsearch server [openlobby/openlobby-es-czech](https://github.com/openlobby/openlobby-es-czech) on http://localhost:9200. You can provide different address in environment variable ELASTICSEARCH_DSN.
### Local run
Clone this repository and run:
make init-env - prepares Python virtualenv in dir .env
source .env/bin/activate - activates virtualenv
make install - installs requirements and server in development mode
make migrate - runs database migrations and rebuilds Elasticsearch index
make run - runs development server on port 8010
Now you can use GraphQL API endpoint and GraphiQL web interface at http://localhost:8010/graphql
Next time you can just do steps 2 and 5.
### Testing
Run: pytest
For full test suite run you have to provide OpenID Provider issuer URL which allows client registration. For example you can run Keycloak sever locally: docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=pass -p 8080:8080 –rm jboss/keycloak
Login into Keycloak admin console http://localhost:8080/auth/admin/ (as admin/pass) and go to Realm Settings -> Client Registration -> Client Registration Policies -> Trusted Hosts. There add localhost to “Trusted Hosts”, turn off “Host Sending Client Registration Request Must Match” and save it.
Now run: pytest –issuer=http://localhost:8080/auth/realms/master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file openlobby-0.1.0.tar.gz
.
File metadata
- Download URL: openlobby-0.1.0.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4d9b5737e808a144beada4e2b58c941b178094bea13d595f5f71034b7e58c3c5
|
|
MD5 |
134c602eeae8008f762fc9e2dd1bc628
|
|
BLAKE2b-256 |
7aef0096a534760ff1ed87551dbf8b2da14d745b05947c954c5717916905e9aa
|