rhino_project_core 0.30.0.alpha.25 → 0.30.0.alpha.29

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: 2fe2e19c2a5d551a7a22deb670682c76eadb220fd8e6dea96c36620080cabd39
4
- data.tar.gz: 48bf757f3d0e6ebe265c1a9dd3f75bfa142589c4faa2c5e4affc074e0bd63f0e
3
+ metadata.gz: 878a70a35ea5f47d96334367458d1d96c1cf6634b11d12ab53cb2ac324d8e3c9
4
+ data.tar.gz: 9e9aa898914db2d35c275aed52b28095fed6bdd4826a4d3698081a650b73b78f
5
5
  SHA512:
6
- metadata.gz: 7a8b55122ff03416b1b4596b725a67379d84a521ea9201b83a2642bafb805749d9b976cb97bdb63cf44b3e47f714df138835a8d330fbfaa1a7ed694b301a795d
7
- data.tar.gz: 75de2434ba470dae12736e2819e41559f223afb5202bb253d1f804fda5ee0a72666591c4ad07fa5e8b5a5d0a1893ff5b07629a6ec604b0c861b3e1df1c33accb
6
+ metadata.gz: ee0ef61a1b3774d6aa271ec3dd0c687233f5dddb664e383a2810bed710efc703c7220c4fa53c10c50b6c26b37a9a6f848bb07e8473cd40418d83857e48acf790
7
+ data.tar.gz: 6430d5c9109698be5934cd7e51948466034b6428fdc808d02c779212ba2b415e2c94ba840237b7810680ba7626fff07b8bcd056a5f7b7ffc650dd796f71803d9
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rhino
4
+ module EnvHelper
5
+ module_function
6
+
7
+ def rhino_env_tag
8
+ # Filter environment variables to get only those starting with "RHINO_PUBLIC"
9
+ rhino_public_env = ENV.select { |key, _| key.start_with?("RHINO_PUBLIC") }
10
+
11
+ # Create a JavaScript object with the environment variables
12
+ js_env = rhino_public_env.transform_keys { |key| key.sub("RHINO_PUBLIC_", "") }
13
+
14
+ # Create a JavaScript snippet that initializes window.rhino.env
15
+ js_code = <<~JS
16
+ (function() {
17
+ window.rhino = window.rhino || {};
18
+ window.rhino.env = window.rhino.env || {};
19
+ var env = #{js_env.to_json};
20
+ for (var key in env) {
21
+ if (Object.prototype.hasOwnProperty.call(env, key)) {
22
+ window.rhino.env[key] = env[key];
23
+ }
24
+ }
25
+ })();
26
+ JS
27
+
28
+ # Return as a script tag
29
+ javascript_tag(js_code)
30
+ end
31
+ end
32
+ end
@@ -5,7 +5,7 @@ module DeviseTokenAuth::ConfirmationsController::Extensions
5
5
  def show
6
6
  super
7
7
  rescue StandardError
8
- redirect_to ENV["ROOT_URL"]
8
+ redirect_to ENV["RHINO_APP_URL"]
9
9
  end
10
10
  end
11
11
 
@@ -4,6 +4,6 @@ class DeviseTokenAuth::PasswordsController
4
4
  # If there is an error preparing to edit the password, redirect to frontend
5
5
  # This would normally be an expired password token
6
6
  def render_edit_error
7
- redirect_to "#{ENV['ROOT_URL']}/auth/reset-password/expired"
7
+ redirect_to "#{ENV['RHINO_APP_URL']}/auth/reset-password/expired"
8
8
  end
9
9
  end
@@ -1,7 +1,6 @@
1
1
  PORT=<%= server_port %>
2
2
 
3
- # Server
4
- ROOT_URL=http://localhost:$PORT
3
+ RHINO_APP_URL=http://localhost:$PORT
5
4
 
6
5
  DB_NAME=<%= db_name %>
7
6
  DB_HOST=<%= db_host %>
@@ -9,7 +8,13 @@ DB_PORT=<%= db_port %>
9
8
  DB_USERNAME=<%= db_user %>
10
9
  DB_PASSWORD=<%= db_password %>
11
10
 
12
- # Production server:
11
+ # Production
12
+
13
+ #RHINO_PUBLIC_ROLLBAR_ACCESS_TOKEN=
14
+
15
+ #RHINO_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_...
16
+ #RHINO_STRIPE_SECRET_KEY=sk_...
17
+
13
18
  SENDGRID_API_KEY=<api-key>
14
19
 
15
20
  #AWS_ACCESS_KEY=
@@ -21,13 +26,6 @@ SENDGRID_API_KEY=<api-key>
21
26
  #AZURE_ACCOUNT_NAME="azure_acc_name"
22
27
  #AZURE_CONTAINER="container-test"
23
28
 
24
- #STRIPE_PUBLISHABLE_KEY=pk_...
25
- #STRIPE_SECRET_KEY=sk_...
26
-
27
29
  #AUTH_GOOGLE_OAUTH2_CLIENT_ID=
28
30
  #AUTH_GOOGLE_OAUTH2_SECRET_KEY=
29
31
 
30
- ROLLBAR_ACCESS_TOKEN=
31
-
32
- # Production client:
33
- VITE_ROLLBAR_ACCESS_TOKEN=
@@ -66,6 +66,6 @@ DeviseTokenAuth.setup do |config|
66
66
  # send email, set it to true. (This is a setting for compatibility)
67
67
  # config.send_confirmation_email = true
68
68
 
69
- config.default_confirm_success_url = "#{ENV['ROOT_URL']}/auth/signin"
70
- config.default_password_reset_url = "#{ENV['ROOT_URL']}/auth/reset-password"
69
+ config.default_confirm_success_url = "#{ENV['RHINO_APP_URL']}/auth/signin"
70
+ config.default_password_reset_url = "#{ENV['RHINO_APP_URL']}/auth/reset-password"
71
71
  end
data/lib/rhino/version.rb CHANGED
@@ -10,7 +10,7 @@ module Rhino
10
10
  MAJOR = 0
11
11
  MINOR = 30
12
12
  TINY = 0
13
- PRE = "alpha.25"
13
+ PRE = "alpha.29"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhino_project_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0.alpha.25
4
+ version: 0.30.0.alpha.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Rosevear
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-18 00:00:00.000000000 Z
10
+ date: 2025-03-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -387,6 +387,7 @@ files:
387
387
  - app/controllers/rhino/crud_controller.rb
388
388
  - app/controllers/rhino/simple_controller.rb
389
389
  - app/controllers/rhino/simple_stream_controller.rb
390
+ - app/helpers/rhino/env_helper.rb
390
391
  - app/helpers/rhino/omniauth_helper.rb
391
392
  - app/helpers/rhino/policy_helper.rb
392
393
  - app/helpers/rhino/segment_helper.rb