composer.lock outdated #139

Closed
opened 2026-02-05 17:11:09 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @mark-boute on GitHub (Aug 7, 2024).

Current Behavior

When following the Get Started documentation and running composer install I get the following output:

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.

This does not matter when building on Ubuntu, but I am trying to build a NixOS derivation using php83.buildComposerProject. That requires the .lock file to be up-to-date unless I set the composerStrictValidation = true; option, which is not recommended for published packages.

Expected Behavior

I expect the composer.json and .lock files to be in sync.

Steps to Reproduce

Follow the Getting Started guide

Panel Version

v1.0.0-beta7

Wings Version

n.a.

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

pelican@boisserver:/var/www/pelican$ composer validate
./composer.json is valid, but with a few warnings
See https://getcomposer.org/doc/04-schema.md for details on the schema
# Lock file errors
- The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`.
# General warnings
- No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
Originally created by @mark-boute on GitHub (Aug 7, 2024). ### Current Behavior When following the Get Started documentation and running `composer install` I get the following output: `Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.` This does not matter when building on Ubuntu, but I am trying to build a NixOS derivation using `php83.buildComposerProject`. That requires the .lock file to be up-to-date unless I set the `composerStrictValidation = true;` option, which is not recommended for published packages. ### Expected Behavior I expect the composer.json and .lock files to be in sync. ### Steps to Reproduce Follow the Getting Started guide ### Panel Version v1.0.0-beta7 ### Wings Version n.a. ### Games and/or Eggs Affected _No response_ ### Docker Image _No response_ ### Error Logs ```bash pelican@boisserver:/var/www/pelican$ composer validate ./composer.json is valid, but with a few warnings See https://getcomposer.org/doc/04-schema.md for details on the schema # Lock file errors - The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`. # General warnings - No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license. ``` ### Is there an existing issue for this? - [X] I have searched the existing issues before opening this issue. - [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server. - [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
Author
Owner

@rmartinoscar commented on GitHub (Aug 7, 2024):

Hey we are aware of this you can skip this warning it will be patched upon next release

@rmartinoscar commented on GitHub (Aug 7, 2024): Hey we are aware of this you can skip this warning it will be patched upon next release
Author
Owner

@Silver-Golden commented on GitHub (Nov 9, 2024):

@mark-boute by any chance did ye get it to work nicely on nixos?
If so do ye have a config ye can share?

@Silver-Golden commented on GitHub (Nov 9, 2024): @mark-boute by any chance did ye get it to work nicely on nixos? If so do ye have a config ye can share?
Author
Owner

@mark-boute commented on GitHub (Nov 9, 2024):

@mark-boute by any chance did ye get it to work nicely on nixos?
If so do ye have a config ye can share?

Semi-working.
We managed to get it to build by changing a setting to not evaluate the lockfile, but decided to install the panel manually as it's essentially just a webpage.
We did get wings working. I think the repo is now private, so I'll check for relevant code real quick.

@mark-boute commented on GitHub (Nov 9, 2024): > @mark-boute by any chance did ye get it to work nicely on nixos? > If so do ye have a config ye can share? Semi-working. We managed to get it to build by changing a setting to not evaluate the lockfile, but decided to install the panel manually as it's essentially just a webpage. We did get wings working. I think the repo is now private, so I'll check for relevant code real quick.
Author
Owner

@mark-boute commented on GitHub (Nov 9, 2024):

Services

{ inputs, pkgs, lib, config, ... }:

with lib; let
  cfg = config.modules.pelican-panel;
  dir = "/var/www/pelican";
