[PR #2081] fix: Signed Certificate detail page and Generate the signing cert at the start. #2039

Open
opened 2026-02-26 20:32:10 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2081
Author: @Novapixel1010
Created: 10/18/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (6)

📊 Changes

2 files changed (+77 additions, -11 deletions)

View changed files

📝 docker/Dockerfile (+38 -11)
📝 docker/start.sh (+39 -0)

📄 Description

Description

This pull request introduces automatic generation of a self-signed signing certificate (cert.p12) at container startup.
Previously, Documenso required a manually mounted PKCS#12 certificate for document signing. This change allows the container to operate out-of-the-box without external dependencies or manual setup. (Note to self if possible make it so this can be disabled via a simple true/false statement in env)

I also fix this issue #1634. Where the Signed Certificate detail page wasn't working.

#1634 and #1892

Changes Made

  • Added logic in start.sh to:

    • Check if a signing certificate exists at $NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH or /app/certs/cert.p12.

    • Generate a new RSA 2048-bit key and self-signed certificate if missing.

    • Export it as a PKCS#12 file with no passphrase.

Change 2

  • Add PLAYWRIGHT and dependencies
  • Make sure to install the dependencies for running the certutil command so you can add a self-signed certificate for test environments and edge cases.

Testing Performed

  • Verified new self-signed certificate generation on clean container startup.
  • Signed multiple documents successfully using the newly generated cert.
  • Verified that the Signed Certificate detail page is included
  • Verified that the container logs show:

Generated self-signed PKCS#12 at /app/certs/cert.p12 (no passphrase)”

Certificate file found and readable — document signing is ready!”

  • Tested feature in production and in a testing environment.
  • Also tried to use alpine but could not get it to work right so I used 22-bookworm-slim.
  • Tested on browser Brave.

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

This is my first major PR on github. So let me know if I missed something. I didn't not see the repo for the Doc's?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2081 **Author:** [@Novapixel1010](https://github.com/Novapixel1010) **Created:** 10/18/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (6) - [`53d20a8`](https://github.com/documenso/documenso/commit/53d20a8d8cda380d6f53eb3f201e1dcdd64fef26) Generate cert at start - [`65aff20`](https://github.com/documenso/documenso/commit/65aff20b506142f6ee604cccc39c2f83667589fa) add chromium - [`983577f`](https://github.com/documenso/documenso/commit/983577f857374c5202e08a159d9306422cc2b9bc) Update Dockerfile - [`d891a43`](https://github.com/documenso/documenso/commit/d891a43a875352855522d95df1cda08f30dad8b7) Update Dockerfile | telemetry - [`b3a6c4d`](https://github.com/documenso/documenso/commit/b3a6c4d0d69d500ad5970d062c02dee0743eb0d7) Merge branch 'main' into main - [`b55dc49`](https://github.com/documenso/documenso/commit/b55dc4996437b22b9043fc5f9f4d9f70686b27c4) Merge branch 'main' into main ### 📊 Changes **2 files changed** (+77 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile` (+38 -11) 📝 `docker/start.sh` (+39 -0) </details> ### 📄 Description ## Description This pull request introduces automatic generation of a self-signed signing certificate (cert.p12) at container startup. Previously, Documenso required a manually mounted PKCS#12 certificate for document signing. This change allows the container to operate out-of-the-box without external dependencies or manual setup. (Note to self if possible make it so this can be disabled via a simple true/false statement in `env`) I also fix this issue #1634. Where the Signed Certificate detail page wasn't working. ## Related Issue #1634 and #1892 ## Changes Made - Added logic in start.sh to: - Check if a signing certificate exists at $NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH or /app/certs/cert.p12. - Generate a new RSA 2048-bit key and self-signed certificate if missing. - Export it as a PKCS#12 file with no passphrase. Change 2 - Add PLAYWRIGHT and dependencies - Make sure to install the dependencies for running the `certutil` command so you can add a self-signed certificate for test environments and edge cases. ## Testing Performed - Verified new self-signed certificate generation on clean container startup. - Signed multiple documents successfully using the newly generated cert. - Verified that the Signed Certificate detail page is included - Verified that the container logs show: “✅ Generated self-signed PKCS#12 at /app/certs/cert.p12 (no passphrase)” “✅ Certificate file found and readable — document signing is ready!” - Tested feature in production and in a testing environment. - Also tried to use alpine but could not get it to work right so I used 22-bookworm-slim. - Tested on browser Brave. ## Checklist - [X] I have tested these changes locally and they work as expected. - [X] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [ ] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes This is my first major PR on github. So let me know if I missed something. I didn't not see the repo for the Doc's? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2039
No description provided.