Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#320] Improve docker support and developer experience #323

Merged
merged 23 commits into from
Apr 30, 2024

Conversation

delano
Copy link
Collaborator

@delano delano commented Apr 29, 2024

Update config, normalize text, remove scripts, improve Redis handling, upgrade Ruby version, fix Redis pipeline usage, and more.

This pull request includes multiple commits that make various changes to the codebase. The changes include updating the config to rename variables and remove unused integration, normalizing text configuration, removing deprecated scripts, changing the default application port, removing references to deprecated config settings, removing an outdated license file, updating the README, updating environment variable names and documentation for consistency, improving Redis connection handling, upgrading the Ruby version requirement, and fixing Redis pipeline usage. These changes aim to improve the codebase, enhance performance, and ensure better maintainability.

Rename config variables for host, SSL, Redis. Remove stathat integration. Update limits and descriptions. Fix typos and formatting issues. Remove unused incoming config.
Removed unused text configuration options and references to them from
views and validation logic. The "paid_recipient_text" and
"nonpaid_recipient_text" configuration values were no longer being
utilized after removing support for distinguishing paid vs unpaid
recipients. View and logic code was cleaned up to remove stray
references. This simplifies configuration and avoids confusing or
misleading strings being displayed to users.
Leave these to the redis tools.
This change updates the default port for the thin web server from 7143 to 3000 across config files and code examples.

The original intention was to avoid clashing with other services running locally. With the advent of Container Technology, that's less common than it used to be.

The port was changed to align with common conventions for development webservers. Specifying a well-known port will make the application easier for new developers to run locally, without needing to manually configure the port number.
In a much earlier rendition, we made reference to Etherpad as being an
inspiration for our collaboration. Even at that time, including the
license wasn't necessary so removing it altogether now for posterity.
For v0.13.0-RC3 release and add GitHub Container Registry instructions
Added detailed Docker setup and management instructions for local dev
Standardized environment variable names in configuration files and
documentation for easier use and understanding. Renamed
`ONETIMESECRET_*` variables to shorter names like `HOST`, `REDIS_URL`
for readability. Updated Dockerfile and README with new names. This
avoids duplication and improves the user experience with a more
consistent interface.
This change handles Redis connection errors more gracefully. It exits
directly when a connection cannot be established, and logs the specific
error types instead of a generic message. This will make debugging
connection issues easier.

- Rescue Redis::CannotConnectError and exit immediately with a specific
log message including the error class
- Rescue other errors and log detail including error class before
exiting non-zero
This change updates the Gemfile to specify Ruby version 3.2 or higher as
our project's minimum required version. Ruby 3 introduced performance
improvements and new features that will benefit our application. By
raising our baseline Ruby version, we can take advantage of these
enhancements while still supporting the latest release series.
This change replaces deprecated Redis pipelined calls with the modern
multi/exec pipeline API when generating one-time values. By batching the
sadd operations instead of sending individually, this improves
throughput and latency of value generation especially under high load.
@delano delano linked an issue Apr 29, 2024 that may be closed by this pull request
@delano delano added the bug label Apr 29, 2024
@delano delano self-assigned this Apr 29, 2024
@delano delano added dependencies Pull requests that update a dependency file documentation tech debt ruby3 Related to ruby version 3+ Bug fix dx Developer experience working with onetimesecret labels Apr 29, 2024
This change removes the social media follow links and versioning
information from the site footer, as they were no longer relevant.
Set RUBY_YJIT_ENABLE to reduce Docker build time by enabling the Ruby JIT compiler. Build caching will now make incremental changes faster.
The monitored_link and display_icons view configuration settings were
removed as they are no longer used. The settings controlled links and
icons that were part of the previous UI but have since been removed.
Added return statements to email sending code to avoid exceptions on errors. This ensures attempted message sends will not cause further failures if an error occurs.
The logging code was updated to handle anonymous customers differently
than authenticated ones when logging rate limit errors. For anonymous
requests, the obscured customer ID is replaced with the string
"anonymous" instead of attempting to obscure an empty email address.
This avoids exceptions and provides clearer logs when anonymous users
hit API limits.
@delano delano changed the title Update config, normalize text, remove scripts, improve Redis handling, upgrade Ruby version, fix Redis pipeline usage, and more [#320] Improve docker support and developer experience Apr 30, 2024
Adds note about why we maintain support for EOL'd versions of Ruby. This
also fixes the Github Action workflow failures.
@onetimesecret
Copy link
Owner

PR Review

⏱️ Estimated effort to review [1-5]

3, because the PR includes multiple changes across different areas of the codebase, including config updates, text normalization, script removals, Redis handling improvements, and Ruby version upgrades. While the changes seem to be focused on improving the codebase, the overall scope and impact require a moderate review effort.

🧪 Relevant tests

No

🔍 Possible issues

No

🔒 Security concerns

No

@delano delano marked this pull request as ready for review April 30, 2024 18:23
@delano delano merged commit 51ddaa9 into develop Apr 30, 2024
6 checks passed
@delano delano deleted the 320-better-dx-for-deploying-via-docker-image branch April 30, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug fix bug dependencies Pull requests that update a dependency file documentation dx Developer experience working with onetimesecret Review effort [1-5]: 3 ruby3 Related to ruby version 3+ tech debt
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Better DX for deploying via docker image
2 participants