in {
  options = {
    modules.pelican-panel = {
      enable = mkEnableOption "Pelican Panel";
    };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [
      pkgs.curl
      pkgs.gnutar
      pkgs.unzip
      pkgs.php83
      pkgs.php83Packages.composer
      pkgs.php83Extensions.gd
      pkgs.php83Extensions.mysqli
      pkgs.php83Extensions.mbstring
      pkgs.php83Extensions.bcmath
      pkgs.php83Extensions.xml
      pkgs.php83Extensions.curl
      pkgs.php83Extensions.zip
      pkgs.php83Extensions.intl
      pkgs.php83Extensions.sqlite3
      ( import ./pelican-install.nix { inherit pkgs; inherit dir; } )
      ( import ./pelican-update.nix { inherit pkgs; inherit dir; } )
    ];

    systemd.timers."pelican-cron" = {
      wantedBy = [ "timers.target" ];
      timerConfig = {
        OnBootSec = "5m";
        OnUnitActiveSec = "1m";
        Unit = "pelican-cron.service";
      };
    };

    systemd.services."pelican-cron" = {
      script = ''
        ${pkgs.php83}/bin/php ${dir}/artisan schedule:run >> /dev/null 2>&1
      '';
      serviceConfig = {
        Type = "oneshot";
      };
    };

    systemd.services.pelican-queue = {
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
          User = "nginx";
          Group = "nginx";
          Restart = "always";
          ExecStart = "${pkgs.php83}/bin/php ${dir}/artisan queue:work --tries=3";
          startLimitInterval = 180;
          startLimitBurst = 30;
          RestartSec = "5";
      };
    };
  };
}

Install script

{ pkgs, dir }:

