Compare commits
1 commit
main
...
synapse-s3
Author | SHA1 | Date | |
---|---|---|---|
c4d3a8f86d |
4 changed files with 35 additions and 1 deletions
modules/matrix
overlays
secrets
|
@ -281,7 +281,10 @@ in
|
|||
"redis"
|
||||
];
|
||||
|
||||
plugins = [ config.services.matrix-synapse.package.plugins.matrix-synapse-shared-secret-auth ];
|
||||
plugins = [
|
||||
config.services.matrix-synapse.package.plugins.matrix-synapse-s3-storage-provider
|
||||
config.services.matrix-synapse.package.plugins.matrix-synapse-shared-secret-auth
|
||||
];
|
||||
};
|
||||
|
||||
services.matrix-authentication-service = {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
element-stickerpicker = prev.callPackage ./pkgs/element-stickerpicker {
|
||||
inherit (inputs) element-stickers maunium-stickerpicker;
|
||||
};
|
||||
matrix-cache-gc = prev.callPackage ./pkgs/matrix-cache-gc.nix { inherit inputs; };
|
||||
nextcloud-skeleton = prev.callPackage ./pkgs/nextcloud-skeleton { };
|
||||
}
|
||||
)
|
||||
|
|
30
overlays/pkgs/matrix-cache-gc.nix
Normal file
30
overlays/pkgs/matrix-cache-gc.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
inputs,
|
||||
writeShellApplication,
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "matrix-cache-gc";
|
||||
text = ''
|
||||
## CONFIGURATION ##
|
||||
#AWS_ACCESS_KEY_ID=GKxxx
|
||||
#AWS_SECRET_ACCESS_KEY=xxxx
|
||||
AWS_ENDPOINT_URL=https://buckets.pub.solar
|
||||
S3_BUCKET=matrix-synapse
|
||||
MEDIA_STORE=/var/lib/matrix-synapse/media_store
|
||||
PG_USER=matrix-synapse
|
||||
PG_DB=matrix
|
||||
PG_HOST=/run/postgresql
|
||||
|
||||
## CODE ##
|
||||
cat > database.yaml <<EOF
|
||||
user: $PG_USER
|
||||
database: $PG_DB
|
||||
host: $PG_HOST
|
||||
EOF
|
||||
|
||||
alias s3_media_upload=${inputs.nixpkgs.legacyPackages.x86_64-linux.matrix-synapse.plugins.matrix-synapse-s3-storage-provider}/bin/s3_media_upload
|
||||
s3_media_upload update-db 1d
|
||||
s3_media_upload --no-progress check-deleted "$MEDIA_STORE"
|
||||
s3_media_upload --no-progress upload "$MEDIA_STORE" "$S3_BUCKET" --delete --endpoint-url "$AWS_ENDPOINT_URL"
|
||||
'';
|
||||
}
|
Binary file not shown.
Loading…
Add table
Reference in a new issue