A long-lived project that still receives updates
Active Storage previewer for Microsoft Office files based on LibreOffice
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.2
~> 6.0
>= 7.2.0
~> 13.0

Runtime

 Project Readme

Active Storage previewer for Microsoft Office files

Use LibreOffice to generate previews for Microsoft Word documents, Microsoft PowerPoint presentations, and Microsoft Excel spreadsheets in Active Storage.

Requirements

Usage

Add the activestorage-office-previewer gem to your app’s Gemfile and run bundle install:

gem "activestorage-office-previewer"

Generate previews of Microsoft Office files using Active Storage’s preview feature.

Security

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.

Version 0.2.0 adds two defense-in-depth layers:

  • An environment allowlist. The gem starts soffice with a minimal environment. Application secrets in the host environment do not reach the soffice process.
  • A throwaway user profile. Each conversion uses a new LibreOffice profile. The profile refuses active content and externally linked resources.

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.

License

This gem is released under the terms of the MIT license.

LibreOffice is released under the terms of the Mozilla Public License, version 2.0.