Files
OpenShell/.packit.yaml
Adam Miller 436c59a2a1 fix(rpm): restore 0.0.0.0 bind address for Podman via default gateway.toml (#1438)
* fix(rpm): restore 0.0.0.0 bind address for Podman via default gateway.toml

The gateway binary default changed to 127.0.0.1 in recent commits
(b61a98db, f257ed01). This breaks the Podman compute driver because
sandbox containers reach the gateway over the host network bridge and
cannot connect to the loopback address.

Ship a default TOML config template that the RPM systemd unit seeds
into ~/.config/openshell/gateway.toml on first start. The template
sets bind_address = "0.0.0.0:17670" and pins compute_drivers =
["podman"] to prevent unexpected driver selection when Docker is also
installed. The binary default remains 127.0.0.1 (secure-by-default
for non-RPM installs).

Changes:
- deploy/rpm/gateway.toml.default: new default config template
- openshell.spec: install template to %{_datadir}/openshell-gateway/;
  add ExecStartPre to seed ~/.config/openshell/gateway.toml on first
  start; add %check assertions for template presence and unit reference
- deploy/rpm/CONFIGURATION.md: document default config, override paths,
  and updated bind address throughout
- deploy/rpm/QUICKSTART.md: update bind address note for RPM installs
- crates/openshell-server/src/config_file.rs: contract test that parses
  the RPM template through load() and asserts bind_address=0.0.0.0
  and compute_drivers=[podman]
- e2e/with-podman-gateway.sh: start from RPM template as base config
  so e2e exercises the same TOML path RPM users get on first start

* fix(rpm): restore openshell_python_version macro in dist-info metadata

* fix(rpm): reset Packit-managed version fields to match main baseline

Version, Source0, and Source1 were stamped to 0.0.43 by Packit CI
during branch builds. Reset to 0.0.37 (current main baseline) so
the spec diff only contains our intentional changes. Packit's
fix-spec-file action will re-stamp these fields at build time.

* Revert "fix(rpm): reset Packit-managed version fields to match main baseline"

This reverts commit 8ef9d7ad8e.

* fix(rpm): introduce openshell_version macro; remove hardcoded versions

Add %global openshell_version as the single source of truth for the
package version. Version:, Source0:, Source1:, openshell_cargo_version,
and openshell_python_version all expand from this one macro.

Update .packit.yaml fix-spec-file to patch %global openshell_version
instead of the Version:, Source0:, and Source1: lines individually.
2026-05-18 16:48:35 -07:00

88 lines
4.2 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Packit configuration for OpenShell RPM builds via Fedora COPR.
# See https://packit.dev/docs/configuration for full reference.
upstream_tag_template: "v{version}"
upstream_package_name: openshell
downstream_package_name: openshell
specfile_path: openshell.spec
# Packages needed in the SRPM build environment to create vendor tarball
srpm_build_deps:
- rust
- cargo
- git-core
actions:
get-current-version:
# Release workflows pass OPENSHELL_RPM_VERSION so every artifact shares one
# precomputed identity. Local Packit runs fall back to the latest SemVer
# upstream tag, avoiding operational tags such as vm-dev; Packit normalizes
# those to invalid Cargo package versions such as m.dev.
- 'bash -c "if [ -n \"${OPENSHELL_RPM_VERSION:-}\" ]; then echo \"${OPENSHELL_RPM_VERSION}\"; else git describe --tags --match ''v[0-9]*.[0-9]*.[0-9]*'' --abbrev=0 HEAD | sed ''s/^v//''; fi"'
create-archive:
# Step 1: Create source tarball from git working tree.
# Uses git ls-files + tar instead of git archive so the tarball
# reflects any patching that Packit may have done (e.g. version bumps).
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && TMPDIR=$(mktemp -d) && DIR=openshell-${VERSION} && mkdir -p ${TMPDIR}/${DIR} && git ls-files -z | xargs -0 tar cf - | tar xf - -C ${TMPDIR}/${DIR}/ && tar -czf openshell-${VERSION}.tar.gz -C ${TMPDIR} ${DIR} && rm -rf ${TMPDIR}"'
# Step 2: Create vendored Cargo dependencies tarball for offline RPM build.
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && CARGO_HTTP_TIMEOUT=600 CARGO_NET_RETRY=5 cargo vendor --locked --quiet && tar -cJf openshell-${VERSION}-vendor.tar.xz vendor/ && rm -rf vendor/"'
# Step 3: Return the primary archive name. Packit expects create-archive
# to print one path for Source0; Source1 is patched explicitly below.
- 'bash -c "echo openshell-${PACKIT_PROJECT_VERSION}.tar.gz"'
fix-spec-file:
# Update the canonical version macro. Version:, Source0:, Source1:, and all
# other version references expand from %{openshell_version} so only this
# one line needs updating.
- 'bash -c "sed -i -r \"s/^%global openshell_version .*/%global openshell_version ${PACKIT_RPMSPEC_VERSION}/\" openshell.spec"'
# Update Release
- 'bash -c "RELEASE=${OPENSHELL_RPM_RELEASE:-${PACKIT_RPMSPEC_RELEASE}} && sed -i -r \"s/^Release:(\\s*)\\S+/Release:\\1${RELEASE}%{?dist}/\" openshell.spec"'
# Keep embedded binary metadata aligned with the release workflow. Python
# dist-info stays at the RPM Version; dev build identity is carried by
# Release so Fedora's Python RPM post-processing can normalize metadata.
- 'bash -c "if [ -n \"${OPENSHELL_CARGO_VERSION:-}\" ]; then sed -i -r \"s/^%global openshell_cargo_version .*/%global openshell_cargo_version ${OPENSHELL_CARGO_VERSION}/\" openshell.spec; fi"'
# Override image_tag to 'latest' for tagged stable releases.
# For PR and commit-to-main builds the spec default ('dev') is kept,
# matching the :dev images pushed by release-dev.yml.
- 'bash -c "if git describe --exact-match --tags HEAD 2>/dev/null | grep -qE ''^v[0-9]+\.[0-9]+\.[0-9]+$''; then sed -i ''s/^%global image_tag.*/%global image_tag latest/'' openshell.spec; fi"'
jobs:
# Build on every pull request targeting main for CI validation
- job: copr_build
trigger: pull_request
branch: main
identifier: main-pr
targets:
- fedora-all
- epel-10
# Build into maxamillion/openshell on every commit to main
# for continuous development and testing builds.
- job: copr_build
trigger: commit
branch: main
owner: "maxamillion"
project: "openshell"
identifier: main-commit
targets:
- fedora-all
- epel-10
preserve_project: true
list_on_homepage: true
# Build on GitHub releases for publishable RPMs.
# See: https://packit.dev/docs/configuration/upstream/copr_build#using-a-custom-copr-project
- job: copr_build
trigger: release
owner: "maxamillion"
project: "openshell"
targets:
- fedora-all
- epel-10
preserve_project: true
list_on_homepage: true