pkgs.writeShellScriptBin "pelican-install" ''
  DIR=${dir}
  
  echo "Installing Pelican panel to $DIR ..."
  if [ -d $DIR ]; then
    echo "Directory $DIR already exists, exiting"
    exit 1
  fi
  echo "Creating directory ..."
  mkdir -p $DIR
  cd $DIR

  echo "Downloading Pelican panel ..."
  curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | tar -xzv
  echo "Installing Pelican panel using composer ..."
  yes | composer install --no-dev --optimize-autoloader

  echo "Setting up the environment ..."
  yes "" | php artisan p:environment:setup

  echo "Setting permissions ..."
  chmod -R 755 storage/* bootstrap/cache/
  chown -R nginx:nginx $DIR

  echo "Pelican panel installed successfully"
''

Wings package derivation

{ stdenv, lib, fetchurl, docker, gnutar }:

stdenv.mkDerivation rec {
  pname = "pelican-wings";
  version = "v1.0.0-beta6";

  src = fetchurl {
    url = "https://github.com/pelican-dev/wings/releases/download/${version}/wings_linux_amd64";
    hash = "sha256-a2T4BjqS8Hy5YqwDEJpbvGqqsrVjdRhxvJLgk3MCXag=";
  };

  buildInputs = [ docker gnutar ];

  phases = [ "installPhase" ];

  installPhase = ''
    install -D $src $out/bin/wings
  '';
}

And to enable the wings service

{ inputs, pkgs, lib, config, ... }:

with lib; let
  cfg = config.modules.pelican-wings;
in {
  options = {
    modules.pelican-wings = {
      enable = mkEnableOption "Pelican Wings";
    };
  };

  config = mkIf cfg.enable {
    networking.firewall.allowedTCPPorts = [ 8080 8443 ];

    virtualisation.docker.enable = true;

    environment.systemPackages = [
      ( pkgs.callPackage ./package.nix {} )
    ];

    systemd.services.pelican-wings = {
      description = "Wings Daemon";
      after = [ "docker.service" ];
      requires = [ "docker.service" ];
      partOf = [ "docker.service" ];

      serviceConfig = {
        User = "root";
        WorkingDirectory = "/etc/pelican";
        LimitNOFILE = 4096;
        PIDFile = "/var/run/wings/daemon.pid";
        ExecStart = "/run/current-system/sw/bin/wings";
        Restart = "on-failure";
        startLimitInterval = 180;
        startLimitBurst = 30;
        RestartSec = "5";
      };

      wantedBy = [ "multi-user.target" ];
    };
  };
}
@mark-boute commented on GitHub (Nov 9, 2024): Services ```nix { inputs, pkgs, lib, config, ... }: with lib; let cfg = config.modules.pelican-panel; dir = "/var/www/pelican"; in { options = { modules.pelican-panel = { enable = mkEnableOption "Pelican Panel"; }; }; config = mkIf cfg.enable { environment.systemPackages = [ pkgs.curl pkgs.gnutar pkgs.unzip pkgs.php83 pkgs.php83Packages.composer pkgs.php83Extensions.gd pkgs.php83Extensions.mysqli pkgs.php83Extensions.mbstring pkgs.php83Extensions.bcmath pkgs.php83Extensions.xml pkgs.php83Extensions.curl pkgs.php83Extensions.zip pkgs.php83Extensions.intl pkgs.php83Extensions.sqlite3 ( import ./pelican-install.nix { inherit pkgs; inherit dir; } ) ( import ./pelican-update.nix { inherit pkgs; inherit dir; } ) ]; systemd.timers."pelican-cron" = { wantedBy = [ "timers.target" ]; timerConfig = { OnBootSec = "5m"; OnUnitActiveSec = "1m"; Unit = "pelican-cron.service"; }; }; systemd.services."pelican-cron" = { script = '' ${pkgs.php83}/bin/php ${dir}/artisan schedule:run >> /dev/null 2>&1 ''; serviceConfig = { Type = "oneshot"; }; }; systemd.services.pelican-queue = { wantedBy = [ "multi-user.target" ]; serviceConfig = { User = "nginx"; Group = "nginx"; Restart = "always"; ExecStart = "${pkgs.php83}/bin/php ${dir}/artisan queue:work --tries=3"; startLimitInterval = 180; startLimitBurst = 30; RestartSec = "5"; }; }; }; } ``` Install script ```nix { pkgs, dir }: pkgs.writeShellScriptBin "pelican-install" '' DIR=${dir} echo "Installing Pelican panel to $DIR ..." if [ -d $DIR ]; then echo "Directory $DIR already exists, exiting" exit 1 fi echo "Creating directory ..." mkdir -p $DIR cd $DIR echo "Downloading Pelican panel ..." curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | tar -xzv echo "Installing Pelican panel using composer ..." yes | composer install --no-dev --optimize-autoloader echo "Setting up the environment ..." yes "" | php artisan p:environment:setup echo "Setting permissions ..." chmod -R 755 storage/* bootstrap/cache/ chown -R nginx:nginx $DIR echo "Pelican panel installed successfully" '' ``` Wings package derivation ```nix { stdenv, lib, fetchurl, docker, gnutar }: stdenv.mkDerivation rec { pname = "pelican-wings"; version = "v1.0.0-beta6"; src = fetchurl { url = "https://github.com/pelican-dev/wings/releases/download/${version}/wings_linux_amd64"; hash = "sha256-a2T4BjqS8Hy5YqwDEJpbvGqqsrVjdRhxvJLgk3MCXag="; }; buildInputs = [ docker gnutar ]; phases = [ "installPhase" ]; installPhase = '' install -D $src $out/bin/wings ''; } ``` And to enable the wings service ```nix { inputs, pkgs, lib, config, ... }: with lib; let cfg = config.modules.pelican-wings; in { options = { modules.pelican-wings = { enable = mkEnableOption "Pelican Wings"; }; }; config = mkIf cfg.enable { networking.firewall.allowedTCPPorts = [ 8080 8443 ]; virtualisation.docker.enable = true; environment.systemPackages = [ ( pkgs.callPackage ./package.nix {} ) ]; systemd.services.pelican-wings = { description = "Wings Daemon"; after = [ "docker.service" ]; requires = [ "docker.service" ]; partOf = [ "docker.service" ]; serviceConfig = { User = "root"; WorkingDirectory = "/etc/pelican"; LimitNOFILE = 4096; PIDFile = "/var/run/wings/daemon.pid"; ExecStart = "/run/current-system/sw/bin/wings"; Restart = "on-failure"; startLimitInterval = 180; startLimitBurst = 30; RestartSec = "5"; }; wantedBy = [ "multi-user.target" ]; }; }; } ```
Author
Owner

@Silver-Golden commented on GitHub (Nov 9, 2024):

That's amazing!
by any chance do ye also have the pelican-update.nix ? I see it referenced above.

I honestly thought the wings would have been harder to make work than that

@Silver-Golden commented on GitHub (Nov 9, 2024): That's amazing! by any chance do ye also have the ``pelican-update.nix`` ? I see it referenced above. I honestly thought the wings would have been harder to make work than that
Author
Owner

@matthijsk16 commented on GitHub (Nov 9, 2024):

Update script

{ pkgs, dir }:

pkgs.writeShellScriptBin "pelican-update" ''
  DIR=${dir}
  
  echo "Updateing Pelican panel in $DIR ..."
  if [ -d $DIR ]; then
    echo "Directory $DIR found, entering maintenance mode ..."
  else
    echo "Directory $DIR does not exist, exiting"
    exit 1
  fi
  
  cd $DIR
  php artisan down

  echo "Downloading Pelican panel update ..."
  curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | tar -xzv

  echo "Setting permissions ..."
  chmod -R 755 storage/* bootstrap/cache

  echo "Updating Pelican panel using composer ..."
  yes | composer install --no-dev --optimize-autoloader

  echo "Clearing compiled template cache ..."
  php artisan view:clear
  php artisan config:clear 

  echo "Optimizing Pelican panel ..."
  php artisan filament:optimize

  echo "Updating the database ..."
  php artisan migrate --seed --force

  echo "Setting permissions ..."
  chown -R nginx:nginx $DIR

  echo "Restart Pelican queue service ..."
  systemctl restart pelican-queue.service

  echo "Exiting maintenance mode ..."
  php artisan up

  echo "Pelican panel updated successfully"
''

I want to add an important disclaimer for both the install and update script:
Since Pelican is in beta, the install/update process can change with a new update. Therefore always first check the Pelican docs and change the above script before executing it.

Also, if you ever come across a way to install Pelican the full nix way, please let us know!

EDIT:
Almost forgot, but you also need nginx and its config:

{ lib, config, pkgs, ... }:
with lib;
let
  appUser = "nginx";
  name = "panel";
  module = "pelican-panel";
  cfg = config.modules.nginx.${name};
  serverName = "${name}.<DOMAIN NAME>";
  dataDir = "/var/www/pelican/public";
  port = 443;
in
{
  options.modules.nginx.${name} = {
    enable = mkEnableOption "Enable ${name}";
  };

  config = mkIf cfg.enable {
    modules.${module}.enable = true;
    networking.firewall.allowedTCPPorts = [ port ];

    services.phpfpm.pools.${appUser} = {
      user = appUser;
      settings = {
        "listen.owner" = appUser;
        "listen.group" = appUser;
        "listen.mode" = "0600";
        "pm" = "dynamic";
        "pm.max_children" = 75;
        "pm.start_servers" = 10;
        "pm.min_spare_servers" = 5;
        "pm.max_spare_servers" = 20;
        "pm.max_requests" = 500;
        "catch_workers_output" = 1;
      };
    };

    services.nginx.virtualHosts."${serverName}" = {
      root = "${dataDir}";
      listen = [{ inherit port; addr="0.0.0.0"; ssl=true; }];

      forceSSL = true;
      enableACME = true;

      extraConfig = ''
        index index.html index.htm index.php;
        charset utf-8;

        access_log off;
        error_log  /var/log/nginx/pelican.app-error.log error;

        client_max_body_size 100m;
        client_body_timeout 120s;

        sendfile off;

        ssl_session_cache shared:SSL:10m;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
        ssl_prefer_server_ciphers on;

        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header Content-Security-Policy "frame-ancestors 'self'";
        add_header X-Frame-Options DENY;
        add_header Referrer-Policy same-origin;
      '';

      locations = {
        "/" = {
          extraConfig = ''       
            try_files $uri $uri/ /index.php?$query_string;
          '';
	      };

        "/favicon.ico".extraConfig = ''
          access_log off;
          log_not_found off;
        '';

        "/robots.txt".extraConfig = ''
          access_log off;
          log_not_found off;
        '';
      
        "~ \\.php$"  = {         
          extraConfig = ''
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:${config.services.phpfpm.pools.${appUser}.socket};
            fastcgi_index index.php;
            include ${config.services.nginx.package}/conf/fastcgi_params;
            fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTP_PROXY "";
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
            fastcgi_connect_timeout 300;
            fastcgi_send_timeout 300;
            fastcgi_read_timeout 300;      
          '';
        };

        "~ /\\.ht".extraConfig = ''
          deny all;
        '';
      };
    };
  };
}

@matthijsk16 commented on GitHub (Nov 9, 2024): Update script ```nix { pkgs, dir }: pkgs.writeShellScriptBin "pelican-update" '' DIR=${dir} echo "Updateing Pelican panel in $DIR ..." if [ -d $DIR ]; then echo "Directory $DIR found, entering maintenance mode ..." else echo "Directory $DIR does not exist, exiting" exit 1 fi cd $DIR php artisan down echo "Downloading Pelican panel update ..." curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | tar -xzv echo "Setting permissions ..." chmod -R 755 storage/* bootstrap/cache echo "Updating Pelican panel using composer ..." yes | composer install --no-dev --optimize-autoloader echo "Clearing compiled template cache ..." php artisan view:clear php artisan config:clear echo "Optimizing Pelican panel ..." php artisan filament:optimize echo "Updating the database ..." php artisan migrate --seed --force echo "Setting permissions ..." chown -R nginx:nginx $DIR echo "Restart Pelican queue service ..." systemctl restart pelican-queue.service echo "Exiting maintenance mode ..." php artisan up echo "Pelican panel updated successfully" '' ``` I want to add an important disclaimer for both the install and update script: Since Pelican is in beta, the install/update process can change with a new update. Therefore always first check the Pelican docs and change the above script before executing it. Also, if you ever come across a way to install Pelican the full nix way, please let us know! EDIT: Almost forgot, but you also need nginx and its config: ```nix { lib, config, pkgs, ... }: with lib; let appUser = "nginx"; name = "panel"; module = "pelican-panel"; cfg = config.modules.nginx.${name}; serverName = "${name}.<DOMAIN NAME>"; dataDir = "/var/www/pelican/public"; port = 443; in { options.modules.nginx.${name} = { enable = mkEnableOption "Enable ${name}"; }; config = mkIf cfg.enable { modules.${module}.enable = true; networking.firewall.allowedTCPPorts = [ port ]; services.phpfpm.pools.${appUser} = { user = appUser; settings = { "listen.owner" = appUser; "listen.group" = appUser; "listen.mode" = "0600"; "pm" = "dynamic"; "pm.max_children" = 75; "pm.start_servers" = 10; "pm.min_spare_servers" = 5; "pm.max_spare_servers" = 20; "pm.max_requests" = 500; "catch_workers_output" = 1; }; }; services.nginx.virtualHosts."${serverName}" = { root = "${dataDir}"; listen = [{ inherit port; addr="0.0.0.0"; ssl=true; }]; forceSSL = true; enableACME = true; extraConfig = '' index index.html index.htm index.php; charset utf-8; access_log off; error_log /var/log/nginx/pelican.app-error.log error; client_max_body_size 100m; client_body_timeout 120s; sendfile off; ssl_session_cache shared:SSL:10m; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"; ssl_prefer_server_ciphers on; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header Content-Security-Policy "frame-ancestors 'self'"; add_header X-Frame-Options DENY; add_header Referrer-Policy same-origin; ''; locations = { "/" = { extraConfig = '' try_files $uri $uri/ /index.php?$query_string; ''; }; "/favicon.ico".extraConfig = '' access_log off; log_not_found off; ''; "/robots.txt".extraConfig = '' access_log off; log_not_found off; ''; "~ \\.php$" = { extraConfig = '' fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:${config.services.phpfpm.pools.${appUser}.socket}; fastcgi_index index.php; include ${config.services.nginx.package}/conf/fastcgi_params; fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M"; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTP_PROXY ""; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; ''; }; "~ /\\.ht".extraConfig = '' deny all; ''; }; }; }; } ```
Author
Owner

@rmartinoscar commented on GitHub (Nov 9, 2024):

Please make a PR.

@rmartinoscar commented on GitHub (Nov 9, 2024): Please make a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel-pelican-dev#139