litestream 0.11.0-x86_64-darwin → 0.11.2-x86_64-darwin
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 +4 -4
- data/app/controllers/litestream/application_controller.rb +6 -1
- data/lib/litestream/commands.rb +3 -5
- data/lib/litestream/engine.rb +4 -0
- data/lib/litestream/generators/litestream/templates/initializer.rb +4 -4
- data/lib/litestream/version.rb +1 -1
- data/lib/litestream.rb +31 -11
- data/lib/tasks/litestream_tasks.rake +3 -8
- metadata +61 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b0adcbe9f34a23e5f6bd0a6de57018ee114fe11cdf4557577d1c32c6fe02a7cf
         | 
| 4 | 
            +
              data.tar.gz: 183480af9a279fc8490844e3aa389ceed2f8f5ebacffcd66b8fbeefd80d6c3b2
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5306db6b0fb66f2fdcd51b067c5cd39098eb9de1389282b91f38f4c9a315a8193d83d8ebcb803e79c0d762b53f439a72e5cfea7541658b54ae573224e65b59e2
         | 
| 7 | 
            +
              data.tar.gz: 5684670016f90f4277d156dedae679372c758d24b9c8048d4316ddd7c632bc70a05e24b960ca0d488891faf5f69d00e991d217be3490004f638d55ce489354d7
         | 
| @@ -3,7 +3,12 @@ module Litestream | |
| 3 3 | 
             
                protect_from_forgery with: :exception
         | 
| 4 4 | 
             
                around_action :force_english_locale!
         | 
| 5 5 |  | 
| 6 | 
            -
                 | 
| 6 | 
            +
                if Litestream.password
         | 
| 7 | 
            +
                  http_basic_authenticate_with(
         | 
| 8 | 
            +
                    name: Litestream.username,
         | 
| 9 | 
            +
                    password: Litestream.password
         | 
| 10 | 
            +
                  )
         | 
| 11 | 
            +
                end
         | 
| 7 12 |  | 
| 8 13 | 
             
                private
         | 
| 9 14 |  | 
    
        data/lib/litestream/commands.rb
    CHANGED
    
    | @@ -118,11 +118,9 @@ module Litestream | |
| 118 118 | 
             
                  end
         | 
| 119 119 |  | 
| 120 120 | 
             
                  def prepare(command, argv = {}, database = nil)
         | 
| 121 | 
            -
                     | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 124 | 
            -
                      ENV["LITESTREAM_SECRET_ACCESS_KEY"] ||= Litestream.configuration.replica_access_key
         | 
| 125 | 
            -
                    end
         | 
| 121 | 
            +
                    ENV["LITESTREAM_REPLICA_BUCKET"] ||= Litestream.replica_bucket
         | 
| 122 | 
            +
                    ENV["LITESTREAM_ACCESS_KEY_ID"] ||= Litestream.replica_key_id
         | 
| 123 | 
            +
                    ENV["LITESTREAM_SECRET_ACCESS_KEY"] ||= Litestream.replica_access_key
         | 
| 126 124 |  | 
| 127 125 | 
             
                    args = {
         | 
| 128 126 | 
             
                      "--config" => Rails.root.join("config", "litestream.yml").to_s
         | 
    
        data/lib/litestream/engine.rb
    CHANGED
    
    
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
            # This allows you to configure Litestream using Rails encrypted credentials,
         | 
| 5 5 | 
             
            # or some other mechanism where the values are only avaialble at runtime.
         | 
| 6 6 |  | 
| 7 | 
            -
             | 
| 7 | 
            +
            Rails.application.configure do
         | 
| 8 8 | 
             
              # An example of using Rails encrypted credentials to configure Litestream.
         | 
| 9 9 | 
             
              # litestream_credentials = Rails.application.credentials.litestream
         | 
| 10 10 |  | 
| @@ -19,15 +19,15 @@ Litestream.configure do |config| | |
| 19 19 | 
             
              # any SFTP server.
         | 
| 20 20 | 
             
              # In this example, we are using Rails encrypted credentials to store the URL to
         | 
| 21 21 | 
             
              # our storage provider bucket.
         | 
| 22 | 
            -
              # config.replica_bucket = litestream_credentials | 
| 22 | 
            +
              # config.litestream.replica_bucket = litestream_credentials&.replica_bucket
         | 
| 23 23 |  | 
| 24 24 | 
             
              # Replica-specific authentication key.
         | 
| 25 25 | 
             
              # Litestream needs authentication credentials to access your storage provider bucket.
         | 
| 26 26 | 
             
              # In this example, we are using Rails encrypted credentials to store the access key ID.
         | 
| 27 | 
            -
              # config.replica_key_id = litestream_credentials | 
| 27 | 
            +
              # config.litestream.replica_key_id = litestream_credentials&.replica_key_id
         | 
| 28 28 |  | 
| 29 29 | 
             
              # Replica-specific secret key.
         | 
| 30 30 | 
             
              # Litestream needs authentication credentials to access your storage provider bucket.
         | 
| 31 31 | 
             
              # In this example, we are using Rails encrypted credentials to store the secret access key.
         | 
| 32 | 
            -
              # config.replica_access_key = litestream_credentials | 
| 32 | 
            +
              # config.litestream.replica_access_key = litestream_credentials&.replica_access_key
         | 
| 33 33 | 
             
            end
         | 
    
        data/lib/litestream/version.rb
    CHANGED
    
    
    
        data/lib/litestream.rb
    CHANGED
    
    | @@ -3,11 +3,25 @@ | |
| 3 3 | 
             
            require "sqlite3"
         | 
| 4 4 |  | 
| 5 5 | 
             
            module Litestream
         | 
| 6 | 
            +
              VerificationFailure = Class.new(StandardError)
         | 
| 7 | 
            +
             | 
| 6 8 | 
             
              class << self
         | 
| 7 | 
            -
                 | 
| 9 | 
            +
                attr_writer :configuration
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                def configuration
         | 
| 12 | 
            +
                  @configuration ||= Configuration.new
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                def deprecator
         | 
| 16 | 
            +
                  @deprecator ||= ActiveSupport::Deprecation.new("0.12.0", "Litestream")
         | 
| 17 | 
            +
                end
         | 
| 8 18 | 
             
              end
         | 
| 9 19 |  | 
| 10 20 | 
             
              def self.configure
         | 
| 21 | 
            +
                deprecator.warn(
         | 
| 22 | 
            +
                  'Configuring Litestream via Litestream.configure is deprecated. Use Rails.application.configure { config.litestream.* = ... } instead.',
         | 
| 23 | 
            +
                  caller
         | 
| 24 | 
            +
                )
         | 
| 11 25 | 
             
                self.configuration ||= Configuration.new
         | 
| 12 26 | 
             
                yield(configuration)
         | 
| 13 27 | 
             
              end
         | 
| @@ -19,11 +33,7 @@ module Litestream | |
| 19 33 | 
             
                end
         | 
| 20 34 | 
             
              end
         | 
| 21 35 |  | 
| 22 | 
            -
               | 
| 23 | 
            -
             | 
| 24 | 
            -
              mattr_writer :username
         | 
| 25 | 
            -
              mattr_writer :password
         | 
| 26 | 
            -
              mattr_writer :queue
         | 
| 36 | 
            +
              mattr_writer :username, :password, :queue, :replica_bucket, :replica_key_id, :replica_access_key
         | 
| 27 37 |  | 
| 28 38 | 
             
              class << self
         | 
| 29 39 | 
             
                def verify!(database_path)
         | 
| @@ -52,17 +62,27 @@ module Litestream | |
| 52 62 | 
             
                # use method instead of attr_accessor to ensure
         | 
| 53 63 | 
             
                # this works if variable set after Litestream is loaded
         | 
| 54 64 | 
             
                def username
         | 
| 55 | 
            -
                   | 
| 65 | 
            +
                  ENV["LITESTREAM_USERNAME"] || @@username || "litestream"
         | 
| 56 66 | 
             
                end
         | 
| 57 67 |  | 
| 58 | 
            -
                # use method instead of attr_accessor to ensure
         | 
| 59 | 
            -
                # this works if variable set after Litestream is loaded
         | 
| 60 68 | 
             
                def password
         | 
| 61 | 
            -
                   | 
| 69 | 
            +
                  ENV["LITESTREAM_PASSWORD"] || @@password
         | 
| 62 70 | 
             
                end
         | 
| 63 71 |  | 
| 64 72 | 
             
                def queue
         | 
| 65 | 
            -
                   | 
| 73 | 
            +
                  ENV["LITESTREAM_QUEUE"] || @@queue || "default"
         | 
| 74 | 
            +
                end
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                def replica_bucket
         | 
| 77 | 
            +
                  @@replica_bucket || configuration.replica_bucket
         | 
| 78 | 
            +
                end
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                def replica_key_id
         | 
| 81 | 
            +
                  @@replica_key_id || configuration.replica_key_id
         | 
| 82 | 
            +
                end
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                def replica_access_key
         | 
| 85 | 
            +
                  @@replica_access_key || configuration.replica_access_key
         | 
| 66 86 | 
             
                end
         | 
| 67 87 |  | 
| 68 88 | 
             
                def replicate_process
         | 
| @@ -1,14 +1,9 @@ | |
| 1 1 | 
             
            namespace :litestream do
         | 
| 2 2 | 
             
              desc "Print the ENV variables needed for the Litestream config file"
         | 
| 3 3 | 
             
              task env: :environment do
         | 
| 4 | 
            -
                 | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
                end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                puts "LITESTREAM_REPLICA_BUCKET=#{Litestream.configuration.replica_bucket}"
         | 
| 10 | 
            -
                puts "LITESTREAM_ACCESS_KEY_ID=#{Litestream.configuration.replica_key_id}"
         | 
| 11 | 
            -
                puts "LITESTREAM_SECRET_ACCESS_KEY=#{Litestream.configuration.replica_access_key}"
         | 
| 4 | 
            +
                puts "LITESTREAM_REPLICA_BUCKET=#{Litestream.replica_bucket}"
         | 
| 5 | 
            +
                puts "LITESTREAM_ACCESS_KEY_ID=#{Litestream.replica_key_id}"
         | 
| 6 | 
            +
                puts "LITESTREAM_SECRET_ACCESS_KEY=#{Litestream.replica_access_key}"
         | 
| 12 7 |  | 
| 13 8 | 
             
                true
         | 
| 14 9 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: litestream
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.11. | 
| 4 | 
            +
              version: 0.11.2
         | 
| 5 5 | 
             
            platform: x86_64-darwin
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Stephen Margheim
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024- | 
| 11 | 
            +
            date: 2024-09-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: logfmt
         | 
| @@ -38,20 +38,76 @@ dependencies: | |
| 38 38 | 
             
                - - ">="
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 40 | 
             
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: actionpack
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - ">="
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '7.0'
         | 
| 48 | 
            +
              type: :runtime
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - ">="
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '7.0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: actionview
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - ">="
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '7.0'
         | 
| 62 | 
            +
              type: :runtime
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - ">="
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '7.0'
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: activesupport
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - ">="
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '7.0'
         | 
| 76 | 
            +
              type: :runtime
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - ">="
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '7.0'
         | 
| 41 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 84 | 
             
              name: activejob
         | 
| 43 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 86 | 
             
                requirements:
         | 
| 45 87 | 
             
                - - ">="
         | 
| 46 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: '0'
         | 
| 89 | 
            +
                    version: '7.0'
         | 
| 48 90 | 
             
              type: :runtime
         | 
| 49 91 | 
             
              prerelease: false
         | 
| 50 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 93 | 
             
                requirements:
         | 
| 52 94 | 
             
                - - ">="
         | 
| 53 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: '0'
         | 
| 96 | 
            +
                    version: '7.0'
         | 
| 97 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            +
              name: railties
         | 
| 99 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 | 
            +
                requirements:
         | 
| 101 | 
            +
                - - ">="
         | 
| 102 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            +
                    version: '7.0'
         | 
| 104 | 
            +
              type: :runtime
         | 
| 105 | 
            +
              prerelease: false
         | 
| 106 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 | 
            +
                requirements:
         | 
| 108 | 
            +
                - - ">="
         | 
| 109 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            +
                    version: '7.0'
         | 
| 55 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 112 | 
             
              name: rubyzip
         | 
| 57 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -149,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 149 205 | 
             
                - !ruby/object:Gem::Version
         | 
| 150 206 | 
             
                  version: '0'
         | 
| 151 207 | 
             
            requirements: []
         | 
| 152 | 
            -
            rubygems_version: 3.5. | 
| 208 | 
            +
            rubygems_version: 3.5.11
         | 
| 153 209 | 
             
            signing_key:
         | 
| 154 210 | 
             
            specification_version: 4
         | 
| 155 211 | 
             
            summary: Integrate Litestream with the RubyGems infrastructure.
         |