skywalking 0.0.0.alpha

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.
Files changed (184) hide show
  1. checksums.yaml +7 -0
  2. data/.asf.yaml +40 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +236 -0
  5. data/CHANGELOG.md +15 -0
  6. data/CODE_OF_CONDUCT.md +132 -0
  7. data/LICENSE +201 -0
  8. data/NOTICE +5 -0
  9. data/README.md +18 -0
  10. data/Rakefile +23 -0
  11. data/docs/How-to-release.md +179 -0
  12. data/examples/rails-demo/.dockerignore +47 -0
  13. data/examples/rails-demo/.gitattributes +9 -0
  14. data/examples/rails-demo/.gitignore +34 -0
  15. data/examples/rails-demo/.kamal/hooks/docker-setup.sample +3 -0
  16. data/examples/rails-demo/.kamal/hooks/post-deploy.sample +14 -0
  17. data/examples/rails-demo/.kamal/hooks/post-proxy-reboot.sample +3 -0
  18. data/examples/rails-demo/.kamal/hooks/pre-build.sample +51 -0
  19. data/examples/rails-demo/.kamal/hooks/pre-connect.sample +47 -0
  20. data/examples/rails-demo/.kamal/hooks/pre-deploy.sample +109 -0
  21. data/examples/rails-demo/.kamal/hooks/pre-proxy-reboot.sample +3 -0
  22. data/examples/rails-demo/.kamal/secrets +17 -0
  23. data/examples/rails-demo/.rubocop.yml +8 -0
  24. data/examples/rails-demo/.ruby-version +1 -0
  25. data/examples/rails-demo/Dockerfile +72 -0
  26. data/examples/rails-demo/Gemfile +64 -0
  27. data/examples/rails-demo/README.md +24 -0
  28. data/examples/rails-demo/Rakefile +6 -0
  29. data/examples/rails-demo/app/assets/images/.keep +0 -0
  30. data/examples/rails-demo/app/assets/stylesheets/application.css +10 -0
  31. data/examples/rails-demo/app/controllers/application_controller.rb +4 -0
  32. data/examples/rails-demo/app/controllers/concerns/.keep +0 -0
  33. data/examples/rails-demo/app/helpers/application_helper.rb +2 -0
  34. data/examples/rails-demo/app/javascript/application.js +3 -0
  35. data/examples/rails-demo/app/javascript/controllers/application.js +9 -0
  36. data/examples/rails-demo/app/javascript/controllers/hello_controller.js +7 -0
  37. data/examples/rails-demo/app/javascript/controllers/index.js +4 -0
  38. data/examples/rails-demo/app/jobs/application_job.rb +7 -0
  39. data/examples/rails-demo/app/mailers/application_mailer.rb +4 -0
  40. data/examples/rails-demo/app/models/application_record.rb +3 -0
  41. data/examples/rails-demo/app/models/concerns/.keep +0 -0
  42. data/examples/rails-demo/app/views/layouts/application.html.erb +28 -0
  43. data/examples/rails-demo/app/views/layouts/mailer.html.erb +13 -0
  44. data/examples/rails-demo/app/views/layouts/mailer.text.erb +1 -0
  45. data/examples/rails-demo/app/views/pwa/manifest.json.erb +22 -0
  46. data/examples/rails-demo/app/views/pwa/service-worker.js +26 -0
  47. data/examples/rails-demo/bin/brakeman +7 -0
  48. data/examples/rails-demo/bin/bundle +109 -0
  49. data/examples/rails-demo/bin/dev +2 -0
  50. data/examples/rails-demo/bin/docker-entrypoint +14 -0
  51. data/examples/rails-demo/bin/importmap +4 -0
  52. data/examples/rails-demo/bin/jobs +6 -0
  53. data/examples/rails-demo/bin/kamal +27 -0
  54. data/examples/rails-demo/bin/rails +4 -0
  55. data/examples/rails-demo/bin/rake +4 -0
  56. data/examples/rails-demo/bin/rubocop +8 -0
  57. data/examples/rails-demo/bin/setup +34 -0
  58. data/examples/rails-demo/bin/thrust +5 -0
  59. data/examples/rails-demo/config/application.rb +27 -0
  60. data/examples/rails-demo/config/boot.rb +4 -0
  61. data/examples/rails-demo/config/cable.yml +17 -0
  62. data/examples/rails-demo/config/cache.yml +16 -0
  63. data/examples/rails-demo/config/credentials.yml.enc +1 -0
  64. data/examples/rails-demo/config/database.yml +41 -0
  65. data/examples/rails-demo/config/deploy.yml +116 -0
  66. data/examples/rails-demo/config/environment.rb +5 -0
  67. data/examples/rails-demo/config/environments/development.rb +72 -0
  68. data/examples/rails-demo/config/environments/production.rb +90 -0
  69. data/examples/rails-demo/config/environments/test.rb +53 -0
  70. data/examples/rails-demo/config/importmap.rb +7 -0
  71. data/examples/rails-demo/config/initializers/assets.rb +7 -0
  72. data/examples/rails-demo/config/initializers/content_security_policy.rb +25 -0
  73. data/examples/rails-demo/config/initializers/filter_parameter_logging.rb +8 -0
  74. data/examples/rails-demo/config/initializers/inflections.rb +16 -0
  75. data/examples/rails-demo/config/initializers/skywalking_ruby.rb +18 -0
  76. data/examples/rails-demo/config/locales/en.yml +31 -0
  77. data/examples/rails-demo/config/puma.rb +41 -0
  78. data/examples/rails-demo/config/queue.yml +18 -0
  79. data/examples/rails-demo/config/recurring.yml +10 -0
  80. data/examples/rails-demo/config/routes.rb +14 -0
  81. data/examples/rails-demo/config/storage.yml +34 -0
  82. data/examples/rails-demo/config.ru +6 -0
  83. data/examples/rails-demo/db/cable_schema.rb +11 -0
  84. data/examples/rails-demo/db/cache_schema.rb +14 -0
  85. data/examples/rails-demo/db/queue_schema.rb +129 -0
  86. data/examples/rails-demo/db/seeds.rb +9 -0
  87. data/examples/rails-demo/lib/tasks/.keep +0 -0
  88. data/examples/rails-demo/log/.keep +0 -0
  89. data/examples/rails-demo/public/400.html +114 -0
  90. data/examples/rails-demo/public/404.html +114 -0
  91. data/examples/rails-demo/public/406-unsupported-browser.html +114 -0
  92. data/examples/rails-demo/public/422.html +114 -0
  93. data/examples/rails-demo/public/500.html +114 -0
  94. data/examples/rails-demo/public/icon.png +0 -0
  95. data/examples/rails-demo/public/icon.svg +3 -0
  96. data/examples/rails-demo/public/robots.txt +1 -0
  97. data/examples/rails-demo/script/.keep +0 -0
  98. data/examples/rails-demo/storage/.keep +0 -0
  99. data/examples/rails-demo/test/application_system_test_case.rb +5 -0
  100. data/examples/rails-demo/test/controllers/.keep +0 -0
  101. data/examples/rails-demo/test/fixtures/files/.keep +0 -0
  102. data/examples/rails-demo/test/helpers/.keep +0 -0
  103. data/examples/rails-demo/test/integration/.keep +0 -0
  104. data/examples/rails-demo/test/mailers/.keep +0 -0
  105. data/examples/rails-demo/test/models/.keep +0 -0
  106. data/examples/rails-demo/test/system/.keep +0 -0
  107. data/examples/rails-demo/test/test_helper.rb +15 -0
  108. data/examples/rails-demo/tmp/.keep +0 -0
  109. data/examples/rails-demo/tmp/pids/.keep +0 -0
  110. data/examples/rails-demo/tmp/storage/.keep +0 -0
  111. data/examples/rails-demo/vendor/.keep +0 -0
  112. data/examples/rails-demo/vendor/javascript/.keep +0 -0
  113. data/examples/sinatra-demo/sinatra-demo.rb +32 -0
  114. data/lib/skywalking/agent.rb +98 -0
  115. data/lib/skywalking/configuration.rb +255 -0
  116. data/lib/skywalking/environment.rb +50 -0
  117. data/lib/skywalking/log/logger.rb +53 -0
  118. data/lib/skywalking/plugins/redis5.rb +70 -0
  119. data/lib/skywalking/plugins/sinatra.rb +55 -0
  120. data/lib/skywalking/plugins_manager.rb +84 -0
  121. data/lib/skywalking/proto/asyncprofiler/AsyncProfiler_pb.rb +23 -0
  122. data/lib/skywalking/proto/asyncprofiler/AsyncProfiler_services_pb.rb +45 -0
  123. data/lib/skywalking/proto/browser/BrowserPerfCompat_pb.rb +15 -0
  124. data/lib/skywalking/proto/browser/BrowserPerfCompat_services_pb.rb +42 -0
  125. data/lib/skywalking/proto/browser/BrowserPerf_pb.rb +21 -0
  126. data/lib/skywalking/proto/browser/BrowserPerf_services_pb.rb +46 -0
  127. data/lib/skywalking/proto/common/Command_pb.rb +20 -0
  128. data/lib/skywalking/proto/common/Common_pb.rb +21 -0
  129. data/lib/skywalking/proto/ebpf/accesslog_pb.rb +58 -0
  130. data/lib/skywalking/proto/ebpf/accesslog_services_pb.rb +42 -0
  131. data/lib/skywalking/proto/event/Event_pb.rb +21 -0
  132. data/lib/skywalking/proto/event/Event_services_pb.rb +45 -0
  133. data/lib/skywalking/proto/language-agent/CLRMetricCompat_pb.rb +15 -0
  134. data/lib/skywalking/proto/language-agent/CLRMetricCompat_services_pb.rb +38 -0
  135. data/lib/skywalking/proto/language-agent/CLRMetric_pb.rb +23 -0
  136. data/lib/skywalking/proto/language-agent/CLRMetric_services_pb.rb +42 -0
  137. data/lib/skywalking/proto/language-agent/ConfigurationDiscoveryService_pb.rb +19 -0
  138. data/lib/skywalking/proto/language-agent/ConfigurationDiscoveryService_services_pb.rb +51 -0
  139. data/lib/skywalking/proto/language-agent/JVMMetricCompat_pb.rb +15 -0
  140. data/lib/skywalking/proto/language-agent/JVMMetricCompat_services_pb.rb +39 -0
  141. data/lib/skywalking/proto/language-agent/JVMMetric_pb.rb +28 -0
  142. data/lib/skywalking/proto/language-agent/JVMMetric_services_pb.rb +43 -0
  143. data/lib/skywalking/proto/language-agent/MeterCompat_pb.rb +15 -0
  144. data/lib/skywalking/proto/language-agent/MeterCompat_services_pb.rb +39 -0
  145. data/lib/skywalking/proto/language-agent/Meter_pb.rb +24 -0
  146. data/lib/skywalking/proto/language-agent/Meter_services_pb.rb +48 -0
  147. data/lib/skywalking/proto/language-agent/TracingCompat_pb.rb +15 -0
  148. data/lib/skywalking/proto/language-agent/TracingCompat_services_pb.rb +48 -0
  149. data/lib/skywalking/proto/language-agent/Tracing_pb.rb +31 -0
  150. data/lib/skywalking/proto/language-agent/Tracing_services_pb.rb +71 -0
  151. data/lib/skywalking/proto/logging/Logging_pb.rb +26 -0
  152. data/lib/skywalking/proto/logging/Logging_services_pb.rb +46 -0
  153. data/lib/skywalking/proto/management/ManagementCompat_pb.rb +15 -0
  154. data/lib/skywalking/proto/management/ManagementCompat_services_pb.rb +44 -0
  155. data/lib/skywalking/proto/management/Management_pb.rb +21 -0
  156. data/lib/skywalking/proto/management/Management_services_pb.rb +48 -0
  157. data/lib/skywalking/proto/profile/ProfileCompat_pb.rb +15 -0
  158. data/lib/skywalking/proto/profile/ProfileCompat_services_pb.rb +43 -0
  159. data/lib/skywalking/proto/profile/Profile_pb.rb +22 -0
  160. data/lib/skywalking/proto/profile/Profile_services_pb.rb +47 -0
  161. data/lib/skywalking/proto/service-mesh-probe/service-mesh_pb.rb +25 -0
  162. data/lib/skywalking/proto/service-mesh-probe/service-mesh_services_pb.rb +43 -0
  163. data/lib/skywalking/reporter/buffer_trigger.rb +108 -0
  164. data/lib/skywalking/reporter/client/grpc_client.rb +114 -0
  165. data/lib/skywalking/reporter/client/proto.rb +29 -0
  166. data/lib/skywalking/reporter/grpc.rb +46 -0
  167. data/lib/skywalking/reporter/protocol.rb +28 -0
  168. data/lib/skywalking/reporter/report.rb +82 -0
  169. data/lib/skywalking/reporter/scheduler.rb +158 -0
  170. data/lib/skywalking/tracing/carrier.rb +121 -0
  171. data/lib/skywalking/tracing/carrier_item.rb +27 -0
  172. data/lib/skywalking/tracing/constants.rb +49 -0
  173. data/lib/skywalking/tracing/entry_span.rb +48 -0
  174. data/lib/skywalking/tracing/exit_span.rb +53 -0
  175. data/lib/skywalking/tracing/ignored_context.rb +34 -0
  176. data/lib/skywalking/tracing/noop_span.rb +32 -0
  177. data/lib/skywalking/tracing/segment.rb +57 -0
  178. data/lib/skywalking/tracing/span.rb +111 -0
  179. data/lib/skywalking/tracing/span_context.rb +242 -0
  180. data/lib/skywalking/tracing/tag.rb +49 -0
  181. data/lib/skywalking/utils/id_gen.rb +30 -0
  182. data/lib/skywalking/version.rb +18 -0
  183. data/lib/skywalking.rb +36 -0
  184. metadata +340 -0
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative "config/application"
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,10 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css.
3
+ *
4
+ * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5
+ * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6
+ * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7
+ * depending on specificity.
8
+ *
9
+ * Consider organizing styles into separate files for maintainability.
10
+ */
@@ -0,0 +1,4 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3
+ allow_browser versions: :modern
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+ import "@hotwired/turbo-rails"
3
+ import "controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ // Import and register all your controllers from the importmap via controllers/**/*_controller
2
+ import { application } from "controllers/application"
3
+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
4
+ eagerLoadControllersFrom("controllers", application)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
File without changes
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= content_for(:title) || "App Demo" %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <meta name="mobile-web-app-capable" content="yes">
8
+ <%= csrf_meta_tags %>
9
+ <%= csp_meta_tag %>
10
+
11
+ <%= yield :head %>
12
+
13
+ <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
14
+ <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
15
+
16
+ <link rel="icon" href="/icon.png" type="image/png">
17
+ <link rel="icon" href="/icon.svg" type="image/svg+xml">
18
+ <link rel="apple-touch-icon" href="/icon.png">
19
+
20
+ <%# Includes all stylesheet files in app/assets/stylesheets %>
21
+ <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
22
+ <%= javascript_importmap_tags %>
23
+ </head>
24
+
25
+ <body>
26
+ <%= yield %>
27
+ </body>
28
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "AppDemo",
3
+ "icons": [
4
+ {
5
+ "src": "/icon.png",
6
+ "type": "image/png",
7
+ "sizes": "512x512"
8
+ },
9
+ {
10
+ "src": "/icon.png",
11
+ "type": "image/png",
12
+ "sizes": "512x512",
13
+ "purpose": "maskable"
14
+ }
15
+ ],
16
+ "start_url": "/",
17
+ "display": "standalone",
18
+ "scope": "/",
19
+ "description": "AppDemo.",
20
+ "theme_color": "red",
21
+ "background_color": "red"
22
+ }
@@ -0,0 +1,26 @@
1
+ // Add a service worker for processing Web Push notifications:
2
+ //
3
+ // self.addEventListener("push", async (event) => {
4
+ // const { title, options } = await event.data.json()
5
+ // event.waitUntil(self.registration.showNotification(title, options))
6
+ // })
7
+ //
8
+ // self.addEventListener("notificationclick", function(event) {
9
+ // event.notification.close()
10
+ // event.waitUntil(
11
+ // clients.matchAll({ type: "window" }).then((clientList) => {
12
+ // for (let i = 0; i < clientList.length; i++) {
13
+ // let client = clientList[i]
14
+ // let clientPath = (new URL(client.url)).pathname
15
+ //
16
+ // if (clientPath == event.notification.data.path && "focus" in client) {
17
+ // return client.focus()
18
+ // }
19
+ // }
20
+ //
21
+ // if (clients.openWindow) {
22
+ // return clients.openWindow(event.notification.data.path)
23
+ // }
24
+ // })
25
+ // )
26
+ // })
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ ARGV.unshift("--ensure-latest")
6
+
7
+ load Gem.bin_path("brakeman", "brakeman")
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_requirement
64
+ @bundler_requirement ||=
65
+ env_var_version ||
66
+ cli_arg_version ||
67
+ bundler_requirement_for(lockfile_version)
68
+ end
69
+
70
+ def bundler_requirement_for(version)
71
+ return "#{Gem::Requirement.default}.a" unless version
72
+
73
+ bundler_gem_version = Gem::Version.new(version)
74
+
75
+ bundler_gem_version.approximate_recommendation
76
+ end
77
+
78
+ def load_bundler!
79
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
80
+
81
+ activate_bundler
82
+ end
83
+
84
+ def activate_bundler
85
+ gem_error = activation_error_handling do
86
+ gem "bundler", bundler_requirement
87
+ end
88
+ return if gem_error.nil?
89
+ require_error = activation_error_handling do
90
+ require "bundler/version"
91
+ end
92
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
93
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94
+ exit 42
95
+ end
96
+
97
+ def activation_error_handling
98
+ yield
99
+ nil
100
+ rescue StandardError, LoadError => e
101
+ e
102
+ end
103
+ end
104
+
105
+ m.load_bundler!
106
+
107
+ if m.invoked_as_script?
108
+ load Gem.bin_path("bundler", "bundle")
109
+ end
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ exec "./bin/rails", "server", *ARGV
@@ -0,0 +1,14 @@
1
+ #!/bin/bash -e
2
+
3
+ # Enable jemalloc for reduced memory usage and latency.
4
+ if [ -z "${LD_PRELOAD+x}" ]; then
5
+ LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
6
+ export LD_PRELOAD
7
+ fi
8
+
9
+ # If running the rails server then create or migrate existing database
10
+ if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
11
+ ./bin/rails db:prepare
12
+ fi
13
+
14
+ exec "${@}"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../config/application"
4
+ require "importmap/commands"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../config/environment"
4
+ require "solid_queue/cli"
5
+
6
+ SolidQueue::Cli.start(ARGV)
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'kamal' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("kamal", "kamal")
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path("../config/application", __dir__)
3
+ require_relative "../config/boot"
4
+ require "rails/commands"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../config/boot"
3
+ require "rake"
4
+ Rake.application.run
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ # explicit rubocop config increases performance slightly while avoiding config confusion.
6
+ ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7
+
8
+ load Gem.bin_path("rubocop", "rubocop")
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ APP_ROOT = File.expand_path("..", __dir__)
5
+
6
+ def system!(*args)
7
+ system(*args, exception: true)
8
+ end
9
+
10
+ FileUtils.chdir APP_ROOT do
11
+ # This script is a way to set up or update your development environment automatically.
12
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
13
+ # Add necessary setup steps to this file.
14
+
15
+ puts "== Installing dependencies =="
16
+ system("bundle check") || system!("bundle install")
17
+
18
+ # puts "\n== Copying sample files =="
19
+ # unless File.exist?("config/database.yml")
20
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
21
+ # end
22
+
23
+ puts "\n== Preparing database =="
24
+ system! "bin/rails db:prepare"
25
+
26
+ puts "\n== Removing old logs and tempfiles =="
27
+ system! "bin/rails log:clear tmp:clear"
28
+
29
+ unless ARGV.include?("--skip-server")
30
+ puts "\n== Starting development server =="
31
+ STDOUT.flush # flush the output before exec(2) so that it displays
32
+ exec "bin/dev"
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ load Gem.bin_path("thruster", "thrust")
@@ -0,0 +1,27 @@
1
+ require_relative "boot"
2
+
3
+ require "rails/all"
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module AppDemo
10
+ class Application < Rails::Application
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 8.0
13
+
14
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
15
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
16
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
17
+ config.autoload_lib(ignore: %w[assets tasks])
18
+
19
+ # Configuration for the application, engines, and railties goes here.
20
+ #
21
+ # These settings can be overridden in specific environments using the files
22
+ # in config/environments, which are processed later.
23
+ #
24
+ # config.time_zone = "Central Time (US & Canada)"
25
+ # config.eager_load_paths << Rails.root.join("extras")
26
+ end
27
+ end
@@ -0,0 +1,4 @@
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,17 @@
1
+ # Async adapter only works within the same process, so for manually triggering cable updates from a console,
2
+ # and seeing results in the browser, you must do so from the web console (running inside the dev process),
3
+ # not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
4
+ # to make the web console appear.
5
+ development:
6
+ adapter: async
7
+
8
+ test:
9
+ adapter: test
10
+
11
+ production:
12
+ adapter: solid_cable
13
+ connects_to:
14
+ database:
15
+ writing: cable
16
+ polling_interval: 0.1.seconds
17
+ message_retention: 1.day
@@ -0,0 +1,16 @@
1
+ default: &default
2
+ store_options:
3
+ # Cap age of oldest cache entry to fulfill retention policies
4
+ # max_age: <%= 60.days.to_i %>
5
+ max_size: <%= 256.megabytes %>
6
+ namespace: <%= Rails.env %>
7
+
8
+ development:
9
+ <<: *default
10
+
11
+ test:
12
+ <<: *default
13
+
14
+ production:
15
+ database: cache
16
+ <<: *default
@@ -0,0 +1 @@
1
+ WYIIUJVh9ImHFkXx8GZZqIHJjgLNLkZ4ilM9wFA2J7Pw6F9uAZ8iCGvPn4rL1ThXzdZLWQutIPD608JJTsBFZoJsPUsI3F2dXGE7D3kvXsM6EGc2e2F4u7npPwd94dHPoL398DCNiL9yYy2wWEW4U35NSRilK9eguLqmasttFBk8nfpoXt4A2D26pSU1vKyft+7/ZFDMduSMvE+stQM1SWdvdSZIDcMMajw5LWIjslhakn3QA1iO87qJtzCm2mWRgEiVyZWeIBovZ9akW1apsq0F67QnC1+6p/zh0ZTbalhe+ENkJO49arMFf8C9pZm5inFZrwO6vmviMaWspbTt6hcou4agiC3nBCqF3fHvmpKgQsXLyRHYNkoMPmuHVjilv9nW8O/vnRBuFXJN8MRS2fzGGTC1G2Pija2TTFmb7KzdF3rkhXQHQlUm0LQXlx8l/RgYdQeHQ8lhpaVge0jZJ0Aquyb396jc+gIlZiaHTNffQ6r6/cEa1Gj+--HhZpI/RF7QrOmZNy--/vy5cF/99DGDY67RSRzvQA==
@@ -0,0 +1,41 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+
24
+ # Store production database in the storage/ directory, which by default
25
+ # is mounted as a persistent Docker volume in config/deploy.yml.
26
+ production:
27
+ primary:
28
+ <<: *default
29
+ database: storage/production.sqlite3
30
+ cache:
31
+ <<: *default
32
+ database: storage/production_cache.sqlite3
33
+ migrations_paths: db/cache_migrate
34
+ queue:
35
+ <<: *default
36
+ database: storage/production_queue.sqlite3
37
+ migrations_paths: db/queue_migrate
38
+ cable:
39
+ <<: *default
40
+ database: storage/production_cable.sqlite3
41
+ migrations_paths: db/cable_migrate