docusealco / docuseal

Open source DocuSign alternative. Create, fill, and sign digital documents ✍️
https://www.docuseal.co
GNU Affero General Public License v3.0
5.7k stars 378 forks source link

have cache at another location #131

Closed Stunkymonkey closed 8 months ago

Stunkymonkey commented 8 months ago

I am currently packaging this application for NixOS. Generating the package is done. Running it is not yet working (maybe I am not clever enoth).

Looking at the current situation the application always expect the tmp-folder just besides the application. Is it supported/possible to define an environment variable (like RAILS_CACHE) to have the tmp stored somewhere else like /tmp/docuseal or /var/lib/docuseal/tmp? The problem with NixOS, that the application is write-protected and therefore throws an error currently.

currently i have set the following environment variables:

RAILS_ENV = "production";
NODE_ENV = "production";
WORKDIR = "/var/lib/docuseal";
FORCE_SSL = "false";
SECRET_KEY_BASE = "xxxxx";

might be beneficial for the current docker setup to enable this as well.

omohokcoj commented 8 months ago

@Stunkymonkey afaik it's not possible to change rails cache folder. I'm not sure if that's actually a good idea to move rails cache to /tmp - rails cache folder contains some files/folders that can be persistent after reboot (bootsnap cache for instance to load the app faster). But you can create a symlink to make rails cache stored in /tmp if needed

Stunkymonkey commented 8 months ago

I am fine in placing them to /var/lib/docuseal.

Tomorrow I will try symlinking the tmp folder and will report my outcome.

Stunkymonkey commented 8 months ago

so symlinking does not work, but instead I created the folders myself before running the application. I then had to adjust where the pid-file is located (/var/lib/docuseal) and it started.

I will close this issue once resolved. Seems solvable for me right now.

Stunkymonkey commented 8 months ago

Ok I got it working with postgresql, but I am failing to support sqlite:

machine # [   23.976390] rails[714]: => Booting Puma
machine # [   23.977092] rails[714]: => Rails 7.0.7 application starting in production
machine # [   23.977812] rails[714]: => Run `bin/rails server --help` for more startup options
machine # [   26.059495] rails[714]: E, [2023-11-11T14:35:42.341950 #714] ERROR -- : Database URL cannot be empty
machine # [   26.060509] rails[714]: Exiting

my question @omohokcoj here: does the env-variable have to be "unset" (null) or "empty" ("") to get sqlite working?

current progress: https://github.com/Stunkymonkey/nixpkgs/tree/docuseal-1.2.3

omohokcoj commented 8 months ago

@Stunkymonkey yeah you need to unset the DATABASE_URL env variable to use sqlite

Stunkymonkey commented 8 months ago

thanks a lot for your support.

I will create a PR to have this packaged and available at NixOS as well.