fix: NixOS deployment code #254

Merged
fricklerhandwerk merged 1 commit from fricklerhandwerk/Fediversity:fix-packaging into main 2025-03-19 09:51:06 +01:00
  • simplify the configuration module

    the package attribute makes little sense to be user-configurable,
    since it will always need to be the derivation defined in this very
    repository. for debugging one may as well change the original code itself.

  • unbreak deployment

    setting CREDENTIALS_DIRECTORY disabled the systemd mechanism set up
    in the configuration module.

  • remove unneeded configuration for deployment

  • unbreak integration tests

    before that missed waiting for the service to create some
    state before running the application-level tests.

Closes Fediversity/Fediversity#101

Check https://demo.fediversity.eu to validate that there's something deployed.

- simplify the configuration module the `package` attribute makes little sense to be user-configurable, since it will always need to be the derivation defined in this very repository. for debugging one may as well change the original code itself. - unbreak deployment setting `CREDENTIALS_DIRECTORY` disabled the systemd mechanism set up in the configuration module. - remove unneeded configuration for deployment - unbreak integration tests before that missed waiting for the service to create some state before running the application-level tests. Closes https://git.fediversity.eu/Fediversity/Fediversity/issues/101 Check https://demo.fediversity.eu to validate that there's something deployed.
fricklerhandwerk force-pushed fix-packaging from 0b57a35f0a to f963ae8443 2025-03-18 18:25:59 +01:00 Compare
kiara reviewed 2025-03-18 18:36:12 +01:00
@ -25,4 +20,2 @@
package = panel;
production = true;
domain = "demo.fediversity.eu";
host = "0.0.0.0";
Owner

was this not needed?

was this not needed?
Author
Owner

Apparently not, the default is 127.0.0.1 and that works, why wouldn't it?

Apparently not, the default is `127.0.0.1` and that works, why wouldn't it?
kiara reviewed 2025-03-18 18:37:19 +01:00
@ -31,4 +24,2 @@
};
port = 8000;
settings = {
DATABASE_URL = "sqlite:///var/lib/${name}/db.sqlite3";
Owner

i imagine once in prod we switch to postgres we should specify DATABASE_URL again here?

i imagine once in prod we switch to postgres we should specify `DATABASE_URL` again here?
Author
Owner

Yep

Yep
kiara reviewed 2025-03-18 18:40:12 +01:00
@ -33,4 +26,0 @@
settings = {
DATABASE_URL = "sqlite:///var/lib/${name}/db.sqlite3";
CREDENTIALS_DIRECTORY = "/var/lib/${name}/.credentials";
STATIC_ROOT = "/var/lib/${name}/static";
Owner

are you sure this was not needed? a local runserver now gets me:

django.core.exceptions.ImproperlyConfigured: COMPRESS_ROOT defaults to STATIC_ROOT, please define either

are you sure this was not needed? a local `runserver` now gets me: > django.core.exceptions.ImproperlyConfigured: COMPRESS_ROOT defaults to STATIC_ROOT, please define either
Author
Owner

Yes, sorry, fixed. Ideally we'd do this whole configuration bit in exactly one shape, but as discussed verbally this is sightly tricky and I won't get into it right now.

Yes, sorry, fixed. Ideally we'd do this whole configuration bit in exactly one shape, but as discussed verbally this is sightly tricky and I won't get into it right now.
kiara requested changes 2025-03-18 18:43:06 +01:00
kiara left a comment
Owner

thanks for cleaning the mess i left 😭, tho this version broke local dev

thanks for cleaning the mess i left 😭, tho this version broke local dev
fricklerhandwerk force-pushed fix-packaging from f963ae8443 to 3364d6c972 2025-03-19 09:49:12 +01:00 Compare
fricklerhandwerk merged commit 3364d6c972 into main 2025-03-19 09:51:06 +01:00
fricklerhandwerk deleted branch fix-packaging 2025-03-19 09:51:06 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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: fediversity/fediversity#254
No description provided.