diff --git a/config/settings/base.py b/config/settings/base.py index 688b0d01cb6a977861de6ce9bc949b3fc01fd6e9..a2680f93b93e007b1456be43aadaa7ae735139ce 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -21,6 +21,9 @@ def get_from_env(envvar, default_value=None, fail_if_not_found=True): 'Could not get environment variable {0}'.format(envvar)) return value +# Version --------------------------------------------------------------------- +PROJECT_VERSION = '2.4.3' + # Unauthenticated access ------------------------------------------------------ # This variable should eventually control whether unauthenticated access is # allowed *ANYWHERE* on this service, except the home page, which is always diff --git a/gracedb/api/v1/main/views.py b/gracedb/api/v1/main/views.py index 1b76397b9025d24eb4c2c9c029eee87b46c13c02..9164e7fa2bc37a42fcfc231abd7683a0c6ec3248 100644 --- a/gracedb/api/v1/main/views.py +++ b/gracedb/api/v1/main/views.py @@ -150,6 +150,9 @@ class GracedbRoot(APIView): "signoff-statuses": dict(SignoffBase.OPERATOR_STATUS_CHOICES), "instruments": dict(SignoffBase.INSTRUMENT_CHOICES), "voevent-types" : dict(VOEvent.VOEVENT_TYPE_CHOICES), + "api-versions": api_settings.ALLOWED_VERSIONS, + "server-version": settings.PROJECT_VERSION, + # Maintained for backwards compatibility with client "API_VERSIONS": api_settings.ALLOWED_VERSIONS, }) diff --git a/gracedb/events/views.py b/gracedb/events/views.py index a377f2c13e63683ecdd817b710965a1b0a66caa1..472100517f7a8a757b2cfc97024eec651b71ac65 100644 --- a/gracedb/events/views.py +++ b/gracedb/events/views.py @@ -99,6 +99,9 @@ def index(request): signoff_instrument = group.name[:2].upper() break + # Server code version + context['server_version'] = settings.PROJECT_VERSION + context['signoff_authorized'] = signoff_authorized context['signoff_instrument'] = signoff_instrument diff --git a/gracedb/templates/gracedb/index.html b/gracedb/templates/gracedb/index.html index 184f76346bf7c260bec3183325126118274f39d5..88b0ac363d538a270e36f784e8eb7e3856706993 100644 --- a/gracedb/templates/gracedb/index.html +++ b/gracedb/templates/gracedb/index.html @@ -88,6 +88,7 @@ body { <li><a href="https://gw-astronomy.org/wiki/LV_EM/TechInfo">LV-EM Technical Info</a></li> <li><a href="https://dcc.ligo.org/G1501296">Tutorial for operators and detector engineers</a></li> </ul> + <p>Server code version: <b>{{server_version}}</b></p> {% endif %} </div>