diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py
index 520b424e..7bbdef66 100644
--- a/bookwyrm/settings.py
+++ b/bookwyrm/settings.py
@@ -11,6 +11,11 @@ env.read_env()
DOMAIN = env("DOMAIN")
VERSION = "0.3.0"
+RELEASE_API = env(
+ "RELEASE_API",
+ "https://api.github.com/repos/bookwyrm-social/bookwyrm/releases/latest",
+)
+
PAGE_LENGTH = env("PAGE_LENGTH", 15)
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
diff --git a/bookwyrm/templates/settings/dashboard/dashboard.html b/bookwyrm/templates/settings/dashboard/dashboard.html
index 65c666a6..45c4d22f 100644
--- a/bookwyrm/templates/settings/dashboard/dashboard.html
+++ b/bookwyrm/templates/settings/dashboard/dashboard.html
@@ -48,6 +48,7 @@
{% endif %}
+
{% if pending_domains %}
{% endif %}
+
{% if not site.allow_registration and site.allow_invite_requests and invite_requests %}
{% endif %}
+
+ {% if current_version %}
+
+ {% endif %}
diff --git a/bookwyrm/views/admin/dashboard.py b/bookwyrm/views/admin/dashboard.py
index 6c6ab009..92fb0185 100644
--- a/bookwyrm/views/admin/dashboard.py
+++ b/bookwyrm/views/admin/dashboard.py
@@ -1,6 +1,7 @@
""" instance overview """
from datetime import timedelta
from dateutil.parser import parse
+from packaging import version
from django.contrib.auth.decorators import login_required, permission_required
from django.db.models import Q
@@ -9,7 +10,9 @@ from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views import View
-from bookwyrm import models
+from bookwyrm import models, settings
+from bookwyrm.connectors.abstract_connector import get_data
+from bookwyrm.connectors.connector_manager import ConnectorException
# pylint: disable= no-self-use
@@ -107,6 +110,19 @@ class Dashboard(View):
"register_stats": register_chart.get_chart(start, end, interval),
"works_stats": works_chart.get_chart(start, end, interval),
}
+
+ # check version
+ try:
+ release = get_data(settings.RELEASE_API, timeout=3)
+ available_version = release.get("tag_name", None)
+ if available_version and version.parse(available_version) > version.parse(
+ settings.VERSION
+ ):
+ data["current_version"] = settings.VERSION
+ data["available_version"] = available_version
+ except ConnectorException:
+ pass
+
return TemplateResponse(request, "settings/dashboard/dashboard.html", data)