Commit Graph

8086 Commits (79e490c5fa6031af7baa83f04f751bdc790dc408)

Author SHA1 Message Date
Aditya Toshniwal 79e490c5fa Updated yarn.lock file to use yarn v4.14.0 and fix the builds 2026-04-17 17:13:19 +05:30
Ashesh Vashi e4edcf2253
fix: SharedServer feature parity columns and write guards (#9835)
Add passexec_cmd, passexec_expiration, kerberos_conn, tags, and
post_connection_sql to SharedServer so non-owners get their own
per-user values instead of inheriting the owner's.  Drop the unused
db_res column which was never overlaid or writable by non-owners.

Key changes:
- New Alembic migration (sharedserver_feature_parity) adds 5 columns,
  drops db_res, cleans up orphaned records.  All operations idempotent.
- Overlay copies new fields from SharedServer instead of suppressing
- _owner_only_fields guard blocks non-owners from setting passexec_cmd,
  passexec_expiration, db_res, db_res_type via API
- Non-owners can set post_connection_sql (runs under their own creds)
- update_tags and flag_modified use sharedserver for non-owners
- update() response returns sharedserver tags for non-owners
- ServerManager passexec suppression with config.SERVER_MODE guard
- UI: post_connection_sql editable for non-owners (readonly only when
  connected, not when shared)
- SCHEMA_VERSION bumped to 51
- Comprehensive unit tests for overlay, write guards, and tag deltas
2026-04-13 15:03:31 +05:30
Ashesh Vashi 4ddb16f47a
fix: customize container user permissions using PUID and PGID. #9657 (#9833)
Add support for custom container user permissions via PUID and PGID
environment variables. When the container is started as root
(--user root), the pgadmin user is reassigned to the requested UID/GID
and all initialization runs under that user via su-exec, ensuring
files are created with correct ownership from the start.

Key changes:
- Dockerfile: add su-exec package, add chmod g=u for /run/pgadmin
  (fixes OpenShift random UID access)
- entrypoint.sh: add PUID/PGID validation and privilege dropping
  before initialization (not after), preserving OpenShift compatibility

Three modes supported:
- Default (USER 5050): unchanged behavior
- Custom UID (--user root -e PUID=N -e PGID=N): drops to target user
  before any init
- OpenShift (random UID, GID 0): passwd fixup + group permissions
2026-04-13 14:34:18 +05:30
Ashesh Vashi a3a0537277
fix: Bump runtime dependencies and upgrade ESLint to v10 (#9834)
- electron: 41.0.2 → 41.2.0
- eslint: ^9.39.2 → ^10.2.0
- axios: ^1.13.5 → ^1.15.0
- electron-context-menu: ^4.1.0 → ^4.1.2
- Added @eslint/js and globals as explicit devDependencies (required by ESLint 10)
- Fixed no-useless-assignment lint errors in downloader.js and misc.js
2026-04-09 21:31:17 +05:30
Ashesh Vashi 9a76ed80bb
fix: enforce data isolation and harden shared servers in server mode (#9830)
pgAdmin 4 in server mode had no data isolation between users — any
authenticated user could access other users' private servers,
background processes, and debugger state by guessing object IDs.
The shared server feature had 21 vulnerabilities including credential
leaks, privilege escalation via passexec_cmd, and owner data
corruption via SQLAlchemy session mutations.

Centralized access control:
- New server_access.py with get_server(), get_server_group(),
  get_user_server_query() replacing ~20 unfiltered queries
- connection_manager() raises ObjectGone (HTTP 410) in server mode
  when access is denied — fixes 155+ unguarded callers
- UserScopedMixin.for_user() on 10 models replaces scattered
  user_id filters

Shared server isolation (all 21 audit issues):
- Expunge server from session before property merge to prevent
  owner data corruption
- Suppress passexec_cmd, post_connection_sql for non-owners in
  merge, API response, and ServerManager
- Override all 6 SSL/passfile connection_params keys from
  SharedServer; strip owner-only keys; sanitize on creation
- _is_non_owner() helper centralises 15+ inline ownership checks
- SharedServer lookup uses (osid, user_id) not name
- Unique constraint on SharedServer(osid, user_id)
- Tunnel/DB password save, change_password, clear_saved_password,
  clear_sshtunnel_password all branch on ownership
- Only owner can unshare (delete_shared_server guard)
- Session restore includes shared servers
- tunnel_port/tunnel_keep_alive copied from owner, not hardcoded

Tool/module hardening:
- All tool endpoints use get_server()
- Debugger function arguments scoped by user_id
- Background processes use Process.for_user()
- Workspace adhoc servers scoped to current user

Migration (schema version 49 -> 50):
- Add user_id to debugger_function_arguments composite PK
- Add indexes on server, sharedserver, servergroup
- Add unique constraint on sharedserver(osid, user_id)
2026-04-09 18:32:59 +05:30
Ashesh Vashi 872d5ac0b3
fix: Bump python & javascript dependencies (#9827)
* Update Python dependencies:
   - google-auth-oauthlib 1.3.0 → 1.3.1
   - sphinxcontrib-youtube 1.4.1 → 1.5.0
   - fixtures 4.3.1 → 4.3.2
   - Add missing newline at end of requirements files

* Update JavaScript dependencies:
   - Replace deprecated @babel/plugin-proposal-* packages with @babel/plugin-transform-* equivalents
   - Remove unused @types/classnames dependency
   - Update yarn.lock
   - Pin the 'react-frame-component' to '~5.2.6'

* fix: Use PostGIS 36 for EPAS 18 in CI workflow
   - EPAS 18 ships with edb-as18-postgis36 instead of postgis34.
   - Add a postgisver matrix variable to support mixed versions.
   - Add exclude+include for EPAS 18 PostGIS matrix to fix empty runs-on

* Moving '@babel/plugin-transform-class-properties', '@babel/preset-react' to devDependencies section
2026-04-08 17:31:56 +05:30
rztrainlocal d59fcf3459
fix(9656): Use absolute paths for a2enmod, a2enconf for debain setup script (#9815)
Reason: On debian, it does not have `/usr/sbin` in the path environment variable anymore.

Co-authored-by: rztrainlocal <ke@KE-U758.HOME>
2026-04-06 21:48:19 +05:30
Akshay Joshi d8a078af53 Updated version for release v9.14 2026-03-30 17:44:32 +05:30
Dave Page 9bb96360dd
Support /v1/responses for OpenAI models. #9795
* Support /v1/responses for OpenAI models. #9795

* Address CodeRabbit review feedback on OpenAI provider.

- Preserve exception chains with 'raise ... from e' in all
  exception handlers for better debugging tracebacks.
- Use f-string !s conversion instead of str() calls.
- Extract duplicated max_tokens error handling into a shared
  _raise_max_tokens_error() helper method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Validate api_url and use incomplete_details from Responses API.

- Strip known endpoint suffixes (/chat/completions, /responses) from
  api_url in __init__ to prevent doubled paths if a user provides a
  full endpoint URL instead of a base URL.
- Use incomplete_details.reason from the Responses API to properly
  distinguish between max_output_tokens and content_filter when the
  response status is 'incomplete', in both the non-streaming and
  streaming parsers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 14:16:22 +05:30
Libor M. 2228575564
Czech translation for version 9.14 2026-03-30 12:43:22 +05:30
Khushboo Vashi 5dd0de9e0f Revert "Update JavaScript dependencies."
This reverts commit 92bb092718.
2026-03-30 12:29:48 +05:30
Khushboo Vashi aa3dc389e4 Update Release Notes. 2026-03-27 14:27:15 +05:30
Akshay Joshi 92bb092718 Update JavaScript dependencies. 2026-03-27 13:23:18 +05:30
Anil Sahoo 3598840203
Fixed an issue where ALT+F5 for executing a query in the Query Tool shows a crosshair cursor icon for rectangular selection. #9570 2026-03-27 12:59:35 +05:30
Domenico Sgarbossa 792441ab95
Updated Italian translation for v9.14. 2026-03-27 11:30:59 +05:30
Anil Sahoo 2c626d1181
Fixed Geometry Viewer not auto-updating on first query execution after View/Edit Data to Query Tool promotion. #9392 2026-03-27 11:23:47 +05:30
Pravesh Sharma 278e812293
Fixed an issue where the default fillfactor value for B-tree indexes was incorrect. #9648 2026-03-27 11:20:40 +05:30
Pravesh Sharma 1d51a1a943
Fixed an issue where the Query tool kept prompting for a password when using a shared server. #9789 2026-03-27 11:03:15 +05:30
Dave Page bf649420b7
Fix a couple of related issues in the Query Tool layout.
- Hide the AI Assistant tab if AI is disabled or unconfigured. #9696
- Ensure the AI Assistant tab is not the first one shown.
2026-03-27 11:01:42 +05:30
Anil Sahoo 1c93f93a6a
Fixed Python & feature test failures caused by Werkzeug 3.1.7 rejecting empty Host header in CSRF token generation. 2026-03-26 17:59:58 +05:30
Akshay Joshi 3ba887001a Updated message catalogs for v9.14 2026-03-26 17:06:45 +05:30
Akshay Joshi 257654849b Updated Javascript and Python dependencies. 2026-03-17 12:12:00 +05:30
Dave Page d7f462c22c
Clarify where the LLM API key files should be. #9758 2026-03-17 11:44:17 +05:30
Dave Page 6296016b67
Fix an issue where LLM responses are not streamed or rendered properly in the AI Assistant. #9734
* Address CodeRabbit review feedback for streaming and SQL extraction.

- Anthropic: preserve separators between text blocks in streaming to
  match _parse_response() behavior.
- Docker: validate that the API URL points to a loopback address to
  constrain the request surface.
- Docker/OpenAI: raise LLMClientError on empty streams instead of
  yielding blank LLMResponse objects, matching non-streaming behavior.
- SQL extraction: strip trailing semicolons before joining blocks to
  avoid double semicolons in output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address remaining CodeRabbit review feedback for streaming and rendering.

- Use distinct 3-tuple ('complete', text, messages) for completion events
  to avoid ambiguity with ('tool_use', [...]) 2-tuples in chat streaming.
- Pass conversation history from request into chat_with_database_stream()
  so follow-up NLQ turns retain context.
- Add re.IGNORECASE to SQL fence regex for case-insensitive matching.
- Render MarkdownContent as block element instead of span to avoid
  invalid DOM when response contains paragraphs, lists, or tables.
- Keep stop notice as a separate message instead of appending to partial
  markdown, preventing it from being swallowed by open code fences.
- Snapshot streamingIdRef before setMessages in error handler to avoid
  race condition where ref is cleared before React executes the updater.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address CodeRabbit review feedback for streaming providers and history.

- Fix critical NameError: use self._api_url instead of undefined API_URL
  in anthropic and openai streaming _process_stream() methods.
- Match sync path auth handling: conditionally set API key headers in
  streaming paths for both anthropic and openai providers.
- Remove unconditional temperature from openai streaming payload to
  match sync path compatibility approach.
- Add URL scheme validation to OllamaClient.__init__ to prevent unsafe
  local/resource access via non-http schemes.
- Guard ollama streaming finalizer: raise error when stream drops
  without a done frame and no content was received.
- Update chat.py type hint and docstring for 3-tuple completion event.
- Serialize and return filtered conversation history in the complete
  SSE event so the client can round-trip it on follow-up turns.
- Store and send conversation history from NLQChatPanel, clear on
  conversation reset.
- Fix JSON-fallback SQL render path: clear content when SQL was
  extracted without fenced blocks so ChatMessage uses sql-only renderer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix missing closing brace in NLQChatPanel switch statement.

Adding block scoping to the error case introduced an unmatched brace
that prevented the switch statement from closing properly, causing
an eslint parse error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix missing compaction module and SQL extraction test.

- Replace compaction module imports with inline history deserialization
  and filtering since compaction.py is on a different branch.
- Add rstrip(';') to SQL extraction test to match production code,
  fixing double-semicolon assertion failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix SQL extraction test expected values after rstrip(';') change.

The rstrip(';') applied to each block before joining means single
blocks and the last block in multi-block joins no longer have
trailing semicolons. Update expected values to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Strictly guard Ollama stream: raise if no terminal done frame received.

Truncated content from a dropped connection should not be treated as
a complete response, even if partial text was streamed. Always raise
when final_data is None, matching CodeRabbit's recommendation.
2026-03-17 11:41:57 +05:30
Akshay Joshi e3472103bb Updated release note. 2026-03-16 19:20:18 +05:30
Dave Page 990b4f5e54
Fix an issue where the AI Assistant was not retaining conversation context between messages, with chat history compaction to manage token budgets.
* Address CodeRabbit review feedback for chat context and compaction.

- Track tool-use turns as groups instead of one-to-one pairs, so
  multi-tool assistant messages don't leave orphaned results.
- Add fallback to shrink the recent window when protected messages
  alone exceed the token budget, preventing compaction no-ops.
- Fix low-value test fixtures to keep transient messages short so
  they actually classify as low-importance.
- Guard Clear button against in-flight stream race conditions by
  adding a clearedRef flag and cancelling active streams.
- Assert that conversation history is actually passed through to
  chat_with_database in the "With History" test.

* Address remaining CodeRabbit review feedback for compaction module.

- Expand protected set to cover full tool groups, preventing orphaned
  tool call/result messages when a turn straddles the recent window.
- Add input validation in deserialize_history() for non-list/non-dict data.
- Strengthen test assertion for preserved recent window tail.


* Fix CI test failures in compaction and NLQ chat tests.

- Lower max_tokens budget in test_drops_low_value to reliably force
  compaction (500 was borderline, use 200).
- Consume SSE response data before asserting mock calls in NLQ chat
  test, since Flask's streaming generator only executes on iteration.


* Clarify mock patch target in NLQ chat test.

Add comment explaining why we patch the source module rather than the
use site: the endpoint uses a local import inside the function body,
so there is no module-level binding to patch.
2026-03-16 19:02:36 +05:30
Rohit Bhati 74b1a3bcc4
Fixed Process Watcher garbled text on Windows with non-UTF-8 locales. #9457 2026-03-16 19:00:41 +05:30
Anil Sahoo 01c2d12b51
Fixed an issue where selecting all in the Query Tool's Messages tab would select the entire page content. #8992 2026-03-16 14:39:42 +05:30
Dave Page e5cf456fae
Fixed an issue where AI Reports are grayed out after setting an API key by auto-selecting the default provider. #9694
* Don't let auto-selection override an explicit default_provider choice.

If the same save payload includes a default_provider update (including
setting it to empty/disabled), skip the auto-selection logic so the
user's explicit choice is respected.
2026-03-16 14:24:09 +05:30
Dave Page da55da4d32
Replace misleading AI thinking messages with fun elephant-themed ones. #9702
The previous messages like "Vacuuming the catalog..." and "Analyzing
table statistics..." could be mistaken for actual database operations.
Replace them with clearly whimsical elephant-themed messages, expand
the pool to 32 messages, and consolidate them into a single shared
module with gettext() support.
2026-03-16 14:23:05 +05:30
Akshay Joshi b301bdcecd Updated release note 2026-03-16 12:43:29 +05:30
Dave Page 23bd3359c1
Fixed an issue where AI features are visible in the UI even when LLM_ENABLED is set to False. 2026-03-16 12:35:16 +05:30
Dave Page 0bc4edbab5
Improve the AI Assistant user prompt to be more descriptive of the actual functionality. 2026-03-16 12:34:44 +05:30
Dave Page 34aa360830
Allow copying of text from the AI Assistant chat panel. #9738 2026-03-16 12:16:45 +05:30
Dave Page 7e39fc8477
Fix flakey SchemaDialogView 'change text' JS test
Add a wait for the FormView autofocus timer (200ms) to complete before
typing, preventing a race condition where the autofocus moves focus away
from the target field on slow CI machines. This matches the pattern
already used by simulateValidData in the same test file.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:14:10 +05:30
Dave Page 8f74b2e6d4
Fixed an issue where AI Reports fail with OpenAI models that do not support the temperature parameter. #9719
Removed the temperature parameter from all LLM provider clients and
pipeline calls, allowing each model to use its default. This fixes
compatibility with GPT-5-mini/nano and future models that don't
support user-configurable temperature.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:13:04 +05:30
Dave Page c8cb744ffd
Fix model tool prompt
* Fix NLQ system prompt to work with models that prioritize text instructions over tool calls.

The previous prompt told the model to "Return ONLY the JSON object, nothing else"
while also providing tool definitions. Models like Qwen 3.5 would follow the text
instruction and never use tools. The updated prompt clearly separates the tool-use
phase from the final JSON response phase, and explicitly instructs the model to
call tools directly rather than describing them in text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update release notes for NLQ prompt fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix issue number in release notes for NLQ prompt fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:10:02 +05:30
Dave Page b3aa78c0a5
Added support for custom LLM provider URLs for OpenAI and Anthropic, allowing use of OpenAI-compatible providers such as LM Studio, EXO, and LiteLLM. #9703
- Add configurable API URL fields for OpenAI and Anthropic providers
- Make API keys optional when using custom URLs (for local providers)
- Auto-clear model dropdown when provider settings change
- Refresh button uses current unsaved form values
- Update documentation and release notes

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:08:55 +05:30
Dave Page 78e3b67eb1
Fix an issue where the AI Assistant input textbox sometimes swallows the first character of input. #9740 2026-03-16 12:06:47 +05:30
Muhammad Aqeel c8bd75c9a8
Fix apparmor_parser not found error in desktop postinst script (#9728)
Add a runtime guard in the postinst so apparmor_parser is only called
  when available. Previously, packages built on Ubuntu 24+ would fail to
  install on headless servers or systems without AppArmor tools. A warning
  is printed when the profile load is skipped to aid debugging.
2026-03-10 15:29:40 +00:00
Akshay Joshi a0e6da0772 1) Updated JavaScripts and Python dependecies.
2) Updated release note.
2026-03-10 13:41:19 +05:30
Rohit Bhati 8ca765478f
Fixed an issue where permissions page is not completely accessible on full scroll. #9721 2026-03-10 12:59:42 +05:30
Pravesh Sharma f49c967bfd
Added support to download binary data from result grid. #4011 2026-03-10 12:25:21 +05:30
Khushboo Vashi 0a539c32d9
Fixed an issue where OAuth2 authentication fails with 'object has no attribute' if OAUTH2_AUTO_CREATE_USER is False. #9279 2026-03-10 12:24:55 +05:30
Anil Sahoo 395ff36322
Ensure that the Geometry Viewer refreshes when re-running queries or switching geometry columns, preventing stale data from being displayed. #9392 2026-03-09 16:08:14 +05:30
Florian 00a44a5d76
fix TypeError Exception in session.py
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2026-03-09 12:21:36 +05:30
Daniel Nylander 3ecdc57a59
i18n: Complete Swedish translation (3625/3625 strings)
- Translate all 357 previously untranslated strings
- Fix 1 duplicate entry ('on' with empty msgstr)
- Fix format string mismatch (%(provider)s)
- Total: 3625 translated strings (100% coverage)

Co-authored-by: Daniel Nylander <daniel@danielnylander.se>
2026-03-09 12:21:18 +05:30
Akshay Joshi 08b0f6fe7b 1) Updated Python and Javascripts dependencies.
2) Created new release note files for v9.14
2026-03-05 17:56:33 +05:30
Khushboo Vashi 6d18741f1a Ensure the Kerberos mock test handles OS errors correctly. 2026-03-05 17:44:12 +05:30
Akshay Joshi dc47bf48f7 Remove PG/EPAS 13 from the github runners. 2026-03-05 16:52:41 +05:30