Compare commits

...
11 Commits
Author SHA1 Message Date
Alex Turchyn 4ffd198505 adjust demo 2023-07-12 01:36:33 +03:00
Alex Turchyn d595e7d52b adjust readme 2023-07-10 21:15:59 +03:00
Alex Turchyn aabbf2dc7f update Discord invite link 2023-07-10 00:13:49 +03:00
Alex Turchyn 95e4bf945c use sha256 on rails key_derivation_salt 2023-07-09 22:00:22 +03:00
Alex Turchyn 15523d8377 do not allow to remove current user 2023-07-09 16:30:51 +03:00
Alex Turchyn e2cda2bd5c update schema 2023-07-09 16:30:51 +03:00
Alex Turchyn 12b98fdcd4 move DigitalOcean button to another repository 2023-07-09 15:05:35 +03:00
Alex Turchyn be208a1080 disable RedundantConstantBase in erblint 2023-07-09 15:00:32 +03:00
Alex Turchyn 9268c60f9e remove old preview image 2023-07-09 14:59:32 +03:00
Alex Turchyn 52b310e1a8 add lang attrs 2023-07-09 14:59:32 +03:00
Alex Turchyn 16757acbe0 increase tokens length 2023-07-09 14:59:31 +03:00
24 changed files with 122 additions and 59 deletions

No files matched your search

