Revert "Automatically run "make ports" if needed"
This reverts commit 43dacc9aaf
.
This commit is contained in:
parent
43dacc9aaf
commit
c68feed578
@ -23,6 +23,10 @@ curl -s https://raw.githubusercontent.com/animenotifier/notify.moe/go/install.sh
|
|||||||
* In your browser, import the file `security/default/root.crt` as a trusted Root authority
|
* In your browser, import the file `security/default/root.crt` as a trusted Root authority
|
||||||
* Open `https://beta.notify.moe`
|
* Open `https://beta.notify.moe`
|
||||||
|
|
||||||
|
## OS restarts
|
||||||
|
|
||||||
|
* If you restart your operating system, run `make ports` to update your port bindings
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
| [![Eduard Urbach on Twitter](https://gravatar.com/avatar/16ed4d41a5f244d1b10de1b791657989?s=70)](https://twitter.com/eduardurbach "Follow @eduardurbach on Twitter") |
|
| [![Eduard Urbach on Twitter](https://gravatar.com/avatar/16ed4d41a5f244d1b10de1b791657989?s=70)](https://twitter.com/eduardurbach "Follow @eduardurbach on Twitter") |
|
||||||
|
5
main.go
5
main.go
@ -49,12 +49,9 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
// API
|
// API
|
||||||
arn.API.Install(app)
|
arn.API.Install(app)
|
||||||
|
|
||||||
// Development server configuration
|
// Domain
|
||||||
if arn.IsDevelopment() {
|
if arn.IsDevelopment() {
|
||||||
app.Config.Domain = "beta.notify.moe"
|
app.Config.Domain = "beta.notify.moe"
|
||||||
|
|
||||||
// Test connectivity
|
|
||||||
app.OnStart(testConnectivity)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
|
33
ports.go
33
ports.go
@ -1,33 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/tls"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"os/exec"
|
|
||||||
|
|
||||||
"github.com/fatih/color"
|
|
||||||
)
|
|
||||||
|
|
||||||
// testConnectivity will test if port 443 is accessible or not.
|
|
||||||
// If not, it will attempt to run "sudo make ports" and consume
|
|
||||||
// execution once the user has entered the password.
|
|
||||||
func testConnectivity() {
|
|
||||||
config := tls.Config{
|
|
||||||
InsecureSkipVerify: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := tls.Dial("tcp", ":443", &config)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("--------------------------------------------------------------------------------")
|
|
||||||
color.Red("HTTPS port 443 is not accessible")
|
|
||||||
fmt.Println("Running", color.YellowString("make ports"), "to be able to access", color.GreenString("https://"+app.Config.Domain))
|
|
||||||
|
|
||||||
cmd := exec.Command("sudo", "make", "ports")
|
|
||||||
cmd.Stdout = os.Stdout
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
cmd.Stdin = os.Stdin
|
|
||||||
cmd.Run()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user