Compare commits

...

6 commits

Author SHA1 Message Date
sabban
185c1ca600 add --force to keep with the legacy behavior 2023-12-08 10:59:58 +01:00
sabban
b59fb8ef43 fix and simplify rpm post installation script 2023-12-08 10:40:06 +01:00
sabban
9fb31b613d fix post installation scripts 2023-12-08 10:23:30 +01:00
sabban
cfcbcd1ca1 fix windows installer as well 2023-12-08 09:50:14 +01:00
sabban
fcad7484e4 fix rpm spec 2023-12-08 08:21:09 +01:00
sabban
53584a8a56 fix lapi credentials creation for debian package 2023-12-07 23:02:23 +01:00
3 changed files with 3 additions and 11 deletions

2
debian/postinst vendored
View file

@ -58,7 +58,7 @@ if [ "$1" = configure ]; then
db_get crowdsec/capi
CAPI=$RET
cscli machines add -a
[ -s /etc/crowdsec/local_api_credentials.yaml ] || cscli machines add -a --force
if [ "$CAPI" = true ]; then
cscli capi register

View file

@ -167,19 +167,11 @@ if [ $1 == 1 ]; then
SILENT=true TMP_ACQUIS_FILE_SKIP=skip genacquisition
set +e
fi
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] && [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
install -m 600 /dev/null %{_sysconfdir}/crowdsec/online_api_credentials.yaml
install -m 600 /dev/null %{_sysconfdir}/crowdsec/local_api_credentials.yaml
cscli capi register
cscli machines add -a
fi
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] ; then
touch %{_sysconfdir}/crowdsec/online_api_credentials.yaml
cscli capi register
fi
if [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
touch %{_sysconfdir}/crowdsec/local_api_credentials.yaml
cscli machines add -a
cscli machines add -a --force
fi
cscli hub update

View file

@ -143,7 +143,7 @@
<CustomAction Id="FixPermissionsCreds" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<SetProperty Id="FixPermissionsNotif" Value="&quot;icacls.exe&quot; C:\ProgramData\CrowdSec\config\notifications\*.yaml /inheritance:r /grant:r *S-1-5-32-544:(F)" Sequence="execute" Before="FixPermissionsNotif" />
<CustomAction Id="FixPermissionsNotif" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<SetProperty Id="RegisterMachine" Value="&quot;[INSTALLDIR]\cscli.exe&quot; machines add -a" Sequence="execute" Before="RegisterMachine" />
<SetProperty Id="RegisterMachine" Value="&quot;[INSTALLDIR]\cscli.exe&quot; machines add -a --force" Sequence="execute" Before="RegisterMachine" />
<CustomAction Id="RegisterMachine" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />
<SetProperty Id="RegisterCAPI" Value="&quot;[INSTALLDIR]\cscli.exe&quot; capi register" Sequence="execute" Before="RegisterMachine" />
<CustomAction Id="RegisterCAPI" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />