Skip to content

Conversation

@cyb3rgh05t
Copy link
Contributor

updated to latest dockserver release

Description of the change

Benefits

Possible drawbacks

Applicable issues

  • fixes #

Additional information

updated to latest dockserver release
Copilot AI review requested due to automatic review settings December 18, 2025 12:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a major UI overhaul for the docker-uploader application, updating it to the latest dockserver release (version 5.0.0). The changes include a complete redesign of the web interface with a modern, responsive layout featuring multiple theme options, improved API endpoints for better data management, and enhanced backend functionality.

Key Changes

  • Complete UI redesign with modern, responsive interface featuring sidebar navigation and 17 theme options
  • New API endpoints for version checking, environment settings management, and queue statistics
  • Database schema enhancements including new columns for better data tracking (filesize_bytes, time_end_clean, successful)
  • Improved error handling and database operations with busy timeout support
  • Enhanced shell scripts with environment file validation and safer update mechanisms

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
index.html Complete redesign with sidebar navigation, dashboard cards, and multi-section layout
js/app.js Comprehensive rewrite with modular functions, auto-save, and enhanced state management
js/utils.js New utility file with helper functions for formatting, theme management, and data handling
css/styles.css New stylesheet replacing old style.css with modern CSS variables and theme support
srv/api/system/version.php New endpoint for version checking with fallback mechanisms
srv/api/system/update_env.php New endpoint for updating environment settings with validation
srv/api/system/env_settings.php New endpoint for reading environment settings
srv/api/jobs/queue_stats.php New endpoint for queue statistics
srv/api/jobs/queue.php New endpoint for queue file listing
srv/entities/UploadJobStatus.php Added new properties for enhanced job tracking
srv/entities/StatusResponse.php Added uptime and storage properties
init-install/run Enhanced with environment file validation and database schema updates
function-gdsa.sh Improved with filesize_bytes tracking and safer database operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +178 to +192
// Find the appropriate section to add the setting
foreach ($data as $key => $value) {
// Convert key to uppercase for env file
$upperKey = strtoupper($key);

// Check if the value needs quotes
if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) {
$formattedValue = $value;
} else {
if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) {
$formattedValue = $value;
} else {
$formattedValue = '"' . $value . '"';
}
}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code has duplicate logic for formatting values (lines 138-147 and lines 184-192). This duplication makes the code harder to maintain. Consider extracting this into a helper function.

Suggested change
// Find the appropriate section to add the setting
foreach ($data as $key => $value) {
// Convert key to uppercase for env file
$upperKey = strtoupper($key);
// Check if the value needs quotes
if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) {
$formattedValue = $value;
} else {
if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) {
$formattedValue = $value;
} else {
$formattedValue = '"' . $value . '"';
}
}
// Helper to consistently format environment values
function formatEnvValue($value)
{
// Check if the value needs quotes
if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) {
return $value;
}
if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) {
return $value;
}
return '"' . $value . '"';
}
// Find the appropriate section to add the setting
foreach ($data as $key => $value) {
// Convert key to uppercase for env file
$upperKey = strtoupper($key);
$formattedValue = formatEnvValue($value);

Copilot uses AI. Check for mistakes.
Comment on lines 12 to +17
$status = StatusResponse::STATUS_UNKNOWN;
$uptime = null;
$storage = null;
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local variables initialized in the constructor are not assigned to the object properties. They should use $this-> to set the actual object properties. Currently, these values are discarded after the constructor completes.

Suggested change
$status = StatusResponse::STATUS_UNKNOWN;
$uptime = null;
$storage = null;
$this->status = StatusResponse::STATUS_UNKNOWN;
$this->uptime = null;
$this->storage = null;

Copilot uses AI. Check for mistakes.

foreach ($lines as $line) {
// Skip comments and section headers
if (strpos($line, '#') === 0 || strpos($line, '##') === 0 || strpos($line, '----') === 0) {
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern uses an unescaped hyphen in a character class which could be interpreted as a range. The hyphen at the end of the pattern should be escaped as '-' or moved to the beginning/end of the character class to avoid ambiguity.

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +124
chmod($envFile, 0755);
chown($envFile, 'abc');
chgrp($envFile, 'abc');

Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chmod operations are attempting to change file ownership using chown/chgrp with the 'abc' user, but these operations may fail silently if the script doesn't have appropriate permissions. Consider adding error checking or removing these operations if they're not essential.

Suggested change
chmod($envFile, 0755);
chown($envFile, 'abc');
chgrp($envFile, 'abc');
if (!@chmod($envFile, 0755)) {
error_log("updateEnvFile: Failed to chmod {$envFile} to 0755");
}
// Change owner and group only when running with sufficient privileges
if (function_exists('posix_getuid') && posix_getuid() === 0) {
if (!@chown($envFile, 'abc')) {
error_log("updateEnvFile: Failed to chown {$envFile} to user 'abc'");
}
if (!@chgrp($envFile, 'abc')) {
error_log("updateEnvFile: Failed to chgrp {$envFile} to group 'abc'");
}
}

Copilot uses AI. Check for mistakes.
continue;
}

// Remove any dangerous characters
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern '/[^A-Za-z0-9_]/' removes all characters except alphanumeric and underscore, but the comment says "Remove any dangerous characters". This is overly broad and will remove legitimate characters like hyphens. Consider being more specific about what constitutes "dangerous" or document why this aggressive filtering is necessary.

Suggested change
// Remove any dangerous characters
// Normalize key: allow only letters, digits, and underscore to avoid unexpected env key formats

Copilot uses AI. Check for mistakes.

switch (timeRange) {
case "day":
days = 1;
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value assigned to days here is unused.

Suggested change
days = 1;

Copilot uses AI. Check for mistakes.
}

// Calculate progress bar class based on percentage
let progressClass = "bg-secondary";
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial value of progressClass is unused, since it is always overwritten.

Suggested change
let progressClass = "bg-secondary";
let progressClass;

Copilot uses AI. Check for mistakes.
@cyb3rgh05t
Copy link
Contributor Author

[5.3.23.2] - 2025-12-18

Fixed

  • SQLite Compatibility: Updated all SQL statements across uploader scripts to use single-quote string syntax instead of double quotes for compatibility with newer SQLite versions
    • Applied to function.sh, function-db.sh, and function-gdsa.sh
    • Implemented proper SQL escaping pattern ${VAR//\'/\'\'} for single quotes in values
    • Affected ~30+ SQL statements (SELECT, INSERT, UPDATE, DELETE operations)
  • Logfile Path Bug: Fixed space character before .txt extension in logfile path generation that caused incorrect log file references
  • CSS Text Overflow: Removed overflow: hidden and text-overflow: ellipsis from .overview-mini-value class to prevent text truncation in dashboard cards
  • TRANSFERS Validation: Improved validation and consistency of TRANSFERS environment variable across all uploader function files

Technical Improvements

  • Enhanced SQL statement compatibility for SQLite 3.44.0+
  • Improved database field escaping and sanitization
  • Standardized TRANSFERS validation logic across backend variants (generic, Dropbox, Google Drive SA)

@fscorrupt fscorrupt requested a review from drag0n141 December 18, 2025 12:54
apprise install fix
removed rclone.conf
improved functions scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant