Skip to content

Fix Nextcloud App Critical Issues & Add Configuration#2

Open
elgorro wants to merge 7 commits intomainfrom
fix/nextcloud-critical-issues
Open

Fix Nextcloud App Critical Issues & Add Configuration#2
elgorro wants to merge 7 commits intomainfrom
fix/nextcloud-critical-issues

Conversation

@elgorro
Copy link
Owner

@elgorro elgorro commented Feb 1, 2026

Fix Nextcloud App Critical Issues & Add Configuration

This PR addresses critical bugs and adds essential configuration features for the Nextcloud app.

🐛 Bug Fixes

  • Fix admin settings save endpoint - Admin API key can now be saved (route was missing)
  • Add user settings UI - Users can now configure personal API keys through the UI

✨ New Features

Advanced Configuration Options:

  • Configurable Claude model (custom input with suggestions)
  • Adjustable max tokens (1-100,000, default 4096)
  • Configurable API timeout (10-1800s, default 30s)

Security & Stability:

  • Input validation (max 100KB content length)
  • Rate limiting (10 requests/minute per user)
  • Proper HTTP status codes (429, 413)

📚 Documentation

  • Updated README with new features
  • Updated installation guide with configuration steps
  • Updated ROADMAP to reflect v0.1.1 status

🧪 Test Plan

  • Admin can save API key and advanced settings
  • User can save/clear personal API key
  • Rate limiting works (try 11+ requests/minute)
  • Large files (>5MB) are rejected with error/warning
  • Different models can be configured
  • Settings persist after page reload

📦 Version

Bumps version from 0.1.0 → 0.1.1

elgorro and others added 7 commits February 1, 2026 11:23
Add missing API route and controller method for admin settings:
- Add /api/admin/settings POST route in routes.php
- Implement saveAdmin() method in SettingsController
- Add validation for empty API key
- Store admin key using setAppValue()

This fixes the bug where admins couldn't save API keys through
the UI because the endpoint didn't exist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Create comprehensive personal settings interface:
- New user.php template with API key form
- UserSettings class implementing ISettings interface
- user.js for form handling and API interaction
- user.css for consistent styling
- Register personal settings in info.xml

Features:
- Save personal API key (overrides admin key)
- Clear personal key (fall back to admin key)
- Visual feedback for success/error states
- Confirmation dialog before clearing key

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Input Validation & Rate Limiting:
- Add content length validation (max 100KB)
- Implement rate limiting (10 requests/minute per user)
- Use distributed cache for rate limit tracking
- Return proper HTTP status codes (429, 413)

Configurable Advanced Settings:
- Model selection (custom input with suggestions)
- Max tokens (1-100,000, default 4096)
- API timeout (10-1800s = 30min, default 30s)
- All settings configurable via admin UI

Implementation:
- ChatController: Add rate limiting and validation
- ClaudeService: Configurable model, tokens, timeout
- SettingsController: Save advanced settings
- Admin UI: Form fields for all settings
- Enhanced CSS: Better form styling

This prevents API abuse, quota exhaustion, and provides
flexibility for different use cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update app version to reflect critical bug fixes and
new features added in this release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Mark completed items:
- User settings UI with personal API key override
- Input validation and rate limiting
- Configurable settings (model, tokens, timeout)

Move "Multiple model selection" from Phase 2 to completed
in Phase 1 as it's now implemented with custom model input.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add documentation for new features:
- Advanced settings configuration (model, tokens, timeout)
- User settings location (Personal settings)
- Rate limiting and input validation features

Update README with security and configuration features.
Update installation guide with step-by-step advanced settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Frontend (fileactions.js):
- Check file size before processing using Nextcloud metadata
- Show warning for files >5MB with actual file size
- Inform users about potential failures and admin options
- No need to download large files just to reject them

Backend (ChatController):
- Increase max content length from 100KB to 5MB
- Update error messages to show MB instead of KB
- Maintain protection against excessively large requests

This provides better UX by:
- Warning users upfront about large files
- Not wasting bandwidth downloading files that will be rejected
- Suggesting action (contact admin to increase limit)
- Still allowing files up to 5MB by default

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant