-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable letsencrypt mode for EC2 provisioner
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
- Loading branch information
Showing
11 changed files
with
72 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
// Copyright (c) Inlets Author(s) 2019. All rights reserved. | ||
// Copyright (c) Inlets Author(s) 2023. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
package cmd | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func Test_MakeHTTPSUserdata_OneDomain(t *testing.T) { | ||
got := MakeHTTPSUserdata("token", "0.8.4", "[email protected]", "prod", []string{"example.com"}) | ||
ioutil.WriteFile("/tmp/t.txt", []byte(got), 0600) | ||
got := MakeHTTPSUserdata("token", "0.9.21", "[email protected]", "prod", []string{"example.com"}) | ||
|
||
os.WriteFile("/tmp/t.txt", []byte(got), 0600) | ||
want := `#!/bin/bash | ||
export AUTHTOKEN="token" | ||
export IP=$(curl -sfSL https://checkip.amazonaws.com) | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.8.4/inlets-pro -o /tmp/inlets-pro && \ | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.9.21/inlets-pro -o /tmp/inlets-pro && \ | ||
chmod +x /tmp/inlets-pro && \ | ||
mv /tmp/inlets-pro /usr/local/bin/inlets-pro | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.8.4/inlets-pro-http.service -o inlets-pro.service && \ | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.9.21/inlets-pro-http.service -o inlets-pro.service && \ | ||
mv inlets-pro.service /etc/systemd/system/inlets-pro.service && \ | ||
echo "AUTHTOKEN=$AUTHTOKEN" >> /etc/default/inlets-pro && \ | ||
echo "IP=$IP" >> /etc/default/inlets-pro && \ | ||
|
@@ -36,19 +37,19 @@ curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.8.4/inlets-p | |
} | ||
|
||
func Test_MakeHTTPSUserdata_TwoDomains(t *testing.T) { | ||
got := MakeHTTPSUserdata("token", "0.8.4", "[email protected]", "prod", | ||
got := MakeHTTPSUserdata("token", "0.9.21", "[email protected]", "prod", | ||
[]string{"a.example.com", "b.example.com"}) | ||
|
||
ioutil.WriteFile("/tmp/t.txt", []byte(got), 0600) | ||
os.WriteFile("/tmp/t.txt", []byte(got), 0600) | ||
want := `#!/bin/bash | ||
export AUTHTOKEN="token" | ||
export IP=$(curl -sfSL https://checkip.amazonaws.com) | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.8.4/inlets-pro -o /tmp/inlets-pro && \ | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.9.21/inlets-pro -o /tmp/inlets-pro && \ | ||
chmod +x /tmp/inlets-pro && \ | ||
mv /tmp/inlets-pro /usr/local/bin/inlets-pro | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.8.4/inlets-pro-http.service -o inlets-pro.service && \ | ||
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/0.9.21/inlets-pro-http.service -o inlets-pro.service && \ | ||
mv inlets-pro.service /etc/systemd/system/inlets-pro.service && \ | ||
echo "AUTHTOKEN=$AUTHTOKEN" >> /etc/default/inlets-pro && \ | ||
echo "IP=$IP" >> /etc/default/inlets-pro && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters