Commit Graph
8 Commits
Author SHA1 Message Date
whoswhip eb21e6d662 Pretty big update, this adds file compression on the server side to preserve space on the disk.
Switched the paste info displaying from server side to client side, which also added a new api to fetch the info.
A new api to check if the user is authorized, (/api/accounts/authenticated)

## Commit Message Details Below Generated by Copilot
Add compression, and install script

Added EncryptByteArray and DecryptByteArray methods to the Encryption class for handling byte array encryption and decryption.
Removed unused namespaces from Program.cs.
Replaced direct file content reading and HTML manipulation with database queries and JSON responses for better error handling and response consistency.
Added JSON error responses for various error conditions.
Implemented content compression and decompression using GZip in Compression.cs to reduce file size and improve performance.
Updated paste creation and retrieval logic to handle compressed and encrypted content.
Added new API endpoints for fetching paste information and checking user authentication status.
Modified HTML templates to dynamically fetch and display paste information and user authentication status using JavaScript.
Added Paste UID property to the Paste class to store unique identifiers for pastes.
Created a new Compression class to handle string compression and decompression using GZip.
Updated the InitializeAsync method to create the pastes.sqlite file if it does not exist.
Enhanced the user interface to show or hide elements based on user authentication status and paste ownership (client side).
Improved error handling and user feedback in the JavaScript code.
Added logic to handle compressed and encrypted content in various parts of the application.
Added a new Bash script (install.sh) to install Sharpbin on a Linux system, which includes fetching the latest release, extracting it, and configuring Cloudflare keys.
2024-10-18 20:12:48 -04:00
whoswhip 878cebacb6 Enhance null safety, UI, and SQL query handling
Improved null safety in `Program.cs` by using the null-conditional operator (`?.`) when accessing cookies. Modified SQL queries to exclude 'Unlisted' pastes and added checks to skip processing 'Private' or 'Unlisted' pastes. Adjusted the command to count total pastes to exclude 'Unlisted' pastes.

Updated `admin/user.html` to support multiple notifications, added functionality to copy the new password to the clipboard, and improved notification display and animation logic.

Removed a hardcoded paste link from `archives.html` which was for testing.

Enhanced `index.html` with a hamburger menu for mobile navigation, improved notification handling, and added CSS styles and media queries for better mobile support. Fixed minor formatting issues and improved code readability.
2024-09-09 21:41:06 -04:00
whoswhip 560ad071ab Add private pastes, user bans, and UI enhancements
Enhanced Program.cs with response caching, compression, CORS policy, and private paste handling.
Refactored user ban logic and added expiration date handling.
Improved admin.html with localization and overflow handling.
Introduced PrivatePaste and Punishment classes.
Enhanced Paste and User classes for private pastes and punishments.
Updated initialization logic for punishedUsers table.
Ensured salts are written back to config.json if generated.
Enhanced user.html with ban/unban functionality and animations.
Improved archives.html, dash.html, and index.html with new UI elements and styles.
Added asynchronous content loading and notifications to paste.html.
Introduced Encryption.cs for AES encryption and decryption.
Created banned.html for displaying error messages.
Added privatepaste.html with dynamic content, password protection, and user interactions.
2024-09-08 16:07:59 -04:00
whoswhip 071434efc9 Enhance security, add admin features, and improve UX
Removed unused cryptography directive and switched to BCrypt for hashing IPs and tokens with a configurable salt. Updated file paths for cross-platform compatibility. Added rate limiting to routes and new admin API endpoints for user management. Improved `config.json` handling and added random password generation.

Enhanced `admin.html` with search debounce, infinite scrolling, and updated CSS. Added password change functionality and notifications to `user.html`. Improved error handling in `archives.html` and refactored `index.html` for better readability. Corrected password character count in `signup.html`.
2024-09-07 18:57:18 -04:00
whoswhip f02e68b1d3 Enhance validation, logging, and UI/UX improvements
## COMMIT MESSAGE GENERATED BY COPILOT

Added JSON validation to multiple endpoints, ensuring valid JSON requests and improved error handling. Updated logging to use `DateTime.Now` and append to `logs.log` for specific actions. Enhanced `/api/accounts/login` with JSON validation and refactored for consistency.  Improved admin and user interfaces with search functionality, better date localization, and CSS adjustments. Enhanced error handling and feedback in `login.html` and `signup.html`, and improved search functionality in `archives.html`.
2024-09-07 13:59:33 -04:00
whoswhip 017abcfacc Account Creation, Logging, and API URI's changed 2024-08-23 09:49:03 -04:00
whoswhip 3be5f90220 Last commit didnt add everything :( 2024-08-18 23:50:58 -04:00
whoswhip d76331b01e Add project files. 2024-08-18 21:55:50 -04:00