flightdeck 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1ca85b84ff8de470263e67d8ea54f382fb0223fa0c6dc515cf24381ba9a5fb5
4
- data.tar.gz: 4a2f5f4f4c9397ce405997d26881131793c425963e956d056ed92baacdde523b
3
+ metadata.gz: cc0fbbb0dc81b9ebb46acbf4ffd958dad391b164adc7baebd3130bfa28ca7d53
4
+ data.tar.gz: d52f430ba7a8c3339fc40b4da463ac26ab024da7bcde764b359e978866eae4ef
5
5
  SHA512:
6
- metadata.gz: 598821a4f92376bde89e2559bc9925f3f1450cfdf28ccc6c86e37aa7f97cef357d154f2cb2e9efc9e42acbc125cb970542d086e1a3f6f485113ecd5412ca85de
7
- data.tar.gz: 438cad3e80e881b0622d4969a56ed9f740665e5794dfc0807ec1252b82e918269cd35d69561895102c767a07a3d9c8d57ff442d64daed9183c0d1790ab3a60ce
6
+ metadata.gz: 5f59a6371351b03d69176c8dd80fcd14d9b0b009189895b42d1926972d7c3d7353d9452f411f590d217c035e1143a6b2b704619cba8319d697167b28a6ac274e
7
+ data.tar.gz: 50ae1e3d7c0a1a8d0489e12f14f22eb0abe1c7d7fde0a9e6ee9a8290bc3ff27c71ced755997f0eee40f1151667c07e8f1b55e587f5f6aae85ffef5e862258980
data/README.md CHANGED
@@ -103,12 +103,28 @@ request, never memoized at boot.
103
103
  In **API-only** apps there is no host session for Devise to use, so use
104
104
  Flightdeck's own HTTP Basic there.
105
105
 
106
+ ### Disabling authentication entirely
107
+
108
+ ```ruby
109
+ # config/initializers/flightdeck.rb
110
+ Flightdeck.configure do |config|
111
+ config.skip_authentication = true
112
+ end
113
+ ```
114
+
115
+ This serves the dashboard — which can retry, discard and delete jobs — to
116
+ anyone who can reach the mount. It exists for deployments where something
117
+ upstream already guards it: a routing constraint, a VPN, a reverse proxy. The
118
+ routing-constraint caveat above still applies unless you set this: without it,
119
+ the engine answers 401 behind your constraint.
120
+
106
121
  ## Configuration
107
122
 
108
123
  | Option | Default | Purpose |
109
124
  | --- | --- | --- |
110
125
  | `base_controller_class` | `nil` | Controller (a String) to inherit from, to reuse your app's authentication. |
111
126
  | `http_basic` | `nil` | `{ username:, password: }` or a callable. Falls back to `ENV`, then credentials. |
127
+ | `skip_authentication` | `false` | Serve without any authentication. For mounts guarded upstream (routing constraint, VPN, proxy). |
112
128
  | `poll_interval` | `5.seconds` | Refresh rate for list and stat panels. |
113
129
  | `chart_poll_interval` | `30.seconds` | Refresh rate for charts. |
114
130
  | `per_page` | `25` | Rows per page in job lists. |
