fix misskey-files service
This commit is contained in:
parent
0e9f98f627
commit
2da13bd3ee
|
@ -67,22 +67,29 @@ in {
|
|||
systemd.services.misskey-files = {
|
||||
serviceConfig.Type = "oneshot";
|
||||
wantedBy = ["misskey.service"];
|
||||
partOf = ["misskey.service"];
|
||||
after = ["home-manager-misskey.service" "network.target"];
|
||||
path = with pkgs; [bash git rsync] ++ misskeyPackages;
|
||||
path = with pkgs; [bash sudo git rsync] ++ misskeyPackages;
|
||||
|
||||
script = ''
|
||||
mkdir -p /home/misskey/misskey || true
|
||||
rsync -avh ${misskeyPackage}/ /home/misskey/misskey/ --delete --exclude node_modules
|
||||
script = let
|
||||
asMisskey = "sudo -u misskey";
|
||||
in ''
|
||||
set -e
|
||||
|
||||
(mkdir -p /home/misskey/misskey && chown misskey:users /home/misskey/misskey) || true
|
||||
|
||||
${asMisskey} rsync -arvh --delete --exclude node_modules ya${misskeyPackage}/ /home/misskey/misskey/
|
||||
chown -R misskey:users /home/misskey/misskey
|
||||
|
||||
rm -rf /home/misskey/misskey/.config
|
||||
mkdir /home/misskey/misskey/.config
|
||||
cat ${misskeyConfigFile} > /home/misskey/misskey/.config/default.yml
|
||||
${asMisskey} mkdir /home/misskey/misskey/.config
|
||||
cat ${misskeyConfigFile} | ${asMisskey} tee /home/misskey/misskey/.config/default.yml
|
||||
|
||||
ln -s /home/misskey/misskey-files /home/misskey/misskey/files
|
||||
${asMisskey} ln -s /home/misskey/misskey-files /home/misskey/misskey/files
|
||||
|
||||
cd /home/misskey/misskey
|
||||
yarn install
|
||||
NODE_ENV=production yarn build
|
||||
${asMisskey} yarn install
|
||||
${asMisskey} env NODE_ENV=production yarn build
|
||||
|
||||
chown -R misskey:users /home/misskey/misskey
|
||||
'';
|
||||
|
|
|
@ -41,7 +41,6 @@ in {
|
|||
"/var/lib/redis-rspamd"
|
||||
|
||||
# misskey
|
||||
"/home/misskey/misskey-files"
|
||||
"/var/lib/redis-misskey"
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue