Skip to content

Conversation

rkoumis
Copy link
Owner

@rkoumis rkoumis commented Jun 23, 2025

I want to build an RPM for CentOS 7

Currently it will build a (non-working) RPM, but only when the Taskfile has ignore_error: true. Without that, it fails to build.

@rkoumis rkoumis force-pushed the centos7-build-rpm branch from 82deeaf to 84c0ce1 Compare July 31, 2025 20:15
@rkoumis rkoumis requested a review from Copilot August 1, 2025 16:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for building an RPM package for CentOS 7 by implementing OS-specific configurations and dependency management to handle the constraints of this older operating system.

Key changes include:

  • CentOS 7 detection and repository configuration to use vault.centos.org instead of mirror.centos.org
  • Version downgrades for Node.js (22→16), pnpm (10→8), and OpenResty (latest→1.25) to ensure compatibility
  • Removal of libcidr-ffi dependency which is unavailable on CentOS 7, with IP validation temporarily disabled

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tasks/install-system-build-dependencies Adds CentOS 7 repository configuration and epel-release installation
tasks/deps/openresty Downgrades OpenResty to 1.25.3.2 for CentOS 7 compatibility
tasks/deps/fluent-bit Uses cmake3 instead of cmake on CentOS 7
tasks/build-deps/pnpm Downgrades pnpm to version 8.15.9 for CentOS 7
tasks/build-deps/nodejs Downgrades Node.js to version 16.17.0 for CentOS 7
Multiple pnpm task files Changes from --frozen-lockfile to --force for package installation
IP validation files Removes libcidr-ffi dependency and disables IP validation functionality
src/api-umbrella-git-1.rockspec Removes libcidr-ffi dependency and downgrades luautf8 version
build/package_dependencies.sh Updates package dependencies for CentOS 7 build requirements
build/package/docker_script Adds CentOS repository configuration for Docker builds
build/package/Gemfile Adds old rake version for compatibility
Taskfile.yml Adds ignore_error flag to default task

Comment on lines 1 to +18

local settings_keys = {
"original_api_settings",
"original_user_settings",
}

local function ip_in_cidrs(ip, allowed_ips)
local ip_cidr = cidr.from_str(ip)
-- local ip_cidr = cidr.from_str(ip)

for _, allowed_ip in ipairs(allowed_ips) do
local allowed_cidr = cidr.from_str(allowed_ip)
if cidr.contains(allowed_cidr, ip_cidr) then
return true
end
end
-- for _, allowed_ip in ipairs(allowed_ips) do
-- local allowed_cidr = cidr.from_str(allowed_ip)
-- if cidr.contains(allowed_cidr, ip_cidr) then
-- return true
-- end
-- end

return false
-- return false
return true
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IP validation is completely disabled by always returning true. This creates a security vulnerability as any IP address will be allowed through, bypassing intended access controls.

Copilot uses AI. Check for mistakes.

cp "$SOURCE_DIR/src/api-umbrella/web-app/package.json" ./
cp "$SOURCE_DIR/src/api-umbrella/web-app/pnpm-lock.yaml" ./
PATH="$DEV_PATH" pnpm install --frozen-lockfile
PATH="$DEV_PATH" pnpm install --force
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --force instead of --frozen-lockfile bypasses dependency version validation and may lead to inconsistent builds. This could introduce unexpected dependency versions that haven't been tested.

Suggested change
PATH="$DEV_PATH" pnpm install --force
PATH="$DEV_PATH" pnpm install --frozen-lockfile

Copilot uses AI. Check for mistakes.

cp "$SOURCE_DIR/src/api-umbrella/example-website/package.json" ./
cp "$SOURCE_DIR/src/api-umbrella/example-website/pnpm-lock.yaml" ./
PATH="$DEV_PATH" pnpm install --frozen-lockfile
PATH="$DEV_PATH" pnpm install --force
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --force instead of --frozen-lockfile bypasses dependency version validation and may lead to inconsistent builds. This could introduce unexpected dependency versions that haven't been tested.

Suggested change
PATH="$DEV_PATH" pnpm install --force
PATH="$DEV_PATH" pnpm install --frozen-lockfile

Copilot uses AI. Check for mistakes.

cp "$SOURCE_DIR/src/api-umbrella/admin-ui/package.json" ./
cp "$SOURCE_DIR/src/api-umbrella/admin-ui/pnpm-lock.yaml" ./
PATH="$DEV_PATH" pnpm install --frozen-lockfile
PATH="$DEV_PATH" pnpm install --force
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --force instead of --frozen-lockfile bypasses dependency version validation and may lead to inconsistent builds. This could introduce unexpected dependency versions that haven't been tested.

Suggested change
PATH="$DEV_PATH" pnpm install --force
PATH="$DEV_PATH" pnpm install --frozen-lockfile

Copilot uses AI. Check for mistakes.

default:
cmds:
- task: all
ignore_error: true
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding ignore_error: true to the default task masks build failures and makes it difficult to identify when the build process encounters problems. This could hide important issues that need to be addressed.

Suggested change
ignore_error: true

Copilot uses AI. Check for mistakes.

Comment on lines +3 to +5
# childprocess needs rake to build. Use an old rake version,
# because new rake needs new Ruby
gem "rake", "~> 0.9.2.2"
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an extremely old version of rake (0.9.2.2 from 2012) introduces potential security vulnerabilities. This version is over 12 years old and likely contains unpatched security issues.

Suggested change
# childprocess needs rake to build. Use an old rake version,
# because new rake needs new Ruby
gem "rake", "~> 0.9.2.2"
# childprocess needs rake to build. Use a newer rake version compatible with your Ruby.
# If you are using Ruby >= 2.2, you can use rake ~> 12.3. If you are using Ruby >= 2.5, use rake ~> 13.0.
gem "rake", "~> 12.3"

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant