Skip to content
Merged

sync #22

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1dee350
server(filesystem): fix archive filesystem
matthewpi Jan 12, 2025
0e96ef3
build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0 (#210)
dependabot[bot] Jan 12, 2025
76a9f6d
build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 (#211)
dependabot[bot] Jan 12, 2025
a55277d
ufs: ensure `fsDirfd` always gets closed (fix file descriptor leak)
matthewpi Jan 12, 2025
c6c235d
cron: batch deletions of activity logs to workaround sqlite limitation
matthewpi Jan 12, 2025
77153ff
ci: fix broken commit hash (#212)
ArnaudLier Feb 14, 2025
25966e7
system: prevent deadlock while sending to a SinkPool
matthewpi Mar 10, 2025
407b783
ufs: improve error handling
matthewpi Mar 10, 2025
5e9a1c7
go: update to `1.23.7`, enable 1.24 in matrix
matthewpi Mar 10, 2025
d0e7332
ci: add dependabot for `github-actions` and `gomod`
matthewpi Mar 10, 2025
7f63162
nix: update flake.lock
matthewpi Mar 10, 2025
a4ff433
chore: remove outdated `wings-api.paw`
matthewpi Mar 10, 2025
91ed7f2
chore: add `.editorconfig`
matthewpi Mar 10, 2025
d49607d
feat: add support for loading token from env and file (`WINGS_TOKEN` …
matthewpi Mar 10, 2025
59905a6
go: update dependencies
matthewpi Mar 10, 2025
91e0162
ci: fix codeql workflow matrix
matthewpi Mar 10, 2025
4b4e8f8
system: fix test relying on reflection to determine if mutex is locked
matthewpi Mar 10, 2025
9535aae
fix: `Duplicated key token in config` panic
matthewpi Mar 10, 2025
49b04fe
fix: use of old `AuthenticationToken` value
matthewpi Mar 10, 2025
f18726c
chore: avoid exiting if config file is not writable
matthewpi Mar 10, 2025
e311206
config: handle old `AuthenticationToken` value
matthewpi Mar 17, 2025
d5097e5
build(deps): bump github.com/pkg/sftp from 1.13.7 to 1.13.8 (#215)
dependabot[bot] Mar 17, 2025
9ff918b
build(deps): bump github.com/docker/docker (#216)
dependabot[bot] Mar 24, 2025
81e8c9a
build(deps): bump github.com/pkg/sftp from 1.13.8 to 1.13.9 (#218)
dependabot[bot] Mar 31, 2025
104fe1a
build(deps): bump github.com/docker/docker (#217)
dependabot[bot] Mar 31, 2025
489af48
build(deps): bump docker/login-action from 3.3.0 to 3.4.0 (#222)
dependabot[bot] Apr 1, 2025
cecdc8c
build(deps): bump github/codeql-action from 3.28.11 to 3.28.13 (#221)
dependabot[bot] Apr 1, 2025
74fd19c
build(deps): bump actions/setup-go from 5.3.0 to 5.4.0 (#220)
dependabot[bot] Apr 1, 2025
3d90ac5
build(deps): bump actions/upload-artifact from 4.6.1 to 4.6.2 (#219)
dependabot[bot] Apr 1, 2025
a4e1674
flake: switch to `go_1_24`
matthewpi Apr 1, 2025
0bc3df9
build(deps): bump github.com/mholt/archives from 0.1.0 to 0.1.1 (#226)
dependabot[bot] Apr 7, 2025
9533f4f
build(deps): bump golang.org/x/sys from 0.31.0 to 0.32.0 (#225)
dependabot[bot] Apr 7, 2025
3ea9e69
build(deps): bump golang.org/x/sync from 0.12.0 to 0.13.0 (#224)
dependabot[bot] Apr 7, 2025
3855eec
build(deps): bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#223)
dependabot[bot] Apr 7, 2025
ae1192f
build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 (#229)
dependabot[bot] Apr 16, 2025
2a94eb0
build(deps): bump gorm.io/gorm from 1.25.12 to 1.26.0 (#234)
dependabot[bot] Apr 28, 2025
cb391bc
build(deps): bump docker/build-push-action from 6.15.0 to 6.16.0 (#235)
dependabot[bot] May 1, 2025
25aaf12
build(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2 (#236)
dependabot[bot] May 1, 2025
d2b4e98
build(deps): bump github/codeql-action from 3.28.13 to 3.28.16 (#237)
dependabot[bot] May 1, 2025
35d2e0f
build(deps): bump golang.org/x/sys from 0.32.0 to 0.33.0 (#238)
dependabot[bot] May 13, 2025
a94d4ec
build(deps): bump actions/setup-go from 5.4.0 to 5.5.0 (#242)
dependabot[bot] Jun 2, 2025
b7d442e
build(deps): bump github/codeql-action from 3.28.16 to 3.28.18 (#243)
dependabot[bot] Jun 2, 2025
b6f07bc
build(deps): bump docker/build-push-action from 6.16.0 to 6.18.0 (#244)
dependabot[bot] Jun 2, 2025
d1f2c4e
build(deps): bump github.com/docker/docker (#245)
dependabot[bot] Jun 2, 2025
56bb2ce
build(deps): bump golang.org/x/crypto from 0.37.0 to 0.39.0 (#246)
dependabot[bot] Jun 9, 2025
ccae513
build(deps): bump github.com/gin-gonic/gin from 1.10.0 to 1.10.1 (#247)
dependabot[bot] Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.go]
max_line_length = 100

[*.md]
trim_trailing_whitespace = false

[*.{md,nix,yaml}]
indent_style = space
indent_size = 2
tab_width = 2
9 changes: 8 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
use flake
#!/usr/bin/env sh

# Load the flake's `devShells.${currentSystem}.default`.
if ! use flake .; then
echo 'The development shell was unable to be built.' >&2
echo 'The development environment was not loaded.' >&2
echo 'Please make the necessary changes in flake.nix to fix any issues and hit enter to try again.' >&2
fi
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
28 changes: 12 additions & 16 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,26 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04

runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- go

steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Code checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
16 changes: 8 additions & 8 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ on:
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
# Always run against a tag, even if the commit into the tag has [docker skip] within the commit message.
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
permissions:
contents: read
packages: write
steps:
- name: Code checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: ghcr.io/${{ github.repository }}
flavor: |
Expand All @@ -34,13 +34,13 @@ jobs:
type=ref,event=branch

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -53,7 +53,7 @@ jobs:
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Build and Push (tag)
uses: docker/build-push-action@v5
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
if: "github.event_name == 'release' && github.event.action == 'published'"
with:
context: .
Expand All @@ -66,7 +66,7 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }}

- name: Build and Push (develop)
uses: docker/build-push-action@v5
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
if: "github.event_name == 'push' && contains(github.ref, 'develop')"
with:
context: .
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@ jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
go: ["1.22.10", "1.23.4"]
os: [ubuntu-24.04]
go: ["1.23.7", "1.24.1"]
goos: [linux]
goarch: [amd64, arm64]

permissions:
contents: read
steps:
- name: Code checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ matrix.go }}

- name: Code checkout
uses: actions/checkout@v4

- name: go mod download
env:
CGO_ENABLED: 0
Expand All @@ -44,8 +43,8 @@ jobs:
CGO_ENABLED: 0
SRC_PATH: github.com/pterodactyl/wings
run: |
go build -v -trimpath -ldflags="-s -w -X ${SRC_PATH}/system.Version=dev-${GIT_COMMIT:0:7}" -o dist/wings ${SRC_PATH}
go build -v -trimpath -ldflags="-X ${SRC_PATH}/system.Version=dev-${GIT_COMMIT:0:7}" -o dist/wings_debug ${SRC_PATH}
go build -v -trimpath -ldflags="-s -w -X ${SRC_PATH}/system.Version=dev-${GITHUB_SHA:0:7}" -o dist/wings ${SRC_PATH}
go build -v -trimpath -ldflags="-X ${SRC_PATH}/system.Version=dev-${GITHUB_SHA:0:7}" -o dist/wings_debug ${SRC_PATH}
chmod 755 dist/*

- name: go test
Expand All @@ -63,15 +62,15 @@ jobs:
go test -race $(go list ./...)

- name: Upload Release Artifact
uses: actions/upload-artifact@v4
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.22.10' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.23.7' }}
with:
name: wings_linux_${{ matrix.goarch }}
path: dist/wings

- name: Upload Debug Artifact
uses: actions/upload-artifact@v4
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.22.10' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ (github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && matrix.go == '1.23.7' }}
with:
name: wings_linux_${{ matrix.goarch }}_debug
path: dist/wings_debug
46 changes: 9 additions & 37 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: write # write is required to create releases and push.

steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Code checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.22.10"
go-version: "1.23.7"

- name: Build release binaries
env:
Expand Down Expand Up @@ -59,41 +59,13 @@ jobs:
git push

- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
body_path: ./RELEASE_CHANGELOG

- name: Upload amd64 binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wings_linux_amd64
asset_name: wings_linux_amd64
asset_content_type: application/octet-stream

- name: Upload arm64 binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wings_linux_arm64
asset_name: wings_linux_arm64
asset_content_type: application/octet-stream

- name: Upload checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./checksums.txt
asset_name: checksums.txt
asset_content_type: text/plain
files: |
dist/*
checksums.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1 (Build)
FROM golang:1.22.10-alpine AS builder
FROM golang:1.23.7-alpine AS builder

ARG VERSION
RUN apk add --update --no-cache git make mailcap
Expand Down
16 changes: 14 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"path/filepath"
"runtime"
"strconv"
"syscall"
"time"

"github.com/NYTimes/logrotate"
Expand Down Expand Up @@ -103,6 +104,7 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {

if err := config.ConfigureTimezone(); err != nil {
log.WithField("error", err).Fatal("failed to detect system timezone or use supplied configuration value")
return
}
log.WithField("timezone", config.Get().System.Timezone).Info("configured wings with system timezone")
if err := config.ConfigureDirectories(); err != nil {
Expand All @@ -111,9 +113,11 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
}
if err := config.EnsurePterodactylUser(); err != nil {
log.WithField("error", err).Fatal("failed to create pterodactyl system user")
return
}
if err := config.ConfigurePasswd(); err != nil {
log.WithField("error", err).Fatal("failed to configure container passwd file")
return
}
log.WithFields(log.Fields{
"username": config.Get().System.Username,
Expand All @@ -125,29 +129,37 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
return
}

t := config.Get().Token
pclient := remote.New(
config.Get().PanelLocation,
remote.WithCredentials(config.Get().AuthenticationTokenId, config.Get().AuthenticationToken),
remote.WithCredentials(t.ID, t.Token),
remote.WithHttpClient(&http.Client{
Timeout: time.Second * time.Duration(config.Get().RemoteQuery.Timeout),
}),
)

if err := database.Initialize(); err != nil {
log.WithField("error", err).Fatal("failed to initialize database")
return
}

manager, err := server.NewManager(cmd.Context(), pclient)
if err != nil {
log.WithField("error", err).Fatal("failed to load server configurations")
return
}

if err := environment.ConfigureDocker(cmd.Context()); err != nil {
log.WithField("error", err).Fatal("failed to configure docker environment")
return
}

if err := config.WriteToDisk(config.Get()); err != nil {
log.WithField("error", err).Fatal("failed to write configuration to disk")
if !errors.Is(err, syscall.EROFS) {
log.WithField("error", err).Error("failed to write configuration to disk")
} else {
log.WithField("error", err).Debug("failed to write configuration to disk")
}
}

// Just for some nice log output.
Expand Down
Loading