Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2552bfd1f9 |
@@ -5,6 +5,13 @@ All notable changes to Library Desk will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.4.1] - 2025-12-24
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Wiki.js API token now optional - GraphQL API works without authentication
|
||||||
|
- Container startup failure when `WIKI_GRAPHQL_API` env var not set
|
||||||
|
|
||||||
## [1.4.0] - 2025-12-24
|
## [1.4.0] - 2025-12-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "library-desk"
|
name = "library-desk"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
description = "Coordination service for The Library system - HybridRAG queries, document ingestion, entity extraction, and knowledge consolidation"
|
description = "Coordination service for The Library system - HybridRAG queries, document ingestion, entity extraction, and knowledge consolidation"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
@@ -35,16 +35,19 @@ class WikiJSClient:
|
|||||||
self.graphql_url = f"{self.base_url}/graphql"
|
self.graphql_url = f"{self.base_url}/graphql"
|
||||||
self.api_token = api_token
|
self.api_token = api_token
|
||||||
self.client = httpx.AsyncClient(timeout=30.0)
|
self.client = httpx.AsyncClient(timeout=30.0)
|
||||||
logger.info(f"Initialized Wiki.js client: {base_url} (using API token)")
|
auth_mode = "with API token" if api_token else "without auth (open API)"
|
||||||
|
logger.info(f"Initialized Wiki.js client: {base_url} ({auth_mode})")
|
||||||
|
|
||||||
async def close(self):
|
async def close(self):
|
||||||
"""Close HTTP client"""
|
"""Close HTTP client"""
|
||||||
await self.client.aclose()
|
await self.client.aclose()
|
||||||
|
|
||||||
def _ensure_authenticated(self):
|
def _get_headers(self) -> Dict[str, str]:
|
||||||
"""Verify API token is configured."""
|
"""Get request headers, optionally including auth token."""
|
||||||
if not self.api_token:
|
headers = {"Content-Type": "application/json"}
|
||||||
raise Exception("Wiki.js API token not configured")
|
if self.api_token:
|
||||||
|
headers["Authorization"] = f"Bearer {self.api_token}"
|
||||||
|
return headers
|
||||||
|
|
||||||
async def _execute_query(
|
async def _execute_query(
|
||||||
self,
|
self,
|
||||||
@@ -64,18 +67,12 @@ class WikiJSClient:
|
|||||||
Raises:
|
Raises:
|
||||||
Exception: If query fails or returns errors
|
Exception: If query fails or returns errors
|
||||||
"""
|
"""
|
||||||
# Ensure API token is configured
|
|
||||||
self._ensure_authenticated()
|
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"query": query,
|
"query": query,
|
||||||
"variables": variables or {}
|
"variables": variables or {}
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = {
|
headers = self._get_headers()
|
||||||
"Authorization": f"Bearer {self.api_token}",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = await self.client.post(
|
response = await self.client.post(
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# Wiki.js Configuration
|
# Wiki.js Configuration
|
||||||
wikijs_url: str = Field(default="http://wiki:3000", description="Wiki.js URL")
|
wikijs_url: str = Field(default="http://wiki:3000", description="Wiki.js URL")
|
||||||
wiki_graphql_api: str = Field(..., description="Wiki.js GraphQL API token (JWT)")
|
wiki_graphql_api: str = Field(default="", description="Wiki.js GraphQL API token (optional - API may be open)")
|
||||||
# Legacy auth fields - kept for backwards compatibility but deprecated
|
# Legacy auth fields - kept for backwards compatibility but deprecated
|
||||||
wikijs_username: str = Field(default="", description="Wiki.js username (deprecated, use wiki_graphql_api)")
|
wikijs_username: str = Field(default="", description="Wiki.js username (deprecated, use wiki_graphql_api)")
|
||||||
wikijs_password: str = Field(default="", description="Wiki.js password (deprecated, use wiki_graphql_api)")
|
wikijs_password: str = Field(default="", description="Wiki.js password (deprecated, use wiki_graphql_api)")
|
||||||
|
|||||||
Reference in New Issue
Block a user