Compare commits

...

17 Commits

Author SHA1 Message Date
Alex Turchyn 6fbc81fae2 increase tokens length 2023-07-08 21:05:29 +03:00
Alex Turchyn dcbdc9e60c fix submit form 2023-07-08 20:59:54 +03:00
Alex Turchyn 254aa9e950 add demo alert 2023-07-08 20:59:50 +03:00
Alex Turchyn 28290c4635 form builder hints 2023-07-08 18:53:29 +03:00
Alex Turchyn a72882ce0f adjust form templates 2023-07-08 18:53:28 +03:00
Alex Turchyn fd0b57c651 update readme 2023-07-08 14:24:59 +03:00
Alex Turchyn 780ced3e7f omit html in github code stats 2023-07-08 13:13:32 +03:00
Alex Turchyn f8f11b6fa6 update readme 2023-07-08 01:36:37 +03:00
Alex Turchyn bdaaa5276c fix pdf generation images 2023-07-07 21:29:38 +03:00
Alex Turchyn e149e08f33 fix style 2023-07-07 01:45:50 +03:00
Alex Turchyn 47bd0571f9 add deployment to DigitalOcean 2023-07-07 01:31:36 +03:00
Alex Turchyn 5352a25ede fix pdf generation images 2023-07-07 00:54:32 +03:00
Alex Turchyn ead316df00 add docker compose 2023-07-06 23:11:08 +03:00
Alex Turchyn dac7594aeb do not require optional gems 2023-07-05 21:42:41 +03:00
Alex Turchyn f4f226ac63 configure db pool size 2023-07-05 21:19:39 +03:00
Alex Turchyn 2112b2f3d3 minor UI fixes 2023-07-05 20:52:59 +03:00
Alex Turchyn b112fc0c81 add analytics tools 2023-07-05 20:40:49 +03:00
36 changed files with 285 additions and 121 deletions
+18
View File
@@ -0,0 +1,18 @@
spec:
name: docuseal
services:
- name: docuseal
dockerfile_path: Dockerfile
git:
repo_clone_url: https://github.com/docusealco/docuseal.git
branch: master
envs:
- key: SECRET_KEY_BASE
value: "- 64 characters string 64 characters string 64 characters string -"
type: SECRET
scope: RUN_TIME
- key: DATABASE_URL
scope: RUN_TIME
value: ${docuseal-db.DATABASE_URL}
databases:
- name: docuseal-db
+1
View File
@@ -0,0 +1 @@
*.html linguist-detectable=false
+7 -7
View File
@@ -4,28 +4,28 @@ source 'https://rubygems.org'
ruby '3.2.2'
gem 'audited'
gem 'aws-sdk-s3'
gem 'azure-storage-blob'
gem 'aws-sdk-s3', require: false
gem 'azure-storage-blob', require: false
gem 'bootsnap', require: false
gem 'devise'
gem 'dotenv', require: false
gem 'faraday'
gem 'google-cloud-storage'
gem 'google-cloud-storage', require: false
gem 'hexapdf'
gem 'image_processing'
gem 'lograge'
gem 'mysql2'
gem 'mysql2', require: false
gem 'oj'
gem 'pagy'
gem 'pg'
gem 'pg', require: false
gem 'premailer-rails'
gem 'puma'
gem 'rails'
gem 'rails-i18n'
gem 'rollbar', require: ENV.key?('ROLLBAR_ACCESS_TOKEN')
gem 'ruby-vips'
gem 'shakapacker'
gem 'sqlite3'
gem 'sqlite3', require: false
gem 'strip_attributes'
gem 'turbo-rails'
gem 'tzinfo-data'
+2 -4
View File
@@ -72,9 +72,6 @@ GEM
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
audited (5.3.3)
activerecord (>= 5.0, < 7.1)
request_store (~> 1.2)
aws-eventstream (1.2.0)
aws-partitions (1.781.0)
aws-sdk-core (3.175.0)
@@ -379,6 +376,7 @@ GEM
railties (>= 5.2)
retriable (3.1.2)
rexml (3.2.5)
rollbar (3.4.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
@@ -488,7 +486,6 @@ PLATFORMS
DEPENDENCIES
annotate
audited
aws-sdk-s3
azure-storage-blob
better_html
@@ -517,6 +514,7 @@ DEPENDENCIES
puma
rails
rails-i18n
rollbar
rspec-rails
rubocop
rubocop-performance
+63 -13
View File
@@ -1,24 +1,74 @@
# README
<h1 align="center" style="border-bottom: none">
<div>
<a href="https://www.docuseal.co">
<img alt="DocuSeal" src="https://github.com/docusealco/docuseal/assets/5418788/c12cd051-81cd-4402-bc3a-92f2cfdc1b06" width="80" />
<br>
</a>
DocuSeal
</div>
</h1>
<h3 align="center">
Open source document filling and signing
</h3>
<p align="center">
<a href="https://hub.docker.com/r/docuseal/docuseal">
<img alt="Docker releases" src="https://img.shields.io/docker/v/docuseal/docuseal">
</a>
<a href="https://discord.com/invite/B5wg5wKk">
<img src="https://img.shields.io/discord/1125112641170448454?logo=discord"/>
</a>
<a href="https://twitter.com/intent/follow?screen_name=docusealco">
<img src="https://img.shields.io/twitter/follow/docusealco?style=social" alt="Follow @docusealco" />
</a>
</p>
<p>
DocuSeal is an open source platform that provides secure and efficient digital document signing and processing. Create PDF forms to have them filled and signed online on any device with an easy-to-use, mobile-optimized web tool.
</p>
<h2 align="center">
<a href="https://demo.docuseal.co">✨ Live Demo</a>
</h2>
This README would normally document whatever steps are necessary to get the
application up and running.
[![Demo](https://github.com/docusealco/docuseal/assets/5418788/d8703ea3-361a-423f-8bfe-eff1bd9dbe14)](https://demo.docuseal.co)
Things you may want to cover:
## Features
- [x] PDF form fields builder (WYSIWYG)
- [x] 10 field types available (Signature, Date, File, Checkbox etc.)
- [x] Multiple submitters per document
- [x] Automated emails via SMTP
- [x] Files storage on AWS S3, Google Storage, or Azure
- [x] Automatic PDF eSignature
- [x] PDF signature verification
- [x] Users management
- [x] Mobile-optimized
- [x] Easy to deploy in minutes
* Ruby version
## Deploy
* System dependencies
| Heroku | Railway | DigitalOcean |
| ---------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [<img alt="Deploy on Heroku" src="https://www.herokucdn.com/deploy/button.svg" height="40">](https://heroku.com/deploy?template=https://github.com/docusealco/docuseal-heroku) | [<img alt="Deploy on Railway" src="https://railway.app/button.svg" height="40">](https://railway.app/template/IGoDnc?referralCode=ruU7JR) | [<img alt="Deploy on DigitalOcean" src="https://www.deploytodo.com/do-btn-blue.svg" height="40">](https://cloud.digitalocean.com/apps/new?repo=https://github.com/docusealco/docuseal/tree/master&refcode=421d50f53990) |
* Configuration
* Database creation
#### Docker
* Database initialization
```sh
docker run --name docuseal -p 3000:3000 -v.:/data docuseal/docuseal
```
* How to run the test suite
By default DocuSeal docker container uses an SQLite database to store data and configurations. Alternatively, it is possible use PostgreSQL or MySQL databases by specifying the `DATABASE_URL` env variable.
* Services (job queues, cache servers, search engines, etc.)
#### Docker Compose
* Deployment instructions
Download docker-compose.yml into your private server:
```sh
curl https://raw.githubusercontent.com/docusealco/docuseal/master/docker-compose.yml > docker-compose.yml
```
* ...
Run docker compose under a custom domain over https (make sure your DNS points to the server to automatically issue ssl certs with Caddy):
```sh
HOST=your-domain-name.com docker-compose up
```
## License
DocuSeal is released under the GNU Affero General Public License v3.0.
+3 -3
View File
@@ -10,9 +10,9 @@ class SubmitFormController < ApplicationController
Submitter.preload(submission: { template: { documents_attachments: { preview_images_attachments: :blob } } })
.find_by!(slug: params[:slug])
cookies.signed[:submitter_sid] = @submitter.signed_id
return redirect_to submit_form_completed_path(@submitter.slug) if @submitter.completed_at?
redirect_to submit_form_completed_path(@submitter.slug) if @submitter.completed_at?
cookies[:submitter_sid] = @submitter.signed_id
end
def update
@@ -41,7 +41,7 @@ class SubmitFormController < ApplicationController
private
def normalized_values
params[:values].to_unsafe_h.transform_values do |v|
params.fetch(:values, {}).to_unsafe_h.transform_values do |v|
if params[:cast_boolean] == 'true'
v == 'true'
else
@@ -41,6 +41,14 @@
</span>
</button>
</div>
<div class="text-center mt-4">
Signed with
<a
href="https://www.docuseal.co"
target="_blank"
class="underline"
>DocuSeal</a> - open source documents software
</div>
</div>
</template>
+1 -1
View File
@@ -29,7 +29,7 @@
{{ message }}
</div>
<div class="text-xs">
<span class="font-medium">Click to upload</span> or drag and drop
<span class="font-medium">Click to upload</span> or drag and drop files
</div>
</div>
</div>
+12 -12
View File
@@ -21,18 +21,12 @@
name="authenticity_token"
:value="authenticityToken"
>
<input
v-if="currentStep === stepFields.length - 1"
type="hidden"
name="completed"
value="true"
>
<input
value="put"
name="_method"
type="hidden"
>
<div class="mt-4">
<div class="md:mt-4">
<div v-if="['cells', 'text'].includes(currentField.type)">
<label
v-if="currentField.name"
@@ -226,7 +220,7 @@
@attached="[attachments.push($event), $refs.areas.scrollIntoField(currentField)]"
/>
</div>
<div class="mt-8">
<div class="mt-6 md:mt-8">
<button
type="submit"
class="base-button w-full flex justify-center"
@@ -263,7 +257,7 @@
href="#"
class="inline border border-base-300 h-3 w-3 rounded-full mx-1"
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': index < currentStep || isCompleted, 'bg-white': index > currentStep }"
@click.prevent="isCompleted ? '' : goToStep(step, true)"
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(step, true)]"
/>
</div>
</div>
@@ -401,13 +395,13 @@ export default {
}
})
},
saveStep () {
saveStep (formData) {
if (this.isCompleted) {
return Promise.resolve({})
} else {
return fetch(this.submitPath, {
method: 'POST',
body: new FormData(this.$refs.form)
body: formData || new FormData(this.$refs.form)
})
}
},
@@ -420,7 +414,13 @@ export default {
await stepPromise()
this.saveStep().then(response => {
const formData = new FormData(this.$refs.form)
if (this.currentStep === this.stepFields.length - 1) {
formData.append('completed', 'true')
}
this.saveStep(formData).then(response => {
const nextStep = this.stepFields[this.currentStep + 1]
if (nextStep) {
+1 -1
View File
@@ -29,7 +29,7 @@
{{ message }}
</div>
<div class="text-sm">
<span class="font-medium">Click to upload</span> or drag and drop
<span class="font-medium">Click to upload</span> or drag and drop files
</div>
</div>
</div>
@@ -67,6 +67,25 @@
</div>
</button>
</div>
<div
v-if="fields.length < 4"
class="text-xs p-2 border border-base-200 rounded"
>
<ui>
<li>
Draw a text field on the page with a mouse
</li>
<li>
Single click of the page to add a checkbox
</li>
<li>
Drag &amp; drop any other field type on the page
</li>
<li>
Click on the field type above to add it to the form without drawing it on the document
</li>
</ui>
</div>
</template>
<script>
+1 -1
View File
@@ -32,7 +32,7 @@ class Submitter < ApplicationRecord
belongs_to :submission
attribute :values, :string, default: -> { {} }
attribute :slug, :string, default: -> { SecureRandom.base58(8) }
attribute :slug, :string, default: -> { SecureRandom.base58(10) }
serialize :values, JSON
+1 -1
View File
@@ -36,7 +36,7 @@ class Template < ApplicationRecord
attribute :fields, :string, default: -> { [] }
attribute :schema, :string, default: -> { [] }
attribute :submitters, :string, default: -> { [{ name: DEFAULT_SUBMITTER_NAME, uuid: SecureRandom.uuid }] }
attribute :slug, :string, default: -> { SecureRandom.base58(8) }
attribute :slug, :string, default: -> { SecureRandom.base58(10) }
serialize :fields, JSON
serialize :schema, JSON
+1 -1
View File
@@ -28,7 +28,7 @@
Verify Signed PDF
</div>
<div class="text-xs">
<span class="font-medium">Click to upload</span> or drag and drop
<span class="font-medium">Click to upload</span> or drag and drop files
</div>
</div>
<input id="file" name="files[]" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file" accept="application/pdf" multiple>
+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 19c3.333 -2 5 -4 5 -6c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 2.877 2.5 4c1.5 2 2.5 2.5 3.5 1c.667 -1 1.167 -1.833 1.5 -2.5c1 2.333 2.333 3.5 4 3.5h2.5"></path>
<path d="M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"></path>
<path d="M16 7h4"></path>
</svg>

After

Width:  |  Height:  |  Size: 584 B

+2
View File
@@ -10,10 +10,12 @@
<%= csp_meta_tag %>
<%= javascript_pack_tag 'application', defer: true %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
</head>
<body>
<turbo-frame id="modal"></turbo-frame>
<%= render 'shared/navbar' %>
<% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %>
<% if flash.present? %><%= render 'shared/flash' %><% end %>
<div class="max-w-6xl mx-auto px-4 md:px-2 mb-8">
<%= yield %>
+1 -1
View File
@@ -6,11 +6,11 @@
</title>
<%= render 'shared/meta' %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= javascript_pack_tag 'form', defer: true %>
<%= stylesheet_pack_tag 'form', media: 'all' %>
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
</head>
<body>
<%= yield %>
+1
View File
@@ -10,6 +10,7 @@
<%= csp_meta_tag %>
<%= javascript_pack_tag 'application', defer: true %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
</head>
<body>
<% if flash.present? %><%= render 'shared/flash' %><% end %>
+9
View File
@@ -0,0 +1,9 @@
<div class="absolute top-0 w-full h-0">
<div class="max-w-xl mx-auto mt-1.5">
<div class="px-4 py-3 rounded-2xl flex items-center justify-between mx-4 md:mx-0">
<a target="_blank" href="<%= start_form_url(slug: ::Template.first&.slug) %>" class="font-medium w-full text-center underline">
Demo Environment
</a>
</div>
</div>
</div>
+3
View File
@@ -1,3 +1,6 @@
<% if Docuseal.demo? || (request.path != '/' && !devise_controller?) %>
<meta name="robots" content="noindex">
<% end %>
<meta name="description" content="Open source, self-hosted tool to streamline document filling and signing. Create custom PDF forms to complete and sign with an easy to use online tool.">
<meta property="og:title" content="DocuSeal | Open Source Document Filling and Signing">
<meta property="og:description" content="Open source, self-hosted tool to streamline document filling and signing. Create custom PDF forms to complete and sign with an easy to use online tool.">
+1 -1
View File
@@ -5,7 +5,7 @@
<span>DocuSeal</span>
</a>
<a href="<%= Docuseal::GITHUB_URL %>" target="_blank" class="inline">
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/docusealco/docuseal?style=social&label=" style="height: 22px">
<img alt="GitHub Repo stars" src="https://www.docuseal.co/github-badge.svg" style="height: 22px">
</a>
</div>
<% if signed_in? %>
+4
View File
@@ -0,0 +1,4 @@
<script>
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init('<%= ENV.fetch('POSTHOG_TOKEN', nil) %>',{api_host:'https://app.posthog.com',autocapture: false,enable_recording_console_log: true,capture_pageview: false,session_recording:{maskAllInputs: false,maskInputOptions: {password: true}}})
</script>
+4 -1
View File
@@ -1,4 +1,4 @@
<div class="block w-full md:w-52">
<div class="block w-full md:w-52 flex-none">
<menu-active>
<ul class="menu px-0">
<li class="menu-title py-0"><span>Settings</span></li>
@@ -44,5 +44,8 @@
<%= svg_icon('send', class: 'h-5 w-5') %>
Tell about us
</a>
<a href="mailto:<%= Docuseal::SUPPORT_EMAIL %>" target="_blank" class="w-full block mt-4 underline text-center">
<%= Docuseal::SUPPORT_EMAIL %>
</a>
</div>
</div>
+1 -6
View File
@@ -12,12 +12,7 @@
<div class="flex items-center bg-base-300 rounded-xl p-4 mb-4">
<div class="flex items-center">
<div class="mr-3">
<svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 19c3.333 -2 5 -4 5 -6c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 2.877 2.5 4c1.5 2 2.5 2.5 3.5 1c.667 -1 1.167 -1.833 1.5 -2.5c1 2.333 2.333 3.5 4 3.5h2.5" />
<path d="M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z" />
<path d="M16 7h4" />
</svg>
<%= svg_icon('writing_sign', class: 'w-10 h-10') %>
</div>
<div>
<p class="text-lg font-bold mb-1"><%= @submitter.submission.template.name %></p>
+29 -36
View File
@@ -1,43 +1,36 @@
<div class="max-w-xl mx-auto px-2 mt-12 mb-4">
<div class="card bg-base-200">
<div class="card-body">
<div class="space-y-4 w-full md:px-10 mx-auto">
<div class="space-y-4">
<a href="/" class="flex justify-center">
<span class="mr-3">
<%= render 'shared/logo', width: '50px', height: '50px' %>
</span>
<h1 class="text-5xl font-bold text-center">DocuSeal</h1>
</a>
<p class="text-xl font-semibold text-center">You have been invited to submit the form</p>
<div class="flex items-center bg-base-content/10 rounded-xl p-4">
<div class="flex items-center">
<div class="mr-3">
<svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 19c3.333 -2 5 -4 5 -6c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 2.877 2.5 4c1.5 2 2.5 2.5 3.5 1c.667 -1 1.167 -1.833 1.5 -2.5c1 2.333 2.333 3.5 4 3.5h2.5" />
<path d="M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z" />
<path d="M16 7h4" />
</svg>
</div>
<div>
<p class="font-bold mb-1"><%= @template.name %></p>
<p class="text-sm">Invited by <%= @template.account.name %></p>
</div>
</div>
<div class="max-w-md mx-auto px-2 mt-12 mb-4">
<div class="space-y-6 mx-auto">
<div class="space-y-6">
<div class="text-center w-full space-y-6">
<a href="/" class="flex justify-center">
<span class="mr-3">
<%= render 'shared/logo', width: '50px', height: '50px' %>
</span>
<h1 class="text-5xl font-bold text-center">DocuSeal</h1>
</a>
<p class="text-xl font-semibold text-center">You have been invited to submit a form</p>
</div>
<div class="flex items-center bg-base-300 rounded-xl p-4 mb-4">
<div class="flex items-center">
<div class="mr-3">
<%= svg_icon('writing_sign', class: 'w-10 h-10') %>
</div>
<div>
<p class="text-lg font-bold mb-1"><%= @template.name %></p>
<p class="text-sm">Invited by <%= @template.account.name %></p>
</div>
</div>
<%= form_for @submitter, url: start_form_path(@template.slug), data: { turbo_frame: :_top }, method: :put, html: { class: 'space-y-4' } do |f| %>
<div class="form-control !mt-0">
<%= f.label :email, class: 'label' %>
<%= f.email_field :email, required: true, class: 'base-input', placeholder: 'Provide your email to start' %>
</div>
<div class="form-control">
<%= f.button button_title(title: 'Start', disabled_with: 'Starting'), class: 'base-button' %>
</div>
<% end %>
</div>
</div>
<%= form_for @submitter, url: start_form_path(@template.slug), data: { turbo_frame: :_top }, method: :put, html: { class: 'space-y-4' } do |f| %>
<div class="form-control !mt-0">
<%= f.label :email, class: 'label' %>
<%= f.email_field :email, required: true, class: 'base-input', placeholder: 'Provide your email to start' %>
</div>
<div class="form-control">
<%= f.button button_title(title: 'Start', disabled_with: 'Starting'), class: 'base-button' %>
</div>
<% end %>
</div>
</div>
<%= render 'shared/attribution' %>
+3 -3
View File
@@ -1,5 +1,5 @@
<div style="max-width: 1600px" class="mx-auto pl-4">
<div class="flex justify-between py-1.5 items-center pr-4">
<div class="flex justify-between py-1.5 items-center pr-4 sticky top-0 md:relative z-10 bg-base-100">
<a href="<%= template_path(@submission.template) %>" class="flex space-x-3 py-1">
<span><%= render 'shared/logo', width: 40, height: 40 %></span>
<span class="text-3xl font-semibold focus:text-clip"><%= @submission.template.name %></span>
@@ -21,7 +21,7 @@
<% end %>
</div>
</div>
<div class="flex" style="max-height: calc(100vh - 60px)">
<div class="flex md:max-h-[calc(100vh-60px)]">
<div class="overflow-y-auto overflow-x-hidden hidden lg:block w-52 flex-none pr-3 mt-0.5 pt-0.5">
<% @submission.template.schema.each do |item| %>
<% document = @submission.template.documents.find { |a| item['attachment_uuid'] == a.uuid } %>
@@ -82,7 +82,7 @@
</div>
<% if submitter && !submitter.completed_at? %>
<div class="mt-2 mb-1">
<a class="btn btn-sm btn-primary w-full" target="_blank" href="<%= submit_form_url(slug: submitter.slug) %>">
<a class="btn btn-sm btn-primary w-full" target="_blank" href="<%= submit_form_path(slug: submitter.slug) %>">
Submit Form
</a>
</div>
+1 -6
View File
@@ -12,12 +12,7 @@
<div class="flex items-center bg-base-300 rounded-xl p-4 mb-4">
<div class="flex items-center">
<div class="mr-3">
<svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 19c3.333 -2 5 -4 5 -6c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 2.877 2.5 4c1.5 2 2.5 2.5 3.5 1c.667 -1 1.167 -1.833 1.5 -2.5c1 2.333 2.333 3.5 4 3.5h2.5" />
<path d="M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z" />
<path d="M16 7h4" />
</svg>
<%= svg_icon('writing_sign', class: 'w-10 h-10') %>
</div>
<div>
<p class="text-lg font-bold mb-1"><%= @submitter.submission.template.name %></p>
+1 -1
View File
@@ -159,7 +159,7 @@
<div class="card-body text-center py-16">
<div class="max-w-md mx-auto">
<p class="text-3xl font-bold text-base-content mb-4">There are no Submissions</p>
<p class="text-gray-600">Send an invitation to fill and submit the documents</p>
<p class="text-gray-600">Send an invitation to fill and complete the form</p>
<%= link_to new_template_submission_path(@template), class: 'base-button mt-6', data: { turbo_frame: 'modal' } do %>
<%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %>
<span class="mr-1">Add Recipients</span>
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-2">
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
<%= render 'shared/settings_nav' %>
<div class="flex-grow">
<div class="flex justify-between mb-4">
+10 -1
View File
@@ -1,6 +1,7 @@
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 15) %>
development:
<<: *default
@@ -10,8 +11,16 @@ test:
<<: *default
database: docuseal_test
<% if ENV['DATABASE_URL'].to_s.empty? %>
production:
<% if ENV['DATABASE_URL'].to_s.empty? %>
adapter: sqlite3
database: <%= ENV['WORKDIR'] || '.' %>/db.sqlite3
<% elsif ENV['DATABASE_URL'].match?(/\Apostgres/) %>
<<: *default
url: <%= ENV['DATABASE_URL'] %>
<% elsif ENV['DATABASE_URL'].match?(/\Amysql/) %>
adapter: mysql2
encoding: utf8mb4
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 15) %>
url: <%= ENV['DATABASE_URL'] %>
<% end %>
+1 -1
View File
@@ -15,7 +15,7 @@ Rails.configuration.to_prepare do
ActiveStorage::DirectUploadsController.before_action do
next if current_user
next if Submitter.find_signed(cookies.signed[:submitter_sid])
next if Submitter.find_signed(cookies[:submitter_sid])
head :forbidden
end
+13
View File
@@ -0,0 +1,13 @@
# frozen_string_literal: true
if defined?(Rollbar)
Rollbar.configure do |config|
config.access_token = ENV.fetch('ROLLBAR_ACCESS_TOKEN', nil)
config.enabled = true
config.exception_level_filters['ActionController::RoutingError'] = 'ignore'
config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
end
end
+41
View File
@@ -0,0 +1,41 @@
version: '3'
services:
app:
depends_on:
postgres:
condition: service_healthy
image: docuseal/docuseal:latest
ports:
- 3000:3000
volumes:
- .:/data
environment:
FORCE_SSL: 'true'
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/docuseal
postgres:
image: postgres:latest
volumes:
- './pg_data:/var/lib/postgresql/data'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: docuseal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
caddy:
image: caddy:latest
command: caddy reverse-proxy --from $HOST --to app:3000
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- .:/data
environment:
- HOST=${HOST}
+1
View File
@@ -9,6 +9,7 @@ module Docuseal
DISCORD_URL = 'https://discord.com/invite/B5wg5wKk'
TWITTER_URL = 'https://twitter.com/docusealco'
TWITTER_HANDLE = '@docusealco'
SUPPORT_EMAIL = 'support@docuseal.co'
CERTS = JSON.parse(ENV.fetch('CERTS', '{}'))
+13 -18
View File
@@ -6,7 +6,7 @@ module Submissions
FONT_NAME = 'Helvetica'
INFO_CREATOR = "#{Docuseal::PRODUCT_NAME} (#{Docuseal::PRODUCT_URL})".freeze
SIGN_REASON = 'Signed by %<email>s with docuseal.co'
SIGN_REASON = 'Signed by %<email>s with DocuSeal.co'
TEXT_LEFT_MARGIN = 1
TEXT_TOP_MARGIN = 1
@@ -40,25 +40,29 @@ module Submissions
value = submitter.values[field['uuid']]
next if Array.wrap(value).compact_blank.blank?
canvas = page.canvas(type: :overlay)
case field['type']
when 'image', 'signature'
attachment = submitter.attachments.find { |a| a.uuid == value }
io = StringIO.new(download_supported_image_data(attachment))
image = Vips::Image.new_from_buffer(attachment.download, '').autorot
scale = [(area['w'] * width) / attachment.metadata['width'],
(area['h'] * height) / attachment.metadata['height']].min
scale = [(area['w'] * width) / image.width,
(area['h'] * height) / image.height].min
io = StringIO.new(image.resize([scale * 4, 1].min).write_to_buffer('.png'))
canvas.image(
io,
at: [
(area['x'] * width) + (area['w'] * width / 2) - ((attachment.metadata['width'] * scale) / 2),
height - (area['y'] * height) - (attachment.metadata['height'] * scale / 2) - (area['h'] * height / 2)
(area['x'] * width) + (area['w'] * width / 2) - ((image.width * scale) / 2),
height - (area['y'] * height) - (image.height * scale / 2) - (area['h'] * height / 2)
],
width: attachment.metadata['width'] * scale,
height: attachment.metadata['height'] * scale
width: image.width * scale,
height: image.height * scale
)
when 'file'
page[:Annots] ||= []
@@ -244,7 +248,7 @@ module Submissions
page.box.height = attachment.metadata['height'] * scale
page.canvas.image(
StringIO.new(download_supported_image_data(attachment)),
StringIO.new(attachment.preview_images.first.download),
at: [0, 0],
width: page.box.width,
height: page.box.height
@@ -253,15 +257,6 @@ module Submissions
pdf
end
def download_supported_image_data(attachment)
if SUPPORTED_IMAGE_TYPES.include?(attachment.content_type)
attachment.download
else
Vips::Image.new_from_buffer(attachment.download, '')
.write_to_buffer('.png')
end
end
def h
Rails.application.routes.url_helpers
end
+1 -1
View File
@@ -28,7 +28,7 @@ module Templates
ActiveStorage::Attachment.where(name: ATTACHMENT_NAME, record: attachment).destroy_all
image = Vips::Image.new_from_buffer(binary, '')
image = image.resize(MAX_WIDTH / image.width.to_f)
image = image.autorot.resize(MAX_WIDTH / image.width.to_f)
io = StringIO.new(image.write_to_buffer(FORMAT, Q: Q, interlace: true))