set working dir for systemd service
This commit is contained in:
@@ -90,10 +90,10 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop
|
||||
|
||||
dstPdf := ""
|
||||
pdf, err := ctx.FormFile("pdf")
|
||||
fmt.Println(pdf)
|
||||
|
||||
if err == nil {
|
||||
dstPdf = filepath.Join("static/uploads", pdf.Filename)
|
||||
fmt.Println("Saving pdf at ", dstPdf)
|
||||
if err := ctx.SaveUploadedFile(pdf, dstPdf); err != nil {
|
||||
return models.ShopItem{}, fmt.Errorf("Could not save PDF")
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
description = "zineshop daemon";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
WorkingDirectory = "/var/lib/zineshop";
|
||||
ExecStart = pkgs.writeScript "start-zineshop" ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
PATH="$PATH:${lib.makeBinPath [ pkgs.poppler_utils ]}"
|
||||
@@ -101,9 +102,9 @@
|
||||
|
||||
preStart = ''
|
||||
mkdir -m 0770 -p "/var/lib/zineshop"
|
||||
chown zineshop:zineshop "/var/lib/zineshop"
|
||||
cp -r ${zineshop-pkg}/views /var/lib/zineshop/
|
||||
cp -r ${zineshop-pkg}/static /var/lib/zineshop/
|
||||
chown zineshop:zineshop "/var/lib/zineshop"
|
||||
'';
|
||||
|
||||
wantedBy = [ "default.target" ];
|
||||
|
||||
Reference in New Issue
Block a user