110 Commits

Author SHA1 Message Date
greirson
5f59771420
closer 2025-05-06 21:15:14 -07:00
greirson
520c73b726
refactor(docker): Improve Dockerfile for upload directory management 2025-05-06 20:27:11 -07:00
Greirson Lee-Thorp
543ebffb8d
feat: support puid/pgid/umask (#52)
* feat(docker): Enhance Docker configuration and entrypoint management

- Updated .env.example to include user/group ID and umask settings for better file permission management in Docker.
- Modified docker-compose.yml to specify version and added restart policy for the service.
- Enhanced Dockerfile to create user/group based on ARG values and set umask for file creation.
- Introduced entrypoint.sh script to manage user permissions and execute commands with appropriate privileges.

These changes improve the Docker setup for better handling of file permissions and user management, ensuring a smoother development and deployment experience.

* - Update dockerfile to use existing PUID, PGID if exists and create one as fallback.
- include environment variables in docker compose as well

---------

Co-authored-by: gitmotion <43588713+gitmotion@users.noreply.github.com>
2025-05-06 20:17:32 -07:00
greirson
8270c7ccd0
feat(docker): Added a health check endpoint to ensure the application is running properly, enhancing reliability in deployment. 2025-05-06 20:07:02 -07:00
greirson
e4143c38db
fix(footer): Restore footer content in index.html and adjust styles for improved layout
- Reintroduced footer content in index.html to ensure proper display at the bottom of the page.
- Updated styles.css to enhance footer visibility and layout, including adjustments to padding and opacity for better aesthetics.
- Modified body and container styles to accommodate the footer without overlap, ensuring a cleaner user interface.
2025-05-06 17:03:51 -07:00
greirson
1f236ce086
feat(upload): Add active upload tracking and confirmation dialog for ongoing uploads 2025-05-06 16:38:06 -07:00
greirson
982b7b49e3
feat:(storage) fixing what i borked 2025-05-06 16:26:15 -07:00
greirson
369077676d
refactor(storage): Streamline S3 adapter code and improve metadata handling
- Simplified S3 client initialization and improved error handling for configuration failures.
- Refactored metadata management functions to enhance clarity and maintainability.
- Updated upload logic to better handle multipart uploads and buffer management.
- Improved logging for upload progress and error scenarios, ensuring better visibility during operations.

This commit enhances the S3 adapter's code quality and improves the overall upload process by refining metadata management and error handling.
2025-05-06 13:50:44 -07:00
greirson
165223f8ed
feat(upload): Enhance file upload functionality with improved metadata management and user experience
- Updated index.html to accept only image and video file types for uploads, enhancing user guidance.
- Refactored upload.js to improve error handling and validation for batch uploads, ensuring better user feedback.
- Introduced quality-of-life features in the upload process, including a flag for active uploads to prevent page closure during uploads.
- Enhanced S3 adapter to manage upload metadata more effectively, allowing for resumable uploads and better tracking of upload states.

This commit significantly improves the upload experience by refining file type handling, enhancing error management, and ensuring robust metadata support for uploads.
2025-05-06 13:44:26 -07:00
greirson
1273fe92b1
feat(storage): Enhance S3 adapter with unique folder prefix handling
- Added functionality to ensure top-level folder prefixes are unique per batch to prevent collisions during uploads.
- Improved error logging for S3 operations, including detailed context for failures.
- Refactored metadata management functions to streamline the upload process and ensure robust handling of local metadata.
- Updated the S3 client initialization and metadata directory management for better reliability.

This commit enhances the S3 adapter's capability to manage file uploads more effectively, improving user experience and reducing potential conflicts during concurrent uploads.
2025-05-06 10:50:33 -07:00
Greirson Lee-Thorp
c24e866074
feat(storage): Implement S3 and local storage adapters with enhanced configuration (#54)
- Introduced a storage adapter factory to dynamically select between local and S3 storage based on the STORAGE_TYPE environment variable.
- Added S3 adapter for handling file operations on AWS S3, including multipart uploads and presigned URLs.
- Implemented local storage adapter for managing file operations on the local filesystem.
- Enhanced configuration validation to ensure proper setup for both storage types.
- Updated .env.example and README.md to document new storage configuration options and usage.

This commit significantly improves the application's flexibility in handling file uploads by supporting both local and cloud storage options, enhancing user experience and deployment versatility.

Fixes #25
2025-05-05 22:17:45 -07:00
greirson
cb7e49b0e1
refactor(app): Improve error handling and HTML response processing in root route
- Enhanced error logging to include specific context for index.html processing errors.
- Added checks to ensure headers are sent only when appropriate, preventing potential issues with multiple responses.
- Improved comments for clarity on the purpose of code sections, particularly around HTML processing and error handling.

feat(config): Log raw FOOTER_LINKS from environment variables

- Introduced logging for the raw FOOTER_LINKS value to aid in debugging and configuration verification.
- Maintained existing functionality while enhancing visibility into configuration values.
2025-05-05 17:19:40 -07:00
greirson
5666569580
Merge branch 'main' of https://github.com/DumbWareio/DumbDrop into dev, add dev branch push to dockerhub 2025-05-05 16:53:58 -07:00
Greirson Lee-Thorp
6f1b93ed39
feat: footer (#53)
* fix: Correct BASE_URL handling in login.html for API requests

* feat(upload): Implement persistent state via metadata for resumability (#50) (#51)

* feat: Enhance chunk upload functionality with configurable retry logic

- Introduced MAX_RETRIES configuration to allow dynamic adjustment of retry attempts for chunk uploads.
- Updated index.html to read MAX_RETRIES from server-side configuration, providing a default value if not set.
- Implemented retry logic in uploadChunkWithRetry method, including exponential backoff and error handling for network issues.
- Added console warnings for invalid or missing MAX_RETRIES values to improve debugging.

This commit improves the robustness of file uploads by allowing configurable retry behavior, enhancing user experience during upload failures.

* feat: Enhance upload functionality with metadata management and improved error handling

- Introduced persistent metadata management for uploads, allowing resumability and better tracking of upload states.
- Added special handling for 404 responses during chunk uploads, logging warnings and marking uploads as complete if previously finished.
- Implemented metadata directory creation and validation in app.js to ensure proper upload management.
- Updated upload.js to include metadata read/write functions, improving the robustness of the upload process.
- Enhanced cleanup routines to handle stale metadata and incomplete uploads, ensuring a cleaner state.

This commit significantly improves the upload process by adding metadata support, enhancing error handling, and ensuring better resource management during uploads.

Fixes #24

* feat(footer): Add custom footer links and styles, enhance README and configuration

- Introduced FOOTER_LINKS environment variable for customizable footer links in the application.
- Updated index.html to render footer content dynamically based on FOOTER_LINKS.
- Enhanced styles for the footer in styles.css to improve visual presentation.
- Updated .env.example and README.md to document the new FOOTER_LINKS configuration and its usage.

This commit enhances the user interface by allowing dynamic footer content and improves documentation for better developer understanding.

* fix(footer): Correct footer content rendering logic in app.js

- Initialized footerHtml variable to handle dynamic and static footer content based on the presence of custom footer links.
- Updated logic to ensure that if custom links exist, they are used; otherwise, a default static link is displayed.

This commit improves the footer rendering by ensuring the correct content is displayed based on configuration.
2025-05-05 16:25:10 -07:00
Greirson Lee-Thorp
b256311822
feat(upload): Implement persistent state via metadata for resumability (#50) (#51)
* feat: Enhance chunk upload functionality with configurable retry logic

- Introduced MAX_RETRIES configuration to allow dynamic adjustment of retry attempts for chunk uploads.
- Updated index.html to read MAX_RETRIES from server-side configuration, providing a default value if not set.
- Implemented retry logic in uploadChunkWithRetry method, including exponential backoff and error handling for network issues.
- Added console warnings for invalid or missing MAX_RETRIES values to improve debugging.

This commit improves the robustness of file uploads by allowing configurable retry behavior, enhancing user experience during upload failures.

* feat: Enhance upload functionality with metadata management and improved error handling

- Introduced persistent metadata management for uploads, allowing resumability and better tracking of upload states.
- Added special handling for 404 responses during chunk uploads, logging warnings and marking uploads as complete if previously finished.
- Implemented metadata directory creation and validation in app.js to ensure proper upload management.
- Updated upload.js to include metadata read/write functions, improving the robustness of the upload process.
- Enhanced cleanup routines to handle stale metadata and incomplete uploads, ensuring a cleaner state.

This commit significantly improves the upload process by adding metadata support, enhancing error handling, and ensuring better resource management during uploads.

Fixes #24
2025-05-04 16:30:16 -07:00
greirson
bf1c9a2dbd
fix: Correct BASE_URL handling in login.html for API requests 2025-05-04 11:56:06 -07:00
Greirson Lee-Thorp
105d2a7412
feat(upload): Implement persistent state via metadata for resumability (#50)
* feat: Enhance chunk upload functionality with configurable retry logic

- Introduced MAX_RETRIES configuration to allow dynamic adjustment of retry attempts for chunk uploads.
- Updated index.html to read MAX_RETRIES from server-side configuration, providing a default value if not set.
- Implemented retry logic in uploadChunkWithRetry method, including exponential backoff and error handling for network issues.
- Added console warnings for invalid or missing MAX_RETRIES values to improve debugging.

This commit improves the robustness of file uploads by allowing configurable retry behavior, enhancing user experience during upload failures.

* feat: Enhance upload functionality with metadata management and improved error handling

- Introduced persistent metadata management for uploads, allowing resumability and better tracking of upload states.
- Added special handling for 404 responses during chunk uploads, logging warnings and marking uploads as complete if previously finished.
- Implemented metadata directory creation and validation in app.js to ensure proper upload management.
- Updated upload.js to include metadata read/write functions, improving the robustness of the upload process.
- Enhanced cleanup routines to handle stale metadata and incomplete uploads, ensuring a cleaner state.

This commit significantly improves the upload process by adding metadata support, enhancing error handling, and ensuring better resource management during uploads.
2025-05-04 11:33:01 -07:00
Greirson Lee-Thorp
e963f2bcde
feat: Improve dev experience, Improve Environmental Variable and Folder Control, resolves BASE_URL junk (#49)
* feat: Add ALLOWED_IFRAME_ORIGINS configuration and update security headers (#47)

- Introduced ALLOWED_IFRAME_ORIGINS environment variable to specify trusted origins for iframe embedding.
- Updated security headers middleware to conditionally allow specified origins in Content Security Policy.
- Enhanced documentation in README.md to explain the new configuration and its security implications.

Fixes #35

* feat: Update .env.example and .gitignore for improved configuration management

- Enhanced .env.example with detailed comments for environment variables, including upload settings, security options, and notification configurations.
- Updated .gitignore to include additional editor and OS-specific files, ensuring a cleaner repository.
- Modified package.json to add a predev script for Node.js version validation and adjusted the dev script for nodemon.
- Improved server.js shutdown handling to prevent multiple shutdowns and ensure graceful exits.
- Refactored config/index.js to log loaded environment variables and ensure the upload directory exists based on environment settings.
- Cleaned up fileUtils.js by removing unused functions and improving logging for directory creation.

This commit enhances clarity and maintainability of configuration settings and improves application shutdown behavior.

* feat: Update Docker configuration and documentation for upload handling

- Explicitly set the upload directory environment variable in docker-compose.yml to ensure clarity in file storage.
- Simplified the Dockerfile by removing the creation of the local_uploads directory, as it is now managed by the host system.
- Enhanced README.md to reflect changes in upload directory management and provide clearer instructions for users.
- Removed outdated development configuration files to streamline the development setup.

This commit improves the clarity and usability of the Docker setup for file uploads.

* feat: Add Local Development Guide and update README for clarity

- Introduced a comprehensive LOCAL_DEVELOPMENT.md file with setup instructions, testing guidelines, and troubleshooting tips for local development.
- Updated README.md to include a link to the new Local Development Guide and revised sections for clarity regarding upload directory management.
- Enhanced the Quick Start section to direct users to the dedicated local development documentation.

This commit improves the onboarding experience for developers and provides clear instructions for local setup.

* feat: Implement BASE_URL configuration for asset management and API requests

- Added BASE_URL configuration to README.md, emphasizing the need for a trailing slash when deploying under a subpath.
- Updated index.html and login.html to utilize BASE_URL for linking stylesheets, icons, and API requests, ensuring correct asset loading.
- Enhanced app.js to replace placeholders with the actual BASE_URL during HTML rendering.
- Implemented a validation check in config/index.js to ensure BASE_URL is a valid URL and ends with a trailing slash.

This commit improves the flexibility of the application for different deployment scenarios and enhances asset management.

Fixes #34, Fixes #39, Fixes #38

* Update app.js, borked some of the css n such

* resolved BASE_URL breaking frontend

* fix: Update BASE_URL handling and security headers

- Ensured BASE_URL has a trailing slash in app.js to prevent asset loading issues.
- Refactored index.html and login.html to remove leading slashes from API paths for correct concatenation with BASE_URL.
- Enhanced security headers middleware to include 'connect-src' directive in Content Security Policy.

This commit addresses issues with asset management and improves security configurations.
2025-05-04 10:29:48 -07:00
Greirson Lee-Thorp
107684fe6a
feat: Add ALLOWED_IFRAME_ORIGINS configuration and update security headers (#47) (#48)
- Introduced ALLOWED_IFRAME_ORIGINS environment variable to specify trusted origins for iframe embedding.
- Updated security headers middleware to conditionally allow specified origins in Content Security Policy.
- Enhanced documentation in README.md to explain the new configuration and its security implications.

Fixes #35
2025-05-02 17:25:27 -07:00
V
12ae628bd4
Merge pull request #46 from DumbWareio/greirson/issue45
Tested and working.

tree
├── test
│   ├── dumb.png
│   ├── dumb.txt
│   └── test2
│       ├── dumb.png
│       └── dumb.txt
2025-05-02 15:13:17 -07:00
greirson
ccd06f92bb
feat: Enhance folder upload handling and filename sanitation
- Added support for checking webkitRelativePath in folder uploads, alerting users if their browser does not support this feature.
- Introduced sanitizePathPreserveDirs function to sanitize filenames while preserving directory structure.
- Updated upload route to utilize the new sanitation function and ensure consistent folder naming during uploads.

Fixes #45
2025-05-02 14:38:28 -07:00
abite
8f4b2ea873
Merge pull request #41 from gitmotion/fix/apprise-notifications-not-working-and-cve-fix
Fixed notifications config mapping and filename sanitation/use of spawn for cve/rce
2025-03-13 17:58:37 -04:00
gitmotion
e11c9261f7 Fixed notifications config mapping and filename sanitation for cve/rce
add svg to login / index for favicon

ensure file sanitization before and during notification
2025-03-13 14:24:03 -07:00
abite
81baf87e93
Merge pull request #40 from gitmotion/feature/add-pwa-registration
Add PWA Registration
2025-03-12 16:22:25 -05:00
gitmotion
c4a806604a Add PWA Registration 2025-03-12 14:00:38 -07:00
V
fc83e527b7
feat: Add Demo Mode for Testing and Evaluation (#37)
* demo things.
2025-02-27 11:25:25 -08:00
Chris
c6a969b5cd
feat: pin not working when rate limited redirect fix & allow non https baseUrl pin fix (#32)
* feat: ratelimit pin not working with baseUrl fix

* Remove white space changes

* Refactor PIN verification error handling and input state management

- Improve error handling in login page JavaScript
- Standardize API response structure with explicit success and error fields
- Enhance user feedback for PIN authentication failures
- Implement more robust input state management during login attempts

* Fix PIN verification logic in root route

- Improve PIN verification check to handle missing cookie scenario
- Add explicit check for cookie existence before comparing PIN
- Enhance root route authentication logic for more robust access control
2025-02-24 10:56:57 -08:00
V
d42ca55c08
Update docker-publish.yml
oops, I lied...Fixed this time.
2025-02-21 21:22:07 -07:00
V
a923bb957a
Update docker-publish.yml
Did the thing, didn't break everything... I think. Name=dumbwareio/dumbdrop
2025-02-21 21:20:33 -07:00
Chris
3236a727ff
Update pin input type to password to mask pin and match dumbwareio products (#33) 2025-02-21 18:28:38 -08:00
Greirson Lee-Thorp
1a74774d6a
feat: Enhance login page security and caching
- Add rate limit handling for PIN verification with user-friendly error message
- Disable PIN input on repeated failed attempts to prevent refresh loops
- Implement cache control headers for login page to prevent browser caching
2025-02-21 11:08:21 -08:00
Greirson Lee-Thorp
aa25ef92f8
fix: Update login API endpoint paths for authentication routes
- Modify fetch URLs to use '/api/auth/' prefix for PIN verification endpoints
- Update '/api/pin-required' and '/api/verify-pin' to '/api/auth/pin-required' and '/api/auth/verify-pin'
- Ensure consistent routing for authentication-related API calls

Closes #31
2025-02-19 08:27:23 -08:00
Greirson Lee-Thorp
7e0f3f85d7
Update .cursorrules 2025-02-16 23:57:03 -08:00
Greirson Lee-Thorp
1b40cf2e8e
feat: add BASE_URL configuration for flexible deployment environments (#30)
- Introduce BASE_URL environment variable for flexible application URL configuration
- Update .env.example, docker-compose, and README with new configuration option
- Implement BASE_URL validation in config module
- Modify server logging to use configurable base URL
- Provide default base URL generation when not explicitly set
2025-02-16 23:47:32 -08:00
Greirson Lee-Thorp
22f79f830b
feat: Complete Application Infrastructure and Security Overhaul (#28)
Chores & Configuration
	•	Enhanced development setup: optimized Dockerfile, refined scripts, and improved .gitignore.
	•	Updated docker-compose for better dev/prod separation.
	•	Improved documentation in README and source files.

Features & Enhancements
	•	Refactored project structure with modular architecture.
	•	Improved testing infrastructure and integration tests.
	•	Enhanced file upload logic, client-side handling, and API routes.
	•	Implemented robust server shutdown, rate limiting, and cleanup mechanisms.
	•	Improved upload progress tracking with UI enhancements.
	•	Strengthened security in PIN authentication and cookie handling.

Refactors & Fixes
	•	Cleaned up test infrastructure, logging, and error handling.
	•	Simplified API route paths and improved middleware.
	•	Fixed incorrect total storage size reporting.
	•	Optimized logging verbosity based on environment.

Documentation
	•	Expanded project documentation and comments for clarity.
2025-02-16 15:39:13 -08:00
V
2ec69ba26e
Merge pull request #27 from vin-im/main
Update README.md
2025-02-08 19:03:07 -07:00
V
72e8e2c286 Update README.md
Updated photo and fixed the name.
2025-02-08 16:59:55 -07:00
Greirson Lee-Thorp
0dd96b50ac
fix: Update Apprise notification command execution method 2025-02-07 10:44:13 -08:00
Greirson Lee-Thorp
d1aab6bc60
fix: Add proxy trust configuration for rate limiting 2025-02-07 10:33:53 -08:00
abite
80f74c5b8d
Update issue templates 2025-02-06 11:18:17 -06:00
abite
5d801d699c
Update issue templates 2025-02-06 11:17:37 -06:00
Greirson Lee-Thorp
6f0918a530
docs/test: Add dev setup and update docs (#23)
* feat: Add development environment configuration

- Create dev/dev.sh script for simplified development workflow
- Add docker-compose.dev.yml for local development setup
- Update .gitignore to exclude dev directory except specific files
- Add development section to README.md with guide reference

* docs: Update README and docker-compose with comprehensive setup instructions and configuration options
2025-02-04 21:15:21 -08:00
abite
beb03e2415
Merge pull request #22 from greirson/progress-bar
Feat: Enhanced Upload Progress Bar UI/UX
2025-02-04 20:06:44 -06:00
Greirson Lee-Thorp
3177ac079b
Merge branch 'DumbWareio:main' into progress-bar 2025-02-04 17:45:00 -08:00
Greirson Lee-Thorp
8ab70f45c8
feat: enhance file upload progress tracking and user experience
- Add detailed upload progress tracking with speed and time remaining
- Implement dynamic waiting messages during upload initialization
- Create utility functions for file size and speed formatting
- Improve progress bar UI with more informative status details
- Add interval-based speed and progress updates for smoother UI
2025-02-04 17:00:31 -08:00
abite
3d10957ca0
Merge pull request #21 from greirson/even-dumber-drop
feat: Add auto upload configuration and update environment settings
2025-02-04 12:33:11 -06:00
Greirson Lee-Thorp
16447493bf
Merge branch 'main' into even-dumber-drop 2025-02-04 09:52:10 -08:00
abite
432cf7e386
Merge pull request #17 from greirson/security-enhancements
feat: enhance security with rate limiting and file extension filtering
2025-02-04 08:15:07 -06:00
Greirson Lee-Thorp
afb4f3f106
feat: Enhance AUTO_UPLOAD configuration parsing
- Improve AUTO_UPLOAD environment variable parsing
- Add support for multiple truthy values ('true', '1', 'yes')
- Convert input to lowercase for case-insensitive comparison
2025-02-03 22:29:42 -08:00
Greirson Lee-Thorp
1a5bc93e01
feat: Add auto upload configuration and update environment settings
- Introduce AUTO_UPLOAD environment variable to enable automatic file uploads
- Update .env.example with new configuration options
- Modify docker-compose.yml to use new image and comment out default settings
- Update README.md to document AUTO_UPLOAD feature
- Implement client-side auto upload logic in index.html
- Add server-side logging for auto upload status
chore: Refactor notification message template and size unit handling
2025-02-03 22:11:21 -08:00