-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(daemon): add service with ClamAV sidecars [WIP]
- Loading branch information
1 parent
c2e7e12
commit 980353b
Showing
12 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "clamav"] | ||
path = clamav | ||
url = https://github.com/Cisco-Talos/clamav.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"recommendations": [ | ||
"coolbear.systemd-unit-file", | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"idleberg.nsis", | ||
"panicbit.cargo", | ||
"tamasfe.even-better-toml", | ||
"tauri-apps.tauri-vscode" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.0.2.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
cp clamav-desktop-daemon /usr/local/bin/ | ||
chmod +x /usr/local/bin/clamav-desktop-daemon | ||
|
||
systemctl enable clamav-desktop-daemon | ||
systemctl start clamav-desktop-daemon | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Outfile "InstallService.exe" | ||
RequestExecutionLevel admin | ||
|
||
Section | ||
SetOutPath $INSTDIR | ||
|
||
; Copy the binary to the installation directory | ||
File "clamav-desktop-daemon.exe" | ||
|
||
; Create the service | ||
nsExec::ExecToLog 'sc create clamav-desktop-daemon binPath= "$INSTDIR\clamav-desktop-daemon.exe" start= auto' | ||
Pop $0 ; Get the exit code | ||
StrCmp $0 0 +3 | ||
MessageBox MB_ICONEXCLAMATION|MB_OK "Failed to create the service. Error code $0." | ||
Quit | ||
|
||
; Start the service | ||
nsExec::ExecToLog 'sc start clamav-desktop-daemon' | ||
Pop $0 | ||
StrCmp $0 0 +3 | ||
MessageBox MB_ICONEXCLAMATION|MB_OK "Failed to start the service. Error code $0." | ||
Quit | ||
|
||
MessageBox MB_ICONINFORMATION|MB_OK "Service installed and started successfully." | ||
SectionEnd | ||
|
||
Section "Uninstall" | ||
; Stop the service before uninstalling | ||
nsExec::ExecToLog 'sc stop clamav-desktop-daemon' | ||
; TODO Find a solid way to wait for the service to stop. | ||
Sleep 3000 ; Wait for the service to stop | ||
|
||
; Delete the service | ||
nsExec::ExecToLog 'sc delete clamav-desktop-daemon' | ||
|
||
; Delete the binary | ||
Delete "$INSTDIR\clamav-desktop-daemon.exe" | ||
SectionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
cp clamav-desktop-daemon /usr/local/bin/ | ||
chmod +x /usr/local/bin/clamav-desktop-daemon | ||
|
||
launchctl load /Library/LaunchDaemons/com.clamav-desktop.service.plist | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "clamav-desktop-daemon" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |