data_migration_for_rails 0.1.1
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 +7 -0
- data/LICENSE +17 -0
- data/README.md +196 -0
- data/Rakefile +8 -0
- data/app/assets/config/manifest.js +2 -0
- data/app/assets/stylesheets/application.css +15 -0
- data/app/channels/application_cable/channel.rb +6 -0
- data/app/channels/application_cable/connection.rb +6 -0
- data/app/controllers/concerns/data_migration/pundit_authorization.rb +12 -0
- data/app/controllers/data_migration/application_controller.rb +63 -0
- data/app/controllers/data_migration/exports_controller.rb +68 -0
- data/app/controllers/data_migration/imports_controller.rb +78 -0
- data/app/controllers/data_migration/migration_executions_controller.rb +75 -0
- data/app/controllers/data_migration/migration_plans_controller.rb +103 -0
- data/app/controllers/data_migration/migration_steps_controller.rb +164 -0
- data/app/controllers/data_migration/users_controller.rb +71 -0
- data/app/controllers/users/sessions_controller.rb +30 -0
- data/app/helpers/data_migration/application_helper.rb +24 -0
- data/app/jobs/application_job.rb +9 -0
- data/app/jobs/export_job.rb +27 -0
- data/app/jobs/import_job.rb +28 -0
- data/app/mailers/application_mailer.rb +6 -0
- data/app/models/application_record.rb +5 -0
- data/app/models/data_migration_user.rb +43 -0
- data/app/models/migration_execution.rb +93 -0
- data/app/models/migration_plan.rb +23 -0
- data/app/models/migration_record.rb +60 -0
- data/app/models/migration_step.rb +150 -0
- data/app/policies/application_policy.rb +53 -0
- data/app/policies/data_migration/user_policy.rb +27 -0
- data/app/policies/data_migration_user_policy.rb +37 -0
- data/app/policies/migration_execution_policy.rb +33 -0
- data/app/policies/migration_plan_policy.rb +41 -0
- data/app/policies/migration_step_policy.rb +29 -0
- data/app/services/data_migration/model_registry.rb +95 -0
- data/app/services/exports/generator_service.rb +444 -0
- data/app/services/imports/processor_service.rb +457 -0
- data/app/services/migration_plans/export_config_service.rb +41 -0
- data/app/services/migration_plans/import_config_service.rb +158 -0
- data/app/views/data_migration/devise/registrations/edit.html.erb +41 -0
- data/app/views/data_migration/devise/sessions/new.html.erb +35 -0
- data/app/views/data_migration/devise/shared/_error_messages.html.erb +13 -0
- data/app/views/data_migration/devise/shared/_links.html.erb +21 -0
- data/app/views/data_migration/exports/new.html.erb +85 -0
- data/app/views/data_migration/imports/new.html.erb +70 -0
- data/app/views/data_migration/migration_executions/index.html.erb +78 -0
- data/app/views/data_migration/migration_executions/show.html.erb +338 -0
- data/app/views/data_migration/migration_plans/_form.html.erb +28 -0
- data/app/views/data_migration/migration_plans/edit.html.erb +12 -0
- data/app/views/data_migration/migration_plans/index.html.erb +118 -0
- data/app/views/data_migration/migration_plans/new.html.erb +9 -0
- data/app/views/data_migration/migration_plans/show.html.erb +105 -0
- data/app/views/data_migration/migration_steps/_form.html.erb +473 -0
- data/app/views/data_migration/migration_steps/edit.html.erb +12 -0
- data/app/views/data_migration/migration_steps/new.html.erb +9 -0
- data/app/views/data_migration/users/_form.html.erb +49 -0
- data/app/views/data_migration/users/edit.html.erb +2 -0
- data/app/views/data_migration/users/index.html.erb +41 -0
- data/app/views/data_migration/users/new.html.erb +2 -0
- data/app/views/data_migration/users/show.html.erb +133 -0
- data/app/views/layouts/_navbar.html.erb +38 -0
- data/app/views/layouts/data_migration.html.erb +37 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/users/registrations/edit.html.erb +41 -0
- data/app/views/users/sessions/new.html.erb +35 -0
- data/app/views/users/shared/_error_messages.html.erb +13 -0
- data/app/views/users/shared/_links.html.erb +21 -0
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/content_security_policy.rb +27 -0
- data/config/initializers/devise.rb +313 -0
- data/config/initializers/filter_parameter_logging.rb +10 -0
- data/config/initializers/inflections.rb +18 -0
- data/config/initializers/permissions_policy.rb +15 -0
- data/config/initializers/warden.rb +14 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/en.yml +31 -0
- data/config/routes.rb +62 -0
- data/db/migrate/20251102121659_create_migration_plans.rb +13 -0
- data/db/migrate/20251102122012_create_migration_steps.rb +24 -0
- data/db/migrate/20251105215702_create_migration_executions.rb +23 -0
- data/db/migrate/20251105215853_create_migration_records.rb +16 -0
- data/db/migrate/20251115154000_remove_unused_attributes.rb +17 -0
- data/db/migrate/20251116120000_add_filter_params_to_migration_executions.rb +7 -0
- data/db/migrate/20251118140000_create_data_migration_users.rb +27 -0
- data/db/migrate/20251118200641_add_user_foreign_keys.rb +15 -0
- data/db/migrate/20251124140000_add_attachment_export_mode_to_migration_steps.rb +9 -0
- data/db/schema.rb +102 -0
- data/db/seeds.rb +19 -0
- data/lib/data_migration/engine.rb +28 -0
- data/lib/data_migration/version.rb +5 -0
- data/lib/data_migration.rb +8 -0
- data/lib/tasks/data_migration_tasks.rake +40 -0
- metadata +279 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-md-8">
|
|
3
|
+
<h1><%= @user.email %></h1>
|
|
4
|
+
<% if @user.id == current_user.id %>
|
|
5
|
+
<span class="badge bg-info">Your Account</span>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<div class="card mt-4">
|
|
9
|
+
<div class="card-header">
|
|
10
|
+
<h5 class="mb-0">User Information</h5>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="card-body">
|
|
13
|
+
<dl class="row">
|
|
14
|
+
<dt class="col-sm-3">Email:</dt>
|
|
15
|
+
<dd class="col-sm-9"><%= @user.email %></dd>
|
|
16
|
+
|
|
17
|
+
<dt class="col-sm-3">Role:</dt>
|
|
18
|
+
<dd class="col-sm-9">
|
|
19
|
+
<span class="badge bg-<%= @user.admin? ? 'danger' : (@user.operator? ? 'warning' : 'secondary') %>">
|
|
20
|
+
<%= @user.role.titleize %>
|
|
21
|
+
</span>
|
|
22
|
+
|
|
23
|
+
<% if policy(@user).change_role? && @user.id != current_user.id %>
|
|
24
|
+
<div class="btn-group btn-group-sm ms-3">
|
|
25
|
+
<%= button_to "Make Viewer", change_role_user_path(@user, role: :viewer),
|
|
26
|
+
method: :patch,
|
|
27
|
+
class: "btn btn-sm btn-outline-secondary #{'active' if @user.viewer?}",
|
|
28
|
+
data: { confirm: "Change #{@user.email} to Viewer?" } %>
|
|
29
|
+
<%= button_to "Make Operator", change_role_user_path(@user, role: :operator),
|
|
30
|
+
method: :patch,
|
|
31
|
+
class: "btn btn-sm btn-outline-warning #{'active' if @user.operator?}",
|
|
32
|
+
data: { confirm: "Change #{@user.email} to Operator?" } %>
|
|
33
|
+
<%= button_to "Make Admin", change_role_user_path(@user, role: :admin),
|
|
34
|
+
method: :patch,
|
|
35
|
+
class: "btn btn-sm btn-outline-danger #{'active' if @user.admin?}",
|
|
36
|
+
data: { confirm: "Change #{@user.email} to Admin?" } %>
|
|
37
|
+
</div>
|
|
38
|
+
<% end %>
|
|
39
|
+
</dd>
|
|
40
|
+
|
|
41
|
+
<dt class="col-sm-3">Email Confirmed:</dt>
|
|
42
|
+
<dd class="col-sm-9">
|
|
43
|
+
<% if @user.confirmed? %>
|
|
44
|
+
<span class="text-success">✓ Yes (on <%= @user.confirmed_at.strftime("%Y-%m-%d %H:%M") %>)</span>
|
|
45
|
+
<% else %>
|
|
46
|
+
<span class="text-warning">⚠ Pending confirmation</span>
|
|
47
|
+
<% end %>
|
|
48
|
+
</dd>
|
|
49
|
+
|
|
50
|
+
<dt class="col-sm-3">Joined:</dt>
|
|
51
|
+
<dd class="col-sm-9"><%= @user.created_at.strftime("%Y-%m-%d %H:%M") %></dd>
|
|
52
|
+
|
|
53
|
+
<dt class="col-sm-3">Last Sign In:</dt>
|
|
54
|
+
<dd class="col-sm-9">
|
|
55
|
+
<% if @user.current_sign_in_at %>
|
|
56
|
+
<%= time_ago_in_words(@user.current_sign_in_at) %> ago
|
|
57
|
+
<% else %>
|
|
58
|
+
<em>Never</em>
|
|
59
|
+
<% end %>
|
|
60
|
+
</dd>
|
|
61
|
+
</dl>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="card mt-4">
|
|
66
|
+
<div class="card-header d-flex justify-content-between align-items-center">
|
|
67
|
+
<h5 class="mb-0">Execution History</h5>
|
|
68
|
+
<span class="badge bg-secondary"><%= @user.migration_executions.count %></span>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="card-body">
|
|
71
|
+
<% if @user.migration_executions.any? %>
|
|
72
|
+
<div class="table-responsive">
|
|
73
|
+
<table class="table table-sm">
|
|
74
|
+
<thead>
|
|
75
|
+
<tr>
|
|
76
|
+
<th>Type</th>
|
|
77
|
+
<th>Plan</th>
|
|
78
|
+
<th>Status</th>
|
|
79
|
+
<th>When</th>
|
|
80
|
+
</tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody>
|
|
83
|
+
<% @user.migration_executions.recent.limit(10).each do |execution| %>
|
|
84
|
+
<tr>
|
|
85
|
+
<td><%= execution.execution_type.titleize %></td>
|
|
86
|
+
<td><%= link_to execution.migration_plan.name, execution.migration_plan %></td>
|
|
87
|
+
<td>
|
|
88
|
+
<span class="badge bg-<%= execution_status_color(execution.status) %>">
|
|
89
|
+
<%= execution.status.titleize %>
|
|
90
|
+
</span>
|
|
91
|
+
</td>
|
|
92
|
+
<td><small><%= time_ago_in_words(execution.created_at) %> ago</small></td>
|
|
93
|
+
</tr>
|
|
94
|
+
<% end %>
|
|
95
|
+
</tbody>
|
|
96
|
+
</table>
|
|
97
|
+
</div>
|
|
98
|
+
<% if @user.migration_executions.count > 10 %>
|
|
99
|
+
<%= link_to "View All", migration_executions_path(user_id: @user.id), class: "btn btn-sm btn-outline-primary w-100" %>
|
|
100
|
+
<% end %>
|
|
101
|
+
<% else %>
|
|
102
|
+
<p class="text-muted text-center">No executions yet.</p>
|
|
103
|
+
<% end %>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="col-md-4">
|
|
109
|
+
<div class="card">
|
|
110
|
+
<div class="card-header">
|
|
111
|
+
<h6 class="mb-0">Permissions</h6>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="card-body">
|
|
114
|
+
<dl class="mb-0">
|
|
115
|
+
<dt>Execute Migrations:</dt>
|
|
116
|
+
<dd><%= @user.can_execute_migrations? ? '✓ Yes' : '✗ No' %></dd>
|
|
117
|
+
|
|
118
|
+
<dt>Manage Plans:</dt>
|
|
119
|
+
<dd><%= @user.can_manage_plans? ? '✓ Yes' : '✗ No' %></dd>
|
|
120
|
+
|
|
121
|
+
<dt>Manage Users:</dt>
|
|
122
|
+
<dd><%= @user.can_manage_users? ? '✓ Yes' : '✗ No' %></dd>
|
|
123
|
+
</dl>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="card mt-3">
|
|
128
|
+
<div class="card-body">
|
|
129
|
+
<%= link_to "← Back to Users", users_path, class: "btn btn-secondary w-100" %>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
2
|
+
<div class="container-fluid">
|
|
3
|
+
<%= link_to "Data Migration", authenticated_root_path, class: "navbar-brand" %>
|
|
4
|
+
|
|
5
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
6
|
+
<span class="navbar-toggler-icon"></span>
|
|
7
|
+
</button>
|
|
8
|
+
|
|
9
|
+
<div class="collapse navbar-collapse" id="navbarNav">
|
|
10
|
+
<ul class="navbar-nav me-auto">
|
|
11
|
+
<li class="nav-item">
|
|
12
|
+
<%= link_to "Migration Plans", migration_plans_path, class: "nav-link" %>
|
|
13
|
+
</li>
|
|
14
|
+
<li class="nav-item">
|
|
15
|
+
<%= link_to "Executions", migration_executions_path, class: "nav-link" %>
|
|
16
|
+
</li>
|
|
17
|
+
<% if current_user.admin? %>
|
|
18
|
+
<li class="nav-item">
|
|
19
|
+
<%= link_to "Users", users_path, class: "nav-link" %>
|
|
20
|
+
</li>
|
|
21
|
+
<% end %>
|
|
22
|
+
</ul>
|
|
23
|
+
|
|
24
|
+
<ul class="navbar-nav">
|
|
25
|
+
<li class="nav-item dropdown">
|
|
26
|
+
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
|
|
27
|
+
<%= current_user.name %> (<%= current_user.role.titleize %>)
|
|
28
|
+
</a>
|
|
29
|
+
<ul class="dropdown-menu dropdown-menu-end">
|
|
30
|
+
<li><%= link_to "Change Password", edit_user_registration_path, class: "dropdown-item" %></li>
|
|
31
|
+
<li><hr class="dropdown-divider"></li>
|
|
32
|
+
<li><%= button_to "Logout", destroy_user_session_path, method: :delete, class: "dropdown-item" %></li>
|
|
33
|
+
</ul>
|
|
34
|
+
</li>
|
|
35
|
+
</ul>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</nav>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Data Migration Tool</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<%= csrf_meta_tags %>
|
|
7
|
+
<%= csp_meta_tag %>
|
|
8
|
+
|
|
9
|
+
<!-- Bootstrap CSS and JS from CDN -->
|
|
10
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<% if user_signed_in? %>
|
|
16
|
+
<%= render 'layouts/navbar' %>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
<div class="container mt-4">
|
|
20
|
+
<% if notice %>
|
|
21
|
+
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
22
|
+
<%= notice %>
|
|
23
|
+
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
<% if alert %>
|
|
28
|
+
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
29
|
+
<%= alert %>
|
|
30
|
+
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
31
|
+
</div>
|
|
32
|
+
<% end %>
|
|
33
|
+
|
|
34
|
+
<%= yield %>
|
|
35
|
+
</div>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<div class="row justify-content-center">
|
|
2
|
+
<div class="col-md-6">
|
|
3
|
+
<div class="card shadow">
|
|
4
|
+
<div class="card-body p-4">
|
|
5
|
+
<h2 class="card-title mb-4">Change Password</h2>
|
|
6
|
+
|
|
7
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
8
|
+
<%= render "data_migration/devise/shared/error_messages", resource: resource %>
|
|
9
|
+
|
|
10
|
+
<div class="mb-3">
|
|
11
|
+
<%= f.label :password, "New password", class: "form-label" %>
|
|
12
|
+
<%= f.password_field :password, autocomplete: "new-password", class: "form-control", placeholder: "Enter new password" %>
|
|
13
|
+
<small class="form-text text-muted">
|
|
14
|
+
(Minimum 6 characters)
|
|
15
|
+
</small>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="mb-3">
|
|
19
|
+
<%= f.label :password_confirmation, "Confirm new password", class: "form-label" %>
|
|
20
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control", placeholder: "Confirm new password" %>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<hr class="my-4">
|
|
24
|
+
|
|
25
|
+
<div class="mb-4">
|
|
26
|
+
<%= f.label :current_password, class: "form-label" %>
|
|
27
|
+
<%= f.password_field :current_password, autocomplete: "current-password", class: "form-control", placeholder: "Enter current password to confirm changes" %>
|
|
28
|
+
<small class="form-text text-muted">
|
|
29
|
+
We need your current password to confirm changes
|
|
30
|
+
</small>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="d-flex gap-2">
|
|
34
|
+
<%= f.submit "Update Password", class: "btn btn-primary" %>
|
|
35
|
+
<%= link_to "Back", :back, class: "btn btn-outline-secondary" %>
|
|
36
|
+
</div>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<div class="row justify-content-center mt-5">
|
|
2
|
+
<div class="col-md-5">
|
|
3
|
+
<div class="card shadow">
|
|
4
|
+
<div class="card-body p-5">
|
|
5
|
+
<div class="text-center mb-4">
|
|
6
|
+
<h2 class="card-title">Data Migration Tool</h2>
|
|
7
|
+
<p class="text-muted">Sign in to your account</p>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
|
11
|
+
<div class="mb-3">
|
|
12
|
+
<%= f.label :email, class: "form-label" %>
|
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: "form-control", placeholder: "Enter your email" %>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="mb-3">
|
|
17
|
+
<%= f.label :password, class: "form-label" %>
|
|
18
|
+
<%= f.password_field :password, autocomplete: "current-password", class: "form-control", placeholder: "Enter your password" %>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<% if devise_mapping.rememberable? %>
|
|
22
|
+
<div class="mb-3 form-check">
|
|
23
|
+
<%= f.check_box :remember_me, class: "form-check-input" %>
|
|
24
|
+
<%= f.label :remember_me, class: "form-check-label" %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
27
|
+
|
|
28
|
+
<div class="d-grid">
|
|
29
|
+
<%= f.submit "Sign in", class: "btn btn-primary btn-lg" %>
|
|
30
|
+
</div>
|
|
31
|
+
<% end %>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<% if resource.errors.any? %>
|
|
2
|
+
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
3
|
+
<h6 class="alert-heading">
|
|
4
|
+
<%= pluralize(resource.errors.count, "error") %> prohibited this from being saved:
|
|
5
|
+
</h6>
|
|
6
|
+
<ul class="mb-0">
|
|
7
|
+
<% resource.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
12
|
+
</div>
|
|
13
|
+
<% end %>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
|
2
|
+
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
|
6
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
10
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
14
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<%- if devise_mapping.omniauthable? %>
|
|
18
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
19
|
+
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Be sure to restart your server when you modify this file.
|
|
4
|
+
|
|
5
|
+
# Version of your assets, change this if you want to expire all your assets.
|
|
6
|
+
Rails.application.config.assets.version = '1.0'
|
|
7
|
+
|
|
8
|
+
# Add additional assets to the asset load path.
|
|
9
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
|
10
|
+
|
|
11
|
+
# Precompile additional assets.
|
|
12
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
|
13
|
+
# folder are already added.
|
|
14
|
+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Be sure to restart your server when you modify this file.
|
|
4
|
+
|
|
5
|
+
# Define an application-wide content security policy.
|
|
6
|
+
# See the Securing Rails Applications Guide for more information:
|
|
7
|
+
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
|
8
|
+
|
|
9
|
+
# Rails.application.configure do
|
|
10
|
+
# config.content_security_policy do |policy|
|
|
11
|
+
# policy.default_src :self, :https
|
|
12
|
+
# policy.font_src :self, :https, :data
|
|
13
|
+
# policy.img_src :self, :https, :data
|
|
14
|
+
# policy.object_src :none
|
|
15
|
+
# policy.script_src :self, :https
|
|
16
|
+
# policy.style_src :self, :https
|
|
17
|
+
# # Specify URI for violation reports
|
|
18
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
|
22
|
+
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
|
23
|
+
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
|
24
|
+
#
|
|
25
|
+
# # Report violations without enforcing the policy.
|
|
26
|
+
# # config.content_security_policy_report_only = true
|
|
27
|
+
# end
|