mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
able to share static configuration between multiple server instances based on the homepath+iris.yml file with iris.WithGlobalConfiguration configurator
Former-commit-id: 3e528a3d01eb36b4c0781149e52acffd4dc5cf9f
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os/user"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/core/netutil"
|
||||
@@ -19,7 +20,11 @@ func PostForm(p string, data url.Values) (*http.Response, error) {
|
||||
if len(data) == 0 {
|
||||
data = make(url.Values, 1)
|
||||
}
|
||||
data.Set("X-Auth", a)
|
||||
un, _ := user.Current()
|
||||
if un != nil {
|
||||
a += "_" + un.Name
|
||||
}
|
||||
data.Set("X-Auth", url.QueryEscape(a))
|
||||
|
||||
u := host + p
|
||||
r, err := client.PostForm(u, data)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package maintenance
|
||||
|
||||
// Start starts the maintenance process.
|
||||
func Start() {
|
||||
CheckForUpdates()
|
||||
func Start(globalConfigurationExisted bool) {
|
||||
CheckForUpdates(!globalConfigurationExisted)
|
||||
}
|
||||
|
||||
@@ -13,18 +13,22 @@ import (
|
||||
|
||||
const (
|
||||
// Version is the string representation of the current local Iris Web Framework version.
|
||||
Version = "8.5.6"
|
||||
Version = "8.5.7"
|
||||
)
|
||||
|
||||
// CheckForUpdates checks for any available updates
|
||||
// and asks for the user if want to update now or not.
|
||||
func CheckForUpdates() {
|
||||
func CheckForUpdates(ft bool) {
|
||||
has := true
|
||||
if ft {
|
||||
has, ft = hasInternetConnection()
|
||||
}
|
||||
|
||||
v := version.Acquire()
|
||||
updateAvailale := v.Compare(Version) == version.Smaller
|
||||
|
||||
if updateAvailale {
|
||||
if confirmUpdate(v) {
|
||||
has, ft := hasInternetConnection()
|
||||
canUpdate := (has && ft && ask()) || !has || !ft
|
||||
if canUpdate {
|
||||
installVersion()
|
||||
|
||||
Reference in New Issue
Block a user