modules: contrib: Add cryptpad module
This is a module to deploy cryptpad locally - as it is, this is only intended for dev purposes, not for production environments
This commit is contained in:
51
modules/contrib/cryptpad/main.mcl
Normal file
51
modules/contrib/cryptpad/main.mcl
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import "fmt"
|
||||||
|
|
||||||
|
class deploy() {
|
||||||
|
|
||||||
|
$pkgname = "cryptpad"
|
||||||
|
$installdir = "/opt/"
|
||||||
|
$gitbranch = "2025.3.1-rc"
|
||||||
|
$gitclonecommand = fmt.printf("git clone -b %s --depth 1 https://github.com/cryptpad/cryptpad.git %s", $gitbranch, $pkgname)
|
||||||
|
$shell = "/bin/bash"
|
||||||
|
|
||||||
|
exec "cryptpad-fetch" {
|
||||||
|
cwd => $installdir,
|
||||||
|
|
||||||
|
ifshell => $shell,
|
||||||
|
ifcmd => fmt.printf("test ! -d %s%s", $installdir, $pkgname),
|
||||||
|
|
||||||
|
shell => $shell,
|
||||||
|
cmd => $gitclonecommand,
|
||||||
|
}
|
||||||
|
|
||||||
|
exec "cryptpad-install" {
|
||||||
|
cwd => fmt.printf("%s%s", $installdir, $pkgname),
|
||||||
|
|
||||||
|
ifshell => $shell,
|
||||||
|
ifcmd => fmt.printf("test -d %s%s", $installdir, $pkgname),
|
||||||
|
|
||||||
|
shell => $shell,
|
||||||
|
cmd => "npm install && npm run install:components",
|
||||||
|
|
||||||
|
Depend => Exec["cryptpad-fetch"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file "/opt/cryptpad/config/config.js" {
|
||||||
|
source => "/opt/cryptpad/config/config.example.js",
|
||||||
|
state => "exists",
|
||||||
|
|
||||||
|
Depend => Exec["cryptpad-install"],
|
||||||
|
}
|
||||||
|
|
||||||
|
exec "cryptpad-run" {
|
||||||
|
cwd => fmt.printf("%s%s", $installdir, $pkgname),
|
||||||
|
|
||||||
|
ifshell => $shell,
|
||||||
|
ifcmd => fmt.printf("test -d %s%s", $installdir, $pkgname),
|
||||||
|
|
||||||
|
shell => $shell,
|
||||||
|
cmd => "npm run dev",
|
||||||
|
|
||||||
|
Depend => File["/opt/cryptpad/config/config.js"],
|
||||||
|
}
|
||||||
|
}
|
||||||
0
modules/contrib/cryptpad/metadata.yaml
Normal file
0
modules/contrib/cryptpad/metadata.yaml
Normal file
Reference in New Issue
Block a user