Compare commits

...

9 Commits

Author SHA1 Message Date
dependabot[bot]
60ef1c4af8 build(deps): bump github.com/buger/jsonparser from 1.1.1 to 1.1.2
Bumps [github.com/buger/jsonparser](https://github.com/buger/jsonparser) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/buger/jsonparser/releases)
- [Commits](https://github.com/buger/jsonparser/compare/v1.1.1...v1.1.2)

---
updated-dependencies:
- dependency-name: github.com/buger/jsonparser
  dependency-version: 1.1.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-28 23:43:24 +00:00
Anthony
3b968bbae1 Add volume mapping for /run/wings 2026-01-14 13:22:28 -06:00
Anthony
c1cc803d46 changelog 2026-01-13 14:19:18 -06:00
Anthony
fbfe5b9b54 Merge pull request #292 from pterodactyl/server-machine-id-mount
feat: add mount for /etc/machine-id for servers
2026-01-13 13:11:55 -06:00
Matthew Penner
13029244e3 feat: add mount for /etc/machine-id for servers
Signed-off-by: Matthew Penner <me@matthewp.io>
2026-01-13 11:49:43 -07:00
Matthew Penner
70f02a2585 nix: update flake.lock
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/f4330d2' (2025-03-07)
  → 'github:hercules-ci/flake-parts/80daad0' (2026-01-11)
• Updated input 'flake-parts/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/147dee3' (2025-03-02)
  → 'github:nix-community/nixpkgs.lib/2075416' (2025-12-14)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/36fd87b' (2025-03-07)
  → 'github:NixOS/nixpkgs/ffbc9f8' (2026-01-11)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/3d0579f' (2025-02-17)
  → 'github:numtide/treefmt-nix/e96d59d' (2026-01-11)
2026-01-13 11:07:16 -07:00
Anthony
d3a416f0be Merge pull request #293 from pterodactyl/matthewpi/update-ci
chore: update ci pipelines and Go version to 1.24.11
2026-01-13 12:06:46 -06:00
Matthew Penner
b1f9446e29 chore: update ci pipelines and Go version to 1.24.11
Signed-off-by: Matthew Penner <me@matthewp.io>
2026-01-13 11:04:22 -07:00
DaneEveritt
00605c9dfb Don't include the v in the version tag 2026-01-05 17:19:28 -08:00
14 changed files with 119 additions and 48 deletions

View File

@@ -26,7 +26,7 @@ jobs:
security-events: write
steps:
- name: Code checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Initialize CodeQL
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5

View File

@@ -19,11 +19,11 @@ jobs:
packages: write
steps:
- name: Code checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Docker metadata
id: docker_meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ghcr.io/${{ github.repository }}
flavor: |
@@ -34,10 +34,10 @@ jobs:
type=ref,event=branch
- name: Setup QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Setup Docker buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
@@ -49,8 +49,8 @@ jobs:
- name: Get Build Information
id: build_info
run: |
echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "version_tag=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build and Push (tag)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

View File

@@ -16,17 +16,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-24.04]
go: ["1.24.1"]
go: ["1.24.11", "1.25.5"]
goos: [linux]
goarch: [amd64, arm64]
permissions:
contents: read
steps:
- name: Code checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: ${{ matrix.go }}
@@ -62,15 +62,15 @@ jobs:
go test -race $(go list ./...)
- name: Upload Release Artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.23.7' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.24.11' }}
with:
name: wings_linux_${{ matrix.goarch }}
path: dist/wings
- name: Upload Debug Artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.23.7' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.24.11' }}
with:
name: wings_linux_${{ matrix.goarch }}_debug
path: dist/wings_debug

View File

