Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to pelican #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
SRC_PATH: github.com/pterodactyl/wings
SRC_PATH: github.com/pelican-dev/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}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
CGO_ENABLED: 0
REF: ${{ github.ref }}
run: |
GOARCH=amd64 go build -o dist/wings_linux_amd64 -v -trimpath -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=${REF:11}" github.com/pterodactyl/wings
GOARCH=amd64 go build -o dist/wings_linux_amd64 -v -trimpath -ldflags="-s -w -X github.com/pelican-dev/wings/system.Version=${REF:11}" github.com/pelican-dev/wings
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=${REF:11}" github.com/pterodactyl/wings
GOARCH=arm64 go build -o dist/wings_linux_arm64 -v -trimpath -ldflags="-s -w -X github.com/pelican-dev/wings/system.Version=${REF:11}" github.com/pelican-dev/wings
chmod 755 dist/wings_linux_arm64

- name: Extract changelog
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY go.mod go.sum /app/
RUN go mod download
COPY . /app/
RUN CGO_ENABLED=0 go build \
-ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=$VERSION" \
-ldflags="-s -w -X github.com/pelican-dev/wings/system.Version=$VERSION" \
-v \
-trimpath \
-o wings \
Expand All @@ -20,6 +20,6 @@ FROM gcr.io/distroless/static:latest
COPY --from=builder /etc/os-release /etc/os-release

COPY --from=builder /app/wings /usr/bin/
CMD [ "/usr/bin/wings", "--config", "/etc/pterodactyl/config.yml" ]
CMD [ "/usr/bin/wings", "--config", "/etc/pelican/config.yml" ]

EXPOSE 8080
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ build:
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -gcflags "all=-trimpath=$(pwd)" -o build/wings_linux_arm64 -v wings.go

debug:
go build -ldflags="-X github.com/pterodactyl/wings/system.Version=$(GIT_HEAD)"
go build -ldflags="-X github.com/pelican-dev/wings/system.Version=$(GIT_HEAD)"
sudo ./wings --debug --ignore-certificate-errors --config config.yml --pprof --pprof-block-rate 1

# Runs a remotly debuggable session for Wings allowing an IDE to connect and target
# different breakpoints.
rmdebug:
go build -gcflags "all=-N -l" -ldflags="-X github.com/pterodactyl/wings/system.Version=$(GIT_HEAD)" -race
go build -gcflags "all=-N -l" -ldflags="-X github.com/pelican-dev/wings/system.Version=$(GIT_HEAD)" -race
sudo dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./wings -- --debug --ignore-certificate-errors --config config.yml

cross-build: clean build compress
Expand Down
4 changes: 2 additions & 2 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/goccy/go-json"
"github.com/spf13/cobra"

"github.com/pterodactyl/wings/config"
"github.com/pelican-dev/wings/config"
)

var configureArgs struct {
Expand Down Expand Up @@ -175,7 +175,7 @@ func getRequest() (*http.Request, error) {
return nil, err
}

r.Header.Set("Accept", "application/vnd.pterodactyl.v1+json")
r.Header.Set("Accept", "application/vnd.pelican.v1+json")
r.Header.Set("Content-Type", "application/json")
r.Header.Set("Authorization", fmt.Sprintf("Bearer %s", configureArgs.Token))

Expand Down
12 changes: 6 additions & 6 deletions cmd/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"github.com/goccy/go-json"
"github.com/spf13/cobra"

"github.com/pterodactyl/wings/config"
"github.com/pterodactyl/wings/environment"
"github.com/pterodactyl/wings/loggers/cli"
"github.com/pterodactyl/wings/system"
"github.com/pelican-dev/wings/config"
"github.com/pelican-dev/wings/environment"
"github.com/pelican-dev/wings/loggers/cli"
"github.com/pelican-dev/wings/system"
)

