mission_control-jobs 0.6.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -4
  3. data/app/assets/stylesheets/mission_control/jobs/bulma.min.css +21012 -2
  4. data/app/controllers/concerns/mission_control/jobs/basic_authentication.rb +33 -0
  5. data/app/controllers/concerns/mission_control/jobs/job_filters.rb +16 -1
  6. data/app/controllers/mission_control/jobs/application_controller.rb +12 -0
  7. data/app/helpers/mission_control/jobs/application_helper.rb +1 -0
  8. data/app/helpers/mission_control/jobs/dates_helper.rb +16 -2
  9. data/app/helpers/mission_control/jobs/jobs_helper.rb +1 -1
  10. data/app/views/mission_control/jobs/jobs/_filters.html.erb +13 -3
  11. data/app/views/mission_control/jobs/jobs/_general_information.html.erb +4 -4
  12. data/app/views/mission_control/jobs/jobs/_job.html.erb +1 -1
  13. data/app/views/mission_control/jobs/jobs/blocked/_job.html.erb +1 -1
  14. data/app/views/mission_control/jobs/jobs/failed/_job.html.erb +1 -1
  15. data/app/views/mission_control/jobs/jobs/finished/_job.html.erb +1 -1
  16. data/app/views/mission_control/jobs/jobs/in_progress/_job.html.erb +1 -1
  17. data/app/views/mission_control/jobs/jobs/scheduled/_job.html.erb +1 -1
  18. data/app/views/mission_control/jobs/queues/_job.html.erb +1 -1
  19. data/app/views/mission_control/jobs/recurring_tasks/_recurring_task.html.erb +2 -2
  20. data/app/views/mission_control/jobs/shared/_job.html.erb +3 -3
  21. data/app/views/mission_control/jobs/workers/_worker.html.erb +1 -1
  22. data/lib/active_job/jobs_relation.rb +7 -5
  23. data/lib/active_job/queue_adapters/solid_queue_ext.rb +7 -2
  24. data/lib/mission_control/jobs/authentication.rb +67 -0
  25. data/lib/mission_control/jobs/engine.rb +16 -12
  26. data/lib/mission_control/jobs/i18n_config.rb +17 -0
  27. data/lib/mission_control/jobs/tasks.rb +8 -0
  28. data/lib/mission_control/jobs/version.rb +1 -1
  29. data/lib/mission_control/jobs.rb +13 -3
  30. metadata +11 -4
  31. data/lib/tasks/mission_control/jobs_tasks.rake +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90d1d2bb94c81934c6d0f2c366b76ba9d9ee778c90a4ca0385515ea7b84d658f
4
- data.tar.gz: 51f7c76c6de7a39cc18e5b813a7d84ae18c94e9cd25487c0f16cb94e650d2319
3
+ metadata.gz: df0dc5c7b14924b9cb9063225ea71332d38e6550dded42c22e4d6698e9ed6b28
4
+ data.tar.gz: 11fd491a0028f31c0c9975c560113580c06d79d3eb188e7968caccc1a84bf39d
5
5
  SHA512:
6
- metadata.gz: 69e67bae39f22105acac0e10b9c52452fb453acc6e52e868746875f9daa75cd5556eadfca06db76eecb70e6c634dfdc1ecc217cc001d726da9b93bd9606b7ebe
7
- data.tar.gz: ab9c390dfd70c8b196ee3e6c1e5c07821299c2b23fd733a62c39d7b01cab3350f53c17ae9c9bdf5aaad9becf8b50b55dfd34b555b30500585373f901296e7717
6
+ metadata.gz: ca6d18a6d0ad2676ed21218df330d8fcea6a9daa106c780d36a0a148d951c939988120393bbc9a782fa5f0cd9179b0b6f14ecab09c1c7b7ca37e6fb17e1f3add
7
+ data.tar.gz: 41c69feb7ce874eb91ca7c063463c98627832f95cdd20a6033846837c489c04f00031ddc1eaac44f6271a4ca939e47f6a3b00d921d20d040a09c615cb70b7817
data/README.md CHANGED
@@ -32,7 +32,7 @@ And that's it. With this alone, you should be able to access Mission Control Job
32
32
 
33
33
  ### API-only apps or apps using `vite_rails` and other asset pipelines outside Rails
34
34
 
35
- If you want to use this gem with an [API-only Rails app](https://guides.rubyonrails.org/api_app.html) or an app that's using `vite_ruby`/`vite_rails`, or some other custom asset pipeline different from Sprockets and Propshaft, you need just one more thing: configure an asset pipeline so you can serve the JavaScript and CSS included in this gem. We recommend to use [`Propshaft`](https://github.com/rails/propshaft). You simply need to add this line to your application's Gemfile:
35
+ If you want to use this gem with an [API-only Rails app](https://guides.rubyonrails.org/api_app.html) or an app that's using `vite_ruby`/`vite_rails`, or some other custom asset pipeline different from Sprockets and Propshaft, you need one more thing: configure an asset pipeline so you can serve the JavaScript and CSS included in this gem. We recommend to use [`Propshaft`](https://github.com/rails/propshaft). You simply need to add this line to your application's Gemfile:
36
36
 
37
37
  ```ruby
38
38
  gem "propshaft"
@@ -43,11 +43,42 @@ Then execute
43
43
  $ bundle install
44
44
  ```
45
45
 
46
- And you should be ready to go.
46
+ Then, make sure you add a step to your deployment pipeline to precompile assets:
47
+ ```
48
+ RAILS_ENV=production rails assets:precompile
49
+ ```
50
+
51
+ For example, if you're using the Dockerfile generated by Rails with an API-only app or having skipped the assets pipeline, re-add:
52
+ ```
53
+ # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
54
+ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
55
+ ```
56
+
57
+ *Note: Legacy CSS bundlers `sass-rails` and `sassc-rails` may fail to compile some of the CSS vendored into this library from [Bulma](https://github.com/jgthms/bulma), which was created in [Dart SASS](https://sass-lang.com/dart-sass/). You will therefore need to upgrade to `dartsass-rails` or some library that relies on it, like `cssbundling-rails`.*
58
+
59
+ ### Authentication
60
+
61
+ Mission Control comes with **HTTP basic authentication enabled and closed** by default. Credentials are stored in [Rails's credentials](https://edgeguides.rubyonrails.org/security.html#custom-credentials) like this:
62
+ ```yml
63
+ mission_control:
64
+ http_basic_auth_user: dev
65
+ http_basic_auth_password: secret
66
+ ```
47
67
 
48
- ### Authentication and base controller class
68
+ If no credentials are configured, Mission Control won't be accessible. To set these up, you can run the generator provided like this:
49
69
 
50
- By default, Mission Control's controllers will extend the host app's `ApplicationController`. If no authentication is enforced, `/jobs` will be available to everyone. You might want to implement some kind of authentication for this in your app. To make this easier, you can specify a different controller as the base class for Mission Control's controllers:
70
+ ```
71
+ bin/rails mission_control:jobs:authentication:configure
72
+ ```
73
+
74
+ To set them up for different environments you can use the `RAILS_ENV` environment variable, like this:
75
+ ```
76
+ RAILS_ENV=production bin/rails mission_control:jobs:authentication:configure
77
+ ```
78
+
79
+ #### Custom authentication
80
+
81
+ You can provide your own authentication mechanism, for example, if you have a certain type of admin user in your app that can access Mission Control. To make this easier, you can specify a different controller as the base class for Mission Control's controllers. By default, Mission Control's controllers will extend the host app's `ApplicationController`, but you can change this easily:
51
82
 
52
83
  ```ruby
53
84
  Rails.application.configure do
@@ -58,7 +89,11 @@ end
58
89
  Or, in your environment config or `application.rb`:
59
90
  ```ruby
60
91
  config.mission_control.jobs.base_controller_class = "AdminController"
92
+ ```
61
93
 
94
+ If you do this, you can disable the default HTTP Basic Authentication using the following option:
95
+ ```ruby
96
+ config.mission_control.jobs.http_basic_auth_enabled = false
62
97
  ```
63
98
 
64
99
  ### Other configuration settings