@@ -6,14 +6,18 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
- name: Code checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: "1.24.1"
go-version: 1.24.11
- name: Build release binaries
env:
CGO_ENABLED: 0
@@ -22,22 +26,25 @@ jobs:
chmod 755 dist/wings_linux_amd64
GOARCH=arm64 go build -o dist/wings_linux_arm64 -v -trimpath -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=${{ github.ref_name }}" github.com/pterodactyl/wings
chmod 755 dist/wings_linux_arm64
- name: Create release branch
env:
REF: ${{ github.ref }}
VERSION: ${{ github.ref_name }}
run: |
BRANCH=release/${{ github.ref_name }}
BRANCH=release/${{ env.VERSION }}
git config --local user.email "ci@pterodactyl.io"
git config --local user.name "Pterodactyl CI"
git checkout -b $BRANCH
git push -u origin $BRANCH
sed -i "s/var Version = \".*\"/var Version = \"${{ github.ref_name }}\"/" system/const.go
sed -i "s/var Version = \".*\"/var Version = \"${VERSION:1}\"/" system/const.go
git add system/const.go
git commit -m "ci(release): bump version"
git push
- name: write changelog
run: |
sed -n "/^## ${{ github.ref_name }}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,5 +1,9 @@
# 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
### Fixed
* [CVE-2025-68954](https://github.com/pterodactyl/panel/security/advisories/GHSA-8c39-xppg-479c)

View File

@@ -1,5 +1,5 @@
# Stage 1 (Build)
FROM golang:1.24.1-alpine AS builder
FROM golang:1.24.11-alpine AS builder
ARG VERSION
RUN apk add --update --no-cache git make mailcap

View File

@@ -197,9 +197,9 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
for _, serv := range manager.All() {
s := serv
// For each server we encounter make sure the root data directory exists.
if err := s.EnsureDataDirectoryExists(); err != nil {
s.Log().Error("could not create root data directory for server: not loading server...")
// For each server ensure the minimal environment is configured for the server.
if err := s.CreateEnvironment(); err != nil {
s.Log().Error("could create base environment for server...")
continue
}

View File

@@ -177,11 +177,11 @@ type SystemConfiguration struct {
Passwd struct {
// Enable controls whether generated passwd files should be mounted into containers.
//
// By default this option is disabled and Wings will not mount any additional passwd
// files into containers.
// By default this option is disabled and Wings will not mount any
// additional passwd files into containers.
Enable bool `yaml:"enabled" default:"false"`
// Directory is the directory on disk where the generated files will be stored.
// Directory is the directory on disk where the generated passwd files will be stored.
// This directory may be temporary as it will be re-created whenever Wings is started.
//
// This path **WILL** be both written to by Wings and mounted into containers created by
@@ -192,6 +192,26 @@ type SystemConfiguration struct {
Directory string `yaml:"directory" default:"/run/wings/etc"`
} `yaml:"passwd"`
// MachineID controls the mounting of a generated `/etc/machine-id` file into containers started by Wings.
MachineID struct {
// Enable controls whether a generated machine-id file should be mounted
// into containers.
//
// By default this option is enabled and Wings will mount an additional
// machine-id file into containers.
Enable bool `yaml:"enabled" default:"true"`
// Directory is the directory on disk where the generated machine-id files will be stored.
// This directory may be temporary as it will be re-created whenever Wings is started.
//
// This path **WILL** be both written to by Wings and mounted into containers created by
// Wings. If you are running Wings itself in a container, this path will need to be mounted
// into the Wings container as the exact path on the host, which should match the value
// specified here. If you are using SELinux, you will need to make sure this file has the
// correct SELinux context in order for containers to use it.
Directory string `yaml:"directory" default:"/run/wings/machine-id"`
} `yaml:"machine_id"`
// The amount of time in seconds that can elapse before a server's disk space calculation is
// considered stale and a re-check should occur. DANGER: setting this value too low can seriously
// impact system performance and cause massive I/O bottlenecks and high CPU usage for the Wings
@@ -634,6 +654,11 @@ func ConfigureDirectories() error {
return err
}
log.WithField("path", _config.System.TmpDirectory).Debug("ensuring temporary data directory exists")
if err := os.MkdirAll(_config.System.TmpDirectory, 0o700); err != nil {
return err
}
log.WithField("path", _config.System.ArchiveDirectory).Debug("ensuring archive data directory exists")
if err := os.MkdirAll(_config.System.ArchiveDirectory, 0o700); err != nil {
return err
@@ -651,6 +676,13 @@ func ConfigureDirectories() error {
}
}
if _config.System.MachineID.Enable {
log.WithField("path", _config.System.MachineID.Directory).Debug("ensuring machine-id directory exists")
if err := os.MkdirAll(_config.System.MachineID.Directory, 0o755); err != nil {
return err
}
}
return nil
}

View File

@@ -23,6 +23,7 @@ services:
- "/var/log/pterodactyl/:/var/log/pterodactyl/"
- "/tmp/pterodactyl/:/tmp/pterodactyl/"
- "/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
#- "/srv/daemon-data/:/srv/daemon-data/"
# Required for ssl if you use let's encrypt. uncomment to use.

24
flake.lock generated
View File

@@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1741352980,
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1741379970,
"narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=",
"lastModified": 1768127708,
"narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f",
"rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38",
"type": "github"
},
"original": {
@@ -36,11 +36,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1740877520,
"narHash": "sha256-oiwv/ZK/2FhGxrCkQkB83i7GnWXPPLzoqFHpDD3uYpk=",
"lastModified": 1765674936,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "147dee35aab2193b174e4c0868bd80ead5ce755c",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"type": "github"
},
"original": {
@@ -63,11 +63,11 @@
]
},
"locked": {
"lastModified": 1739829690,
"narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"lastModified": 1768158989,
"narHash": "sha256-67vyT1+xClLldnumAzCTBvU0jLZ1YBcf4vANRWP3+Ak=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "3d0579f5cc93436052d94b73925b48973a104204",
"rev": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca",
"type": "github"
},
"original": {

4
go.mod
View File

@@ -13,7 +13,7 @@ require (
github.com/apex/log v1.9.0
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/beevik/etree v1.5.0
github.com/buger/jsonparser v1.1.1
github.com/buger/jsonparser v1.1.2
github.com/cenkalti/backoff/v4 v4.3.0
github.com/creasty/defaults v1.8.0
github.com/docker/docker v28.3.3+incompatible
@@ -45,6 +45,7 @@ require (
golang.org/x/crypto v0.46.0
golang.org/x/sync v0.19.0
golang.org/x/sys v0.39.0
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
@@ -132,7 +133,6 @@ require (
golang.org/x/net v0.47.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
google.golang.org/protobuf v1.36.5 // indirect
gotest.tools/v3 v3.0.2 // indirect

4
go.sum
View File

@@ -57,8 +57,8 @@ github.com/bodgit/sevenzip v1.6.1 h1:kikg2pUMYC9ljU7W9SaqHXhym5HyKm8/M/jd31fYan4
github.com/bodgit/sevenzip v1.6.1/go.mod h1:GVoYQbEVbOGT8n2pfqCIMRUaRjQ8F9oSqoBEqZh5fQ8=
github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4=
github.com/bodgit/windows v1.0.1/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk=
github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g=
github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=

View File

@@ -29,21 +29,34 @@ func (s *Server) Mounts() []environment.Mount {
},
}
cfg := config.Get()
// Handle mounting a generated `/etc/passwd` if the feature is enabled.
if passwd := config.Get().System.Passwd; passwd.Enable {
s.Log().WithFields(log.Fields{"source_path": passwd.Directory}).Info("mouting generated /etc/{group,passwd} to workaround UID/GID issues")
if cfg.System.Passwd.Enable {
s.Log().WithFields(log.Fields{"source_path": cfg.System.Passwd.Directory}).Info("mouting generated /etc/{group,passwd} to workaround UID/GID issues")
m = append(m, environment.Mount{
Source: filepath.Join(passwd.Directory, "group"),
Source: filepath.Join(cfg.System.Passwd.Directory, "group"),
Target: "/etc/group",
ReadOnly: true,
})
m = append(m, environment.Mount{
Source: filepath.Join(passwd.Directory, "passwd"),
Source: filepath.Join(cfg.System.Passwd.Directory, "passwd"),
Target: "/etc/passwd",
ReadOnly: true,
})
}
if cfg.System.MachineID.Enable {
// Hytale wants a machine-id in order to encrypt tokens for the server.
// So add a mount to `/etc/machine-id` to a source that contains the
// server's UUID without any dashes.
m = append(m, environment.Mount{
Source: filepath.Join(cfg.System.MachineID.Directory, s.ID()),
Target: "/etc/machine-id",
ReadOnly: true,
})
}
// Also include any of this server's custom mounts when returning them.
return append(m, s.customMounts()...)
}

View File

@@ -1,11 +1,13 @@
package server
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
@@ -259,6 +261,18 @@ func (s *Server) CreateEnvironment() error {
return err
}
cfg := config.Get()
if cfg.System.MachineID.Enable {
// Hytale wants a machine-id in order to encrypt tokens for the server. So
// write a machine-id file for the server that contains the server's UUID
// without any dashes.
p := filepath.Join(cfg.System.MachineID.Directory, s.ID())
machineID := append(bytes.ReplaceAll([]byte(s.ID()), []byte{'-'}, []byte{}), '\n')
if err := os.WriteFile(p, machineID, 0o644); err != nil {
return fmt.Errorf("failed to write machine-id (at '%s') for server '%s': %w", p, s.ID(), err)
}
}
return s.Environment.Create()
}