activestorage-office-previewer 0.1.1 → 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.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/active_storage/previewer/office_previewer.rb +76 -10
- metadata +21 -214
- data/.gitignore +0 -2
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -151
- data/Rakefile +0 -10
- data/activestorage-office-previewer.gemspec +0 -25
- data/test/database/setup.rb +0 -6
- data/test/dummy/.browserslistrc +0 -1
- data/test/dummy/.gitignore +0 -36
- data/test/dummy/.ruby-version +0 -1
- data/test/dummy/README.md +0 -24
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/config/manifest.js +0 -2
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/channels/application_cable/channel.rb +0 -4
- data/test/dummy/app/channels/application_cable/connection.rb +0 -4
- data/test/dummy/app/controllers/application_controller.rb +0 -2
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/javascript/channels/consumer.js +0 -6
- data/test/dummy/app/javascript/channels/index.js +0 -5
- data/test/dummy/app/javascript/packs/application.js +0 -17
- data/test/dummy/app/jobs/application_job.rb +0 -7
- data/test/dummy/app/mailers/application_mailer.rb +0 -4
- data/test/dummy/app/models/application_record.rb +0 -3
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -15
- data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/test/dummy/babel.config.js +0 -72
- data/test/dummy/config/application.rb +0 -13
- data/test/dummy/config/cable.yml +0 -10
- data/test/dummy/config/credentials.yml.enc +0 -1
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -62
- data/test/dummy/config/environments/production.rb +0 -112
- data/test/dummy/config/environments/test.rb +0 -48
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/test/dummy/config/initializers/assets.rb +0 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/content_security_policy.rb +0 -30
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -33
- data/test/dummy/config/puma.rb +0 -38
- data/test/dummy/config/routes.rb +0 -3
- data/test/dummy/config/spring.rb +0 -6
- data/test/dummy/config/storage.yml +0 -34
- data/test/dummy/config/webpack/development.js +0 -5
- data/test/dummy/config/webpack/environment.js +0 -3
- data/test/dummy/config/webpack/production.js +0 -5
- data/test/dummy/config/webpack/test.js +0 -5
- data/test/dummy/config/webpacker.yml +0 -96
- data/test/dummy/config.ru +0 -5
- data/test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb +0 -27
- data/test/dummy/db/seeds.rb +0 -7
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/lib/tasks/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/postcss.config.js +0 -12
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/robots.txt +0 -1
- data/test/dummy/storage/.keep +0 -0
- data/test/dummy/test/application_system_test_case.rb +0 -5
- data/test/dummy/test/channels/application_cable/connection_test.rb +0 -11
- data/test/dummy/test/controllers/.keep +0 -0
- data/test/dummy/test/fixtures/.keep +0 -0
- data/test/dummy/test/fixtures/files/.keep +0 -0
- data/test/dummy/test/helpers/.keep +0 -0
- data/test/dummy/test/integration/.keep +0 -0
- data/test/dummy/test/mailers/.keep +0 -0
- data/test/dummy/test/models/.keep +0 -0
- data/test/dummy/test/system/.keep +0 -0
- data/test/dummy/test/test_helper.rb +0 -13
- data/test/dummy/tmp/.keep +0 -0
- data/test/dummy/vendor/.keep +0 -0
- data/test/fixtures/files/hello.docx +0 -0
- data/test/fixtures/files/hello.pptx +0 -0
- data/test/fixtures/files/hello.xlsx +0 -0
- data/test/office_previewer_test.rb +0 -54
- data/test/test_helper.rb +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a74c92bd90571f8f11d06448107750e3f18ecb0d57a4630dea9e9ab51dce0806
|
|
4
|
+
data.tar.gz: 5f77832a3f5b34c87082756d9d655eaca45c7db6fc85d47028771c0348bed613
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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,37 +14,101 @@ 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
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
def preview
|
|
73
|
+
def preview(**options)
|
|
34
74
|
download_blob_to_tempfile do |input|
|
|
35
75
|
draw_poster_image_from input do |output|
|
|
36
|
-
yield io: output, filename: "#{blob.filename.base}.png", content_type: "image/png"
|
|
76
|
+
yield io: output, filename: "#{blob.filename.base}.png", content_type: "image/png", **options
|
|
37
77
|
end
|
|
38
78
|
end
|
|
39
79
|
end
|
|
40
80
|
|
|
41
81
|
private
|
|
42
82
|
def draw_poster_image_from(file, &block)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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.
|
|
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:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activestorage
|
|
@@ -16,86 +15,72 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
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:
|
|
25
|
+
version: 7.2.0
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: appraisal
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - "~>"
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
32
|
+
version: '2.2'
|
|
34
33
|
type: :development
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
39
|
+
version: '2.2'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: rake
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
44
|
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 13.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
|
|
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:
|
|
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:
|
|
67
|
+
version: '6.0'
|
|
69
68
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
69
|
+
name: ruby-vips
|
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
|
72
71
|
requirements:
|
|
73
|
-
- - "
|
|
72
|
+
- - ">="
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
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:
|
|
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,119 +99,27 @@ dependencies:
|
|
|
114
99
|
requirements:
|
|
115
100
|
- - ">="
|
|
116
101
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
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:
|
|
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
|
-
- ".gitignore"
|
|
132
|
-
- Gemfile
|
|
133
|
-
- Gemfile.lock
|
|
134
115
|
- LICENSE.md
|
|
135
116
|
- README.md
|
|
136
|
-
- Rakefile
|
|
137
|
-
- activestorage-office-previewer.gemspec
|
|
138
117
|
- lib/active_storage/previewer/office_previewer.rb
|
|
139
118
|
- lib/activestorage-office-previewer.rb
|
|
140
|
-
- test/database/setup.rb
|
|
141
|
-
- test/dummy/.browserslistrc
|
|
142
|
-
- test/dummy/.gitignore
|
|
143
|
-
- test/dummy/.ruby-version
|
|
144
|
-
- test/dummy/README.md
|
|
145
|
-
- test/dummy/Rakefile
|
|
146
|
-
- test/dummy/app/assets/config/manifest.js
|
|
147
|
-
- test/dummy/app/assets/images/.keep
|
|
148
|
-
- test/dummy/app/assets/stylesheets/application.css
|
|
149
|
-
- test/dummy/app/channels/application_cable/channel.rb
|
|
150
|
-
- test/dummy/app/channels/application_cable/connection.rb
|
|
151
|
-
- test/dummy/app/controllers/application_controller.rb
|
|
152
|
-
- test/dummy/app/controllers/concerns/.keep
|
|
153
|
-
- test/dummy/app/helpers/application_helper.rb
|
|
154
|
-
- test/dummy/app/javascript/channels/consumer.js
|
|
155
|
-
- test/dummy/app/javascript/channels/index.js
|
|
156
|
-
- test/dummy/app/javascript/packs/application.js
|
|
157
|
-
- test/dummy/app/jobs/application_job.rb
|
|
158
|
-
- test/dummy/app/mailers/application_mailer.rb
|
|
159
|
-
- test/dummy/app/models/application_record.rb
|
|
160
|
-
- test/dummy/app/models/concerns/.keep
|
|
161
|
-
- test/dummy/app/views/layouts/application.html.erb
|
|
162
|
-
- test/dummy/app/views/layouts/mailer.html.erb
|
|
163
|
-
- test/dummy/app/views/layouts/mailer.text.erb
|
|
164
|
-
- test/dummy/babel.config.js
|
|
165
|
-
- test/dummy/config.ru
|
|
166
|
-
- test/dummy/config/application.rb
|
|
167
|
-
- test/dummy/config/cable.yml
|
|
168
|
-
- test/dummy/config/credentials.yml.enc
|
|
169
|
-
- test/dummy/config/database.yml
|
|
170
|
-
- test/dummy/config/environment.rb
|
|
171
|
-
- test/dummy/config/environments/development.rb
|
|
172
|
-
- test/dummy/config/environments/production.rb
|
|
173
|
-
- test/dummy/config/environments/test.rb
|
|
174
|
-
- test/dummy/config/initializers/application_controller_renderer.rb
|
|
175
|
-
- test/dummy/config/initializers/assets.rb
|
|
176
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
|
177
|
-
- test/dummy/config/initializers/content_security_policy.rb
|
|
178
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
|
179
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
|
180
|
-
- test/dummy/config/initializers/inflections.rb
|
|
181
|
-
- test/dummy/config/initializers/mime_types.rb
|
|
182
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
|
183
|
-
- test/dummy/config/locales/en.yml
|
|
184
|
-
- test/dummy/config/puma.rb
|
|
185
|
-
- test/dummy/config/routes.rb
|
|
186
|
-
- test/dummy/config/spring.rb
|
|
187
|
-
- test/dummy/config/storage.yml
|
|
188
|
-
- test/dummy/config/webpack/development.js
|
|
189
|
-
- test/dummy/config/webpack/environment.js
|
|
190
|
-
- test/dummy/config/webpack/production.js
|
|
191
|
-
- test/dummy/config/webpack/test.js
|
|
192
|
-
- test/dummy/config/webpacker.yml
|
|
193
|
-
- test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb
|
|
194
|
-
- test/dummy/db/seeds.rb
|
|
195
|
-
- test/dummy/lib/assets/.keep
|
|
196
|
-
- test/dummy/lib/tasks/.keep
|
|
197
|
-
- test/dummy/log/.keep
|
|
198
|
-
- test/dummy/postcss.config.js
|
|
199
|
-
- test/dummy/public/404.html
|
|
200
|
-
- test/dummy/public/422.html
|
|
201
|
-
- test/dummy/public/500.html
|
|
202
|
-
- test/dummy/public/apple-touch-icon-precomposed.png
|
|
203
|
-
- test/dummy/public/apple-touch-icon.png
|
|
204
|
-
- test/dummy/public/favicon.ico
|
|
205
|
-
- test/dummy/public/robots.txt
|
|
206
|
-
- test/dummy/storage/.keep
|
|
207
|
-
- test/dummy/test/application_system_test_case.rb
|
|
208
|
-
- test/dummy/test/channels/application_cable/connection_test.rb
|
|
209
|
-
- test/dummy/test/controllers/.keep
|
|
210
|
-
- test/dummy/test/fixtures/.keep
|
|
211
|
-
- test/dummy/test/fixtures/files/.keep
|
|
212
|
-
- test/dummy/test/helpers/.keep
|
|
213
|
-
- test/dummy/test/integration/.keep
|
|
214
|
-
- test/dummy/test/mailers/.keep
|
|
215
|
-
- test/dummy/test/models/.keep
|
|
216
|
-
- test/dummy/test/system/.keep
|
|
217
|
-
- test/dummy/test/test_helper.rb
|
|
218
|
-
- test/dummy/tmp/.keep
|
|
219
|
-
- test/dummy/vendor/.keep
|
|
220
|
-
- test/fixtures/files/hello.docx
|
|
221
|
-
- test/fixtures/files/hello.pptx
|
|
222
|
-
- test/fixtures/files/hello.xlsx
|
|
223
|
-
- test/office_previewer_test.rb
|
|
224
|
-
- test/test_helper.rb
|
|
225
119
|
homepage: https://github.com/basecamp/activestorage-office-previewer
|
|
226
120
|
licenses:
|
|
227
121
|
- MIT
|
|
228
122
|
metadata: {}
|
|
229
|
-
post_install_message:
|
|
230
123
|
rdoc_options: []
|
|
231
124
|
require_paths:
|
|
232
125
|
- lib
|
|
@@ -234,100 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
234
127
|
requirements:
|
|
235
128
|
- - ">="
|
|
236
129
|
- !ruby/object:Gem::Version
|
|
237
|
-
version: 2.
|
|
130
|
+
version: 3.2.0
|
|
238
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
132
|
requirements:
|
|
240
133
|
- - ">="
|
|
241
134
|
- !ruby/object:Gem::Version
|
|
242
135
|
version: '0'
|
|
243
136
|
requirements: []
|
|
244
|
-
rubygems_version:
|
|
245
|
-
signing_key:
|
|
137
|
+
rubygems_version: 4.0.16
|
|
246
138
|
specification_version: 4
|
|
247
139
|
summary: Active Storage previewer for Microsoft Office files based on LibreOffice
|
|
248
|
-
test_files:
|
|
249
|
-
- test/database/setup.rb
|
|
250
|
-
- test/dummy/.browserslistrc
|
|
251
|
-
- test/dummy/.gitignore
|
|
252
|
-
- test/dummy/.ruby-version
|
|
253
|
-
- test/dummy/README.md
|
|
254
|
-
- test/dummy/Rakefile
|
|
255
|
-
- test/dummy/app/assets/config/manifest.js
|
|
256
|
-
- test/dummy/app/assets/images/.keep
|
|
257
|
-
- test/dummy/app/assets/stylesheets/application.css
|
|
258
|
-
- test/dummy/app/channels/application_cable/channel.rb
|
|
259
|
-
- test/dummy/app/channels/application_cable/connection.rb
|
|
260
|
-
- test/dummy/app/controllers/application_controller.rb
|
|
261
|
-
- test/dummy/app/controllers/concerns/.keep
|
|
262
|
-
- test/dummy/app/helpers/application_helper.rb
|
|
263
|
-
- test/dummy/app/javascript/channels/consumer.js
|
|
264
|
-
- test/dummy/app/javascript/channels/index.js
|
|
265
|
-
- test/dummy/app/javascript/packs/application.js
|
|
266
|
-
- test/dummy/app/jobs/application_job.rb
|
|
267
|
-
- test/dummy/app/mailers/application_mailer.rb
|
|
268
|
-
- test/dummy/app/models/application_record.rb
|
|
269
|
-
- test/dummy/app/models/concerns/.keep
|
|
270
|
-
- test/dummy/app/views/layouts/application.html.erb
|
|
271
|
-
- test/dummy/app/views/layouts/mailer.html.erb
|
|
272
|
-
- test/dummy/app/views/layouts/mailer.text.erb
|
|
273
|
-
- test/dummy/babel.config.js
|
|
274
|
-
- test/dummy/config.ru
|
|
275
|
-
- test/dummy/config/application.rb
|
|
276
|
-
- test/dummy/config/cable.yml
|
|
277
|
-
- test/dummy/config/credentials.yml.enc
|
|
278
|
-
- test/dummy/config/database.yml
|
|
279
|
-
- test/dummy/config/environment.rb
|
|
280
|
-
- test/dummy/config/environments/development.rb
|
|
281
|
-
- test/dummy/config/environments/production.rb
|
|
282
|
-
- test/dummy/config/environments/test.rb
|
|
283
|
-
- test/dummy/config/initializers/application_controller_renderer.rb
|
|
284
|
-
- test/dummy/config/initializers/assets.rb
|
|
285
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
|
286
|
-
- test/dummy/config/initializers/content_security_policy.rb
|
|
287
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
|
288
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
|
289
|
-
- test/dummy/config/initializers/inflections.rb
|
|
290
|
-
- test/dummy/config/initializers/mime_types.rb
|
|
291
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
|
292
|
-
- test/dummy/config/locales/en.yml
|
|
293
|
-
- test/dummy/config/puma.rb
|
|
294
|
-
- test/dummy/config/routes.rb
|
|
295
|
-
- test/dummy/config/spring.rb
|
|
296
|
-
- test/dummy/config/storage.yml
|
|
297
|
-
- test/dummy/config/webpack/development.js
|
|
298
|
-
- test/dummy/config/webpack/environment.js
|
|
299
|
-
- test/dummy/config/webpack/production.js
|
|
300
|
-
- test/dummy/config/webpack/test.js
|
|
301
|
-
- test/dummy/config/webpacker.yml
|
|
302
|
-
- test/dummy/db/migrate/20191204133417_create_active_storage_tables.active_storage.rb
|
|
303
|
-
- test/dummy/db/seeds.rb
|
|
304
|
-
- test/dummy/lib/assets/.keep
|
|
305
|
-
- test/dummy/lib/tasks/.keep
|
|
306
|
-
- test/dummy/log/.keep
|
|
307
|
-
- test/dummy/postcss.config.js
|
|
308
|
-
- test/dummy/public/404.html
|
|
309
|
-
- test/dummy/public/422.html
|
|
310
|
-
- test/dummy/public/500.html
|
|
311
|
-
- test/dummy/public/apple-touch-icon-precomposed.png
|
|
312
|
-
- test/dummy/public/apple-touch-icon.png
|
|
313
|
-
- test/dummy/public/favicon.ico
|
|
314
|
-
- test/dummy/public/robots.txt
|
|
315
|
-
- test/dummy/storage/.keep
|
|
316
|
-
- test/dummy/test/application_system_test_case.rb
|
|
317
|
-
- test/dummy/test/channels/application_cable/connection_test.rb
|
|
318
|
-
- test/dummy/test/controllers/.keep
|
|
319
|
-
- test/dummy/test/fixtures/.keep
|
|
320
|
-
- test/dummy/test/fixtures/files/.keep
|
|
321
|
-
- test/dummy/test/helpers/.keep
|
|
322
|
-
- test/dummy/test/integration/.keep
|
|
323
|
-
- test/dummy/test/mailers/.keep
|
|
324
|
-
- test/dummy/test/models/.keep
|
|
325
|
-
- test/dummy/test/system/.keep
|
|
326
|
-
- test/dummy/test/test_helper.rb
|
|
327
|
-
- test/dummy/tmp/.keep
|
|
328
|
-
- test/dummy/vendor/.keep
|
|
329
|
-
- test/fixtures/files/hello.docx
|
|
330
|
-
- test/fixtures/files/hello.pptx
|
|
331
|
-
- test/fixtures/files/hello.xlsx
|
|
332
|
-
- test/office_previewer_test.rb
|
|
333
|
-
- test/test_helper.rb
|
|
140
|
+
test_files: []
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
activestorage-office-previewer (0.1.1)
|
|
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
|
-
builder (3.2.3)
|
|
66
|
-
byebug (11.0.1)
|
|
67
|
-
concurrent-ruby (1.1.5)
|
|
68
|
-
crass (1.0.5)
|
|
69
|
-
erubi (1.9.0)
|
|
70
|
-
globalid (0.4.2)
|
|
71
|
-
activesupport (>= 4.2.0)
|
|
72
|
-
i18n (1.7.0)
|
|
73
|
-
concurrent-ruby (~> 1.0)
|
|
74
|
-
loofah (2.4.0)
|
|
75
|
-
crass (~> 1.0.2)
|
|
76
|
-
nokogiri (>= 1.5.9)
|
|
77
|
-
mail (2.7.1)
|
|
78
|
-
mini_mime (>= 0.1.1)
|
|
79
|
-
marcel (0.3.3)
|
|
80
|
-
mimemagic (~> 0.3.2)
|
|
81
|
-
method_source (0.9.2)
|
|
82
|
-
mimemagic (0.3.3)
|
|
83
|
-
mini_magick (4.9.5)
|
|
84
|
-
mini_mime (1.0.2)
|
|
85
|
-
mini_portile2 (2.4.0)
|
|
86
|
-
minitest (5.13.0)
|
|
87
|
-
nio4r (2.5.2)
|
|
88
|
-
nokogiri (1.10.6)
|
|
89
|
-
mini_portile2 (~> 2.4.0)
|
|
90
|
-
rack (2.0.7)
|
|
91
|
-
rack-test (1.1.0)
|
|
92
|
-
rack (>= 1.0, < 3)
|
|
93
|
-
rails (6.0.1)
|
|
94
|
-
actioncable (= 6.0.1)
|
|
95
|
-
actionmailbox (= 6.0.1)
|
|
96
|
-
actionmailer (= 6.0.1)
|
|
97
|
-
actionpack (= 6.0.1)
|
|
98
|
-
actiontext (= 6.0.1)
|
|
99
|
-
actionview (= 6.0.1)
|
|
100
|
-
activejob (= 6.0.1)
|
|
101
|
-
activemodel (= 6.0.1)
|
|
102
|
-
activerecord (= 6.0.1)
|
|
103
|
-
activestorage (= 6.0.1)
|
|
104
|
-
activesupport (= 6.0.1)
|
|
105
|
-
bundler (>= 1.3.0)
|
|
106
|
-
railties (= 6.0.1)
|
|
107
|
-
sprockets-rails (>= 2.0.0)
|
|
108
|
-
rails-dom-testing (2.0.3)
|
|
109
|
-
activesupport (>= 4.2.0)
|
|
110
|
-
nokogiri (>= 1.6)
|
|
111
|
-
rails-html-sanitizer (1.3.0)
|
|
112
|
-
loofah (~> 2.3)
|
|
113
|
-
railties (6.0.1)
|
|
114
|
-
actionpack (= 6.0.1)
|
|
115
|
-
activesupport (= 6.0.1)
|
|
116
|
-
method_source
|
|
117
|
-
rake (>= 0.8.7)
|
|
118
|
-
thor (>= 0.20.3, < 2.0)
|
|
119
|
-
rake (13.0.1)
|
|
120
|
-
sprockets (4.0.0)
|
|
121
|
-
concurrent-ruby (~> 1.0)
|
|
122
|
-
rack (> 1, < 3)
|
|
123
|
-
sprockets-rails (3.2.1)
|
|
124
|
-
actionpack (>= 4.0)
|
|
125
|
-
activesupport (>= 4.0)
|
|
126
|
-
sprockets (>= 3.0.0)
|
|
127
|
-
sqlite3 (1.4.1)
|
|
128
|
-
thor (0.20.3)
|
|
129
|
-
thread_safe (0.3.6)
|
|
130
|
-
tzinfo (1.2.5)
|
|
131
|
-
thread_safe (~> 0.1)
|
|
132
|
-
websocket-driver (0.7.1)
|
|
133
|
-
websocket-extensions (>= 0.1.0)
|
|
134
|
-
websocket-extensions (0.1.4)
|
|
135
|
-
zeitwerk (2.2.2)
|
|
136
|
-
|
|
137
|
-
PLATFORMS
|
|
138
|
-
ruby
|
|
139
|
-
|
|
140
|
-
DEPENDENCIES
|
|
141
|
-
activestorage-office-previewer!
|
|
142
|
-
bundler (~> 1.17)
|
|
143
|
-
byebug
|
|
144
|
-
mini_magick (~> 4.9.5)
|
|
145
|
-
minitest (~> 5.13.0)
|
|
146
|
-
rails (>= 6.0.0)
|
|
147
|
-
rake (~> 13.0.0)
|
|
148
|
-
sqlite3 (~> 1.4.1)
|
|
149
|
-
|
|
150
|
-
BUNDLED WITH
|
|
151
|
-
1.17.2
|