-18
View File
@@ -1,18 +0,0 @@
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
+2
View File
@@ -30,3 +30,5 @@ linters:
Enabled: false
Style/ZeroLengthPredicate:
Enabled: false
Style/RedundantConstantBase:
Enabled: false
+3 -3
View File
@@ -14,7 +14,7 @@
<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">
<a href="https://discord.gg/qygYCDGck9">
<img src="https://img.shields.io/discord/1125112641170448454?logo=discord"/>
</a>
<a href="https://twitter.com/intent/follow?screen_name=docusealco">
@@ -46,7 +46,7 @@ DocuSeal is an open source platform that provides secure and efficient digital d
| 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) |
| [<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-digitalocean/tree/master&refcode=421d50f53990) |
#### Docker
@@ -64,7 +64,7 @@ Download docker-compose.yml into your private server:
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):
Run the app under a custom domain over https using docker compose (make sure your DNS points to the server to automatically issue ssl certs with Caddy):
```sh
HOST=your-domain-name.com docker-compose up
```
+1 -1
View File
@@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
private
def sign_in_for_demo
sign_in(User.first) unless signed_in?
sign_in(User.order('random()').take) unless signed_in?
end
def current_account
+9 -3
View File
@@ -24,24 +24,30 @@ class UsersController < ApplicationController
if @user.save
UserMailer.invitation_email(@user).deliver_later!
redirect_to settings_users_path, notice: 'User has been invited.'
redirect_to settings_users_path, notice: 'User has been invited'
else
render turbo_stream: turbo_stream.replace(:modal, template: 'users/new'), status: :unprocessable_entity
end
end
def update
return redirect_to settings_users_path, notice: 'Unable to update user.' if Docuseal.demo?
if @user.update(user_params.compact_blank)
redirect_to settings_users_path, notice: 'User has been updated.'
redirect_to settings_users_path, notice: 'User has been updated'
else
render turbo_stream: turbo_stream.replace(:modal, template: 'users/edit'), status: :unprocessable_entity
end
end
def destroy
if Docuseal.demo? || @user.id == current_user.id
return redirect_to settings_users_path, notice: 'Unable to remove user'
end
@user.update!(deleted_at: Time.current)
redirect_to settings_users_path, notice: 'User has been removed.'
redirect_to settings_users_path, notice: 'User has been removed'
end
private
+1
View File
@@ -14,6 +14,7 @@ window.customElements.define('submission-form', class extends HTMLElement {
authenticityToken: this.dataset.authenticityToken,
canSendEmail: this.dataset.canSendEmail === 'true',
isDirectUpload: this.dataset.isDirectUpload === 'true',
isDemo: this.dataset.isDemo === 'true',
values: reactive(JSON.parse(this.dataset.values)),
attachments: reactive(JSON.parse(this.dataset.attachments)),
fields: JSON.parse(this.dataset.fields)
+18 -1
View File
@@ -40,6 +40,17 @@
Download
</span>
</button>
<a
v-if="isDemo"
target="_blank"
href="https://github.com/docusealco/docuseal"
class="white-button flex items-center space-x-1 w-full"
>
<IconBrandGithub />
<span>
Star on Github
</span>
</a>
</div>
<div class="text-center mt-4">
Signed with
@@ -53,13 +64,14 @@
</template>
<script>
import { IconCircleCheck, IconMail, IconDownload, IconInnerShadowTop } from '@tabler/icons-vue'
import { IconCircleCheck, IconBrandGithub, IconMail, IconDownload, IconInnerShadowTop } from '@tabler/icons-vue'
export default {
name: 'FormCompleted',
components: {
IconCircleCheck,
IconInnerShadowTop,
IconBrandGithub,
IconMail,
IconDownload
},
@@ -68,6 +80,11 @@ export default {
type: String,
required: true
},
isDemo: {
type: Boolean,
required: false,
default: false
},
canSendEmail: {
type: Boolean,
required: false,
+6
View File
@@ -246,6 +246,7 @@
</form>
<FormCompleted
v-else
:is-demo="isDemo"
:can-send-email="canSendEmail"
:submitter-slug="submitterSlug"
/>
@@ -317,6 +318,11 @@ export default {
required: true,
default: false
},
isDemo: {
type: Boolean,
required: true,
default: false
},
values: {
type: Object,
required: false,
+2 -2
View File
@@ -13,7 +13,7 @@
# slug :string not null
# ua :string
# uuid :string not null
# values :string not null
# values :text not null
# created_at :datetime not null
# updated_at :datetime not null
# submission_id :bigint not null
@@ -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
+4 -4
View File
@@ -6,11 +6,11 @@
#
# id :bigint not null, primary key
# deleted_at :datetime
# fields :string not null
# fields :text not null
# name :string not null
# schema :string not null
# schema :text not null
# slug :string not null
# submitters :string not null
# submitters :text not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
@@ -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
View File
@@ -1,3 +1,4 @@
<% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %>
<% if @templates.any? %>
<div class="flex justify-between mb-4 items-center">
<h1 class="text-4xl font-bold">Templates</h1>
+1 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="docuseal">
<html data-theme="docuseal" lang="en">
<head>
<title>
DocuSeal | Open Source Document Filling and Signing
@@ -15,7 +15,6 @@
<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
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="docuseal">
<html data-theme="docuseal" lang="en">
<head>
<title>
DocuSeal | Open Source Document Filling and Signing
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="docuseal">
<html data-theme="docuseal" lang="en">
<head>
<title>
DocuSeal | Open Source Document Filling and Signing
+8 -6
View File
@@ -1,9 +1,11 @@
<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 class="mx-auto mt-1.5">
<div class="py-3 rounded-2xl flex items-center justify-between mx-4 md:mx-0">
<div class="w-full text-center">
<span class="font-bold">DocuSeal Demo Environment</span>
<br>
Feel free to
<a href="<%= new_template_path %>" data-turbo-frame="modal" class="inline underline font-medium">create a new template</a> document form or
<a href="<%= start_form_url(slug: ::Template.first&.slug) %>" target="_blank" class="inline underline font-medium">submit the existing one</a> 😊
</div>
</div>
</div>
+10
View File
@@ -0,0 +1,10 @@
<a href="https://github.com/docusealco/docuseal" class="btn btn-neutral btn-sm btn-outline inline-flex items-center justify-center" target="_blank" alt="Star on GitHub" style="height: 37px">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg>
</span>
<span class="flex">
<span class="hidden lg:block">Star on&nbsp</span>GitHub
</span>
</a>
+11 -5
View File
@@ -4,13 +4,19 @@
<%= render 'shared/logo' %>
<span>DocuSeal</span>
</a>
<a href="<%= Docuseal::GITHUB_URL %>" target="_blank" class="inline">
<img alt="GitHub Repo stars" src="https://www.docuseal.co/github-badge.svg" style="height: 22px">
</a>
<% unless Docuseal.demo? %>
<a href="<%= Docuseal::GITHUB_URL %>" target="_blank" class="inline">
<img alt="GitHub Repo stars" src="https://www.docuseal.co/github-badge.svg" style="height: 22px">
</a>
<% end %>
</div>
<% if signed_in? %>
<div class="space-x-6">
<%= link_to 'Settings', settings_profile_index_path, class: 'hidden md:inline font-medium text-lg' %>
<div class="space-x-4 flex items-center">
<% if Docuseal.demo? %>
<%= render 'shared/github_button' %>
<% else %>
<%= link_to 'Settings', settings_profile_index_path, class: 'hidden md:inline font-medium text-lg mr-2' %>
<% end %>
<div class="dropdown dropdown-end">
<label tabindex="0" class="cursor-pointer bg-base-content text-purple-300 rounded-full p-2 w-9 justify-center flex">
<span class="text-sm align-text-top"><%= current_user.initials %></span>
+1 -1
View File
@@ -33,7 +33,7 @@
<div class="mx-auto" style="max-width: 1000px">
<div class="relative md:mx-32">
<div id="form_container" class="shadow-md bg-base-100 absolute bottom-0 md:bottom-4 w-full border border-base-200 border p-4 rounded">
<submission-form data-is-direct-upload="<%= Docuseal.active_storage_public? %>" data-submitter-uuid="<%= @submitter.uuid %>" data-submitter-slug="<%= @submitter.slug %>" data-can-send-email="<%= Accounts.can_send_emails?(Struct.new(:id).new(@submitter.submission.template.account_id)) %>" data-attachments="<%= attachments_index.values.select { |e| e.record_id == @submitter.id }.to_json(only: %i[uuid], methods: %i[url filename content_type]) %>" data-fields="<%= @submitter.submission.template.fields.select { |f| f['submitter_uuid'] == @submitter.uuid }.to_json %>" data-values="<%= @submitter.values.to_json %>" data-authenticity-token="<%= form_authenticity_token %>"></submission-form>
<submission-form data-is-demo="<%= Docuseal.demo? %>" data-is-direct-upload="<%= Docuseal.active_storage_public? %>" data-submitter-uuid="<%= @submitter.uuid %>" data-submitter-slug="<%= @submitter.slug %>" data-can-send-email="<%= Accounts.can_send_emails?(Struct.new(:id).new(@submitter.submission.template.account_id)) %>" data-attachments="<%= attachments_index.values.select { |e| e.record_id == @submitter.id }.to_json(only: %i[uuid], methods: %i[url filename content_type]) %>" data-fields="<%= @submitter.submission.template.fields.select { |f| f['submitter_uuid'] == @submitter.uuid }.to_json %>" data-values="<%= @submitter.values.to_json %>" data-authenticity-token="<%= form_authenticity_token %>"></submission-form>
</div>
</div>
</div>
+11 -5
View File
@@ -157,13 +157,19 @@
<% else %>
<div class="card bg-base-200">
<div class="card-body text-center py-16">
<div class="max-w-md mx-auto">
<div class="max-w-lg 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 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>
<% end %>
<div class="space-x-2">
<%= 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>
<% end %>
<%= link_to start_form_url(slug: @template.slug), class: 'white-button mt-6', target: '_blank', rel: 'noopener' do %>
<%= svg_icon('writing', class: 'w-6 h-6') %>
<span class="mr-1">Submit it Yourself</span>
<% end %>
</div>
</div>
</div>
</div>
+1 -1
View File
@@ -110,7 +110,7 @@ Rails.application.configure do
config.active_record.encryption = {
primary_key: encryption_secret.first(32),
deterministic_key: encryption_secret.last(32),
key_derivation_salt: encryption_secret
key_derivation_salt: Digest::SHA256.hexdigest(encryption_secret)
}
# Do not dump schema after migrations.
+4 -4
View File
@@ -86,7 +86,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_01_075115) do
t.string "uuid", null: false
t.string "email", null: false
t.string "slug", null: false
t.string "values", null: false
t.text "values", null: false
t.string "ua"
t.string "ip"
t.datetime "sent_at"
@@ -102,9 +102,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_01_075115) do
create_table "templates", force: :cascade do |t|
t.string "slug", null: false
t.string "name", null: false
t.string "schema", null: false
t.string "fields", null: false
t.string "submitters", null: false
t.text "schema", null: false
t.text "fields", null: false
t.text "submitters", null: false
t.bigint "author_id", null: false
t.bigint "account_id", null: false
t.datetime "deleted_at"
+25
View File
@@ -3,6 +3,31 @@
module Accounts
module_function
def create_duplicate(account)
new_account = account.dup
new_user = account.users.first.dup
new_user.account = new_account
new_user.encrypted_password = SecureRandom.hex
new_user.email = "#{SecureRandom.hex}@docuseal.co"
account.templates.each do |template|
new_template = template.dup
new_template.account = new_account
new_template.slug = SecureRandom.base58(10)
new_template.save!
Templates::CloneAttachments.call(template: new_template, original_template: template)
end
new_user.save!(validate: false)
new_account
end
def load_signing_certs(account)
certs =
if Docuseal.multitenant?
+1 -1
View File
@@ -6,7 +6,7 @@ module Docuseal
PRODUCT_NAME = 'DocuSeal'
DEFAULT_APP_URL = 'http://localhost:3000'
GITHUB_URL = 'https://github.com/docusealco/docuseal'
DISCORD_URL = 'https://discord.com/invite/B5wg5wKk'
DISCORD_URL = 'https://discord.gg/qygYCDGck9'
TWITTER_URL = 'https://twitter.com/docusealco'
TWITTER_HANDLE = '@docusealco'
SUPPORT_EMAIL = 'support@docuseal.co'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB