Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Openlobby Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
openlobby
Openlobby Server
Commits
f6dcaf55
Commit
f6dcaf55
authored
7 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
Update readme, makefile and settings.
parent
179a0300
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-0
1 addition, 0 deletions
Makefile
README.md
+29
-12
29 additions, 12 deletions
README.md
openlobby/core/documents.py
+1
-1
1 addition, 1 deletion
openlobby/core/documents.py
openlobby/settings.py
+1
-1
1 addition, 1 deletion
openlobby/settings.py
with
32 additions
and
14 deletions
Makefile
+
1
−
0
View file @
f6dcaf55
...
...
@@ -10,6 +10,7 @@ run:
migrate
:
DEBUG
=
1 python manage.py migrate
DEBUG
=
1 python manage.py search_index
--rebuild
-f
build
:
docker build
-t
openlobby/openlobby-server:latest .
...
...
This diff is collapsed.
Click to expand it.
README.md
+
29
−
12
View file @
f6dcaf55
...
...
@@ -25,7 +25,7 @@ Configuration is done by environment variables:
-
`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 ind
e
x (default:
`openlobby`
)
-
`ES_INDEX`
- Elasticsearch ind
ices prefi
x (default:
`openlobby`
)
## Docker
...
...
@@ -41,12 +41,27 @@ Demo of Open Lobby with instructions is in repository
## Local run and development
You need to have Python 3 installed. Clone this repository and run:
### Prrequisites
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:
1.
`make init-env`
- prepares Python virtualenv in dir
`.env`
2.
`source .env/bin/activate`
- activates virtualenv
3.
`make install`
- installs requirements and server in development mode
4.
`make migrate`
- runs database migrations
4.
`make migrate`
- runs database migrations
and rebuilds Elasticsearch index
5.
`make run`
- runs development server on port
`8010`
Now you can use GraphQL API endpoint and GraphiQL web interface at
...
...
@@ -54,16 +69,18 @@ Now you can use GraphQL API endpoint and GraphiQL web interface at
Next time you can just do steps 2 and 5.
Development server assumes that you have
[
openlobby/openlobby-es-czech
](
https://github.com/openlobby/openlobby-es-czech
)
.
running on
`http://localhost:9200`
. You can override this address in environment
variable
`ELASTICSEARCH_DSN`
. E.g.
`ELASTICSEARCH_DSN=http://my-server:9200 make run`
### Testing
Run:
`pytest`
Expects Elasticsearch for tests running on
`localhost:9200`
(can be override by
environment variable
`ELASTICSEARCH_DSN`
). Tests creates random indices with
prefix
`test_`
and deletes all indices matching
`test_*`
on teardown.
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`
This diff is collapsed.
Click to expand it.
openlobby/core/documents.py
+
1
−
1
View file @
f6dcaf55
...
...
@@ -5,7 +5,7 @@ import json
from
.models
import
Report
report
=
Index
(
'
report
'
)
report
=
Index
(
'
{}-
report
s
'
.
format
(
settings
.
ES_INDEX
)
)
@report.doc_type
...
...
This diff is collapsed.
Click to expand it.
openlobby/settings.py
+
1
−
1
View file @
f6dcaf55
...
...
@@ -141,7 +141,7 @@ GRAPHENE = {
###############################################################################
# Custom settings
# Elasticsearch index
# Elasticsearch index
with reports
ES_INDEX
=
os
.
environ
.
get
(
'
ES_INDEX
'
,
'
openlobby
'
)
# default analyzer for text fields
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment