diff --git a/README.md b/README.md index 630e216..9d38ec6 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,7 @@ Run checks and tests with: ``` For compiled frontend assets, run `npm run build`. Django uses Vite in development, the build manifest when present, and checked-in preview assets otherwise. + +## Knowledge Library + +`/knowledge/` is a separate personal link library with its own menu, data and capture API. It does not use Project Manager cards. See [Knowledge Library setup and limitations](docs/knowledge-library.md) and the [Pocket source review](docs/research/knowledge-library-pocket.md). The separate MCP `knowledge:read` scope grants contextual discovery; opt-in ntfy scheduling is available through a management command. diff --git a/config/settings.py b/config/settings.py index e9acaa1..f55d743 100644 --- a/config/settings.py +++ b/config/settings.py @@ -17,6 +17,7 @@ INSTALLED_APPS = [ "django.contrib.staticfiles", "core", "dashboard", + "knowledge", 'projects', 'oauth2_provider', ] @@ -57,6 +58,13 @@ PROJECT_DOCS_MAX_FILES = int(os.environ.get('PROJECT_DOCS_MAX_FILES', '500')) PROJECTS_ATTACHMENT_MAX_BYTES = int(os.environ.get('PROJECTS_ATTACHMENT_MAX_BYTES', 10 * 1024 * 1024)) PROJECTS_ATTACHMENT_MAX_FILES = int(os.environ.get('PROJECTS_ATTACHMENT_MAX_FILES', 50)) PROJECTS_ATTACHMENT_MAX_CARD_BYTES = int(os.environ.get('PROJECTS_ATTACHMENT_MAX_CARD_BYTES', 100 * 1024 * 1024)) +KNOWLEDGE_NTFY_ENABLED = os.environ.get('KNOWLEDGE_NTFY_ENABLED', '0') == '1' +KNOWLEDGE_NTFY_URL = os.environ.get('KNOWLEDGE_NTFY_URL', '') +KNOWLEDGE_NTFY_USER_ID = os.environ.get('KNOWLEDGE_NTFY_USER_ID', '') +KNOWLEDGE_NTFY_MODE = os.environ.get('KNOWLEDGE_NTFY_MODE', 'forgotten') +KNOWLEDGE_NTFY_WEEKLY_LIMIT = int(os.environ.get('KNOWLEDGE_NTFY_WEEKLY_LIMIT', '2')) +KNOWLEDGE_NTFY_QUIET_START = int(os.environ.get('KNOWLEDGE_NTFY_QUIET_START', '22')) +KNOWLEDGE_NTFY_QUIET_END = int(os.environ.get('KNOWLEDGE_NTFY_QUIET_END', '8')) DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3'}} CACHES = { @@ -81,7 +89,7 @@ if not DEBUG and (not MCP_PUBLIC_URL.startswith('https://') or not OAUTH_ISSUER_ raise ImproperlyConfigured('MCP_PUBLIC_URL and OAUTH_ISSUER_URL must use HTTPS in production.') OAUTH2_PROVIDER = { 'OIDC_ISS_ENDPOINT': f'{OAUTH_ISSUER_URL}/', - 'SCOPES': {'projects:read': 'Read projects and cards', 'projects:write': 'Create and edit projects and cards'}, + 'SCOPES': {'projects:read': 'Read projects and cards', 'projects:write': 'Create and edit projects and cards', 'knowledge:read': 'Find saved knowledge links'}, 'DEFAULT_SCOPES': ['projects:read'], 'ALLOWED_REDIRECT_URI_SCHEMES': ['http', 'https'] if DEBUG else ['https'], 'PKCE_REQUIRED': True, diff --git a/config/urls.py b/config/urls.py index 006c218..f558f54 100644 --- a/config/urls.py +++ b/config/urls.py @@ -5,6 +5,7 @@ from django.conf import settings from oauth2_provider.urls import metadata_urlpatterns from core import views from projects import views as project_views +from knowledge import views as knowledge_views urlpatterns = [ *metadata_urlpatterns, @@ -14,6 +15,8 @@ urlpatterns = [ path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('accounts/password/change/', auth_views.PasswordChangeView.as_view(template_name='projects/form.html', success_url='/projects/profile/'), name='password_change'), path('projects/', include('projects.urls')), + path('knowledge/', include('knowledge.urls')), + path('api/bookmarks/', knowledge_views.api_add, name='knowledge_api_add'), path("", include('dashboard.urls')), path("examples/today/", views.today, name="today"), path("health/", views.health, name="health"), diff --git a/core/templates/core/base.html b/core/templates/core/base.html index 0761521..7db9bbd 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -12,6 +12,7 @@ {% vite_assets %} + {% block extra_head %}{% endblock %}
Skip to content @@ -21,7 +22,7 @@ - {% if user.is_authenticated %}{% endif %} + {% if user.is_authenticated %}{% endif %} @@ -31,5 +32,5 @@