diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9cd27a22..9c2f57bd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,6 +30,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Create .version file + run: echo ${{ github.ref_name }} > .version + - name: Login to Docker Hub uses: docker/login-action@v2 with: diff --git a/.gitignore b/.gitignore index dd1db6a5..c266ed37 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ yarn-debug.log* .env .DS_Store +.version /coverage /attachments diff --git a/Dockerfile b/Dockerfile index fcc13c8c..b3606341 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ COPY ./log ./log COPY ./lib ./lib COPY ./public ./public COPY ./tmp ./tmp -COPY LICENSE README.md Rakefile config.ru ./ +COPY LICENSE README.md Rakefile config.ru .version ./ COPY --from=fonts /fonts/LiberationSans-Regular.ttf /fonts/LiberationSans-Bold.ttf /fonts/DancingScript-Regular.otf /fonts/OFL.txt /fonts COPY --from=webpack /app/public/packs ./public/packs diff --git a/app/views/pages/landing.html.erb b/app/views/pages/landing.html.erb index 97ccf250..bd459da6 100644 --- a/app/views/pages/landing.html.erb +++ b/app/views/pages/landing.html.erb @@ -4,11 +4,16 @@
<%= render 'shared/logo', width: '100', height: '100' %> -

+

DocuSeal

+ <% if Docuseal.version.present? %> + + v<%= Docuseal.version %> + + <% end %>
-

+

A self-hosted and open-source web platform that provides secure and efficient digital document signing and processing.

@@ -62,7 +67,8 @@

Open Source

- Source code is available under github.com/docusealco.
Open-source contributors are always ready to help! + Source code is available under github.com/docusealco.
+ Open-source contributors are always ready to help!

diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index b833e151..333ad2e3 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -116,6 +116,11 @@ <%= Docuseal::SUPPORT_EMAIL %> + <% if Docuseal.version.present? %> + + v<%= Docuseal.version %> + + <% end %> <% end %> diff --git a/lib/docuseal.rb b/lib/docuseal.rb index 0fecc306..588c1ebc 100644 --- a/lib/docuseal.rb +++ b/lib/docuseal.rb @@ -29,6 +29,7 @@ module Docuseal CERTS = JSON.parse(ENV.fetch('CERTS', '{}')) TIMESERVER_URL = ENV.fetch('TIMESERVER_URL', nil) + VERSION_FILE_PATH = Rails.root.join('.version') DEFAULT_URL_OPTIONS = { host: HOST, @@ -37,6 +38,10 @@ module Docuseal module_function + def version + @version ||= VERSION_FILE_PATH.read.strip if VERSION_FILE_PATH.exist? + end + def multitenant? ENV['MULTITENANT'] == 'true' end