activestorage-office-previewer 0.1.2 → 0.2.0

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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/lib/active_storage/previewer/office_previewer.rb +74 -8
  4. metadata +18 -215
  5. data/.github/workflows/ci.yml +0 -33
  6. data/.gitignore +0 -5
  7. data/Appraisals +0 -8
  8. data/Gemfile +0 -3
  9. data/Gemfile.lock +0 -155
  10. data/Rakefile +0 -10
  11. data/activestorage-office-previewer.gemspec +0 -26
  12. data/gemfiles/rails_6.0.gemfile +0 -7
  13. data/gemfiles/rails_master.gemfile +0 -7
  14. data/test/database/setup.rb +0 -6
  15. data/test/dummy/.browserslistrc +0 -1
  16. data/test/dummy/.gitignore +0 -36
  17. data/test/dummy/.ruby-version +0 -1
  18. data/test/dummy/README.md +0 -24
  19. data/test/dummy/Rakefile +0 -6
  20. data/test/dummy/app/assets/config/manifest.js +0 -2
  21. data/test/dummy/app/assets/images/.keep +0 -0
  22. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  23. data/test/dummy/app/channels/application_cable/channel.rb +0 -4
  24. data/test/dummy/app/channels/application_cable/connection.rb +0 -4
  25. data/test/dummy/app/controllers/application_controller.rb +0 -2
  26. data/test/dummy/app/controllers/concerns/.keep +0 -0
  27. data/test/dummy/app/helpers/application_helper.rb +0 -2
  28. data/test/dummy/app/javascript/channels/consumer.js +0 -6
  29. data/test/dummy/app/javascript/channels/index.js +0 -5
  30. data/test/dummy/app/javascript/packs/application.js +0 -17
  31. data/test/dummy/app/jobs/application_job.rb +0 -7
  32. data/test/dummy/app/mailers/application_mailer.rb +0 -4
  33. data/test/dummy/app/models/application_record.rb +0 -3
  34. data/test/dummy/app/models/concerns/.keep +0 -0
  35. data/test/dummy/app/views/layouts/application.html.erb +0 -15
  36. data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
  37. data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
  38. data/test/dummy/babel.config.js +0 -72
  39. data/test/dummy/config/application.rb +0 -13
  40. data/test/dummy/config/cable.yml +0 -10
  41. data/test/dummy/config/credentials.yml.enc +0 -1
  42. data/test/dummy/config/database.yml +0 -25
  43. data/test/dummy/config/environment.rb +0 -5
  44. data/test/dummy/config/environments/development.rb +0 -62
  45. data/test/dummy/config/environments/production.rb +0 -112
  46. data/test/dummy/config/environments/test.rb +0 -48
  47. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
  48. data/test/dummy/config/initializers/assets.rb +0 -14
  49. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  50. data/test/dummy/config/initializers/content_security_policy.rb +0 -30
  51. data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
  52. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  53. data/test/dummy/config/initializers/inflections.rb +0 -16
  54. data/test/dummy/config/initializers/mime_types.rb +0 -4
  55. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  56. data/test/dummy/config/locales/en.yml +0 -33
  57. data/test/dummy/config/puma.rb +0 -38
  58. data/test/dummy/config/routes.rb +0 -3
  59. data/test/dummy/config/spring.rb +0 -6
  60. data/test/dummy/config/storage.yml +0 -34
  61. data/test/dummy/config/webpack/development.js +0 -5
  62. data/test/dummy/config/webpack/environment.js +0 -3
  63. data/test/dummy/config/webpack/production.js +0 -5
  64. data/test/dummy/config/webpack/test.js +0 -5
  65. data/test/dummy/config/webpacker.yml +0 -96
  66. data/test/dummy/config.ru +0 -5
  67. data/test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb +0 -28
  68. data/test/dummy/db/seeds.rb +0 -7
  69. data/test/dummy/lib/assets/.keep +0 -0
  70. data/test/dummy/lib/tasks/.keep +0 -0
  71. data/test/dummy/log/.keep +0 -0
  72. data/test/dummy/postcss.config.js +0 -12
  73. data/test/dummy/public/404.html +0 -67
  74. data/test/dummy/public/422.html +0 -67
  75. data/test/dummy/public/500.html +0 -66
  76. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  77. data/test/dummy/public/apple-touch-icon.png +0 -0
  78. data/test/dummy/public/favicon.ico +0 -0
  79. data/test/dummy/public/robots.txt +0 -1
  80. data/test/dummy/storage/.keep +0 -0
  81. data/test/dummy/test/application_system_test_case.rb +0 -5
  82. data/test/dummy/test/channels/application_cable/connection_test.rb +0 -11
  83. data/test/dummy/test/controllers/.keep +0 -0
  84. data/test/dummy/test/fixtures/.keep +0 -0
  85. data/test/dummy/test/fixtures/files/.keep +0 -0
  86. data/test/dummy/test/helpers/.keep +0 -0
  87. data/test/dummy/test/integration/.keep +0 -0
  88. data/test/dummy/test/mailers/.keep +0 -0
  89. data/test/dummy/test/models/.keep +0 -0
  90. data/test/dummy/test/system/.keep +0 -0
  91. data/test/dummy/test/test_helper.rb +0 -13
  92. data/test/dummy/tmp/.keep +0 -0
  93. data/test/dummy/vendor/.keep +0 -0
  94. data/test/fixtures/files/hello.docx +0 -0
  95. data/test/fixtures/files/hello.pptx +0 -0
  96. data/test/fixtures/files/hello.xlsx +0 -0
  97. data/test/office_previewer_test.rb +0 -54
  98. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0e244b0f3233795591d219542fac46b19bc1efc87e64ca5560a75e6ca56f9e3
4
- data.tar.gz: 6963f641fd72c599266e629cddee3d8b4ccf5dfdbd288973f75c74378e6ba245
3
+ metadata.gz: a74c92bd90571f8f11d06448107750e3f18ecb0d57a4630dea9e9ab51dce0806
4
+ data.tar.gz: 5f77832a3f5b34c87082756d9d655eaca45c7db6fc85d47028771c0348bed613
5
5
  SHA512:
6
- metadata.gz: 57f20a13cfb1e64615796709f27fa67a0cfc9464677e173051956fd5fad1a375ab32b503765dfaa5af2a4870cb6ca0c0c4b47ddf6f356b29aa2abba5d0f57c8b
7
- data.tar.gz: 35541067f2cca532716f2e49bf979159d478a484038783486123466644d34dd7e2101ea634124b62992cd27521c966499e6f87e7fe5e22c660f8c6005fdb06e6
6
+ metadata.gz: a1c498d69a377ebb7e70f2e3df6ab75f70a58e48849e413840ca9bc6f891e9b3e3854d108e8caa3d983bbfe37300ead05c76ef818e67e862486d85a758e3e4b9
7
+ data.tar.gz: 4a760f799cff0aee29183c4261f734178ee2a042d9ef1ee1386c48373872f86ac5f49d6d2fb52b9b834d615c636ed6cd64209a73e1094925ec009f5220075f71
data/README.md CHANGED
@@ -17,6 +17,17 @@ gem "activestorage-office-previewer"
17
17
 
18
18
  Generate previews of Microsoft Office files using Active Storage’s [preview feature](https://guides.rubyonrails.org/active_storage_overview.html#previewing-files).
19
19
 
20
+ ## Security
21
+
22
+ This gem converts documents that your users upload. Document conversion is a high-risk operation. LibreOffice is a large application with a wide feature set.
23
+
24
+ Version 0.2.0 adds two defense-in-depth layers:
25
+
26
+ * **An environment allowlist.** The gem starts `soffice` with a minimal environment. Application secrets in the host environment do not reach the `soffice` process.
27
+ * **A throwaway user profile.** Each conversion uses a new LibreOffice profile. The profile refuses active content and externally linked resources.
28
+
29
+ **Isolate the converter.** These two layers reduce risk. They do not replace process isolation. Run LibreOffice with no access to the host filesystem, no access to host process data, and no access to your secrets. Use a container, a dedicated user account, or a namespace.
30
+
20
31
  ## License
21
32
 
22
33
  This gem is released under the terms of the MIT license.
@@ -1,4 +1,6 @@
1
1
  require "active_storage/previewer"
2
+ require "tmpdir"
3
+ require "uri"
2
4
 
3
5
  class ActiveStorage::Previewer::OfficePreviewer < ActiveStorage::Previewer
4
6
  ACCEPTABLE_CONTENT_TYPES = [
@@ -12,22 +14,60 @@ class ActiveStorage::Previewer::OfficePreviewer < ActiveStorage::Previewer
12
14
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" # .xlsx
13
15
  ]
14
16
 
17
+ # LibreOffice is launched with an explicit, minimal environment rather than the
18
+ # full environment of the host process. Only these variables are forwarded; every
19
+ # other variable — application secrets such as RAILS_MASTER_KEY, DATABASE_URL, or
20
+ # cloud credentials in particular — is withheld from the child process. Only the
21
+ # set of names is fixed here: the values are taken from the parent environment, so
22
+ # each deployment keeps its own locale, paths, and temporary directory.
23
+ PRESERVED_ENV_KEYS = %w[
24
+ PATH HOME LANG LANGUAGE LC_ALL LC_CTYPE LC_MESSAGES LC_NUMERIC TMPDIR TMP TEMP USER LOGNAME
25
+ ]
26
+
27
+ # Seeded into a throwaway LibreOffice user profile for every conversion.
28
+ #
29
+ # DisableActiveContent turns off "active content" — LibreOffice's term for OLE and
30
+ # DDE objects and other embedded executable content.
31
+ #
32
+ # BlockUntrustedRefererLinks refuses externally linked resources. Without it a
33
+ # document may reference a file by link and LibreOffice resolves that reference
34
+ # during conversion. The regression test in test/office_previewer_test.rb covers
35
+ # this path. Do not remove either key without re-running that test.
36
+ #
37
+ # Both keys are set deliberately. The measured drop in rendered ink (0.0965 to
38
+ # 0.0047 on LibreOffice 24.2.7.2) was obtained with DisableActiveContent alone, so
39
+ # that is the key the measurement exercises. BlockUntrustedRefererLinks is set as
40
+ # well because it is the documented lever for linked resources, and relying on a
41
+ # single observed behaviour across LibreOffice versions is not worth the risk.
42
+ REGISTRY_MODIFICATIONS = <<~XCU
43
+ <?xml version="1.0" encoding="UTF-8"?>
44
+ <oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
45
+ <item oor:path="/org.openoffice.Office.Common/Security/Scripting">
46
+ <prop oor:name="DisableActiveContent" oor:op="fuse"><value>true</value></prop>
47
+ <prop oor:name="BlockUntrustedRefererLinks" oor:op="fuse"><value>true</value></prop>
48
+ </item>
49
+ </oor:items>
50
+ XCU
51
+
15
52
  class << self
16
53
  def accept?(blob)
17
54
  blob.content_type.in?(ACCEPTABLE_CONTENT_TYPES) && soffice_exists?
18
55
  end
19
56
 
20
57
  def soffice_exists?
21
- if @soffice_exists.nil?
22
- @soffice_exists = system(soffice_path, "--version", out: File::NULL, err: File::NULL)
23
- else
24
- @soffice_exists
25
- end
58
+ return @soffice_exists if defined?(@soffice_exists)
59
+
60
+ @soffice_exists = system(scrubbed_env, soffice_path, "--version", out: File::NULL, err: File::NULL, unsetenv_others: true)
26
61
  end
27
62
 
28
63
  def soffice_path
29
64
  ActiveStorage.paths[:soffice] || "soffice"
30
65
  end
66
+
67
+ # The minimal environment handed to LibreOffice, drawn from the parent process.
68
+ def scrubbed_env
69
+ ENV.slice(*PRESERVED_ENV_KEYS)
70
+ end
31
71
  end
32
72
 
33
73
  def preview(**options)
@@ -40,9 +80,35 @@ class ActiveStorage::Previewer::OfficePreviewer < ActiveStorage::Previewer
40
80
 
41
81
  private
42
82
  def draw_poster_image_from(file, &block)
43
- system soffice_path, "--headless", "--invisible", "--convert-to", "png",
44
- "--outdir", tmpdir, file.path, out: File::NULL, err: File::NULL
45
- consume "#{tmpdir}/#{File.basename(file.path, ".*")}.png", &block
83
+ Dir.mktmpdir("ActiveStorage-office-profile-") do |profile|
84
+ seed_libreoffice_profile profile
85
+
86
+ system self.class.scrubbed_env, soffice_path,
87
+ "-env:UserInstallation=#{profile_url(profile)}",
88
+ "--headless", "--invisible", "--convert-to", "png",
89
+ "--outdir", tmpdir, file.path,
90
+ out: File::NULL, err: File::NULL, unsetenv_others: true
91
+
92
+ consume "#{tmpdir}/#{File.basename(file.path, ".*")}.png", &block
93
+ end
94
+ end
95
+
96
+ # Populate a disposable LibreOffice user profile whose registry disables active
97
+ # content. A fresh profile per conversion keeps the setting in force and avoids
98
+ # sharing mutable state between concurrent conversions.
99
+ def seed_libreoffice_profile(profile)
100
+ user = File.join(profile, "user")
101
+ Dir.mkdir(user)
102
+ File.write File.join(user, "registrymodifications.xcu"), REGISTRY_MODIFICATIONS
103
+ end
104
+
105
+ # -env:UserInstallation takes a URL, not a path. Dir.tmpdir honours TMPDIR, which
106
+ # can hold a space or a "#" — on macOS it is under /var/folders by default — and
107
+ # appending such a path raw yields a URL LibreOffice resolves somewhere else. It
108
+ # would then run against an unseeded profile and quietly drop the settings above,
109
+ # so percent-encode everything outside the unreserved set.
110
+ def profile_url(profile)
111
+ "file://#{URI::DEFAULT_PARSER.escape(profile, /[^A-Za-z0-9\-_.~\/]/)}"
46
112
  end
47
113
 
48
114
  def consume(path, &block)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-office-previewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Claghorn
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activestorage
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 6.0.0
18
+ version: 7.2.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 6.0.0
25
+ version: 7.2.0
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: appraisal
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -44,58 +43,44 @@ dependencies:
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 13.0.0
46
+ version: '13.0'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: 13.0.0
53
+ version: '13.0'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: minitest
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: 5.13.0
60
+ version: '6.0'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: 5.13.0
67
+ version: '6.0'
69
68
  - !ruby/object:Gem::Dependency
70
- name: mini_magick
69
+ name: ruby-vips
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - "~>"
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: 4.9.5
74
+ version: '0'
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - "~>"
79
+ - - ">="
81
80
  - !ruby/object:Gem::Version
82
- version: 4.9.5
81
+ version: '0'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: sqlite3
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 1.4.1
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 1.4.1
97
- - !ruby/object:Gem::Dependency
98
- name: byebug
99
84
  requirement: !ruby/object:Gem::Requirement
100
85
  requirements:
101
86
  - - ">="
@@ -114,123 +99,27 @@ dependencies:
114
99
  requirements:
115
100
  - - ">="
116
101
  - !ruby/object:Gem::Version
117
- version: 6.0.0
102
+ version: 7.2.0
118
103
  type: :development
119
104
  prerelease: false
120
105
  version_requirements: !ruby/object:Gem::Requirement
121
106
  requirements:
122
107
  - - ">="
123
108
  - !ruby/object:Gem::Version
124
- version: 6.0.0
125
- description:
109
+ version: 7.2.0
126
110
  email: george@basecamp.com
127
111
  executables: []
128
112
  extensions: []
129
113
  extra_rdoc_files: []
130
114
  files:
131
- - ".github/workflows/ci.yml"
132
- - ".gitignore"
133
- - Appraisals
134
- - Gemfile
135
- - Gemfile.lock
136
115
  - LICENSE.md
137
116
  - README.md
138
- - Rakefile
139
- - activestorage-office-previewer.gemspec
140
- - gemfiles/rails_6.0.gemfile
141
- - gemfiles/rails_master.gemfile
142
117
  - lib/active_storage/previewer/office_previewer.rb
143
118
  - lib/activestorage-office-previewer.rb
144
- - test/database/setup.rb
145
- - test/dummy/.browserslistrc
146
- - test/dummy/.gitignore
147
- - test/dummy/.ruby-version
148
- - test/dummy/README.md
149
- - test/dummy/Rakefile
150
- - test/dummy/app/assets/config/manifest.js
151
- - test/dummy/app/assets/images/.keep
152
- - test/dummy/app/assets/stylesheets/application.css
153
- - test/dummy/app/channels/application_cable/channel.rb
154
- - test/dummy/app/channels/application_cable/connection.rb
155
- - test/dummy/app/controllers/application_controller.rb
156
- - test/dummy/app/controllers/concerns/.keep
157
- - test/dummy/app/helpers/application_helper.rb
158
- - test/dummy/app/javascript/channels/consumer.js
159
- - test/dummy/app/javascript/channels/index.js
160
- - test/dummy/app/javascript/packs/application.js
161
- - test/dummy/app/jobs/application_job.rb
162
- - test/dummy/app/mailers/application_mailer.rb
163
- - test/dummy/app/models/application_record.rb
164
- - test/dummy/app/models/concerns/.keep
165
- - test/dummy/app/views/layouts/application.html.erb
166
- - test/dummy/app/views/layouts/mailer.html.erb
167
- - test/dummy/app/views/layouts/mailer.text.erb
168
- - test/dummy/babel.config.js
169
- - test/dummy/config.ru
170
- - test/dummy/config/application.rb
171
- - test/dummy/config/cable.yml
172
- - test/dummy/config/credentials.yml.enc
173
- - test/dummy/config/database.yml
174
- - test/dummy/config/environment.rb
175
- - test/dummy/config/environments/development.rb
176
- - test/dummy/config/environments/production.rb
177
- - test/dummy/config/environments/test.rb
178
- - test/dummy/config/initializers/application_controller_renderer.rb
179
- - test/dummy/config/initializers/assets.rb
180
- - test/dummy/config/initializers/backtrace_silencers.rb
181
- - test/dummy/config/initializers/content_security_policy.rb
182
- - test/dummy/config/initializers/cookies_serializer.rb
183
- - test/dummy/config/initializers/filter_parameter_logging.rb
184
- - test/dummy/config/initializers/inflections.rb
185
- - test/dummy/config/initializers/mime_types.rb
186
- - test/dummy/config/initializers/wrap_parameters.rb
187
- - test/dummy/config/locales/en.yml
188
- - test/dummy/config/puma.rb
189
- - test/dummy/config/routes.rb
190
- - test/dummy/config/spring.rb
191
- - test/dummy/config/storage.yml
192
- - test/dummy/config/webpack/development.js
193
- - test/dummy/config/webpack/environment.js
194
- - test/dummy/config/webpack/production.js
195
- - test/dummy/config/webpack/test.js
196
- - test/dummy/config/webpacker.yml
197
- - test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb
198
- - test/dummy/db/seeds.rb
199
- - test/dummy/lib/assets/.keep
200
- - test/dummy/lib/tasks/.keep
201
- - test/dummy/log/.keep
202
- - test/dummy/postcss.config.js
203
- - test/dummy/public/404.html
204
- - test/dummy/public/422.html
205
- - test/dummy/public/500.html
206
- - test/dummy/public/apple-touch-icon-precomposed.png
207
- - test/dummy/public/apple-touch-icon.png
208
- - test/dummy/public/favicon.ico
209
- - test/dummy/public/robots.txt
210
- - test/dummy/storage/.keep
211
- - test/dummy/test/application_system_test_case.rb
212
- - test/dummy/test/channels/application_cable/connection_test.rb
213
- - test/dummy/test/controllers/.keep
214
- - test/dummy/test/fixtures/.keep
215
- - test/dummy/test/fixtures/files/.keep
216
- - test/dummy/test/helpers/.keep
217
- - test/dummy/test/integration/.keep
218
- - test/dummy/test/mailers/.keep
219
- - test/dummy/test/models/.keep
220
- - test/dummy/test/system/.keep
221
- - test/dummy/test/test_helper.rb
222
- - test/dummy/tmp/.keep
223
- - test/dummy/vendor/.keep
224
- - test/fixtures/files/hello.docx
225
- - test/fixtures/files/hello.pptx
226
- - test/fixtures/files/hello.xlsx
227
- - test/office_previewer_test.rb
228
- - test/test_helper.rb
229
119
  homepage: https://github.com/basecamp/activestorage-office-previewer
230
120
  licenses:
231
121
  - MIT
232
122
  metadata: {}
233
- post_install_message:
234
123
  rdoc_options: []
235
124
  require_paths:
236
125
  - lib
@@ -238,100 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
127
  requirements:
239
128
  - - ">="
240
129
  - !ruby/object:Gem::Version
241
- version: 2.6.0
130
+ version: 3.2.0
242
131
  required_rubygems_version: !ruby/object:Gem::Requirement
243
132
  requirements:
244
133
  - - ">="
245
134
  - !ruby/object:Gem::Version
246
135
  version: '0'
247
136
  requirements: []
248
- rubygems_version: 3.1.2
249
- signing_key:
137
+ rubygems_version: 4.0.16
250
138
  specification_version: 4
251
139
  summary: Active Storage previewer for Microsoft Office files based on LibreOffice
252
- test_files:
253
- - test/database/setup.rb
254
- - test/dummy/.browserslistrc
255
- - test/dummy/.gitignore
256
- - test/dummy/.ruby-version
257
- - test/dummy/README.md
258
- - test/dummy/Rakefile
259
- - test/dummy/app/assets/config/manifest.js
260
- - test/dummy/app/assets/images/.keep
261
- - test/dummy/app/assets/stylesheets/application.css
262
- - test/dummy/app/channels/application_cable/channel.rb
263
- - test/dummy/app/channels/application_cable/connection.rb
264
- - test/dummy/app/controllers/application_controller.rb
265
- - test/dummy/app/controllers/concerns/.keep
266
- - test/dummy/app/helpers/application_helper.rb
267
- - test/dummy/app/javascript/channels/consumer.js
268
- - test/dummy/app/javascript/channels/index.js
269
- - test/dummy/app/javascript/packs/application.js
270
- - test/dummy/app/jobs/application_job.rb
271
- - test/dummy/app/mailers/application_mailer.rb
272
- - test/dummy/app/models/application_record.rb
273
- - test/dummy/app/models/concerns/.keep
274
- - test/dummy/app/views/layouts/application.html.erb
275
- - test/dummy/app/views/layouts/mailer.html.erb
276
- - test/dummy/app/views/layouts/mailer.text.erb
277
- - test/dummy/babel.config.js
278
- - test/dummy/config.ru
279
- - test/dummy/config/application.rb
280
- - test/dummy/config/cable.yml
281
- - test/dummy/config/credentials.yml.enc
282
- - test/dummy/config/database.yml
283
- - test/dummy/config/environment.rb
284
- - test/dummy/config/environments/development.rb
285
- - test/dummy/config/environments/production.rb
286
- - test/dummy/config/environments/test.rb
287
- - test/dummy/config/initializers/application_controller_renderer.rb
288
- - test/dummy/config/initializers/assets.rb
289
- - test/dummy/config/initializers/backtrace_silencers.rb
290
- - test/dummy/config/initializers/content_security_policy.rb
291
- - test/dummy/config/initializers/cookies_serializer.rb
292
- - test/dummy/config/initializers/filter_parameter_logging.rb
293
- - test/dummy/config/initializers/inflections.rb
294
- - test/dummy/config/initializers/mime_types.rb
295
- - test/dummy/config/initializers/wrap_parameters.rb
296
- - test/dummy/config/locales/en.yml
297
- - test/dummy/config/puma.rb
298
- - test/dummy/config/routes.rb
299
- - test/dummy/config/spring.rb
300
- - test/dummy/config/storage.yml
301
- - test/dummy/config/webpack/development.js
302
- - test/dummy/config/webpack/environment.js
303
- - test/dummy/config/webpack/production.js
304
- - test/dummy/config/webpack/test.js
305
- - test/dummy/config/webpacker.yml
306
- - test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb
307
- - test/dummy/db/seeds.rb
308
- - test/dummy/lib/assets/.keep
309
- - test/dummy/lib/tasks/.keep
310
- - test/dummy/log/.keep
311
- - test/dummy/postcss.config.js
312
- - test/dummy/public/404.html
313
- - test/dummy/public/422.html
314
- - test/dummy/public/500.html
315
- - test/dummy/public/apple-touch-icon-precomposed.png
316
- - test/dummy/public/apple-touch-icon.png
317
- - test/dummy/public/favicon.ico
318
- - test/dummy/public/robots.txt
319
- - test/dummy/storage/.keep
320
- - test/dummy/test/application_system_test_case.rb
321
- - test/dummy/test/channels/application_cable/connection_test.rb
322
- - test/dummy/test/controllers/.keep
323
- - test/dummy/test/fixtures/.keep
324
- - test/dummy/test/fixtures/files/.keep
325
- - test/dummy/test/helpers/.keep
326
- - test/dummy/test/integration/.keep
327
- - test/dummy/test/mailers/.keep
328
- - test/dummy/test/models/.keep
329
- - test/dummy/test/system/.keep
330
- - test/dummy/test/test_helper.rb
331
- - test/dummy/tmp/.keep
332
- - test/dummy/vendor/.keep
333
- - test/fixtures/files/hello.docx
334
- - test/fixtures/files/hello.pptx
335
- - test/fixtures/files/hello.xlsx
336
- - test/office_previewer_test.rb
337
- - test/test_helper.rb
140
+ test_files: []
@@ -1,33 +0,0 @@
1
- name: CI
2
- on: [push, pull_request]
3
- jobs:
4
- tests:
5
- runs-on: ubuntu-latest
6
-
7
- strategy:
8
- matrix:
9
- gemfile:
10
- - gemfiles/rails_6.0.gemfile
11
- - gemfiles/rails_master.gemfile
12
-
13
- env:
14
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
15
-
16
- steps:
17
- - uses: actions/checkout@v1
18
-
19
- - name: Set up Ruby 2.6
20
- uses: actions/setup-ruby@v1
21
- with:
22
- ruby-version: 2.6.x
23
-
24
- - name: Install dependencies
25
- run: |
26
- sudo apt-get update
27
- sudo apt-get install libreoffice libsqlite3-dev
28
-
29
- gem install bundler
30
- bundle install --jobs 4 --retry 3
31
-
32
- - name: Run tests
33
- run: bundle exec rake test
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.gem
2
- .byebug_history
3
-
4
- gemfiles/*.lock
5
- gemfiles/.bundle
data/Appraisals DELETED
@@ -1,8 +0,0 @@
1
- appraise "rails_6.0" do
2
- gem "rails", "~> 6.0.0"
3
- end
4
-
5
- appraise "rails_master" do
6
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
7
- gem "rails", github: "rails/rails"
8
- end
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/Gemfile.lock DELETED
@@ -1,155 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- activestorage-office-previewer (0.1.2)
5
- activestorage (>= 6.0.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actioncable (6.0.1)
11
- actionpack (= 6.0.1)
12
- nio4r (~> 2.0)
13
- websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.1)
15
- actionpack (= 6.0.1)
16
- activejob (= 6.0.1)
17
- activerecord (= 6.0.1)
18
- activestorage (= 6.0.1)
19
- activesupport (= 6.0.1)
20
- mail (>= 2.7.1)
21
- actionmailer (6.0.1)
22
- actionpack (= 6.0.1)
23
- actionview (= 6.0.1)
24
- activejob (= 6.0.1)
25
- mail (~> 2.5, >= 2.5.4)
26
- rails-dom-testing (~> 2.0)
27
- actionpack (6.0.1)
28
- actionview (= 6.0.1)
29
- activesupport (= 6.0.1)
30
- rack (~> 2.0)
31
- rack-test (>= 0.6.3)
32
- rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.1)
35
- actionpack (= 6.0.1)
36
- activerecord (= 6.0.1)
37
- activestorage (= 6.0.1)
38
- activesupport (= 6.0.1)
39
- nokogiri (>= 1.8.5)
40
- actionview (6.0.1)
41
- activesupport (= 6.0.1)
42
- builder (~> 3.1)
43
- erubi (~> 1.4)
44
- rails-dom-testing (~> 2.0)
45
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.1)
47
- activesupport (= 6.0.1)
48
- globalid (>= 0.3.6)
49
- activemodel (6.0.1)
50
- activesupport (= 6.0.1)
51
- activerecord (6.0.1)
52
- activemodel (= 6.0.1)
53
- activesupport (= 6.0.1)
54
- activestorage (6.0.1)
55
- actionpack (= 6.0.1)
56
- activejob (= 6.0.1)
57
- activerecord (= 6.0.1)
58
- marcel (~> 0.3.1)
59
- activesupport (6.0.1)
60
- concurrent-ruby (~> 1.0, >= 1.0.2)
61
- i18n (>= 0.7, < 2)
62
- minitest (~> 5.1)
63
- tzinfo (~> 1.1)
64
- zeitwerk (~> 2.2)
65
- appraisal (2.2.0)
66
- bundler
67
- rake
68
- thor (>= 0.14.0)
69
- builder (3.2.3)
70
- byebug (11.0.1)
71
- concurrent-ruby (1.1.5)
72
- crass (1.0.5)
73
- erubi (1.9.0)
74
- globalid (0.4.2)
75
- activesupport (>= 4.2.0)
76
- i18n (1.7.0)
77
- concurrent-ruby (~> 1.0)
78
- loofah (2.4.0)
79
- crass (~> 1.0.2)
80
- nokogiri (>= 1.5.9)
81
- mail (2.7.1)
82
- mini_mime (>= 0.1.1)
83
- marcel (0.3.3)
84
- mimemagic (~> 0.3.2)
85
- method_source (0.9.2)
86
- mimemagic (0.3.3)
87
- mini_magick (4.9.5)
88
- mini_mime (1.0.2)
89
- mini_portile2 (2.4.0)
90
- minitest (5.13.0)
91
- nio4r (2.5.2)
92
- nokogiri (1.10.6)
93
- mini_portile2 (~> 2.4.0)
94
- rack (2.0.7)
95
- rack-test (1.1.0)
96
- rack (>= 1.0, < 3)
97
- rails (6.0.1)
98
- actioncable (= 6.0.1)
99
- actionmailbox (= 6.0.1)
100
- actionmailer (= 6.0.1)
101
- actionpack (= 6.0.1)
102
- actiontext (= 6.0.1)
103
- actionview (= 6.0.1)
104
- activejob (= 6.0.1)
105
- activemodel (= 6.0.1)
106
- activerecord (= 6.0.1)
107
- activestorage (= 6.0.1)
108
- activesupport (= 6.0.1)
109
- bundler (>= 1.3.0)
110
- railties (= 6.0.1)
111
- sprockets-rails (>= 2.0.0)
112
- rails-dom-testing (2.0.3)
113
- activesupport (>= 4.2.0)
114
- nokogiri (>= 1.6)
115
- rails-html-sanitizer (1.3.0)
116
- loofah (~> 2.3)
117
- railties (6.0.1)
118
- actionpack (= 6.0.1)
119
- activesupport (= 6.0.1)
120
- method_source
121
- rake (>= 0.8.7)
122
- thor (>= 0.20.3, < 2.0)
123
- rake (13.0.1)
124
- sprockets (4.0.0)
125
- concurrent-ruby (~> 1.0)
126
- rack (> 1, < 3)
127
- sprockets-rails (3.2.1)
128
- actionpack (>= 4.0)
129
- activesupport (>= 4.0)
130
- sprockets (>= 3.0.0)
131
- sqlite3 (1.4.1)
132
- thor (0.20.3)
133
- thread_safe (0.3.6)
134
- tzinfo (1.2.5)
135
- thread_safe (~> 0.1)
136
- websocket-driver (0.7.1)
137
- websocket-extensions (>= 0.1.0)
138
- websocket-extensions (0.1.4)
139
- zeitwerk (2.2.2)
140
-
141
- PLATFORMS
142
- ruby
143
-
144
- DEPENDENCIES
145
- activestorage-office-previewer!
146
- appraisal (~> 2.2)
147
- byebug
148
- mini_magick (~> 4.9.5)
149
- minitest (~> 5.13.0)
150
- rails (>= 6.0.0)
151
- rake (~> 13.0.0)
152
- sqlite3 (~> 1.4.1)
153
-
154
- BUNDLED WITH
155
- 1.17.2