const (
Expand Down Expand Up @@ -94,7 +94,7 @@ func diagnosticsCmdRun(*cobra.Command, []string) {
dockerVersion, dockerInfo, dockerErr := getDockerInfo()

output := &strings.Builder{}
fmt.Fprintln(output, "Pterodactyl Wings - Diagnostics Report")
fmt.Fprintln(output, "Pelican Wings - Diagnostics Report")
printHeader(output, "Versions")
fmt.Fprintln(output, " Wings:", system.Version)
if dockerErr == nil {
Expand Down Expand Up @@ -166,7 +166,7 @@ func diagnosticsCmdRun(*cobra.Command, []string) {

printHeader(output, "Latest Wings Logs")
if diagnosticsArgs.IncludeLogs {
p := "/var/log/pterodactyl/wings.log"
p := "/var/log/pelican/wings.log"
if cfg != nil {
p = path.Join(cfg.System.LogDirectory, "wings.log")
}
Expand Down
42 changes: 21 additions & 21 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ import (
"golang.org/x/crypto/acme"
"golang.org/x/crypto/acme/autocert"

"github.com/pterodactyl/wings/config"
"github.com/pterodactyl/wings/environment"
"github.com/pterodactyl/wings/internal/cron"
"github.com/pterodactyl/wings/internal/database"
"github.com/pterodactyl/wings/loggers/cli"
"github.com/pterodactyl/wings/remote"
"github.com/pterodactyl/wings/router"
"github.com/pterodactyl/wings/server"
"github.com/pterodactyl/wings/sftp"
"github.com/pterodactyl/wings/system"
"github.com/pelican-dev/wings/config"
"github.com/pelican-dev/wings/environment"
"github.com/pelican-dev/wings/internal/cron"
"github.com/pelican-dev/wings/internal/database"
"github.com/pelican-dev/wings/loggers/cli"
"github.com/pelican-dev/wings/remote"
"github.com/pelican-dev/wings/router"
"github.com/pelican-dev/wings/server"
"github.com/pelican-dev/wings/sftp"
"github.com/pelican-dev/wings/system"
)

var (
Expand All @@ -45,7 +45,7 @@ var (

var rootCommand = &cobra.Command{
Use: "wings",
Short: "Runs the API server allowing programmatic control of game servers for Pterodactyl Panel.",
Short: "Runs the API server allowing programmatic control of game servers for Pelican Panel.",
PreRun: func(cmd *cobra.Command, args []string) {
initConfig()
initLogging()
Expand Down Expand Up @@ -107,11 +107,11 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
}
log.WithField("timezone", config.Get().System.Timezone).Info("configured wings with system timezone")
if err := config.ConfigureDirectories(); err != nil {
log.WithField("error", err).Fatal("failed to configure system directories for pterodactyl")
log.WithField("error", err).Fatal("failed to configure system directories for pelican")
return
}
if err := config.EnsurePterodactylUser(); err != nil {
log.WithField("error", err).Fatal("failed to create pterodactyl system user")
if err := config.EnsurePelicanUser(); err != nil {
log.WithField("error", err).Fatal("failed to create pelican system user")
}
log.WithFields(log.Fields{
"username": config.Get().System.Username,
Expand Down Expand Up @@ -201,8 +201,8 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
// machine is rebooted. It is much better for us to just have a single failed
// server instance than an entire offline node.
//
// @see https://github.com/pterodactyl/panel/issues/2475
// @see https://github.com/pterodactyl/panel/issues/3358
// @see https://github.com/pelican-dev/panel/issues/2475
// @see https://github.com/pelican-dev/panel/issues/3358
ctx, cancel := context.WithTimeout(cmd.Context(), time.Second*30)
defer cancel()

Expand Down Expand Up @@ -422,17 +422,17 @@ func initLogging() {
func printLogo() {
fmt.Printf(colorstring.Color(`
____
__ [blue][bold]Pterodactyl[reset] _____/___/_______ _______ ______
__ [blue][bold]Pelican[reset] _____/___/_______ _______ ______
\_____\ \/\/ / / / __ / ___/
\___\ / / / / /_/ /___ /
\___/\___/___/___/___/___ /______/
/_______/ [bold]%s[reset]

Copyright © 2018 - %d Dane Everitt & Contributors

Website: https://pterodactyl.io
Source: https://github.com/pterodactyl/wings
License: https://github.com/pterodactyl/wings/blob/develop/LICENSE
Website: https://pelican.io
Source: https://github.com/pelican-dev/wings
License: https://github.com/pelican-dev/wings/blob/develop/LICENSE

This software is made available under the terms of the MIT license.
The above copyright notice and this permission notice shall be included
Expand All @@ -447,7 +447,7 @@ Wings was not able to locate your configuration file, and therefore is not
able to complete its boot process. Please ensure you have copied your instance
configuration file into the default location below.

Default Location: /etc/pterodactyl/config.yml
Default Location: /etc/pelican/config.yml

[yellow]This is not a bug with this software. Please do not make a bug report
for this issue, it will be closed.[reset]
Expand Down
32 changes: 16 additions & 16 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"golang.org/x/sys/unix"
"gopkg.in/yaml.v2"

"github.com/pterodactyl/wings/system"
"github.com/pelican-dev/wings/system"
)

const DefaultLocation = "/etc/pterodactyl/config.yml"
const DefaultLocation = "/etc/pelican/config.yml"

// DefaultTLSConfig sets sane defaults to use when configuring the internal
// webserver to listen for public connections.
Expand Down Expand Up @@ -122,27 +122,27 @@ type RemoteQueryConfiguration struct {

// SystemConfiguration defines basic system configuration settings.
type SystemConfiguration struct {
// The root directory where all of the pterodactyl data is stored at.
RootDirectory string `default:"/var/lib/pterodactyl" yaml:"root_directory"`
// The root directory where all of the pelican data is stored at.
RootDirectory string `default:"/var/lib/pelican" yaml:"root_directory"`

// Directory where logs for server installations and other wings events are logged.
LogDirectory string `default:"/var/log/pterodactyl" yaml:"log_directory"`
LogDirectory string `default:"/var/log/pelican" yaml:"log_directory"`

// Directory where the server data is stored at.
Data string `default:"/var/lib/pterodactyl/volumes" yaml:"data"`
Data string `default:"/var/lib/pelican/volumes" yaml:"data"`

// Directory where server archives for transferring will be stored.
ArchiveDirectory string `default:"/var/lib/pterodactyl/archives" yaml:"archive_directory"`
ArchiveDirectory string `default:"/var/lib/pelican/archives" yaml:"archive_directory"`

// Directory where local backups will be stored on the machine.
BackupDirectory string `default:"/var/lib/pterodactyl/backups" yaml:"backup_directory"`
BackupDirectory string `default:"/var/lib/pelican/backups" yaml:"backup_directory"`

// TmpDirectory specifies where temporary files for Pterodactyl installation processes
// TmpDirectory specifies where temporary files for Pelican installation processes
// should be created. This supports environments running docker-in-docker.
TmpDirectory string `default:"/tmp/pterodactyl" yaml:"tmp_directory"`
TmpDirectory string `default:"/tmp/pelican" yaml:"tmp_directory"`

// The user that should own all of the server files, and be used for containers.
Username string `default:"pterodactyl" yaml:"username"`
Username string `default:"pelican" yaml:"username"`

// The timezone for this Wings instance. This is detected by Wings automatically if possible,
// and falls back to UTC if not able to be detected. If you need to set this manually, that
Expand Down Expand Up @@ -283,7 +283,7 @@ type Configuration struct {
// if the debug flag is passed through the command line arguments.
Debug bool

AppName string `default:"Pterodactyl" json:"app_name" yaml:"app_name"`
AppName string `default:"Pelican" json:"app_name" yaml:"app_name"`

// A unique identifier for this node in the Panel.
Uuid string
Expand Down Expand Up @@ -425,22 +425,22 @@ func WriteToDisk(c *Configuration) error {
return nil
}

// EnsurePterodactylUser ensures that the Pterodactyl core user exists on the
// EnsurePelicanUser ensures that the Pelican core user exists on the
// system. This user will be the owner of all data in the root data directory
// and is used as the user within containers. If files are not owned by this
// user there will be issues with permissions on Docker mount points.
//
// This function IS NOT thread safe and should only be called in the main thread
// when the application is booting.
func EnsurePterodactylUser() error {
func EnsurePelicanUser() error {
sysName, err := getSystemName()
if err != nil {
return err
}

// Our way of detecting if wings is running inside of Docker.
if sysName == "distroless" {
_config.System.Username = system.FirstNotEmpty(os.Getenv("WINGS_USERNAME"), "pterodactyl")
_config.System.Username = system.FirstNotEmpty(os.Getenv("WINGS_USERNAME"), "pelican")
_config.System.User.Uid = system.MustInt(system.FirstNotEmpty(os.Getenv("WINGS_UID"), "988"))
_config.System.User.Gid = system.MustInt(system.FirstNotEmpty(os.Getenv("WINGS_GID"), "988"))
return nil
Expand All @@ -458,7 +458,7 @@ func EnsurePterodactylUser() error {
return nil
}

log.WithField("username", _config.System.Username).Info("checking for pterodactyl system user")
log.WithField("username", _config.System.Username).Info("checking for pelican system user")
u, err := user.Lookup(_config.System.Username)
// If an error is returned but it isn't the unknown user error just abort
// the process entirely. If we did find a user, return it immediately.
Expand Down
6 changes: 3 additions & 3 deletions config/config_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ type DockerNetworkConfiguration struct {
// The name of the network to use. If this network already exists it will not
// be created. If it is not found, a new network will be created using the interface
// defined.
Name string `default:"pterodactyl_nw"`
Name string `default:"pelican_nw"`
ISPN bool `default:"false" yaml:"ispn"`
Driver string `default:"bridge"`
Mode string `default:"pterodactyl_nw" yaml:"network_mode"`
Mode string `default:"pelican_nw" yaml:"network_mode"`
IsInternal bool `default:"false" yaml:"is_internal"`
EnableICC bool `default:"true" yaml:"enable_icc"`
NetworkMTU int64 `default:"1500" yaml:"network_mtu"`
Expand Down Expand Up @@ -84,7 +84,7 @@ type DockerConfiguration struct {
// enabled.
//
// If the value is blank, the daemon's user namespace remapping configuration is used,
// if the value is "host", then the pterodactyl containers are started with user namespace
// if the value is "host", then the pelican containers are started with user namespace
// remapping disabled
UsernsMode string `default:"" json:"userns_mode" yaml:"userns_mode"`

Expand Down
12 changes: 6 additions & 6 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
wings:
image: ghcr.io/pterodactyl/wings:latest
image: ghcr.io/pelican-dev/wings:latest
restart: always
networks:
- wings0
Expand All @@ -14,14 +14,14 @@ services:
TZ: "UTC"
WINGS_UID: 988
WINGS_GID: 988
WINGS_USERNAME: pterodactyl
WINGS_USERNAME: pelican
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/var/lib/docker/containers/:/var/lib/docker/containers/"
- "/etc/pterodactyl/:/etc/pterodactyl/"
- "/var/lib/pterodactyl/:/var/lib/pterodactyl/"
- "/var/log/pterodactyl/:/var/log/pterodactyl/"
- "/tmp/pterodactyl/:/tmp/pterodactyl/"
- "/etc/pelican/:/etc/pelican/"
- "/var/lib/pelican/:/var/lib/pelican/"
- "/var/log/pelican/:/var/log/pelican/"
- "/tmp/pelican/:/tmp/pelican/"
- "/etc/ssl/certs:/etc/ssl/certs:ro"
# you may need /srv/daemon-data if you are upgrading from an old daemon
#- "/srv/daemon-data/:/srv/daemon-data/"
Expand Down
6 changes: 3 additions & 3 deletions environment/allocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/docker/go-connections/nat"

"github.com/pterodactyl/wings/config"
"github.com/pelican-dev/wings/config"
)

// Defines the allocations available for a given server. When using the Docker environment
Expand Down Expand Up @@ -62,14 +62,14 @@ func (a *Allocations) Bindings() nat.PortMap {
}

// Returns the bindings for the server in a way that is supported correctly by Docker. This replaces
// any reference to 127.0.0.1 with the IP of the pterodactyl0 network interface which will allow the
// any reference to 127.0.0.1 with the IP of the pelican0 network interface which will allow the
// server to operate on a local address while still being accessible by other containers.
func (a *Allocations) DockerBindings() nat.PortMap {
iface := config.Get().Docker.Network.Interface

out := a.Bindings()
// Loop over all the bindings for this container, and convert any that reference 127.0.0.1
// to use the pterodactyl0 network interface IP, as that is the true local for what people are
// to use the pelican0 network interface IP, as that is the true local for what people are
// trying to do when creating servers.
for p, binds := range out {
for i, alloc := range binds {
Expand Down
6 changes: 3 additions & 3 deletions environment/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"

"github.com/pterodactyl/wings/config"
"github.com/pelican-dev/wings/config"
)

var (
Expand Down Expand Up @@ -45,7 +45,7 @@ func ConfigureDocker(ctx context.Context) error {
return err
}

log.Info("creating missing pterodactyl0 interface, this could take a few seconds...")
log.Info("creating missing pelican0 interface, this could take a few seconds...")
if err := createDockerNetwork(ctx, cli); err != nil {
return err
}
Expand Down Expand Up @@ -91,7 +91,7 @@ func createDockerNetwork(ctx context.Context, cli *client.Client) error {
"com.docker.network.bridge.enable_icc": strconv.FormatBool(nw.EnableICC),
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "pterodactyl0",
"com.docker.network.bridge.name": "pelican0",
"com.docker.network.driver.mtu": strconv.FormatInt(nw.NetworkMTU, 10),
},
})
Expand Down
Loading
Loading