Skip to content

Commit 867a8d3

Browse files
author
ohumeniuk
committed
change letsencrypt command
1 parent d74f4f6 commit 867a8d3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

eFormAPI/Installation/CustomActions/CustomAction.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ public static ActionResult InstallCA(Session session)
118118
SaveInstances(webApiName);
119119
IncrementProgressBar(session);
120120

121-
if (session.CustomActionData["GENERATESSL"]== "1")
122-
RunProcess(Path.Combine(installFolder, "letsencrypt\\letsencrypt.exe"), $"--plugin manual --manualhost {uiName} --webroot {session.CustomActionData["INSTALLFOLDER"].TrimEnd('\\')}");
121+
if (session.CustomActionData["GENERATESSL"] == "1")
122+
{
123+
var siteId = GetSiteId(uiName);
124+
RunProcess(Path.Combine(installFolder, "letsencrypt\\letsencrypt.exe"), $"--plugin iissite --siteid { siteId } --accepttos --usedefaulttaskuser");
125+
}
123126

124127
DeleteDirectory(Path.Combine(installFolder, "letsencrypt"));
125128
IncrementProgressBar(session);
@@ -133,6 +136,14 @@ public static ActionResult InstallCA(Session session)
133136
}
134137
}
135138

139+
private static long GetSiteId(string uiName)
140+
{
141+
using (var serverManager = new ServerManager())
142+
{
143+
return serverManager.Sites[uiName].Id;
144+
}
145+
}
146+
136147
public static MessageResult ResetProgressBar(Session session, int totalStatements)
137148
{
138149
var record = new Record(3);

0 commit comments

Comments
 (0)