Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lapi credentials creation for debian package #2646

Merged
merged 7 commits into from Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/postinst
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions rpm/SPECS/crowdsec.spec
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion windows/installer/product.wxs
Expand Up @@ -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" />
Expand Down