@@ -1,4 +1,4 @@
1
- /* Flightdeck 0.5.0 — bundled @hotwired/turbo + @hotwired/stimulus. Generated by `rake assets:build`; do not edit. */
1
+ /* Flightdeck 0.5.2 — bundled @hotwired/turbo + @hotwired/stimulus. Generated by `rake assets:build`; do not edit. */
2
2
  (function(){
3
3
  /**
4
4
  * Minified by jsDelivr using Terser v5.39.0.
@@ -408,7 +408,7 @@ class ToastController extends Stimulus.Controller {
408
408
  application.register("theme", ThemeController)
409
409
  application.register("toast", ToastController)
410
410
 
411
- window.Flightdeck = { application: application, version: "0.5.0" }
411
+ window.Flightdeck = { application: application, version: "0.5.2" }
412
412
  })()
413
413
 
414
414
  })();
@@ -7,9 +7,9 @@
7
7
  "size": 118411
8
8
  },
9
9
  "flightdeck.js": {
10
- "file": "flightdeck-c02e38040ddb.js",
11
- "digest": "c02e38040ddb",
12
- "sha256": "c02e38040ddb22871c1cb96daa7cb78242ceda0dd243c1ab3678fcf6f022d73e",
10
+ "file": "flightdeck-747ab6d1a6fa.js",
11
+ "digest": "747ab6d1a6fa",
12
+ "sha256": "747ab6d1a6fafd8eb6ff4eca9f487ad62a11fdb0df52e8293db0d2699a575dcd",
13
13
  "content_type": "text/javascript; charset=utf-8",
14
14
  "size": 150889
15
15
  }
@@ -33,7 +33,16 @@ module Flightdeck
33
33
  config.base_controller_class = "Admin::BaseController"
34
34
  end
35
35
 
36
- Flightdeck never serves unauthenticated requests, in any environment.
36
+ 5. If something upstream (a routing constraint, VPN, or reverse proxy)
37
+ already guards this mount and you accept the risk, turn Flightdeck's
38
+ gate off entirely:
39
+
40
+ Flightdeck.configure do |config|
41
+ config.skip_authentication = true
42
+ end
43
+
44
+ Flightdeck never serves unauthenticated requests, in any environment,
45
+ unless it is explicitly told to with skip_authentication.
37
46
  TEXT
38
47
 
39
48
  protect_from_forgery with: :exception if respond_to?(:protect_from_forgery)
@@ -73,7 +82,12 @@ module Flightdeck
73
82
  }.compact
74
83
  end
75
84
 
85
+ # Read per request, like the rest of the auth config, so nothing is
86
+ # resolved at boot. `skip_authentication` is the explicit opt-out for
87
+ # deployments that gate the mount upstream — a routing constraint, a VPN,
88
+ # a reverse proxy — and it wins over every other setting here.
76
89
  def authenticate_flightdeck!
90
+ return if Flightdeck.config.skip_authentication
77
91
  return if self.class.host_authenticated?
78
92
 
79
93
  credentials = Flightdeck.config.resolve_http_basic
@@ -9,7 +9,7 @@ module Flightdeck
9
9
  digested = Flightdeck::Assets.digested_name(logical_name)
10
10
  return nil unless digested
11
11
 
12
- flightdeck.asset_file_path(name: digested)
12
+ asset_file_path(name: digested)
13
13
  end
14
14
 
15
15
  # Sidebar counts are capped like every other count, and degrade to "—"
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <title><%= content_for?(:title) ? yield(:title) : "Flightdeck" %></title>
7
- <meta name="turbo-root" content="<%= flightdeck.root_path %>">
7
+ <meta name="turbo-root" content="<%= root_path %>">
8
8
  <%= csrf_meta_tags %>
9
9
  <% if (css = flightdeck_asset_path("flightdeck.css")) %>
10
10
  <link rel="stylesheet" href="<%= css %>">
@@ -22,36 +22,36 @@
22
22
  </div>
23
23
 
24
24
  <nav class="fd-nav">
25
- <%= link_to flightdeck.root_path, class: "fd-nav-link#{" on" if current_page?(flightdeck.root_path)}" do %>
25
+ <%= link_to root_path, class: "fd-nav-link#{" on" if current_page?(root_path)}" do %>
26
26
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><path d="M1.5 13.5v-5h3v5m1.5 0v-9h3v9m1.5 0v-12h3v12" stroke-linejoin="round"/></svg>
27
27
  Overview
28
28
  <% end %>
29
29
 
30
30
  <span class="fd-nav-section">Jobs</span>
31
31
 
32
- <%= link_to flightdeck.jobs_path, class: "fd-nav-link#{" on" if fd_nav_active?(:all)}" do %>
32
+ <%= link_to jobs_path, class: "fd-nav-link#{" on" if fd_nav_active?(:all)}" do %>
33
33
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><rect x="1.5" y="2.5" width="12" height="10" rx="1.5"/><path d="M4.5 6h6M4.5 9h4"/></svg>
34
34
  All jobs <span class="fd-nav-count"><%= fd_nav_count(:all) %></span>
35
35
  <% end %>
36
36
 
37
- <%= link_to flightdeck.jobs_path(state: :failed), class: "fd-nav-link#{" on" if fd_nav_active?(:failed)}" do %>
37
+ <%= link_to jobs_path(state: :failed), class: "fd-nav-link#{" on" if fd_nav_active?(:failed)}" do %>
38
38
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><circle cx="7.5" cy="7.5" r="6"/><path d="M7.5 4.5v3.5M7.5 10.4v.2"/></svg>
39
39
  Failed <span class="fd-nav-count"><%= fd_nav_count(:failed) %></span>
40
40
  <% end %>
41
41
 
42
42
  <span class="fd-nav-section">Infrastructure</span>
43
43
 
44
- <%= link_to flightdeck.queues_path, class: "fd-nav-link#{" on" if controller_name == "queues"}" do %>
44
+ <%= link_to queues_path, class: "fd-nav-link#{" on" if controller_name == "queues"}" do %>
45
45
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><path d="M2 4h11M2 7.5h11M2 11h7"/></svg>
46
46
  Queues <span class="fd-nav-count"><%= fd_nav_queue_count %></span>
47
47
  <% end %>
48
48
 
49
- <%= link_to flightdeck.processes_path, class: "fd-nav-link#{" on" if controller_name == "processes"}" do %>
49
+ <%= link_to processes_path, class: "fd-nav-link#{" on" if controller_name == "processes"}" do %>
50
50
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><rect x="2" y="2" width="11" height="7" rx="1.5"/><path d="M5 13h5M7.5 9v4"/></svg>
51
51
  Processes <span class="fd-nav-count <%= "alert" if fd_nav_any_dead_processes? %>"><%= fd_nav_process_count %></span>
52
52
  <% end %>
53
53
 
54
- <%= link_to flightdeck.recurring_tasks_path, class: "fd-nav-link#{" on" if controller_name == "recurring_tasks"}" do %>
54
+ <%= link_to recurring_tasks_path, class: "fd-nav-link#{" on" if controller_name == "recurring_tasks"}" do %>
55
55
  <svg width="15" height="15" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4"><circle cx="7.5" cy="7.5" r="6"/><path d="M7.5 4v3.5l2.5 1.5"/></svg>
56
56
  Recurring <span class="fd-nav-count"><%= fd_nav_recurring_count %></span>
57
57
  <% end %>
@@ -4,6 +4,7 @@ module Flightdeck
4
4
  class Configuration
5
5
  attr_accessor :base_controller_class,
6
6
  :http_basic,
7
+ :skip_authentication,
7
8
  :poll_interval,
8
9
  :chart_poll_interval,
9
10
  :per_page,
@@ -16,6 +17,7 @@ module Flightdeck
16
17
  def initialize
17
18
  @base_controller_class = nil
18
19
  @http_basic = nil
20
+ @skip_authentication = false
19
21
  @poll_interval = 5.seconds
20
22
  @chart_poll_interval = 30.seconds
21
23
  @per_page = 25
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flightdeck
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flightdeck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier
@@ -49,7 +49,7 @@ files:
49
49
  - MIT-LICENSE
50
50
  - README.md
51
51
  - app/assets/flightdeck/flightdeck-00403457c5d9.css
52
- - app/assets/flightdeck/flightdeck-c02e38040ddb.js
52
+ - app/assets/flightdeck/flightdeck-747ab6d1a6fa.js
53
53
  - app/assets/flightdeck/manifest.json
54
54
  - app/controllers/concerns/flightdeck/toasts.rb
55
55
  - app/controllers/flightdeck/application_controller.rb