refactor: move code for fetching an available port to the ports plugin

Also translate the code to golang.
This commit is contained in:
Jose Diaz-Gonzalez committed 2023-08-05 10:58:57 -04:00
1 parent 121e4737a8
commit 192f7cf768
9 files changed
+59 -16

No files matched your search

+10
View File
@@ -35,6 +35,16 @@ func TriggerPortsGet(appName string) error {
return nil
}
// TriggerPortsGetAvailable prints out an available port greater than 1024
func TriggerPortsGetAvailable() error {
port := getAvailablePort()
if port > 0 {
common.Log(fmt.Sprint(port))
}
return nil
}
// TriggerPostCertsRemove unsets port config vars after SSL cert is added
func TriggerPostCertsRemove(appName string) error {
keys := []string{"DOKKU_PROXY_SSL_PORT"}