[feat] Environment variable to read config file location #390

Closed
opened 2023-11-18 04:34:52 +01:00 by pyrox · 6 comments
Member

As discussed on matrix, adding an environment variable to set the location of the config file would be useful for things like a NixOS module. Perhaps naming it ICESHRIMP_CONFIG or something self-explanatory would be the best option?

As discussed on matrix, adding an environment variable to set the location of the config file would be useful for things like a NixOS module. Perhaps naming it `ICESHRIMP_CONFIG` or something self-explanatory would be the best option?
Author
Member

As an addendum to this, it expects to be able to write to a files directory inside the package, could this be configurable with an environment variable as well? ICESHRIMP_FILES_DIRECTORY, maybe?

Of course, implemented as a fallback if it's unwritable, as is the case with Nix-based packages.

As an addendum to this, it expects to be able to write to a files directory inside the package, could this be configurable with an environment variable as well? `ICESHRIMP_FILES_DIRECTORY`, maybe? Of course, implemented as a fallback if it's unwritable, as is the case with Nix-based packages.
Author
Member

One last one, adding an ICESHRIMP_CUSTOM variable to control the location of the /custom directory would make this easier, as then we don't need to rebuild the package every time the custom directory is changed(which means rebuilding re2, argon2, and sharp from source, as well as wasting a decent chunk of disk space for each copy of iceshrimp)

One last one, adding an `ICESHRIMP_CUSTOM` variable to control the location of the `/custom` directory would make this easier, as then we don't need to rebuild the package every time the custom directory is changed(which means rebuilding re2, argon2, and sharp from source, as well as wasting a decent chunk of disk space for each copy of iceshrimp)
pyrox added the
enhancement
backend
labels 2023-11-19 01:14:30 +01:00
Owner

Working on this right now, need to investigate how .cache is handled, I think that's the only other location it ever tries to write to

Working on this right now, need to investigate how .cache is handled, I think that's the only other location it ever tries to write to
Owner

Implemented in e5276e2765. Caution: the custom/assets folder is loaded at buildtime (or when running yarn gulp), not at runtime. If this causes problems with nix, please open a new issue. I'll investigate the .cache situation now.

Implemented in e5276e27651ed2ba0715e29d141e7f4550070507. Caution: the custom/assets folder is loaded at buildtime (or when running `yarn gulp`), not at runtime. If this causes problems with nix, please open a new issue. I'll investigate the .cache situation now.
zotan closed this issue 2023-11-23 20:32:22 +01:00
Owner

Cache situation: Set COREPACK_HOME and YARN_HOME to a writable directory on startup.

Cache situation: Set `COREPACK_HOME` and `YARN_HOME` to a writable directory on startup.
Owner

Check

Environment="COREPACK_HOME=/var/lib/iceshrimp/cache/corepack"
Environment="YARN_HOME=/var/lib/iceshrimp/cache/yarn"
Environment="ICESHRIMP_CONFIG=/etc/iceshrimp/configuration.yml"
Environment="ICESHRIMP_MEDIA_DIR=/var/lib/iceshrimp/files"
Environment="ICESHRIMP_CUSTOM_DIR=/usr/share/iceshrimp/custom"

for details.

Check https://iceshrimp.dev/iceshrimp/packaging/src/commit/492b78a9cc509770d174ecf14b413963d4aa6914/archlinux/iceshrimp-git/iceshrimp.service#L15-L19 for details.
Sign in to join this conversation.
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: iceshrimp/iceshrimp#390
No description provided.