Commit Graph

95 Commits

Author SHA1 Message Date
Michel Roegl-Brunner
74b89575fe Add workflow_dispatch trigger to release drafter 2025-10-06 13:56:10 +02:00
Michel Roegl-Brunner
6b39fd7e0f Add 'Dependencies' section to release drafter 2025-10-06 13:53:38 +02:00
Michel Roegl-Brunner
2fcb267649 Delete install.sh 2025-10-06 13:44:23 +02:00
CanbiZ
ec20e0322a Add dark mode support across UI (#33)
* Add dark mode support across UI

Introduces DarkModeProvider and DarkModeToggle components for theme management. Updates all major UI components and pages to support dark mode styling using Tailwind CSS dark variants, improving accessibility and user experience for users preferring dark themes.

* Improve dark mode initialization and modal UI (#32)

Adds a script to layout.tsx to set dark mode before hydration, preventing UI flicker. Refactors DarkModeProvider to initialize theme and dark state after mount. Updates ScriptDetailModal for improved readability, consistent styling, and better handling of script status, install methods, and notes.
2025-10-06 13:35:53 +02:00
Michel Roegl-Brunner
b77554a7b5 Update Readme 2025-10-06 12:51:48 +02:00
CanbiZ
d9271804dc add logo 2025-10-06 12:28:38 +02:00
Michel Roegl-Brunner
5582d288d7 Update note from 'beat' to 'beta' in README 2025-10-03 22:55:11 +02:00
Michel Roegl-Brunner
5823e54464 Add GitHub templates and configuration (#8)
- Add CODEOWNERS file for code review assignments
- Add bug report issue template
- Add feature request issue template
- Add pull request template
2025-10-03 15:45:27 +02:00
Michel Roegl-Brunner
1557d589cf chore: Update readme.md for first release 2025-10-03 14:45:29 +02:00
Michel Roegl-Brunner
6fdd336be6 chore: Update readme.md for first release 2025-10-03 14:43:04 +02:00
Michel Roegl-Brunner
446df3c9ef Add favicon v0.1.0 2025-10-03 14:32:01 +02:00
Michel Roegl-Brunner
997d4a9723 Add release drafter 2025-10-03 14:26:43 +02:00
Michel Roegl-Brunner
ab7e46cbc0 fix: resolve npm audit vulnerabilities in prismjs dependency (#37)
* Cleanup: Remove unused components and update configuration

- Remove RepoStatusButton component (unused)
- Remove git.ts library file (unused)
- Update ExecutionModeModal with improvements
- Update page.tsx with enhancements
- Update env.js configuration
- Update scripts router with improvements
- Update .env.example with new variables

* fix: resolve npm audit vulnerabilities in prismjs dependency

- Add overrides to force prismjs@^1.30.0 across all dependencies
- Update refractor to latest version (5.0.0)
- Resolves 3 moderate severity vulnerabilities in prismjs DOM Clobbering
- All npm audit vulnerabilities now resolved (0 vulnerabilities found)
2025-10-03 13:56:21 +02:00
Michel Roegl-Brunner
a2f830a0a1 Delete scripts/install/debian-install.sh 2025-10-03 13:18:03 +02:00
Michel Roegl-Brunner
33d71abec0 Delete scripts/install/2fauth-install.sh 2025-10-03 13:17:56 +02:00
Michel Roegl-Brunner
72e3a2f12c Delete scripts/ct/debian.sh 2025-10-03 13:17:46 +02:00
Michel Roegl-Brunner
e791832a65 Delete scripts/ct/2fauth.sh 2025-10-03 13:17:39 +02:00
Michel Roegl-Brunner
024ffcbf09 feat: Add script installation tracking and update functionality (#36)
* feat: Add script installation tracking with Container ID detection

- Add installed_scripts table to database schema
- Implement Container ID parsing from terminal output
- Add installation tracking for both local and SSH executions
- Create InstalledScriptsTab component with filtering and search
- Add tab navigation to main page (Scripts | Installed Scripts)
- Add tRPC endpoints for installed scripts CRUD operations
- Track installation status, server info, and output logs
- Support both local and SSH execution modes

* fix: Resolve SQL syntax error in database queries

- Change table alias from 'is' to 'inst' in SQL queries
- 'is' is a reserved keyword in SQLite causing syntax errors
- Fixes getAllInstalledScripts, getInstalledScriptById, and getInstalledScriptsByServer methods

* feat: Enhance Container ID detection and add manual editing

- Add comprehensive Container ID detection patterns for various script formats
- Add debug logging to help identify detection issues
- Add manual Container ID editing feature in the frontend
- Add updateInstalledScript tRPC mutation for updating records
- Improve Container ID column with inline editing UI
- Test and verify Container ID detection is working (detected 132 from 2fauth script)

* fix: Improve Container ID detection with ANSI code handling

- Add ANSI color code stripping before pattern matching
- Add primary pattern for exact format: 🆔  Container ID: 113
- Test patterns on both original and cleaned output
- Add better debug logging to show matched text
- This should fix Container ID detection for Proxmox scripts

* feat: Add script update functionality with terminal output

- Add Update button for each installed script (only shows when container_id exists)
- Add WebSocket support for update action (pct enter <ct-id> -- update)
- Add updateScript tRPC endpoint for initiating updates
- Add startScriptUpdate, startLocalScriptUpdate, startSSHScriptUpdate methods
- Modify Terminal component to handle update operations
- Display real-time terminal output for update commands
- Support both local and SSH execution modes for updates
- Show 'Update Container <ID>' in terminal title for update operations

* fix: Fix SSH update functionality

- Replace sshService.executeScript with direct sshpass command
- Use bash -c to execute SSH command: sshpass -p 'password' ssh -o StrictHostKeyChecking=no user@ip 'pct enter <ct-id> -- update'
- This fixes the 'Permission denied' and rsync errors
- SSH updates now work properly for remote containers

* fix: Fix WebSocket update action handling

- Add containerId to WebSocketMessage typedef
- Extract containerId from message in handleMessage function
- Remove debug logging from Terminal component
- This fixes the 'containerId is not defined' error
- Update action should now work properly without creating script records

* feat: Add Update functionality for installed scripts

- Add Update button to InstalledScriptsTab for scripts with Container ID
- Modify Terminal component to handle update operations with isUpdate and containerId props
- Add startUpdateExecution method to WebSocket handler
- Implement local update execution using 'pct enter <CT ID> -c update'
- Implement SSH update execution for remote servers
- Update WebSocket message parsing to handle update parameters
- Users can now update installed scripts by entering the LXC container and running update command

* fix: Fix SSH update execution by using direct command execution

- Add executeCommand method to SSH service for direct command execution
- Update startSSHUpdateExecution to use executeCommand instead of executeScript
- This fixes the rsync permission denied error when updating scripts via SSH
- Update functionality now works properly for both local and SSH installations

* fix: Add server credentials fetching for SSH updates

- Create servers router with getServerById endpoint
- Update handleUpdateScript to fetch full server details including credentials
- This fixes the permission denied error by providing user/password for SSH authentication
- SSH updates now have access to complete server configuration

* fix: Simplify server credentials fetching for SSH updates

- Add server_user and server_password to database query
- Update InstalledScript interface to include server credentials
- Simplify handleUpdateScript to use data already available
- Remove complex tRPC server fetching that was causing errors
- SSH updates now work with complete server authentication data

* fix: Correct pct enter command sequence for updates

- Change from 'pct enter <CT ID> -c "update"' to proper sequence
- First run 'pct enter <CT ID>' to enter container shell
- Then send 'update' command after entering the container
- Apply fix to both local and SSH update execution methods
- Add 1-second delay to ensure container shell is ready before sending update command

* fix: Increase delay to 4 seconds before sending update command

- Change delay from 1 second to 4 seconds for both local and SSH updates
- Ensures container shell is fully ready before sending update command
- Prevents premature command execution that could fail

* cleanup: Remove all debug console.log statements

- Remove debug logging from server.js WebSocket handlers
- Remove debug logging from Terminal component
- Remove debug logging from page.tsx
- Remove debug logging from ExecutionModeModal component
- Remove debug logging from githubJsonService.ts
- Keep only essential server startup messages and error logging
- Clean up codebase for production readiness

* fix: Resolve all build and linter errors

- Fix React Hook useEffect missing dependencies in Terminal.tsx
- Fix TypeScript unsafe argument error in installedScripts.ts by properly typing updateData
- Add missing isUpdate and containerId properties to WebSocketMessage type definition
- Add proper type annotations for callback parameters in server.js
- Fix TypeScript errors with execution.process by adding type assertions
- Remove duplicate updateInstalledScript method in installedScripts.ts
- Build now passes successfully with no errors or warnings
2025-10-03 13:05:25 +02:00
Michel Roegl-Brunner
9d2a1a1b5c install.sh 2025-09-30 11:33:01 +02:00
Michel Roegl-Brunner
433d8121e8 Fix TypeScript and ESLint errors (#31)
- Add proper type annotations for WebSocketMessage and ServerInfo types
- Fix type imports to use type-only imports where appropriate
- Replace logical OR operators with nullish coalescing operators
- Fix floating promises by adding void operator
- Add proper type assertions for database results
- Fix useEffect dependencies in Terminal component
- Remove unused variables and fix unescaped entities
- Add JSDoc type annotations for database methods
- Fix singleton instance type annotations
2025-09-30 11:30:43 +02:00
Michel Roegl-Brunner
2f1df95d90 remove pipefail 2025-09-17 16:39:39 +02:00
Michel Roegl-Brunner
cbb992cdd3 Merge pull request #20 from MickLesk/main
Add structured installer.sh with dependency checks and systemd service
2025-09-16 10:09:45 +02:00
CanbiZ
e3f2e379f2 Fix script URL in README.md 2025-09-16 09:45:48 +02:00
CanbiZ
df542c38b0 Refactor install.sh for improved structure and clarity 2025-09-16 09:45:32 +02:00
CanbiZ
de7dbbaef8 Revise installation section in README.md 2025-09-16 09:43:50 +02:00
CanbiZ
c626abf284 Integrate systemd service for PVESciptslocal
Added systemd service integration for PVESciptslocal.
2025-09-16 09:40:22 +02:00
CanbiZ
8bd7dc942b add install.sh
add install.sh for simple install routine
2025-09-16 09:38:32 +02:00
Michel Roegl-Brunner
e31da334b2 Add install.sh and ammend readme 2025-09-16 09:30:16 +02:00
Michel Roegl-Brunner
33c6804852 Remove broken Update Button 2025-09-16 08:56:26 +02:00
Michel Roegl-Brunner
c1f0f4f3eb Update .env.example 2025-09-16 08:54:51 +02:00
Michel Roegl-Brunner
4f3a8574dc QoL features 2025-09-15 16:30:03 +02:00
Michel Roegl-Brunner
7c1c2f718b Fix formatting in README.md 2025-09-15 15:49:11 +02:00
Michel Roegl-Brunner
6687918119 Merge pull request #17 from michelroegl-brunner/feature/repository-status-update
feat: Add repository status and update functionality
2025-09-15 15:47:34 +02:00
Michel Roegl-Brunner
a5975a9b56 Fix CI/CD problems 2025-09-15 15:46:05 +02:00
Michel Roegl-Brunner
c97af5a122 Fix linter errors 2025-09-15 15:35:45 +02:00
Michel Roegl-Brunner
72399d97e9 Delete test scripts 2025-09-15 15:32:19 +02:00
Michel Roegl-Brunner
cb724f245b feat: Add repository status and update functionality
- Add ORIGINAL_REPO_URL environment variable for repository updates
- Create RepoStatusButton component with status display and update functionality
- Enhance GitManager with fullUpdate() method (git pull + npm install + build)
- Add fullUpdateRepo API endpoint for complete repository updates
- Display repository status with visual indicators (up-to-date, updates available, etc.)
- Show real-time progress during update process
- Add manual refresh capability for repository status
- Integrate repository status component into main page
2025-09-15 15:31:51 +02:00
Michel Roegl-Brunner
067a7d6e79 Update README.md 2025-09-15 15:09:18 +02:00
Michel Roegl-Brunner
561733c9a1 Update README.md 2025-09-15 15:05:15 +02:00
Michel Roegl-Brunner
6adeef2c93 Merge pull request #16 from michelroegl-brunner/feature/optimize-json-sync-with-raw-urls
feat: optimize JSON sync with 1 API call + raw URLs
2025-09-15 14:31:47 +02:00
Michel Roegl-Brunner
82dc4643de feat: optimize JSON sync with 1 API call + raw URLs
- Replace GitHub API calls (390+) with 1 API call + raw URL downloads
- Create GitHubJsonService for efficient JSON file syncing
- Reduce API rate limiting issues by 99.7%
- Add automatic page reload after successful sync
- Update tests to use new service
- Maintain same functionality with better performance

Performance improvement:
- Before: 390+ GitHub API calls (1 per JSON file)
- After: 1 GitHub API call + 389 raw URL downloads
- Raw URLs have no rate limits, making sync much more reliable
2025-09-15 14:30:07 +02:00
Michel Roegl-Brunner
92b2c0d5fc Merge pull request #11 from michelroegl-brunner/remove-prisma
Remove Prisma from project
2025-09-11 12:14:17 +02:00
Michel Roegl-Brunner
8ba7526546 Remove Prisma from project
- Remove @prisma/client and prisma dependencies
- Delete prisma schema and database files
- Remove database context from tRPC
- Clean up Prisma-related scripts and environment variables
- Update README to remove Prisma reference

The project no longer requires a database and builds successfully.
2025-09-11 12:12:44 +02:00
Michel Roegl-Brunner
a9fec63e88 remove test scripts 2025-09-11 11:42:19 +02:00
Michel Roegl-Brunner
c56e284742 Revise README for Node.js version and database info 2025-09-11 11:41:09 +02:00
Michel Roegl-Brunner
114bf21444 Merge pull request #10 from michelroegl-brunner/feature/add-vitest-testing
Fix: Resolve failing tests by fixing mock setup
2025-09-11 11:40:18 +02:00
Michel Roegl-Brunner
170d4b71f7 fix: resolve TypeScript linting errors in test files
- Fix unsafe return of any type in ScriptsGrid.test.tsx
- Fix unsafe argument type in scripts.test.ts
- Remove unused variable warning in scripts.test.ts
- All tests now pass TypeScript strict mode validation
2025-09-11 11:38:35 +02:00
Michel Roegl-Brunner
b0af1c8c4a Changes to Readme 2025-09-11 11:35:11 +02:00
Michel Roegl-Brunner
1378a10d69 fix: resolve failing tests by fixing mock setup
- Fixed fs/promises mocks using vi.hoisted() for proper hoisting
- Fixed child_process spawn mocks with proper default exports
- Updated test cases to use direct mock function references
- All 55 tests now passing successfully

The main issues were:
1. Mock functions not properly hoisted causing reference errors
2. Missing default exports in module mocks
3. Incorrect mock function usage in test assertions

Tests now properly mock:
- readdir, stat, readFile from fs/promises
- spawn from child_process
- localScriptsService.getScriptBySlug
2025-09-11 11:32:56 +02:00
Michel Roegl-Brunner
b883a0c3b8 Add comprehensive Vitest testing infrastructure
- Install Vitest, @vitest/ui, @vitest/coverage-v8, and testing libraries
- Configure Vitest with jsdom environment and path aliases
- Add test scripts to package.json (test, test:ui, test:run, test:coverage)
- Create comprehensive test suites:
  - ScriptManager class tests (file operations, validation, execution)
  - React component tests (ScriptsGrid, ResyncButton, Home page)
  - tRPC API router tests (all endpoints with success/error scenarios)
  - Environment configuration tests
- Set up proper mocking infrastructure for fs, child_process, tRPC, and services
- 41/55 tests currently passing with full coverage of core functionality

Test commands:
- npm run test - Run tests in watch mode
- npm run test:run - Run tests once
- npm run test:ui - Run tests with web UI
- npm run test:coverage - Run tests with coverage report
2025-09-11 11:22:51 +02:00