dockerfile-rails 1.6.13 → 1.6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/dockerfile_generator.rb +10 -1
- metadata +3 -4
- data/lib/fly_replay.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2531120f4d41adf0dd6616bd2402b96236bbe88d29bb4ce68540807fe90ee9d7
|
4
|
+
data.tar.gz: 6ce1bd73ea9ff3d999c11e8c0e22f00b4ed3324f5cca1b811b147a101ca9988a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 300bf0e817f27b0f4972333d87bbe1b322c866e8e3eeaf5eb4bd689f69a584b992ecdf9c5d93299130cef292bf3666a637f353658a744593ef7e32b3f381f7fd
|
7
|
+
data.tar.gz: c71043dc03cea93277164bc4ad4aa4e37712b76df6c40f65883bead0a8503f125f3a5f904c594ce8b6d26873a86fbee6b11deb2f0f58bc6daa2a1d9c106f514b
|
@@ -372,7 +372,8 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
372
372
|
remove_file "config/dockerfile.yml"
|
373
373
|
end
|
374
374
|
|
375
|
-
# check Dockerfile for common errors: missing packages, mismatched Ruby version
|
375
|
+
# check Dockerfile for common errors: missing packages, mismatched Ruby version;
|
376
|
+
# also add DATABASE_URL to fly.toml if needed
|
376
377
|
if options.skip? && File.exist?("Dockerfile")
|
377
378
|
message = nil
|
378
379
|
shell = Thor::Base.shell.new
|
@@ -393,6 +394,14 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
393
394
|
STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
|
394
395
|
end
|
395
396
|
|
397
|
+
if (options.sqlite3? || @sqlite3) && !dockerfile.include?("DATABASE_URL") && File.exist?("fly.toml")
|
398
|
+
toml = IO.read("fly.toml")
|
399
|
+
if !toml.include?("[[env]]")
|
400
|
+
toml += "\n[[env]]\n DATABASE_URL = \"sqlite3:///data/production.sqlite3\"\n"
|
401
|
+
File.write "fly.toml", toml
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
396
405
|
exit 42 if message
|
397
406
|
end
|
398
407
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerfile-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -37,7 +37,6 @@ files:
|
|
37
37
|
- Rakefile
|
38
38
|
- lib/dockerfile-rails.rb
|
39
39
|
- lib/dockerfile-rails/scanner.rb
|
40
|
-
- lib/fly_replay.rb
|
41
40
|
- lib/generators/dockerfile_generator.rb
|
42
41
|
- lib/generators/templates/Dockerfile.erb
|
43
42
|
- lib/generators/templates/_apt_install.erb
|
@@ -75,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
74
|
- !ruby/object:Gem::Version
|
76
75
|
version: '0'
|
77
76
|
requirements: []
|
78
|
-
rubygems_version: 3.5.
|
77
|
+
rubygems_version: 3.5.10
|
79
78
|
signing_key:
|
80
79
|
specification_version: 4
|
81
80
|
summary: Dockerfile generator for Rails
|
data/lib/fly_replay.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Fly
|
4
|
-
class FlyReplay
|
5
|
-
def initialize(app)
|
6
|
-
@app = app
|
7
|
-
end
|
8
|
-
|
9
|
-
def call(env)
|
10
|
-
# replay /prometheus/* to the prom proxy in bubblegum
|
11
|
-
if env["PATH_INFO"].starts_with?("/prometheus")
|
12
|
-
return [307, { "Fly-Replay" => "app=flyio-bubblegum-api" }, []]
|
13
|
-
end
|
14
|
-
|
15
|
-
# replay /debug to the debug app. unsure if this is actually used
|
16
|
-
if env["PATH_INFO"].starts_with?("/debug")
|
17
|
-
return [307, { "Fly-Replay" => "app=debug" }, []]
|
18
|
-
end
|
19
|
-
|
20
|
-
@status, @headers, @response = @app.call(env)
|
21
|
-
|
22
|
-
context = OpenTelemetry::Trace.current_span.context
|
23
|
-
@headers["fly-trace-id"] = context.trace_id.unpack1("H*")
|
24
|
-
@headers["fly-span-id"] = context.span_id.unpack1("H*")
|
25
|
-
|
26
|
-
[@status, @headers, @response]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|