Skip to content

Commit

Permalink
Deploy apps to app root, not doc root
Browse files Browse the repository at this point in the history
  • Loading branch information
sibprogrammer committed Jun 24, 2021
1 parent a55d4ae commit c79d90c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions internal/actions/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
)

func getPrereq(host types.Server, domain types.Domain) (*types.FtpUser, *string, *string, error) {
var fullpath string
var docroot string
var fullPath string
var docRoot string
// TODO: Ideally, there should be no need to do this
{
api := factory.GetDomainManagement(host.GetServerAuth())
Expand All @@ -26,9 +26,9 @@ func getPrereq(host types.Server, domain types.Domain) (*types.FtpUser, *string,
return nil, nil, nil, err
}

fullpath = i.WWWRoot
fullPath = i.WWWRoot
parts := strings.Split(i.WWWRoot, domain.Name)
docroot = parts[len(parts)-1]
docRoot = parts[len(parts)-1]
}

ftp := FindCachedFtpUser(domain)
Expand All @@ -40,7 +40,10 @@ func getPrereq(host types.Server, domain types.Domain) (*types.FtpUser, *string,
}
}

return ftp, &docroot, &fullpath, nil
// assume the parent directory as an app root directory
appRoot := filepath.Dir(docRoot)

return ftp, &appRoot, &fullPath, nil
}

func UploadFileToRoot(host types.Server, domain types.Domain, ovw bool, file string) (string, error) {
Expand Down

0 comments on commit c79d90c

Please sign in to comment.