github error311/FileRise v1.0.2

latest releases: v1.0.5, v1.0.4, v1.0.3...
8 days ago

Full Changelog: v1.0.1...v1.0.2

changes 3/25/2025

  • Context Menu Enhancements:

    • Right‑Click Context Menu:
      • Added context menu support for file list rows so that right‑clicking shows a custom menu.
      • When multiple files are selected, options like “Delete Selected”, “Copy Selected”, “Move Selected”, “Download Zip” are shown.
      • When a file with a “.zip” extension is among the selections, an “Extract Zip” option is added.
    • Single File Options:
      • For a single selected file, additional items (“Preview”, “Edit”, and “Rename”) are appended.
      • The “Edit” option appears only if canEditFile(file.name) returns true.
  • Keyboard Shortcuts:

    • Delete Key Shortcut:
      • Added a global keydown listener to detect the Delete (or Backspace on Mac) key.
      • When pressed (and if no input/textarea is focused) with files selected, it triggers handleDeleteSelected() to open the delete confirmation modal.
  • Modals & Enter-Key Handling:

    • attachEnterKeyListener Update:
      • Modified the function to use the “keydown” event (instead of “keypress”) for better reliability.
      • Ensured the modal is made focusable (by setting a tabindex="-1") and focused immediately after being displayed.
      • This update was applied to modals for rename, download zip, and delete operations.
    • Delete Modal Specific:
      • It was necessary to call attachEnterKeyListener for the delete modal after setting its display to “block” to ensure it captures the Enter key.
  • File Editing Adjustments:

    • Content-Length Check:
      • Modified the editFile function so that it only blocks files when the Content-Length header is non‑null and greater than 10 MB.
      • This change allows editing of 0 KB files (or files with Content-Length “0”) without triggering the “File too large” error.
  • Context Menu for Folder Manager:

    • Provided a separate implementation for a custom context menu for folder manager elements.
    • Bound the context menu to both folder tree nodes (.folder-option) and breadcrumb links (.breadcrumb-link) so that right‑clicking on either triggers a custom menu.
    • The custom menu for folders includes actions for “Create Folder”, “Rename Folder”, and “Delete Folder.”
    • Added guidance to ensure that breadcrumb HTML elements contain the appropriate class and data-folder attribute.
  • Keyboard Shortcut for Folder Deletion (Suggestion):

    • Suggested adding a global keydown listener in folderManager.js to trigger folder deletion (via openDeleteFolderModal()) when Delete/Backspace is pressed and a folder other than “root” is selected.
  • Event Listener Timing:

    • Ensured that context menu and key event listeners are attached after the corresponding DOM elements are rendered.
    • Added explicit focus calls (and tabindex attributes) for modals to capture keyboard events.

changes 3/24/2025

config.php

  • Encryption Functions Added:
    • Introduced encryptData() and decryptData() functions using AES‑256‑CBC to encrypt and decrypt persistent tokens.
  • Encryption Key Handling:
    • Added code to load the encryption key from an environment variable (PERSISTENT_TOKENS_KEY) with a fallback default.
  • Persistent Token Auto-Login:
    • Modified the auto-login logic to check for a remember_me_token cookie.
    • If the persistent tokens file exists, it now reads and decrypts its content before decoding JSON.
    • If a token is expired, the code removes the token, re-encrypts the updated array, writes it back to disk, and clears the cookie.
  • Cookie and Session Settings:
    • No major changes aside from integrating the encryption functionality into the token handling.

auth.php

  • Login Process and “Remember Me” Functionality:
    • When “Remember me” is checked, generates a secure random token.
    • Loads the persistent tokens file (if it exists), decrypts its content, and decodes the JSON.
    • Inserts the new token (with associated username and expiry) into the persistent tokens array.
    • Encrypts the updated tokens array and writes it back to the file.
    • Sets the remember_me_token cookie using the $secure flag and expiry.
  • Authentication & Brute Force Protection:
    • The authentication logic and brute-force protection remain largely unchanged.

logout.php

  • Persistent Token Removal:
    • If a remember_me_token cookie exists, the script loads the persistent tokens file, decrypts its content, removes the token if present, re-encrypts the array, and writes it back.
  • Cookie Clearance and Session Destruction:
    • Clears the remember_me_token cookie.
    • Destroys session data as before.

networkUtils.js

  • Fetch Wrapper Enhancements:
    • Modified sendRequest() to clone the response before attempting to parse JSON.
    • If JSON parsing fails (e.g., because of unexpected response content), the cloned response is used to read the text, preventing the “Body is disturbed or locked” error.
  • Error Handling Improvements:
    • Improved error handling by ensuring the response body is read only once.

Don't miss a new FileRise release

NewReleases is sending notifications on new releases.