Skip to content

Commit

Permalink
Merge pull request #128 from learningequality/pass_the_port_to_the_left
Browse files Browse the repository at this point in the history
Ensure we use options.ini configuration for port selection.
  • Loading branch information
marcellamaki authored May 1, 2024
2 parents 66efddf + e4a1e74 commit aaa762c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/kolibri_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from kolibri_app.constants import MAC

__version__ = "0.4.0"
__version__ = "0.4.1"

os.environ["KOLIBRI_INSTALLER_VERSION"] = __version__

Expand All @@ -13,3 +13,4 @@

os.environ["DJANGO_SETTINGS_MODULE"] = "kolibri_app.django_app_settings"
enable_plugin("kolibri.plugins.app")
enable_plugin("kolibri_app")
6 changes: 5 additions & 1 deletion src/kolibri_app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from kolibri.plugins.app.utils import interface
from kolibri.plugins.app.utils import SHARE_FILE
from kolibri.utils.conf import KOLIBRI_HOME
from kolibri.utils.conf import OPTIONS
from kolibri.utils.server import KolibriProcessBus
from magicbus.plugins import SimplePlugin

Expand Down Expand Up @@ -78,7 +79,10 @@ def start_kolibri_server(self):

if callable(share_file):
interface.register_capabilities(**{SHARE_FILE: share_file})
self.kolibri_server = KolibriProcessBus()
self.kolibri_server = KolibriProcessBus(
port=OPTIONS["Deployment"]["HTTP_PORT"],
zip_port=OPTIONS["Deployment"]["ZIP_CONTENT_PORT"],
)
app_plugin = AppPlugin(self.kolibri_server, self.load_kolibri)
app_plugin.subscribe()
self.kolibri_server.run()
Expand Down
5 changes: 5 additions & 0 deletions src/kolibri_app/kolibri_plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from kolibri.plugins import KolibriPluginBase


class KolibriApp(KolibriPluginBase):
kolibri_option_defaults = "options_defaults"
5 changes: 5 additions & 0 deletions src/kolibri_app/options_defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
option_defaults = {
"Deployment": {
"HTTP_PORT": 0,
}
}

0 comments on commit aaa762c

Please sign in to comment.