Skip to content

Commit

Permalink
[FIX]: Update CODEOWNERS and github-actions (#20)
Browse files Browse the repository at this point in the history
* [FIX] Add asset mappers for the static assets (#15)

* update codewoners and add github-actions

* update documentation
  • Loading branch information
bugloper authored Jul 16, 2024
1 parent b45a33b commit 52eac5d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 52 deletions.
4 changes: 1 addition & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
* @bugloper
.github/ @bugloper @SELISEdigitalplatforms/DEVOPS-ADMIN-ALL-REPOS
CODEOWNERS @bugloper @SELISEdigitalplatforms/DEVOPS-ADMIN-ALL-REPOS
* @SELISEdigitalplatforms/oss-maintainers-gem-gotenberg
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/security_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ Provide any additional information that may help us understand the issue and how
## Contact Information

(Optional) If you would like to be contacted regarding this issue, please provide your preferred contact method.

8 changes: 6 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

version: 2
updates:
- package-ecosystem: "bundler" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# gotenberg

`gotenberg` is a simple Ruby client for gotenberg
According to the official documentation, Gotenberg is a Docker-powered stateless API for PDF files. It offers a developer-friendly API that utilizes powerful tools like Chromium and LibreOffice to convert various document formats (such as HTML, Markdown, Word, Excel, and more) into PDF files and beyond. The gotenberg gem is a simple Ruby client for interacting with this API. Gotenberg provides multiple APIs for tasks such as converting HTML to PDF, URL to PDF, Markdown to PDF, and more.

Currently, this gem only supports the HTML conversion to PDF and health endpoint APIs. This gem seamlessly integrates the Rails asset pipeline with Gotenberg's requirements for HTML and assets and includes useful helper methods for assets which can be used in `.erb` files or other Ruby classes.

Please note that Gotenberg needs to be deployed on your server or VPC and can function as a stateless, central PDF generation engine for all of your applications. For more information and installation guides, please visit the [official website](https://gotenberg.dev).

**High-level flow diagram:**
![Alt text](./docs/diagram.png)

## Installation

Expand Down
44 changes: 2 additions & 42 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
# Reporting a security bug
## Reporting a Vulnerability

<!-- Note: Need to discuss this -->
All security bugs in gotenberg should be reported to the core team through our private mailing list [[email protected]]. Your report will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in handling your report.

After the initial reply to your report, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least every five days, although in practice, it is more likely to be every 24-48 hours.

If you have not received a reply to your email within 48 hours, or have not heard from the security team for the past five days, there are a few steps you can take:

## Disclosure Policy

gotenberg follows a 5-step disclosure policy, which is upheld to the best of our ability.

1. Security report received and is assigned a primary handler. This person will coordinate the fix and release process.
2. Problem is confirmed and a list of all affected versions is determined. Code is audited to find any potential similar problems.
3. Fixes are prepared for all releases which are still supported. These fixes are not committed to the public repository but rather held locally pending the announcement.
4. A suggested embargo date for this vulnerability is chosen and distros@openwall is notified. This notification will include patches for all versions still under support and a contact address for packagers who need advice back-porting patches to older versions.
5. On the embargo date, the [mailing list][mailing-list] and [security list][security-list] are sent a copy of the announcement. The changes are pushed to the public repository and new gems released to RubyGems.

Typically, the embargo date will be set 72 hours from the time vendor-sec is first notified, however, this may vary depending on the severity of the bug or difficulty in applying a fix.

This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the bug in as timely a manner as possible, however, it’s important that we follow the release process above to ensure that the disclosure is handled in a consistent manner.

## Security Updates

Security updates will be posted on the [mailing list][mailing-list] and [security list][security-list].

## Comments on this Policy

If you have any suggestions to improve this policy, please email the core team at [[email protected]].

## Credit for Reporters

We highly appreciate the efforts of security researchers who report vulnerabilities to us. We offer the following forms of recognition:

TODO: Decide on these
* Reporters will be listed on the project's official documentation site.
* Reporters will be acknowledged in the security advisories and release notes associated with the fix.

We strive to ensure that reporters receive due credit for their valuable contributions to the security of gotenberg.

[mailing-list]: http://groups.google.com/group/gotenberg/topics
[security-list]: http://groups.google.com/group/gotenberg-security/topics
To report (possible) security issues in this gem, please use Github's [private reporting feature](https://github.com/SELISEdigitalplatforms/gotenberg/security/advisories/new).
Binary file added docs/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/gotenberg/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def initialize(api_url)
# Convert HTML files to PDF and write it to the output file
#
# @param htmls [Hash{Symbol => String}] A hash with the file name as the key and the HTML content as the value
# @param asset_paths [Array<String>] Optional args, paths to the asset files (like CSS, images) required by the HTML files
# @param asset_paths [Array<String>] Optional args, paths to the asset files (like CSS, images) required by the HTML files # rubocop:disable Layout/LineLength
# @param properties [Hash] Additional properties for PDF conversion
# @option properties [Float] :paperWidth The width of the paper
# @option properties [Float] :paperHeight The height of the paper
Expand All @@ -49,7 +49,7 @@ def initialize(api_url)
# pdf_content = client.html(htmls, asset_paths, properties)
#
# Credit: https://github.com/jbd0101/ruby-gotenberg-client/blob/master/lib/gotenberg.rb
def html(htmls, asset_paths = [], properties = {})
def html(htmls, asset_paths = [], properties = {}) # rubocop:disable Metrics/CyclomaticComplexity
raise GotenbergDownError unless up?

raise IndexFileMissing unless (htmls.keys & ["index", :index]).any?
Expand Down
1 change: 0 additions & 1 deletion lib/gotenberg/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def goten_compiled_asset_path(asset_name)
#
# @param asset_name [String] the name of the asset
# @return [String] the compiled name of the asset

def goten_compiled_asset_name(asset_name)
path = goten_compiled_asset_path(asset_name)
path.split("/").last
Expand Down
4 changes: 4 additions & 0 deletions spec/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
it "has a version number" do
expect(Gotenberg::VERSION).not_to be nil
end

it "matches the version pattern x.y.z" do
expect(Gotenberg::VERSION).to match(/^\d+\.\d+\.\d+$/)
end
end

0 comments on commit 52eac5d

Please sign in to comment.