Skip to content

Instantly share code, notes, and snippets.

View JUNKI555's full-sized avatar
๐Ÿ˜‚

JUNYA KITAYAMA JUNKI555

๐Ÿ˜‚
View GitHub Profile
@etozzato
etozzato / puma.rb
Last active June 19, 2025 23:33
A section of config/puma.rb that will automatically generate a self-signed X509 certificate and provide https in development
if Rails.env.development?
FileUtils.mkdir_p(Rails.root.join('config', 'certs'))
key_path = Rails.root.join('config', 'certs', 'development.key')
crt_path = Rails.root.join('config', 'certs', 'development.crt')
unless File.exist?(key_path) && File.exist?(crt_path)
def cert_domain
'localhost' # Setting[:cookie_domain] || 'localhost'
end