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 := ""
|
dstPdf := ""
|
||||||
pdf, err := ctx.FormFile("pdf")
|
pdf, err := ctx.FormFile("pdf")
|
||||||
fmt.Println(pdf)
|
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dstPdf = filepath.Join("static/uploads", pdf.Filename)
|
dstPdf = filepath.Join("static/uploads", pdf.Filename)
|
||||||
|
fmt.Println("Saving pdf at ", dstPdf)
|
||||||
if err := ctx.SaveUploadedFile(pdf, dstPdf); err != nil {
|
if err := ctx.SaveUploadedFile(pdf, dstPdf); err != nil {
|
||||||
return models.ShopItem{}, fmt.Errorf("Could not save PDF")
|
return models.ShopItem{}, fmt.Errorf("Could not save PDF")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
description = "zineshop daemon";
|
description = "zineshop daemon";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
WorkingDirectory = "/var/lib/zineshop";
|
||||||
ExecStart = pkgs.writeScript "start-zineshop" ''
|
ExecStart = pkgs.writeScript "start-zineshop" ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
PATH="$PATH:${lib.makeBinPath [ pkgs.poppler_utils ]}"
|
PATH="$PATH:${lib.makeBinPath [ pkgs.poppler_utils ]}"
|
||||||
@@ -101,9 +102,9 @@
|
|||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0770 -p "/var/lib/zineshop"
|
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}/views /var/lib/zineshop/
|
||||||
cp -r ${zineshop-pkg}/static /var/lib/zineshop/
|
cp -r ${zineshop-pkg}/static /var/lib/zineshop/
|
||||||
|
chown zineshop:zineshop "/var/lib/zineshop"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
|
|||||||
Reference in New Issue
Block a user