gem 'capistrano-passenger', require: false Add to your Capfile: require 'capistrano/passenger' Declare which server role should be restarted (optional). Usually passenger tries to restart all servers with the app...
...role. If you have dedicated Sidekiq servers with the app role, adjust the passenger_roles setting to exclude them. set :passenger_roles, :app # This is the default Remove any homegrown...
There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout. I'll explain how to implement both flows with devise...
...triggers a DELETE /users/sign_out (at least for devise_saml_authenticatable, others might differ) The server generates a SAML LogoutRequest and responds with a redirect the the SingleLogoutService HTTP-Redirect Binding...
...a new connection end end These three connections will remain connected to the database server after the threads terminate. This only affects threads that use ActiveRecord. You can rely on...
...outlined below. This may cause your application to open more connections than your database server allows. If you don't want to risk that, you can also manually release connections...
...Saving files to a directory that is not shared between deploys or servers If you save your uploads to a made up directory like "RAILS_ROOT/uploads", this directory goes away...
...every release gets a new). Also this directory is not shared between multiple application servers, so your uploads are randomly saved to one local filesystem or another. Fixing this afterwards...
When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup a maintenance page to inform your users. When delivering the...
...for maintenance pages The best HTTP status code for your maintenance page is "503 Service Unavailable": The server is currently unable to handle the request due to a temporary overloading...
...the console, your test may fail after the last step. With unlucky timing the server may receive an AJAX request as the browser tab closes, causing a connection abort when...
...trying to send the response. Since Capybara fails a test if there is a server error this may produce a flaky test. Waiting for pending AJAX requests The following module...
...sometimes outside of our control. For example, on one of our bigger projects, our servers are on a denylist for all of Microsoft's cloud e-mail (like @outlook.com) for...
...were rejected. We then started to send out e-mails via Amazon's SES service, only to discover that we were now blocked by several German providers like @web.de.
...applications can be used by multiple users at the same time. A typical application server like Passenger has multiple worker processes for a single app. In a distributed deployment setup...
...like we use at makandra you will even have multiple application servers, each with their own worker pool. This means that your code needs to deal with concurrent data access...
...form. It runs inside your application and does not depend on an external SaaS service. Truemail supports different validation "layers": Regex validation: if the given address is syntactically valid
...on the other hand means that Truemail will connect to the target mail server and try to start email delivery. If you do this too often, your app servers might...
...at first, but is required for Time.current to work properly. If possible, put your server into local time zone, since Ruby's Time will use that. In the example above...
Time.now will be your local time (or the local time of your server) >> Project.create! >> Project.connection.select_one('SELECT created_at FROM projects') => {"created_at...
...can churn wildly A big drawback of db/structure.sql is that different developer PCs or servers may create slightly different SQL output. Since this file is rewritten with every migration run...
...Possible reasons for this churn include: Two developers use different versions of the database server (e.g. PostgreSQL 16 vs. 17). Two developers use the same version of the database server...
Rails has configurable time zones, while Ruby is always in the server's time zone Thus, using Ruby's time API will give you wrong results for...
...can, however, tell Rails the only single time zone you'll need is the server's. config.time_zone = "Berlin" # Local time zone config.active_record.default_timezone = :local config.active_record.time_zone_aware_attributes = false...
...power to ['creatable_cards'] The reason for this behavior is that the Capybara test server is running in another thread, and the RSpec thread can't "see" the exception at...
...user sees in this situation, e.g. an error flash. ¹ Rack::Test features emulate the server within the same thread and will therefore "see" those exceptions The test thread and server...
...below accordingly. Basic idea We will use the guard-livereload gem as the livereload server (which send updates to the browser), use the livereload-js npm package in the browser...
...to connect to the livereload server, not use rack-livereload any more as this is unnecessarily complex and does not work with many CSP policies. We will configure guard-livereload...
set :assets_roles, %i[webpack] # Give the webpack role to a single server (see code block below) set :assets_prefix, 'packs' # Assets are located in /packs/
...related to Webpacker, but a nice thing Give the webpack role to a single server: # config/deploy/production.rb (analog to config/deploy/staging.rb) ... server ' ', user: ' ', roles: %w(... webpack) Make sure to read as well...
...readonly attribute. Be aware of the differences: disabled fields don’t post to the server don’t get focus are skipped while tab navigation available for button, fieldset, input, select...
...Firefox cancels any JavaScript events at a fieldset[disabled] readonly fields post to the server get focus are included while tab navigation only available for input[type=text], textarea
...esbuild.config.js: external: ['*.ttf'], During the next steps you have to make sure that sprockets serves them correctly and rewrites the paths if necessary. Prepare Sprockets to serve the assets bundled...
...tag and javascript_link_tag to match the new pack names. start the development server with the command bin/dev and check that everything works and looks good. Finish
...chrome queue limited to 1 for e.g. PDF processing to not overload the application server an api queue, that limits a queue to 2 to protect the API server from...
...too many requests in parallel Example: Sidekiq.configure_server do |config| # Edits the default capsule config.queues = %w[critical default low] config.concurrency = 5 # Define a new capsule which processes jobs from the...
...is a single process in play. It runs both your test script and the server responding to the user interactions scripted by your test. A Selenium (Javascript) test has a...
...you spawn by running cucumber. A second thread within the same process runs the server responding to your test. A second process runs the browser that is scripted by the...
This is for people recovering from Subversion. Get an existing from the server for the first time git clone git@example.com:repositoryname See what's changed git status Check in locally...
...git commit -m "good description" Push local commits to the server git push Get and merge updates from the server git pull Stage a file for the next local commit...
Occasionally you need to do something directly on the server -- like having all records recalculate something that cannot be done in a migration because it takes a long time.
...you may have been successful with this on your development machine or the staging server, keep in mind that production machines often hold a lot more records. Using all may...
...maximum number of Passenger workers and Sidekiq worker. If you have a shared database server many possible connections are "expensive", so setting the pool size to a very high number...
...is no good idea (also consider the number of servers you when calculating the total number of possible connections for the shared database server). Blowing up the fail inbox: If...
...monitored. We are experts in Linux and AWS environments, as well as self-hosted server infrastructures. Have a look at makandra operations. Trainee program and makandra curriculum In makandra cards...
...that can help both newcomers and experienced developers in web development and DevOps. It serves as practical support for anyone who wants to expand their technical skills or anyone who...
If you are using PDFKit / wkhtmltopdf, you might as well want to use custom fonts in your stylesheets. Usually this...