Add customize volume

This commit is contained in:
Jill 2024-04-17 23:48:40 +02:00
parent 50704483fd
commit 9bec8cf40f
Signed by: KokaKiwi
GPG key ID: 09A5A2688F13FAC1
6 changed files with 42 additions and 23 deletions

View file

@ -230,7 +230,7 @@ module.exports = {
* Specify a directory where files should be stored.
* It will be created automatically if it does not already exist.
*/
filePath: '/data/files',
filePath: '/cryptpad/data/files',
/* CryptPad offers the ability to archive data for a configurable period
* before deleting it, allowing a means of recovering data in the event
@ -239,41 +239,41 @@ module.exports = {
* To set the location of this archive directory to a custom value, change
* the path below:
*/
archivePath: '/data/archive',
archivePath: '/cryptpad/data/archive',
/* CryptPad allows logged in users to request that particular documents be
* stored by the server indefinitely. This is called 'pinning'.
* Pin requests are stored in a pin-store. The location of this store is
* defined here.
*/
pinPath: '/data/pins',
pinPath: '/cryptpad/data/pins',
/* if you would like the list of scheduled tasks to be stored in
a custom location, change the path below:
*/
taskPath: '/data/tasks',
taskPath: '/cryptpad/data/tasks',
/* if you would like users' authenticated blocks to be stored in
a custom location, change the path below:
*/
blockPath: '/data/block',
blockPath: '/cryptpad/data/block',
/* CryptPad allows logged in users to upload encrypted files. Files/blobs
* are stored in a 'blob-store'. Set its location here.
*/
blobPath: '/data/blob',
blobPath: '/cryptpad/data/blob',
/* CryptPad stores incomplete blobs in a 'staging' area until they are
* fully uploaded. Set its location here.
*/
blobStagingPath: '/data/blobstage',
blobStagingPath: '/cryptpad/data/blobstage',
decreePath: '/data/decrees',
decreePath: '/cryptpad/data/decrees',
/* CryptPad supports logging events directly to the disk in a 'logs' directory
* Set its location here, or set it to false (or nothing) if you'd rather not log
*/
logPath: '/data/logs',
logPath: '/cryptpad/data/logs',
/* =====================
* Debugging

View file

@ -91,7 +91,13 @@ in buildNpmPackage rec {
ln -s $onlyOffice www/common/onlyoffice/dist
'';
postBuild = ''
rm -rf customize
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R . $out/
@ -101,6 +107,8 @@ in buildNpmPackage rec {
makeWrapper ${lib.getExe nodejs} $out/bin/cryptpad-server \
--chdir $out \
--add-flags server.js
runHook postInstall
'';
meta = {

View file

@ -1,10 +1,10 @@
let
{ name ? "deuxfleurs/cryptpad"
, tag ? "nix-latest"
}: let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
in rec {
cryptpad = pkgs.callPackage ./default.nix {
withOnlyOffice = false;
};
cryptpad = pkgs.callPackage ./default.nix {};
docker = pkgs.callPackage ./docker.nix {
inherit cryptpad;
};

View file

@ -2,11 +2,12 @@ services:
app:
image: cryptpad:nix-latest
environment:
CRYPTPAD_CONFIG: '/config.js'
CRYPTPAD_CONFIG: '/cryptpad/config.js'
ports:
- '3000:3000'
- '3001:3001'
- '3003:3003'
volumes:
- ./config.js:/config.js:ro
- ./_data:/data
- ./config.js:/cryptpad/config.js:ro
- ./_customize:/cryptpad/customize:ro
- ./_data:/cryptpad/data

View file

@ -1,17 +1,27 @@
{ pkgs ? import <nixpkgs> {}
, name ? "cryptpad"
, tag ? "nix-latest"
, withOnlyOffice ? true
, cryptpad ? pkgs.callPackage ./default.nix {
inherit withOnlyOffice;
}
}:
pkgs.dockerTools.buildImage {
, cryptpad ? pkgs.callPackage ./default.nix { inherit withOnlyOffice; }
}: let
cryptpad' = cryptpad.overrideAttrs {
postInstall = ''
ln -sf /cryptpad/customize $out/customize
'';
};
in pkgs.dockerTools.buildImage {
inherit name tag;
config = {
Cmd = [
(pkgs.lib.getExe cryptpad)
(pkgs.lib.getExe cryptpad')
];
Volumes = {
"/cryptpad/customize" = {};
};
};
}

View file

@ -186,7 +186,7 @@ let
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
}: {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;