mirror of
https://github.com/pterodactyl/wings.git
synced 2026-04-12 07:06:20 -05:00
Compare commits
4 Commits
server-mac
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac81409505 | ||
|
|
3b968bbae1 | ||
|
|
c1cc803d46 | ||
|
|
fbfe5b9b54 |
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.12.1
|
||||||
|
### Added
|
||||||
|
* Add mount for /etc/machine-id for servers for Hytale ([#292](https://github.com/pterodactyl/wings/pull/292))
|
||||||
|
|
||||||
## v1.12.0
|
## v1.12.0
|
||||||
### Fixed
|
### Fixed
|
||||||
* [CVE-2025-68954](https://github.com/pterodactyl/panel/security/advisories/GHSA-8c39-xppg-479c)
|
* [CVE-2025-68954](https://github.com/pterodactyl/panel/security/advisories/GHSA-8c39-xppg-479c)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ services:
|
|||||||
- "/var/log/pterodactyl/:/var/log/pterodactyl/"
|
- "/var/log/pterodactyl/:/var/log/pterodactyl/"
|
||||||
- "/tmp/pterodactyl/:/tmp/pterodactyl/"
|
- "/tmp/pterodactyl/:/tmp/pterodactyl/"
|
||||||
- "/etc/ssl/certs:/etc/ssl/certs:ro"
|
- "/etc/ssl/certs:/etc/ssl/certs:ro"
|
||||||
|
- "/run/wings:/run/wings"
|
||||||
# you may need /srv/daemon-data if you are upgrading from an old daemon
|
# you may need /srv/daemon-data if you are upgrading from an old daemon
|
||||||
#- "/srv/daemon-data/:/srv/daemon-data/"
|
#- "/srv/daemon-data/:/srv/daemon-data/"
|
||||||
# Required for ssl if you use let's encrypt. uncomment to use.
|
# Required for ssl if you use let's encrypt. uncomment to use.
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ var client *http.Client
|
|||||||
func init() {
|
func init() {
|
||||||
dialer := &net.Dialer{
|
dialer := &net.Dialer{
|
||||||
LocalAddr: nil,
|
LocalAddr: nil,
|
||||||
|
Timeout: time.Second * 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
trnspt := http.DefaultTransport.(*http.Transport).Clone()
|
trnspt := http.DefaultTransport.(*http.Transport).Clone()
|
||||||
@@ -55,10 +56,8 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client = &http.Client{
|
client = &http.Client{
|
||||||
Timeout: time.Hour * 12,
|
Timeout: time.Hour * 2,
|
||||||
|
|
||||||
Transport: trnspt,
|
Transport: trnspt,
|
||||||
|
|
||||||
// Disallow any redirect on an HTTP call. This is a security requirement: do not modify
|
// Disallow any redirect on an HTTP call. This is a security requirement: do not modify
|
||||||
// this logic without first ensuring that the new target location IS NOT within the current
|
// this logic without first ensuring that the new target location IS NOT within the current
|
||||||
// instance's local network.
|
// instance's local network.
|
||||||
@@ -192,7 +191,10 @@ func (dl *Download) Execute() error {
|
|||||||
req.Header.Set("User-Agent", "Pterodactyl Panel (https://pterodactyl.io)")
|
req.Header.Set("User-Agent", "Pterodactyl Panel (https://pterodactyl.io)")
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ErrDownloadFailed
|
if IsDownloadError(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return errors.Wrap(err, ErrDownloadFailed.Error())
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
if res.StatusCode != http.StatusOK {
|
if res.StatusCode != http.StatusOK {
|
||||||
@@ -335,3 +337,7 @@ func mustParseCIDR(ip string) *net.IPNet {
|
|||||||
}
|
}
|
||||||
return block
|
return block
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsDownloadError(err error) bool {
|
||||||
|
return errors.Is(err, ErrDownloadFailed) || errors.Is(err, ErrInvalidIPAddress) || errors.Is(err, ErrInternalResolution)
|
||||||
|
}
|
||||||
|
|||||||
@@ -328,13 +328,15 @@ func postServerPullRemoteFile(c *gin.Context) {
|
|||||||
download := func() error {
|
download := func() error {
|
||||||
s.Log().WithField("download_id", dl.Identifier).WithField("url", u.String()).Info("starting pull of remote file to disk")
|
s.Log().WithField("download_id", dl.Identifier).WithField("url", u.String()).Info("starting pull of remote file to disk")
|
||||||
if err := dl.Execute(); err != nil {
|
if err := dl.Execute(); err != nil {
|
||||||
s.Log().WithField("download_id", dl.Identifier).WithField("error", err).Error("failed to pull remote file")
|
if !downloader.IsDownloadError(err) {
|
||||||
|
s.Log().WithField("download_id", dl.Identifier).WithField("error", err).Error("failed to pull remote file")
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
} else {
|
|
||||||
s.Log().WithField("download_id", dl.Identifier).Info("completed pull of remote file")
|
|
||||||
}
|
}
|
||||||
|
s.Log().WithField("download_id", dl.Identifier).Info("completed pull of remote file")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if !data.Foreground {
|
if !data.Foreground {
|
||||||
go func() {
|
go func() {
|
||||||
_ = download()
|
_ = download()
|
||||||
@@ -346,6 +348,21 @@ func postServerPullRemoteFile(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := download(); err != nil {
|
if err := download(); err != nil {
|
||||||
|
if downloader.IsDownloadError(err) {
|
||||||
|
var message = "The URL or IP address provided could not be resolved to a valid destination."
|
||||||
|
if errors.Is(err, downloader.ErrDownloadFailed) {
|
||||||
|
s.Log().WithField("identifier", dl.Identifier).WithField("error", err).Warn("failed to download remote file")
|
||||||
|
|
||||||
|
message = "An error was encountered while trying to download this file. Please try again later."
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{
|
||||||
|
"identifier": dl.Identifier,
|
||||||
|
"message": message,
|
||||||
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
middleware.CaptureAndAbort(c, err)
|
middleware.CaptureAndAbort(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user