diff --git a/client/src/components/User/UserPreferencesModel.js b/client/src/components/User/UserPreferencesModel.js
index b90febfd231..c5800180134 100644
--- a/client/src/components/User/UserPreferencesModel.js
+++ b/client/src/components/User/UserPreferencesModel.js
@@ -33,15 +33,6 @@ export const getUserPreferencesModel = () => {
submit_icon: "fa-trash",
shouldRender: config.enable_oidc,
},
- communication: {
- title: _l("Change Communication Settings"),
- id: "edit-preferences-communication",
- description: _l("Enable or disable the communication feature to chat with other users."),
- url: `api/users/${Galaxy.user.id}/communication/inputs`,
- icon: "fa-comments-o",
- redirect: "user",
- shouldRender: !!config.enable_communication_server,
- },
permissions: {
title: _l("Set Dataset Permissions for New Histories"),
id: "edit-preferences-permissions",
diff --git a/client/src/layout/communication-server-view.js b/client/src/layout/communication-server-view.js
deleted file mode 100644
index 830fc1dd73c..00000000000
--- a/client/src/layout/communication-server-view.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/** Real-time Communication feature **/
-import $ from "jquery";
-import Backbone from "backbone";
-import _ from "underscore";
-import _l from "utils/localization";
-import Modal from "mvc/ui/ui-modal";
-import { getGalaxyInstance } from "app";
-
-export const CommunicationServerView = Backbone.View.extend({
- initialize: function () {
- this.modal = null;
- },
-
- /** makes bootstrap modal and iframe inside it */
- makeModalIframe: function (e) {
- const Galaxy = getGalaxyInstance();
- // make modal
- const host = Galaxy.config.communication_server_host;
-
- const port = Galaxy.config.communication_server_port;
- const username = _.escape(Galaxy.user.attributes.username);
-
- const persistent_communication_rooms = _.escape(Galaxy.config.persistent_communication_rooms);
-
- const query_string = `?username=${username}&persistent_communication_rooms=${persistent_communication_rooms}`;
-
- const src = `${host}:${port}${query_string}`;
- let $el_chat_modal_header = null;
- let $el_chat_modal_body = null;
-
- const iframe_template = ``;
-
- const header_template =
- '' +
- '' +
- '';
-
- const frame_height = 350;
- const frame_width = 600;
- const class_names = "ui-modal chat-modal";
-
- // deletes the chat modal if already present and create one
- if ($(".chat-modal").length > 0) {
- $(".chat-modal").remove();
- }
- // creates a modal
- CommunicationServerView.modal = new Modal.View({
- body: iframe_template,
- height: frame_height,
- width: frame_width,
- closing_events: true,
- title_separator: false,
- cls: class_names,
- });
-
- // shows modal
- CommunicationServerView.modal.show();
- $el_chat_modal_header = $(".chat-modal .modal-header");
- $el_chat_modal_body = $(".chat-modal .modal-body");
- // adjusts the css of bootstrap modal for chat
- $el_chat_modal_header.addClass("modal-header-body");
- $el_chat_modal_body.addClass("modal-header-body");
- $el_chat_modal_header.find("h4").remove();
- $el_chat_modal_header.removeAttr("min-height padding border");
- $el_chat_modal_header.append(header_template);
- // click event of the close button for chat
- $(".close-modal").click((e) => {
- $(".chat-modal").css("display", "none");
- });
- // click event of expand and compress icon
- $(".expand-compress-modal").click((e) => {
- if ($(".expand-compress-modal").hasClass("fa-expand")) {
- $(".chat-modal .modal-dialog").width("1000px");
- $(".chat-modal .modal-body").height("575px");
- $(".expand-compress-modal").removeClass("fa-expand").addClass("fa-compress");
- $(".expand-compress-modal").attr("title", "Minimize");
- $(".expand-compress-modal").css("margin-left", "96.2%");
- } else {
- $(".chat-modal .modal-dialog").width(`${frame_width}px`);
- $(".chat-modal .modal-body").height(`${frame_height}px`);
- $(".expand-compress-modal").removeClass("fa-compress").addClass("fa-expand");
- $(".expand-compress-modal").attr("title", "Maximize");
- $(".expand-compress-modal").css("margin-left", "93.2%");
- }
- });
- return this;
- },
-
- /**renders the chat icon as a nav item*/
- render: function () {
- return {
- id: "show-chat-online",
- icon: "fa-comment-o",
- tooltip: _l("Chat online"),
- visible: false,
- onclick: this.makeModalIframe,
- };
- },
-});
diff --git a/client/src/layout/menu.js b/client/src/layout/menu.js
index 9c9802da72f..45f942811d7 100644
--- a/client/src/layout/menu.js
+++ b/client/src/layout/menu.js
@@ -1,7 +1,6 @@
import axios from "axios";
import { getGalaxyInstance } from "app";
import _l from "utils/localization";
-import { CommunicationServerView } from "layout/communication-server-view";
const POST_LOGOUT_URL = "root/login?is_logout_redirect=true";
@@ -54,12 +53,6 @@ export function fetchMenu(options = {}) {
const Galaxy = getGalaxyInstance();
const menu = [];
- //
- // Chat server tab
- //
- const extendedNavItem = new CommunicationServerView();
- menu.push(extendedNavItem.render());
-
//
// Analyze data tab.
//
diff --git a/client/src/layout/page.js b/client/src/layout/page.js
index b74f37fb9f5..4c9f72ccfb5 100644
--- a/client/src/layout/page.js
+++ b/client/src/layout/page.js
@@ -105,7 +105,6 @@ const View = Backbone.View.extend({
this.renderInactivityBox();
}
this.renderPanels();
- this._checkCommunicationServerOnline();
return this;
},
@@ -181,36 +180,6 @@ const View = Backbone.View.extend({
toString: function () {
return "PageLayoutView";
},
-
- /** Check if the communication server is online and show the icon otherwise hide the icon */
- _checkCommunicationServerOnline: function () {
- const Galaxy = getGalaxyInstance();
- const host = Galaxy.config.communication_server_host;
- const port = Galaxy.config.communication_server_port;
- const preferences = Galaxy.user.attributes.preferences;
- const $chat_icon_element = $("#show-chat-online");
- /** Check if the user has deactivated the communication in it's personal settings */
- if (preferences && ["1", "true"].indexOf(preferences.communication_server) != -1) {
- // See if the configured communication server is available
- $.ajax({
- url: `${host}:${port}`,
- })
- .success((data) => {
- // enable communication only when a user is logged in
- if (Galaxy.user.id !== null) {
- if ($chat_icon_element.css("visibility") === "hidden") {
- $chat_icon_element.css("visibility", "visible");
- }
- }
- })
- .error((data) => {
- // hide the communication icon if the communication server is not available
- $chat_icon_element.css("visibility", "hidden");
- });
- } else {
- $chat_icon_element.css("visibility", "hidden");
- }
- },
});
export default { View: View };
diff --git a/client/src/nls/locale.js b/client/src/nls/locale.js
index 5822b6080e7..aa468ba831c 100644
--- a/client/src/nls/locale.js
+++ b/client/src/nls/locale.js
@@ -291,7 +291,6 @@ define({
"Associate OpenIDs with your account.": false,
"Customize your Toolbox by displaying or omitting sets of Tools.": false,
"Access your current API key or create a new one.": false,
- "Enable or disable the communication feature to chat with other users.": false,
"Allows you to change your login credentials.": false,
"User Preferences": false,
"Sign out": false,
@@ -300,7 +299,6 @@ define({
"Manage Toolbox filters": false,
"Manage API key": false,
"Set dataset permissions for new histories": false,
- "Change communication settings": false,
"Change password": false,
"Manage information": false,
// ---------------------------------------------------------------------------- history-list
diff --git a/client/src/style/scss/base.scss b/client/src/style/scss/base.scss
index ef61b259f6b..3f3e1a909a6 100644
--- a/client/src/style/scss/base.scss
+++ b/client/src/style/scss/base.scss
@@ -1465,26 +1465,6 @@ div.toolSectionTitle {
display: none;
}
-// communication channel bootstrap modal
-.chat-modal {
- overflow: hidden;
-}
-
-.modal-header-body {
- padding: 2px;
-}
-
-.close-modal {
- float: right;
- cursor: pointer;
-}
-
-.expand-compress-modal {
- cursor: pointer;
- font-size: 12px;
- margin-left: 93.2%;
-}
-
// password complexity monitor
#change_password,
#registrationForm {
diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst
index 4921c3bff8c..0288c19b124 100644
--- a/doc/source/admin/galaxy_options.rst
+++ b/doc/source/admin/galaxy_options.rst
@@ -2636,6 +2636,19 @@
:Type: float
+~~~~~~~~~~~~~~~~~
+``tool_id_boost``
+~~~~~~~~~~~~~~~~~
+
+:Description:
+ Boosts are used to customize this instance's toolbox search. The
+ higher the boost, the more importance the scoring algorithm gives
+ to the given field. Section refers to the tool group in the tool
+ panel. Rest of the fields are tool's attributes.
+:Default: ``9.0``
+:Type: float
+
+
~~~~~~~~~~~~~~~~~~~~~~
``tool_section_boost``
~~~~~~~~~~~~~~~~~~~~~~
@@ -4141,47 +4154,6 @@
:Type: str
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-``enable_communication_server``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:Description:
- Galaxy real time communication server settings
-:Default: ``false``
-:Type: bool
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-``communication_server_host``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:Description:
- Galaxy real time communication server settings
-:Default: ``http://localhost``
-:Type: str
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-``communication_server_port``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:Description:
- Galaxy real time communication server settings
-:Default: ``7070``
-:Type: int
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-``persistent_communication_rooms``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:Description:
- persistent_communication_rooms is a comma-separated list of rooms
- that should be always available.
-:Default: ``None``
-:Type: str
-
-
~~~~~~~~~~~~~~
``use_pbkdf2``
~~~~~~~~~~~~~~
diff --git a/doc/source/admin/special_topics/chat-0.png b/doc/source/admin/special_topics/chat-0.png
deleted file mode 100644
index 98ef2b5b020..00000000000
Binary files a/doc/source/admin/special_topics/chat-0.png and /dev/null differ
diff --git a/doc/source/admin/special_topics/chat-1.png b/doc/source/admin/special_topics/chat-1.png
deleted file mode 100644
index 70a09ed259a..00000000000
Binary files a/doc/source/admin/special_topics/chat-1.png and /dev/null differ
diff --git a/doc/source/admin/special_topics/chat-2.png b/doc/source/admin/special_topics/chat-2.png
deleted file mode 100644
index 45aa7e728d7..00000000000
Binary files a/doc/source/admin/special_topics/chat-2.png and /dev/null differ
diff --git a/doc/source/admin/special_topics/chat-3.png b/doc/source/admin/special_topics/chat-3.png
deleted file mode 100644
index 8dc815a9119..00000000000
Binary files a/doc/source/admin/special_topics/chat-3.png and /dev/null differ
diff --git a/doc/source/admin/special_topics/chat-4.png b/doc/source/admin/special_topics/chat-4.png
deleted file mode 100644
index 428151ebb2b..00000000000
Binary files a/doc/source/admin/special_topics/chat-4.png and /dev/null differ
diff --git a/doc/source/admin/special_topics/chat.rst b/doc/source/admin/special_topics/chat.rst
deleted file mode 100644
index f2ecbeddd14..00000000000
--- a/doc/source/admin/special_topics/chat.rst
+++ /dev/null
@@ -1,137 +0,0 @@
-Galaxy Communication Server
-===========================
-
-A problem faced by administrators, especially those of smaller galaxy sites, is how to connect users with documentation on workflows and analysis procedures, and then helping them through running these steps. For sites where the admins and the tool developers are the same groups, finding time for developing the required training resources and providing the level of hands-on guidance required can be an impossible challenge in time management.
-
-In order to solve this, a simple chat server has been added to Galaxy to provide realtime communication between users. The hope is that this will decrease the burden on administrators:
-
-- *Troubleshooting*: When users have trouble with a tool, they can ask in chat if
- anyone can help, rather than coming to administrators and tool developers
- first.
-- *Sharing*: Your galaxy users can easily talk to coworkers, maybe learn about
- new analyses they've each developed
-- *Dedicated Discussion*: The chat implementation provides the ability to
- designate some fixed chat rooms which will always be visible to users, these
- can be used to help guide user discussion to topics like NGS.
-
-.. image:: communication_server.png
-
-Pre-requisites
---------------
-
-This service will need to be deployed on a host that has:
-
-- Access to the Galaxy database
-- A port exposed
-- A non-default ``id_secret`` set in your ``galaxy.yml``
-
-We say "access to galaxy database", this service could run on an NFS mounted
-copy of Galaxy, if the host it is deployed on can access the database of the
-main galaxy instance. This is required, because the chat service validates
-connecting users to prevent impersonation.
-
-Deploying the Server
---------------------
-
-The chat server is a very new feature in Galaxy and has been disabled by
-default at a number of levels, as not all users may wish to use this feature.
-
-Configuration is managed in ``galaxy.yml``:
-
-.. code-block:: yaml
-
- # Galaxy real time communication server settings
- enable_communication_server: True
- communication_server_host: http://localhost
- communication_server_port: 7070
- # persistent_communication_rooms is a comma-separated list of rooms that should be always available.
- persistent_communication_rooms: NGS,RNA-Seq,Genome Annotation
-
-As you can see in this configuration, it is pointing at a service running on
-the same host as Galaxy, talking to port 7070.
-
-Once you have configured this portion, you will want to install the required
-dependencies, and launch the chat server. This is run as a separate flask based
-service.
-
-Installing the Dependencies
----------------------------
-
-Most admins will find it convenient to activate the Galaxy virtualenv, and run
-the following command:
-
-.. code-block:: console
-
- (.venv)$ pip install flask flask-login flask-socketio eventlet
-
-You can then launch the server:
-
-.. code-block:: console
-
- (.venv)$ python ./scripts/communication/communication_server.py --port 7070 --host localhost
-
-Next we'll configure user-level access.
-
-Enabling the Chat Interace
---------------------------
-
-Users who wish to enable the chat can do so in their user preferences.
-
-.. image:: chat-0.png
-
-There is a new element at the top of the list, which controls chat preferences
-
-.. image:: chat-1.png
-
-And a short dialog to enable it
-
-.. image:: chat-2.png
-
-After which, a new icon becomes visible next to "Analyse Data" on your Galaxy
-header.
-
-.. image:: chat-3.png
-
-Opening the chat interface, lastly we notice that chat defaults to an offline
-state. Clicking the red chat bubble icon will turn it green and allow the user
-to engage with others.
-
-.. image:: chat-4.png
-
-Finally users can connect with one another within Galaxy.
-
-.. image:: communication_server_rooms.png
-
-Security Considerations
------------------------
-
-This service does:
-
-- Ensure authenticated access by decoding their Galaxy ``galaxysession``
- cookie.
-- Prevent user spoofing
-
-This service does not:
-
-- enforce rate-limiting of messages
-- run any sort of text/obscenity filtering rules
-- prevent user spoofing if the user is an administrator and impersonating
- another user
-
-Keeping the Chat Server Running
--------------------------------
-
-Here is an example supervisord configuration for keeping the chat server running:
-
-.. code-block:: console
-
- [program:galaxy_chat_server]
- directory = GALAXY_ROOT
- command = python ./scripts/communication/communication_server.py --port 7070 --host localhost
- autostart = true
- autorestart = unexpected
- user = GALAXY_USER
- startsecs = 2
- redirect_stderr = true
-
-Configuration with virtualenvs will be slightly different.
diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py
index fc33292e699..75fd7b36b6a 100644
--- a/lib/galaxy/config/__init__.py
+++ b/lib/galaxy/config/__init__.py
@@ -620,7 +620,6 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
self.email_domain_blocklist_content = self._load_list_from_file(self._in_config_dir(self.email_domain_blocklist_file)) if self.email_domain_blocklist_file else None
self.email_domain_allowlist_content = self._load_list_from_file(self._in_config_dir(self.email_domain_allowlist_file)) if self.email_domain_allowlist_file else None
- self.persistent_communication_rooms = listify(self.persistent_communication_rooms, do_strip=True)
# The transfer manager and deferred job queue
self.enable_beta_job_managers = string_as_bool(kwargs.get('enable_beta_job_managers', 'False'))
# These are not even beta - just experiments - don't use them unless
diff --git a/lib/galaxy/config/config_manage.py b/lib/galaxy/config/config_manage.py
index b8e6dfd87ba..f00a6d5c0d6 100644
--- a/lib/galaxy/config/config_manage.py
+++ b/lib/galaxy/config/config_manage.py
@@ -312,6 +312,10 @@ OPTION_ACTIONS = {
'tool_submission_burst_at': _DeprecatedAndDroppedAction(),
'toolform_upgrade': _DeprecatedAndDroppedAction(),
'enable_beta_mulled_containers': _DeprecatedAndDroppedAction(),
+ 'enable_communication_server': _DeprecatedAndDroppedAction(),
+ 'communication_server_host': _DeprecatedAndDroppedAction(),
+ 'communication_server_port': _DeprecatedAndDroppedAction(),
+ 'persistent_communication_rooms': _DeprecatedAndDroppedAction(),
}
diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample
index b0fe163e6d8..23c441f1ec7 100644
--- a/lib/galaxy/config/sample/galaxy.yml.sample
+++ b/lib/galaxy/config/sample/galaxy.yml.sample
@@ -2019,19 +2019,6 @@ galaxy:
# commented out line below).
#amqp_internal_connection: sqlalchemy+sqlite:///./database/control.sqlite?isolation_level=IMMEDIATE
- # Galaxy real time communication server settings
- #enable_communication_server: false
-
- # Galaxy real time communication server settings
- #communication_server_host: http://localhost
-
- # Galaxy real time communication server settings
- #communication_server_port: 7070
-
- # persistent_communication_rooms is a comma-separated list of rooms
- # that should be always available.
- #persistent_communication_rooms: null
-
# Allow disabling pbkdf2 hashing of passwords for legacy situations.
# This should normally be left enabled unless there is a specific
# reason to disable it.
diff --git a/lib/galaxy/managers/configuration.py b/lib/galaxy/managers/configuration.py
index 4e74f03fbfb..b530b53c2f4 100644
--- a/lib/galaxy/managers/configuration.py
+++ b/lib/galaxy/managers/configuration.py
@@ -58,10 +58,6 @@ class ConfigSerializer(base.ModelSerializer):
'lims_doc_url' : _defaults_to("https://usegalaxy.org/u/rkchak/p/sts"),
'default_locale' : _use_config,
'enable_openid' : _use_config,
- 'enable_communication_server' : _use_config,
- 'communication_server_port' : _use_config,
- 'communication_server_host' : _use_config,
- 'persistent_communication_rooms' : _use_config,
'enable_tool_recommendations' : _use_config,
'tool_recommendation_model_path' : _use_config,
'admin_tool_recommendations_path' : _use_config,
diff --git a/lib/galaxy/web/framework/middleware/remoteuser.py b/lib/galaxy/web/framework/middleware/remoteuser.py
index f4cdf584f03..1fc9c2e4dad 100644
--- a/lib/galaxy/web/framework/middleware/remoteuser.py
+++ b/lib/galaxy/web/framework/middleware/remoteuser.py
@@ -156,7 +156,6 @@ class RemoteUser:
'/user/logout',
'/user/toolbox_filters',
'/user/set_default_permissions',
- '/user/change_communication',
)
admin_accessible_paths = (
diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py
index 15b78cd304b..8bc5028510d 100644
--- a/lib/galaxy/webapps/galaxy/api/users.py
+++ b/lib/galaxy/webapps/galaxy/api/users.py
@@ -752,33 +752,6 @@ class UserAPIController(BaseAPIController, UsesTagsMixin, CreatesApiKeysMixin, B
'help': ' An API key will allow you to access via web API. Please note that this key acts as an alternate means to access your account and should be treated with the same care as your login password.'}]
return {'message': message, 'inputs': inputs}
- @expose_api
- def get_communication(self, trans, id, payload={}, **kwd):
- """
- Build communication server inputs.
- """
- user = self._get_user(trans, id)
- return {'inputs': [{'name': 'enable',
- 'type': 'boolean',
- 'label': 'Enable communication',
- 'value': user.preferences.get('communication_server', 'false')}]}
-
- @expose_api
- def set_communication(self, trans, id, payload={}, **kwd):
- """
- Allows the user to activate/deactivate the communication server.
- """
- user = self._get_user(trans, id)
- enable = payload.get('enable', 'false')
- if enable == 'true':
- message = 'Your communication server has been activated.'
- else:
- message = 'Your communication server has been disabled.'
- user.preferences['communication_server'] = enable
- trans.sa_session.add(user)
- trans.sa_session.flush()
- return {'message': message}
-
@expose_api
def get_custom_builds(self, trans, id, payload={}, **kwd):
"""
diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml
index eeebaa25a9e..64d8b384ad5 100644
--- a/lib/galaxy/webapps/galaxy/config_schema.yml
+++ b/lib/galaxy/webapps/galaxy/config_schema.yml
@@ -3085,33 +3085,6 @@ mapping:
will automatically create and use a separate sqlite database located in your
/database folder (indicated in the commented out line below).
- enable_communication_server:
- type: bool
- default: false
- required: false
- desc: |
- Galaxy real time communication server settings
-
- communication_server_host:
- type: str
- default: http://localhost
- required: false
- desc: |
- Galaxy real time communication server settings
-
- communication_server_port:
- type: int
- default: 7070
- required: false
- desc: |
- Galaxy real time communication server settings
-
- persistent_communication_rooms:
- type: str
- required: false
- desc: |
- persistent_communication_rooms is a comma-separated list of rooms that should be always available.
-
use_pbkdf2:
type: bool
default: true
diff --git a/lib/galaxy_test/api/test_users.py b/lib/galaxy_test/api/test_users.py
index f413eeed504..33366fbbeed 100644
--- a/lib/galaxy_test/api/test_users.py
+++ b/lib/galaxy_test/api/test_users.py
@@ -164,16 +164,6 @@ class UsersApiTestCase(ApiTestCase):
search_response = get(url).json()
assert "cat1" in search_response
- def test_communication(self):
- user = self._setup_user(TEST_USER_EMAIL)
- url = self.__url("communication/inputs", user)
- self.assertEqual(self.__filter(get(url).json(), "enable", "value"), "false")
- put(url, data=json.dumps(dict(enable="true")))
- self.assertEqual(self.__filter(get(url).json(), "enable", "value"), "true")
-
- def __filter(self, response, name, attr):
- return [r[attr] for r in response["inputs"] if r["name"] == name][0]
-
def __url(self, action, user):
return self._api_url("users/{}/{}".format(user["id"], action), params=dict(key=self.master_api_key))
diff --git a/scripts/communication/communication_server.py b/scripts/communication/communication_server.py
deleted file mode 100755
index e7b73c3311a..00000000000
--- a/scripts/communication/communication_server.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Server for realtime communication between Galaxy uers.
-
-At first you need to install a few requirements.
-
-. GALAXY_ROOT/.venv/bin/activate # activate Galaxy's virtualenv
-pip install flask flask-login flask-socketio eventlet # install the requirements
-
-As a next step start the communication server with something like this:
-
-./scripts/communication/communication_server.py --port 7070 --host localhost
-
-Please make sure the host and the port matches the ones in ./config/galaxy.ini and
-to set the `secret_id`.
-
-This communication server can be controlled on three different levels:
- 1. The admin can activate/deactivate the communication server via ./config/galaxy.ini. [off by default]
- 2. The user can activate/deactivate it in their own personal-settings via Galaxy user preferences. [off by default]
- 3. The user can activate/deactivate communications for a session directly in the communication window. [on by default]
-"""
-
-import argparse
-import hashlib
-import logging
-import os
-import sys
-from datetime import timedelta
-from functools import update_wrapper
-
-import flask.ext.login as flask_login
-from flask import (
- current_app,
- Flask,
- make_response,
- request,
- send_file
-)
-from flask.ext.login import current_user
-from flask_socketio import (
- disconnect,
- emit,
- join_room,
- leave_room,
- SocketIO
-)
-
-sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
-
-import galaxy.config
-from galaxy.security.idencoding import IdEncodingHelper
-from galaxy.util.sanitize_html import sanitize_html
-from galaxy.util.script import app_properties_from_args, populate_config_args
-
-logging.basicConfig()
-log = logging.getLogger(__name__)
-
-parser = argparse.ArgumentParser(description='Real-time communication server for Galaxy.')
-parser.add_argument('--port', type=int, default="7070", help='Port number on which the server should run.')
-parser.add_argument('--host', default='localhost', help='Hostname of the communication server.')
-populate_config_args(parser)
-args = parser.parse_args()
-
-# With the config file we can load the full app properties
-app_properties = app_properties_from_args(args)
-
-config = galaxy.config.Configuration(**app_properties)
-model = galaxy.config.init_models_from_config(config)
-sa_session = model.context.current
-
-# We need the ID secret for configuring the security helper to decrypt
-# galaxysession cookies.
-if "id_secret" not in app_properties:
- log.warning('No ID_SECRET specified. Please set the "id_secret" in your galaxy.ini.')
-
-id_secret = app_properties.get('id_secret', 'dangerous_default')
-
-security_helper = IdEncodingHelper(id_secret=id_secret)
-# And get access to the models
-# Login manager to manage current_user functionality
-login_manager = flask_login.LoginManager()
-
-app = Flask(__name__)
-app.config['SECRET_KEY'] = id_secret
-login_manager.init_app(app)
-socketio = SocketIO(app)
-
-
-@login_manager.request_loader
-def findUserByCookie(request):
- cookie_value = request.cookies.get('galaxysession')
- if not cookie_value:
- return None
-
- session_key = security_helper.decode_guid(cookie_value)
- user_session = sa_session.query(model.GalaxySession).filter_by(session_key=session_key).first()
-
- if user_session:
- return user_session.user
-
- return None
-
-
-# Taken from flask.pocoo.org/snippets/56/
-def crossdomain(origin=None, methods=None, headers=None,
- max_age=21600, attach_to_all=True,
- automatic_options=True):
- if methods is not None:
- methods = ', '.join(sorted(x.upper() for x in methods))
- if headers is not None and not isinstance(headers, str):
- headers = ', '.join(x.upper() for x in headers)
- if not isinstance(origin, str):
- origin = ', '.join(origin)
- if isinstance(max_age, timedelta):
- max_age = max_age.total_seconds()
-
- def get_methods():
- if methods is not None:
- return methods
-
- options_resp = current_app.make_default_options_response()
- return options_resp.headers['allow']
-
- def decorator(f):
- def wrapped_function(*args, **kwargs):
- if automatic_options and request.method == 'OPTIONS':
- resp = current_app.make_default_options_response()
- else:
- resp = make_response(f(*args, **kwargs))
- if not attach_to_all and request.method != 'OPTIONS':
- return resp
-
- h = resp.headers
-
- h['Access-Control-Allow-Origin'] = origin
- h['Access-Control-Allow-Methods'] = get_methods()
- h['Access-Control-Max-Age'] = str(max_age)
- if headers is not None:
- h['Access-Control-Allow-Headers'] = headers
- return resp
-
- f.provide_automatic_options = False
- return update_wrapper(wrapped_function, f)
- return decorator
-
-
-script_dir = os.path.dirname(os.path.realpath(__file__))
-communication_directory = os.path.join(script_dir, 'template')
-
-
-@app.route('/')
-@crossdomain(origin='*')
-def index():
- return send_file(os.path.join(communication_directory, 'communication.html'))
-
-
-@app.route('/communication.js')
-def static_script():
- return send_file(os.path.join(communication_directory, 'communication.js'))
-
-
-@app.route('/communication.css')
-def static_style():
- return send_file(os.path.join(communication_directory, 'communication.css'))
-
-
-@socketio.on('event connect', namespace='/chat')
-def event_connect(message):
- log.info(f"{current_user.username} connected")
-
-
-@socketio.on('event broadcast', namespace='/chat')
-def event_broadcast(message):
- message = sanitize_html(message['data'])
-
- log.debug(f"{current_user.username} broadcast '{message}'")
-
- emit('event response',
- {'data': message, 'user': current_user.username, 'gravatar': hashlib.md5(current_user.email).hexdigest()}, broadcast=True)
-
-
-@socketio.on('event room', namespace='/chat')
-def send_room_message(message):
- data = sanitize_html(message['data'])
- room = sanitize_html(message['room'])
-
- log.debug(f"{current_user.username} sent '{message}' to {room}")
-
- emit('event response room',
- {'data': data, 'user': current_user.username, 'gravatar': hashlib.md5(current_user.email).hexdigest(), 'chatroom': room}, room=room)
-
-
-@socketio.on('event disconnect', namespace='/chat')
-def event_disconnect(message):
- log.info("%s disconnected" % current_user.username)
- disconnect()
-
-
-@socketio.on('join', namespace='/chat')
-def join(message):
- room = sanitize_html(message['room'])
-
- log.debug(f"{current_user.username} joined {room}")
- join_room(room)
-
- emit('event response room',
- {'data': room, 'userjoin': current_user.username}, broadcast=True)
-
-
-@socketio.on('leave', namespace='/chat')
-def leave(message):
- room = sanitize_html(message['room'])
-
- log.debug(f"{current_user.username} left {room}")
- leave_room(room)
-
- emit('event response room',
- {'data': room, 'userleave': current_user.username}, broadcast=True)
-
-
-if __name__ == '__main__':
- socketio.run(app, host=args.host, port=args.port)
diff --git a/scripts/communication/template/communication.css b/scripts/communication/template/communication.css
deleted file mode 100644
index 22d78d6ae2e..00000000000
--- a/scripts/communication/template/communication.css
+++ /dev/null
@@ -1,180 +0,0 @@
-html, body {
- height: 100%;
- font-size: 12px;
-}
-
-body {
- overflow: hidden;
-}
-
-.body-container {
- opacity: 0;
- transition: opacity 1s;
-}
-
-.body-container-loaded {
- opacity: 1;
-}
-
-/* Styles for message text box */
-.message-textarea {
- height: 50px !important;
- width: 99.5%;
- padding: 6px 3px;
- font-size: inherit;
-}
-
-/* Styles for top right icons */
-.right_icons {
- margin-left: 95%;
-}
-
-.chat-room-textbx {
- width: 34%;
- height: 10%;
- padding: 6px 3px;
- font-size: inherit;
-}
-
-ul, li,
-.anchor {
- cursor: pointer;
- color: black;
-}
-
-.nav>li>a:hover, .nav>li>a:focus {
- background-color: #F7F8FA;
-}
-
-.messages {
- overflow-y: auto;
- height: 100%;
- overflow-x: hidden;
- /*background-color: #F7F8FA;*/
-}
-
-.send_message {
- margin-top: 5px;
- margin-left: 2px;
-}
-
-.user_message {
- background-color: #F7F8FA;
- margin: 2px 0px 4px 2px;
- padding: 2px;
- box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.5);
- border-radius: 2px;
-}
-
-.user_name {
- font-weight: 900;
- padding-left: 0px;
-}
-
-.date_time {
- font-style: italic;
- padding-right: 0px;
- font-size: 11px;
-}
-
-.message {
- padding-top: 2px;
-}
-
-.tab-content {
- height: 64%;
-}
-
-.tab-pane {
- height: 100%;
- padding: 5px 20px 5px 5px;
-
-}
-
-#chat_room_tab {
- margin-left: 2%;
-}
-
-.row {
- /* Override the margins, otherwise goes outside of bounds */
- margin-right: 0px;
- margin-left: 0px;
-}
-
-.nav li a {
- padding: 7px 7px;
-}
-
-ul > li i {
- padding-left: 4px;
-}
-
-.join-room {
- margin-left: -2.3%;
-}
-
-.global-rooms {
- overflow-y: auto;
- height: 200px;
- margin-top: 1%;
-}
-
-.global-room {
- margin: 0px 2px 2px 0px;
- padding: 3px 6px;
- font-size: inherit;
-}
-
-a:hover, a:visited {
- text-decoration: none;
-}
-
-/****styles for overflow tabs****/
-.wrapper {
- position: relative;
- margin: 0 auto;
- overflow: hidden;
- height: 45px;
-}
-
-.list {
- position: absolute;
- left: 0px;
- top: 0px;
- min-width: 3000px;
- margin-top: 0px;
-}
-
-.list li {
- display: table-cell;
- position: relative;
- text-align: center;
- color: #efefef;
- vertical-align: middle;
-}
-
-.scroller {
- text-align: center;
- cursor: pointer;
- display: none;
- padding: 5px;
- padding-top: 9px;
- vertical-align: middle;
- background-color: #fff;
-}
-
-.scroller-right {
- float: right;
-}
-
-.scroller-left {
- float: left;
-}
-
-.message-height,
-.notification-padding {
- padding-right: 0px;
-}
-
-
-
diff --git a/scripts/communication/template/communication.html b/scripts/communication/template/communication.html
deleted file mode 100644
index 1a652712c07..00000000000
--- a/scripts/communication/template/communication.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
- Chat
-
-
-
-
-
-