Skip to content

Commit 0b3ac94

Browse files
committed
update install scripts
avoid "install /dev/stdin"
1 parent 193d9e2 commit 0b3ac94

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ jobs:
7575
sudo -E $(which uv) run pytest ./tests/install/no_crowdsec
7676
# these need a running crowdsec
7777
docker run -d --name crowdsec -e CI_TESTING=true -e DISABLE_ONLINE_API=true -e CROWDSEC_BYPASS_DB_VOLUME_CHECK=true -p 8080:8080 -ti crowdsecurity/crowdsec
78-
install -m 0755 /dev/stdin /usr/local/bin/cscli <<'EOT'
78+
cat >/usr/local/bin/cscli <<'EOT'
7979
#!/bin/sh
8080
docker exec crowdsec cscli "$@"
8181
EOT
82+
chmod u+x /usr/local/bin/cscli
8283
sleep 5
8384
sudo -E $(which uv) run pytest ./tests/install/with_crowdsec
8485

debian/rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ override_dh_auto_install:
1919
install -D "$$BOUNCER" -t "debian/$$PKG/usr/bin/"; \
2020
install -D "scripts/_bouncer.sh" -t "debian/$$PKG/usr/lib/$$PKG/"; \
2121
install -D "config/$$BOUNCER.yaml" "debian/$$PKG/etc/crowdsec/bouncers/$$BOUNCER.yaml"; \
22-
BIN="/usr/bin/$$BOUNCER" CFG="/etc/crowdsec/bouncers" envsubst '$$BIN $$CFG' < "config/$$BOUNCER.service" | install -D /dev/stdin "debian/$$PKG/etc/systemd/system/$$BOUNCER.service"
22+
mkdir -p "debian/$$PKG/etc/systemd/system"; \
23+
BIN="/usr/bin/$$BOUNCER" CFG="/etc/crowdsec/bouncers" envsubst '$$BIN $$CFG' < "config/$$BOUNCER.service" > "debian/$$PKG/etc/systemd/system/$$BOUNCER.service"
2324

2425
execute_after_dh_fixperms:
2526
@BOUNCER=crowdsec-custom-bouncer; \

rpm/SPECS/crowdsec-custom-bouncer.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ mkdir -p %{buildroot}%{_bindir}
3535
install -m 755 -D %{name} %{buildroot}%{_bindir}/%{name}
3636
install -m 600 -D config/%{name}.yaml %{buildroot}/etc/crowdsec/bouncers/%{name}.yaml
3737
install -m 600 -D scripts/_bouncer.sh %{buildroot}/usr/lib/%{name}/_bouncer.sh
38-
BIN=%{_bindir}/%{name} CFG=/etc/crowdsec/bouncers envsubst '$BIN $CFG' < config/%{name}.service | install -m 0644 -D /dev/stdin %{buildroot}%{_unitdir}/%{name}.service
38+
39+
mkdir -p %{buildroot}%{_unitdir}
40+
BIN=%{_bindir}/%{name} CFG=/etc/crowdsec/bouncers envsubst '$BIN $CFG' < config/%{name}.service > %{buildroot}%{_unitdir}/%{name}.service
3941

4042
%clean
4143
rm -rf %{buildroot}

0 commit comments

Comments
 (0)