From 021f8f999968d680610895d292e86a4b577ada25 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 16:11:37 -0500 Subject: [PATCH 01/52] add GoogleChromeUpdateInfoProvider Processor --- .../GoogleChromeUpdateInfoProvider.py | 148 ++++++++++++++++++ ...eChromeUpdateInfoProvider.test.recipe.yaml | 24 +++ 2 files changed, 172 insertions(+) create mode 100644 SharedProcessors/GoogleChromeUpdateInfoProvider.py create mode 100644 Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py new file mode 100644 index 0000000..d3f7bad --- /dev/null +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -0,0 +1,148 @@ +#!/usr/local/autopkg/python +# +# based upon a script written by JasonWalker +# +# Related: +# - https://github.com/hjuutilainen/adminscripts/blob/master/chrome-enable-autoupdates.py +# - https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c +# +import uuid +from xml.etree import ElementTree as ET + +import requests +from autopkglib import Processor, ProcessorError + +__all__ = ["GoogleChromeUpdateInfoProvider"] + + +class GoogleChromeUpdateInfoProvider(Processor): + """Gets a static url for latest Chrome Download""" + + description = ( + "Provides download information for the latest version of Google Chrome." + ) + input_variables = { + # "chrome_channel": { + # "required": False, + # "default": "stable", + # "description": "Update channel (e.g., stable, beta, dev).", + # }, + "chrome_os": { + "required": False, + "default": "win", + "description": "Operating system (e.g., win, mac, linux).", + }, + # "chrome_arch": { + # "required": False, + # "default": "x64", + # "description": "Architecture (e.g., x64, x86).", + # }, + "chrome_os_version": { + "required": False, + "default": "10.0", + "description": "Operating system version (e.g., 10.0, 6.2).", + }, + # "chrome_version": { + # "required": False, + # "default": "", + # "description": "Target Chrome version. Leave empty for the latest available.", + # }, + "chrome_appid": { + "required": False, + "default": "{8A69D345-D564-463C-AFF1-A69D9E530F96}", + "description": "For MacOS set to `com.google.Chrome`.", + }, + } + output_variables = { + "chrome_package_name": {"description": "Name of the Chrome package."}, + "chrome_package_sha256": {"description": "SHA256 hash of the Chrome package."}, + "chrome_package_size": {"description": "Size of the Chrome package."}, + "chrome_download_urls": { + "description": "List of download URLs for the Chrome package." + }, + "url": {"description": "A single download url for the Chrome package."}, + } + + def main(self): + """Execution starts here""" + + request_id = str(uuid.uuid4()).upper() + # session_id = str(uuid.uuid4()).upper() + + # channel = self.env.get("chrome_channel") + os = self.env.get("chrome_os") + # arch = self.env.get("chrome_arch") + os_version = self.env.get("chrome_os_version") + # chrome_version = self.env.get("chrome_version", "") + chrome_appid = self.env.get("chrome_appid", "") + + # update_request = f""" + # + # + # + # + # + # """ + + # from: https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c + update_request = f""" + + + + + + + """ + + update_request_url = "https://tools.google.com/service/update2" + + headers = { + "Content-Type": "application/x-www-form-urlencoded", + "X-Goog-Update-Interactivity": "fg", + } + + response = requests.post( + url=update_request_url, headers=headers, data=update_request, timeout=90 + ) + if not response.ok: + raise ProcessorError( + f"Error reported: {response.status_code} : {response.text}" + ) + + content_xml = ET.fromstring(response.content) + try: + package_name = content_xml.find( + "app/updatecheck/manifest/packages/package" + ).get("name") + package_sha256 = content_xml.find( + "app/updatecheck/manifest/packages/package" + ).get("hash_sha256") + package_size = content_xml.find( + "app/updatecheck/manifest/packages/package" + ).get("size") + except AttributeError as err: + self.output(response.text) + raise err + + urls = [ + url.get("codebase") + for url in content_xml.findall("app/updatecheck/urls/url") + ] + + self.env["chrome_package_name"] = package_name + self.env["chrome_package_sha256"] = package_sha256 + self.env["chrome_package_size"] = package_size + self.env["chrome_download_urls"] = urls + + # Note, it might make sense to filter the list in a smarter way: + self.env["url"] = urls[-1] + + # self.output( + # f"\nUpdates found:\nName: {package_name}\nSHA256: {package_sha256}\nSize: {package_size}\nDownload URLs: {urls}" + # ) + + +if __name__ == "__main__": + processor = GoogleChromeUpdateInfoProvider() + processor.execute_shell() diff --git a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml new file mode 100644 index 0000000..7bfd85c --- /dev/null +++ b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml @@ -0,0 +1,24 @@ +--- +Description: Test GoogleChromeUpdateInfoProvider Processor +Identifier: com.github.jgstew.test.GoogleChromeUpdateInfoProvider +Input: + NAME: GoogleChromeUpdateInfoProviderTest +MinimumVersion: "2.3" +Process: + - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider + + - Processor: com.github.jgstew.SharedProcessors/AssertInputContainsString + Arguments: + input_string: "%chrome_package_name%" + assert_string: "chrome_installer." + + - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider + Arguments: + chrome_os: mac + chrome_os_version: "10.12" + chrome_appid: com.google.Chrome + + - Processor: com.github.jgstew.SharedProcessors/AssertInputContainsString + Arguments: + input_string: "%chrome_package_name%" + assert_string: "GoogleChrome-" From 53e58f986bde57da93fe632aae108d34f75d81cd Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 16:15:32 -0500 Subject: [PATCH 02/52] tweak import --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index d3f7bad..4346d90 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -7,7 +7,7 @@ # - https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c # import uuid -from xml.etree import ElementTree as ET +import xml.etree.ElementTree import requests from autopkglib import Processor, ProcessorError @@ -110,7 +110,7 @@ def main(self): f"Error reported: {response.status_code} : {response.text}" ) - content_xml = ET.fromstring(response.content) + content_xml = xml.etree.ElementTree.fromstring(response.content) try: package_name = content_xml.find( "app/updatecheck/manifest/packages/package" From 4a45d7c9b757008c7a6f39ecd19a048b09699a9a Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 17:21:45 -0500 Subject: [PATCH 03/52] remove unused lang= --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index 4346d90..0485bf8 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -89,7 +89,7 @@ def main(self): update_request = f""" - + From da3df045caeed25d5c824a8935fd825f8baedf6a Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 17:38:28 -0500 Subject: [PATCH 04/52] add comments --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index 0485bf8..c7d5bb4 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -3,8 +3,13 @@ # based upon a script written by JasonWalker # # Related: +# - https://github.com/google/omaha/blob/main/doc/ServerProtocolV3.md +# - https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/protocol_3_1.md # - https://github.com/hjuutilainen/adminscripts/blob/master/chrome-enable-autoupdates.py # - https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c +# - https://squirrelistic.com/blog/how_to_download_older_version_of_google_chrome +# - https://github.com/SukkaW/CheckChrome +# - https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/protocol_3_1.md # import uuid import xml.etree.ElementTree From 0aa2e5036f1ccd1ac69fcfb0599b8df51d4cfe00 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 17:48:57 -0500 Subject: [PATCH 05/52] rename some vars, add comments --- .../GoogleChromeUpdateInfoProvider.py | 36 +++++++++++++++---- ...eChromeUpdateInfoProvider.test.recipe.yaml | 2 +- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index c7d5bb4..56e2246 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -32,12 +32,12 @@ class GoogleChromeUpdateInfoProvider(Processor): # "default": "stable", # "description": "Update channel (e.g., stable, beta, dev).", # }, - "chrome_os": { + "chrome_os_platform": { "required": False, "default": "win", "description": "Operating system (e.g., win, mac, linux).", }, - # "chrome_arch": { + # "chrome_os_arch": { # "required": False, # "default": "x64", # "description": "Architecture (e.g., x64, x86).", @@ -75,12 +75,36 @@ def main(self): # session_id = str(uuid.uuid4()).upper() # channel = self.env.get("chrome_channel") - os = self.env.get("chrome_os") - # arch = self.env.get("chrome_arch") - os_version = self.env.get("chrome_os_version") + chrome_os_platform = self.env.get("chrome_os_platform") + # arch = self.env.get("chrome_os_arch") + chrome_os_version = self.env.get("chrome_os_version") # chrome_version = self.env.get("chrome_version", "") chrome_appid = self.env.get("chrome_appid", "") + # chrome_os_platform must be one of: + # "android" or "Android": Android. + # "chromeos" or "ChromeOS" or "Chrome OS": Chrome OS. + # "chromiumos" or "ChromiumOS" or "Chromium OS": Chromium OS. + # "dragonfly": DragonFly BSD. + # "freebsd" or "FreeBSD": FreeBSD. + # "Fuchsia": Fuchsia. + # "ios" or "iOS": Apple iOS. + # "linux" or "Linux": Linux and its derivatives, except as mentioned below. + # "mac" or "Mac OS X": Apple macOS and its derivatives. + # "openbsd" or "OpenBSD": OpenBSD. + # "Solaris": Solaris. + # "win" or "Windows": Microsoft Windows and its derivatives. + # "Unknown": Sent by some clients instead of "" when the platform is not recognized. + + # chrome_os_arch must be one of: + # "arm": ARM + # "arm64": 64-bit ARM + # "x86": x86 + # "x86_64": x86-64 + # "x64": x64 + + # ------------ + # update_request = f""" # @@ -93,7 +117,7 @@ def main(self): # from: https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c update_request = f""" - + diff --git a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml index 7bfd85c..c9ee0ef 100644 --- a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml +++ b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml @@ -14,7 +14,7 @@ Process: - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider Arguments: - chrome_os: mac + chrome_os_platform: mac chrome_os_version: "10.12" chrome_appid: com.google.Chrome From 62a8ab4f043e6725cf37e155ec06002cf1effaca Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 17:56:32 -0500 Subject: [PATCH 06/52] add comments --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 1 + Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index 56e2246..08fe98a 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -3,6 +3,7 @@ # based upon a script written by JasonWalker # # Related: +# - https://github.com/jgstew/jgstew-recipes/blob/main/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml # - https://github.com/google/omaha/blob/main/doc/ServerProtocolV3.md # - https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/protocol_3_1.md # - https://github.com/hjuutilainen/adminscripts/blob/master/chrome-enable-autoupdates.py diff --git a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml index c9ee0ef..3bc6c1e 100644 --- a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml +++ b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml @@ -5,6 +5,7 @@ Input: NAME: GoogleChromeUpdateInfoProviderTest MinimumVersion: "2.3" Process: + # https://github.com/jgstew/jgstew-recipes/blob/main/SharedProcessors/GoogleChromeUpdateInfoProvider.py - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider - Processor: com.github.jgstew.SharedProcessors/AssertInputContainsString From fd106df4b090bff0c4a81381ae8a40c7476a2ee1 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 18:12:06 -0500 Subject: [PATCH 07/52] adding back in more input vars --- .../GoogleChromeUpdateInfoProvider.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index 08fe98a..be6f43d 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -28,21 +28,21 @@ class GoogleChromeUpdateInfoProvider(Processor): "Provides download information for the latest version of Google Chrome." ) input_variables = { - # "chrome_channel": { - # "required": False, - # "default": "stable", - # "description": "Update channel (e.g., stable, beta, dev).", - # }, + "chrome_channel": { + "required": False, + "default": "stable", + "description": "Update channel (e.g., stable, beta, dev).", + }, "chrome_os_platform": { "required": False, "default": "win", "description": "Operating system (e.g., win, mac, linux).", }, - # "chrome_os_arch": { - # "required": False, - # "default": "x64", - # "description": "Architecture (e.g., x64, x86).", - # }, + "chrome_os_arch": { + "required": False, + "default": "", + "description": "Architecture (e.g., x64, x86).", + }, "chrome_os_version": { "required": False, "default": "10.0", @@ -75,9 +75,9 @@ def main(self): request_id = str(uuid.uuid4()).upper() # session_id = str(uuid.uuid4()).upper() - # channel = self.env.get("chrome_channel") + chrome_channel = self.env.get("chrome_channel") chrome_os_platform = self.env.get("chrome_os_platform") - # arch = self.env.get("chrome_os_arch") + chrome_os_arch = self.env.get("chrome_os_arch") chrome_os_version = self.env.get("chrome_os_version") # chrome_version = self.env.get("chrome_version", "") chrome_appid = self.env.get("chrome_appid", "") @@ -118,10 +118,10 @@ def main(self): # from: https://gist.github.com/pudquick/8cd029d0967ee6f5ee353ed5a967f33c update_request = f""" - - - - + + + + """ From 9a2fefb33ec053c52d46dafbc467b2724081bb88 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 12 Dec 2023 18:16:59 -0500 Subject: [PATCH 08/52] tweak version --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 2 +- Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index be6f43d..6bb7dd8 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -45,7 +45,7 @@ class GoogleChromeUpdateInfoProvider(Processor): }, "chrome_os_version": { "required": False, - "default": "10.0", + "default": "11.0", "description": "Operating system version (e.g., 10.0, 6.2).", }, # "chrome_version": { diff --git a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml index 3bc6c1e..37464c9 100644 --- a/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml +++ b/Test-Recipes/GoogleChromeUpdateInfoProvider.test.recipe.yaml @@ -16,7 +16,7 @@ Process: - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider Arguments: chrome_os_platform: mac - chrome_os_version: "10.12" + # chrome_os_version: "10.12" chrome_appid: com.google.Chrome - Processor: com.github.jgstew.SharedProcessors/AssertInputContainsString From b1fcb0623d079d75c7bb7141b5dcbcb548e9acac Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 13 Dec 2023 14:13:19 -0500 Subject: [PATCH 09/52] fix url in google chrome update provider --- SharedProcessors/GoogleChromeUpdateInfoProvider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedProcessors/GoogleChromeUpdateInfoProvider.py b/SharedProcessors/GoogleChromeUpdateInfoProvider.py index 6bb7dd8..1859231 100644 --- a/SharedProcessors/GoogleChromeUpdateInfoProvider.py +++ b/SharedProcessors/GoogleChromeUpdateInfoProvider.py @@ -166,7 +166,7 @@ def main(self): self.env["chrome_download_urls"] = urls # Note, it might make sense to filter the list in a smarter way: - self.env["url"] = urls[-1] + self.env["url"] = f"{urls[-1]}{package_name}" # self.output( # f"\nUpdates found:\nName: {package_name}\nSHA256: {package_sha256}\nSize: {package_size}\nDownload URLs: {urls}" From ffbe19093f919047f3f1c680039d6eb87626ed0b Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 13 Dec 2023 14:44:05 -0500 Subject: [PATCH 10/52] chrome example recipe with new processor --- .templates/.partials/TitlePrefix.mustache | 1 + Google/Chrome-Win-Install_Update.bes.mustache | 62 +++++++++++ Google/Chrome-Win.bigfix.recipe.yaml | 103 ++++++++++++++++++ Google/Chrome-Win.download.recipe.yaml | 28 +++++ 4 files changed, 194 insertions(+) create mode 100644 .templates/.partials/TitlePrefix.mustache create mode 100644 Google/Chrome-Win-Install_Update.bes.mustache create mode 100644 Google/Chrome-Win.bigfix.recipe.yaml create mode 100644 Google/Chrome-Win.download.recipe.yaml diff --git a/.templates/.partials/TitlePrefix.mustache b/.templates/.partials/TitlePrefix.mustache new file mode 100644 index 0000000..de99773 --- /dev/null +++ b/.templates/.partials/TitlePrefix.mustache @@ -0,0 +1 @@ +{{^install_only}}{{^patch}}Install/{{/patch}}Update{{/install_only}}{{#install_only}}Install{{/install_only}}: \ No newline at end of file diff --git a/Google/Chrome-Win-Install_Update.bes.mustache b/Google/Chrome-Win-Install_Update.bes.mustache new file mode 100644 index 0000000..041c6bb --- /dev/null +++ b/Google/Chrome-Win-Install_Update.bes.mustache @@ -0,0 +1,62 @@ + + + <{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}> + {{>TitlePrefix}} {{DisplayName}} v{{version}} - Windows{{#64BitOnly}} (x64){{/64BitOnly}} + DescriptionBasic}} +{{>DescriptionIcon}} + ]]> + windows of operating system + {{#64BitOnly}} + + {{/64BitOnly}} + {{#patch}}{{#DisplayName}} + + {{/DisplayName}}{{/patch}} + {{^install_only}} + = "{{version}}") of values "DisplayVersion" of keys whose(value "DisplayName" of it as string starts with "{{DisplayName}}") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)]]> + {{/install_only}} + {{>Category}} + {{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}} + {{VendorFolder}} + BigFix + {{SourceReleaseDate}} + + + + + action-ui-metadata + {{>action-ui-metadata}} + + + x-fixlet-modification-time + {{x-fixlet-modification-time}} + + BESC + + + + here + + + + + + + diff --git a/Google/Chrome-Win.bigfix.recipe.yaml b/Google/Chrome-Win.bigfix.recipe.yaml new file mode 100644 index 0000000..b3ca111 --- /dev/null +++ b/Google/Chrome-Win.bigfix.recipe.yaml @@ -0,0 +1,103 @@ +--- +Description: Generates a BigFix Task for the latest Chrome-Win +Identifier: com.github.jgstew.bigfix.Chrome-Win +Input: + # Name: Short Name of the Software, No spaces, Example: "DBBrowserforSQLite" + NAME: "Chrome-Win" + # DisplayName: The start of the DisplayName key in the Windows Registry, Example: "DB Browser for SQLite" + DisplayName: "Google Chrome" + VendorFolder: Google + 64BitOnly: True + template_file_path: "./%VendorFolder%/%NAME%-Install_Update.bes.mustache" +# MinimumVersion of AutoPkg - Should always be 2.3 (or higher once a new version is released) +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.Chrome-Win +Process: + # `SharedUtilityMethods` must come first + - Processor: com.github.jgstew.SharedProcessors/SharedUtilityMethods + # `BigFixPrefetchItem` takes the hashes from `URLDownloaderPython` + # Then it assembles them into a BigFix Prefetch Statement or Block + - Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem + Arguments: + file_name: chrome_installer.exe + file_sha1: "" + file_sha256: "%chrome_package_sha256%" + file_size: "%chrome_package_size%" + prefetch_type: block + # prefetch_url: "%url%" + + # remove empty sha1= from prefetch: + - Processor: com.github.jgstew.SharedProcessors/TextSubstitutionRegEx + Arguments: + input_string: "%bigfix_prefetch_item%" + re_pattern: " sha1= " + re_substitution: " " + result_output_var_name: bigfix_prefetch_item + + # `BigFixSetupTemplateDictionary` creates a dictionary to fill out a bigix content template + # If `SourceReleaseDate` is not provided, it will be set to today + - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "DownloadSize" + append_value: "%chrome_package_size%" + + - Processor: com.github.jgstew.SharedProcessors/URLDownloaderPython + Arguments: + filename: "%NAME%-icon.png" + url: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/64px-Google_Chrome_icon_%28September_2014%29.svg.png + COMPUTE_HASHES: false + + - Processor: com.github.jgstew.SharedProcessors/FileGetBase64 + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "icon_base64" + append_value: "%file_base64%" + + # Generate Install/Update content: + + # `ContentFromTemplate` generates bigfix content from a mustache template file + # The file is filled out with variables from the Template Dictionary + # If variables are missing from the Template Dictionary, then that area will be blank + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + template_file_path: "%template_file_path%" + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%.bes" + + # `BESImport` imports the generated BES content into a BigFix Server + # Which server and credentials are used is dictated by `~/.besapi.conf` + - Processor: com.github.jgstew.SharedProcessors/BESImport + + # `BigFixActioner` creates an action from the imported BigFix Content + # The action is an offer that requires user interaction to run in self service application + # The action targets all computers whose name contains `autopkg` + - Processor: com.github.jgstew.SharedProcessors/BigFixActioner + + # Generate Update only content: + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "patch" + append_value: True + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # template_file_path: "%template_file_path%" + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Update.bes" + + - Processor: com.github.jgstew.SharedProcessors/BESImport + + # Generate Install Only Content: + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "install_only" + append_value: true + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # template_file_path: "%template_file_path%" + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallOnly.bes" + - Processor: com.github.jgstew.SharedProcessors/BESImport diff --git a/Google/Chrome-Win.download.recipe.yaml b/Google/Chrome-Win.download.recipe.yaml new file mode 100644 index 0000000..e0cb43e --- /dev/null +++ b/Google/Chrome-Win.download.recipe.yaml @@ -0,0 +1,28 @@ +--- +Description: Downloads the latest version of Chrome for Windows +# based upon https://github.com/autopkg/ahousseini-recipes/blob/master/Chrome/Chrome.download.recipe +Identifier: com.github.jgstew.download.Chrome-Win +Input: + NAME: Chrome +MinimumVersion: "2.3" +Process: + # `SharedUtilityMethods` must come first + - Processor: com.github.jgstew.SharedProcessors/SharedUtilityMethods + + # https://github.com/jgstew/jgstew-recipes/blob/main/SharedProcessors/GoogleChromeUpdateInfoProvider.py + - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider + + - Processor: EndOfCheckPhase + # Arguments: + # # need to add the package name onto the URL: + # url: "%url%%chrome_package_name%" + + - Processor: com.github.jgstew.SharedProcessors/AssertInputContainsString + Arguments: + input_string: "%chrome_package_name%" + assert_string: "chrome_installer." + + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%chrome_package_name%" + re_pattern: '(?P\d+(\.\d+)+)' From b62ef6bbe93ad5e9aacd6872c3c56593080adb56 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 13 Dec 2023 15:26:32 -0500 Subject: [PATCH 11/52] fix arch --- Google/Chrome-Win.download.recipe.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Google/Chrome-Win.download.recipe.yaml b/Google/Chrome-Win.download.recipe.yaml index e0cb43e..3eee4c3 100644 --- a/Google/Chrome-Win.download.recipe.yaml +++ b/Google/Chrome-Win.download.recipe.yaml @@ -11,6 +11,8 @@ Process: # https://github.com/jgstew/jgstew-recipes/blob/main/SharedProcessors/GoogleChromeUpdateInfoProvider.py - Processor: com.github.jgstew.SharedProcessors/GoogleChromeUpdateInfoProvider + Arguments: + chrome_os_arch: "x64" - Processor: EndOfCheckPhase # Arguments: From f256a8bcc52351dd4842e069cda34c02211c658f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:53:33 +0000 Subject: [PATCH 12/52] Bump tj-actions/changed-files from 39 to 41 in /.github/workflows Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 39 to 41. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v39...v41) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- .github/workflows/Test_Changed_Recipes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Test_Changed_Recipes.yaml b/.github/workflows/Test_Changed_Recipes.yaml index 57bbd0f..b4572f3 100644 --- a/.github/workflows/Test_Changed_Recipes.yaml +++ b/.github/workflows/Test_Changed_Recipes.yaml @@ -20,7 +20,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v39 + uses: tj-actions/changed-files@v41 with: files: "**.recipe.yaml" # Ignore windows only recipes: From 2adc7603b282fbfc52315f3925494791f23ce52c Mon Sep 17 00:00:00 2001 From: jgstew Date: Thu, 11 Jan 2024 11:15:15 -0500 Subject: [PATCH 13/52] OneDrive download recipe example --- Microsoft/OneDrive-Win.download.recipe.yaml | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Microsoft/OneDrive-Win.download.recipe.yaml diff --git a/Microsoft/OneDrive-Win.download.recipe.yaml b/Microsoft/OneDrive-Win.download.recipe.yaml new file mode 100644 index 0000000..58d30a5 --- /dev/null +++ b/Microsoft/OneDrive-Win.download.recipe.yaml @@ -0,0 +1,46 @@ +--- +Description: Download the latest Microsoft OneDrive client for Windows +Identifier: com.github.jgstew.download.OneDrive-Win +Input: + # Name: Short Name of the Software, No spaces, Example: "DBBrowserforSQLite" + NAME: "OneDrive" +MinimumVersion: "2.3" +Process: + # `SharedUtilityMethods` must come first + - Processor: com.github.jgstew.SharedProcessors/SharedUtilityMethods + + # - Processor: URLTextSearcher + # Arguments: + # url: https://www.microsoft.com/en-us/microsoft-365/onedrive/download + # # example match `https://go.microsoft.com/fwlink/p/?LinkID=2182910&clcid=0x409&culture=en-us&country=us` + # re_pattern: "(?Phttps://go.microsoft.com/fwlink/p/?LinkID=2182910&clcid=0x409&culture=en-us&country=us)" + + - Processor: com.github.jgstew.SharedProcessors/URLDownloaderPython + Arguments: + # not certain if this always points to latest: + url: https://go.microsoft.com/fwlink/p/?LinkID=2182910&clcid=0x409&culture=en-us&country=us + filename: OneDriveSetup.exe + download_version: "" + COMPUTE_HASHES: True + + - Processor: EndOfCheckPhase + Arguments: + prefetch_url: "%download_url%" + + # validate file signature and get signature date as SourceReleaseDate: + - Processor: com.github.jgstew.SharedProcessors/FileExeVerifySignature + + # get FileVersion from EXE and save to `version` variable + - Processor: com.github.jgstew.SharedProcessors/FileExeGetInfoPE + + # verify version is set correctly: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%version%" + re_pattern: '^\d+\.\d+' + + # verify SourceReleaseDate is set correctly: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%SourceReleaseDate%" + re_pattern: '^20\d{2}-[0-1]\d{1}-[0-3]\d{1}$' From f81a51f5a32f869214e298ab1d29daf893527a1d Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:11:12 -0500 Subject: [PATCH 14/52] Update AutoPkgReleaseNupkg.yaml add comment --- .github/workflows/AutoPkgReleaseNupkg.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/AutoPkgReleaseNupkg.yaml b/.github/workflows/AutoPkgReleaseNupkg.yaml index 87d58c9..60d88e0 100644 --- a/.github/workflows/AutoPkgReleaseNupkg.yaml +++ b/.github/workflows/AutoPkgReleaseNupkg.yaml @@ -27,6 +27,7 @@ jobs: - uses: actions/checkout@v4 + # TODO: switch to using https://github.com/autopkg/setup-autopkg-actions - name: setup-autopkg local action uses: ./.github/actions/setup-autopkg From ddeaa857df87e770b869b86bc8c5d5d16a787434 Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:16:08 -0500 Subject: [PATCH 15/52] Update AutoPkgReleaseNupkg.yaml increase verbosity of test run output when installed through chocolatey --- .github/workflows/AutoPkgReleaseNupkg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoPkgReleaseNupkg.yaml b/.github/workflows/AutoPkgReleaseNupkg.yaml index 60d88e0..5f62085 100644 --- a/.github/workflows/AutoPkgReleaseNupkg.yaml +++ b/.github/workflows/AutoPkgReleaseNupkg.yaml @@ -50,7 +50,7 @@ jobs: run: choco install autopkg -s "$env:USERPROFILE\Library\AutoPkg\Cache\com.github.jgstew.nupkg.AutoPkg\nupkgs\" --pre --no-progress --yes --force --verbose - name: test autopkg chocolately install - run: autopkg run -v Test-Recipes/AutopkgCore.test.recipe.yaml + run: autopkg run -vv Test-Recipes/AutopkgCore.test.recipe.yaml - name: Get Choco log contents if failure occurs if: ${{ failure() }} From 3f4616d96f55b1bccb84066db9eac316c5470841 Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:21:13 -0500 Subject: [PATCH 16/52] Update AutoPkgRelease.nupkg.recipe.yaml bump python version --- AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml b/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml index fa59d06..aa3276c 100644 --- a/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml +++ b/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml @@ -5,7 +5,7 @@ Identifier: com.github.jgstew.nupkg.AutoPkg Input: NAME: autopkg PYTHON_PACKAGE_ID: python3 - PYTHON_VERSION: "3.10.11" + PYTHON_VERSION: "3.10.13" MinimumVersion: "2.3" SupportedPlatforms: - Windows From 7145eab6c840c084678dadc9da8e885c0402f697 Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:25:14 -0500 Subject: [PATCH 17/52] Update AutoPkgReleaseNupkg.yaml bump python test version --- .github/workflows/AutoPkgReleaseNupkg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoPkgReleaseNupkg.yaml b/.github/workflows/AutoPkgReleaseNupkg.yaml index 5f62085..227143d 100644 --- a/.github/workflows/AutoPkgReleaseNupkg.yaml +++ b/.github/workflows/AutoPkgReleaseNupkg.yaml @@ -44,7 +44,7 @@ jobs: - name: chocolately install python # python versions: 3.8.10, 3.9.12, 3.10.5, 3.11.4 - run: choco install python3 --version 3.10.11 --no-progress --yes --force --force-dependencies + run: choco install python3 --version 3.10.13 --no-progress --yes --force --force-dependencies - name: test chocolately install autopkg.nupkg run: choco install autopkg -s "$env:USERPROFILE\Library\AutoPkg\Cache\com.github.jgstew.nupkg.AutoPkg\nupkgs\" --pre --no-progress --yes --force --verbose From d47436c8415a6d7a91e86b8bb0b53b1c289b830f Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:27:40 -0500 Subject: [PATCH 18/52] Update AutoPkgRelease.nupkg.recipe.yaml revert python version --- AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml b/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml index aa3276c..fa59d06 100644 --- a/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml +++ b/AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml @@ -5,7 +5,7 @@ Identifier: com.github.jgstew.nupkg.AutoPkg Input: NAME: autopkg PYTHON_PACKAGE_ID: python3 - PYTHON_VERSION: "3.10.13" + PYTHON_VERSION: "3.10.11" MinimumVersion: "2.3" SupportedPlatforms: - Windows From e7761a8f2d67365bce932b792e0f7145f422be6f Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 17 Jan 2024 17:28:07 -0500 Subject: [PATCH 19/52] Update AutoPkgReleaseNupkg.yaml revert python version in chocolatey test --- .github/workflows/AutoPkgReleaseNupkg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoPkgReleaseNupkg.yaml b/.github/workflows/AutoPkgReleaseNupkg.yaml index 227143d..5f62085 100644 --- a/.github/workflows/AutoPkgReleaseNupkg.yaml +++ b/.github/workflows/AutoPkgReleaseNupkg.yaml @@ -44,7 +44,7 @@ jobs: - name: chocolately install python # python versions: 3.8.10, 3.9.12, 3.10.5, 3.11.4 - run: choco install python3 --version 3.10.13 --no-progress --yes --force --force-dependencies + run: choco install python3 --version 3.10.11 --no-progress --yes --force --force-dependencies - name: test chocolately install autopkg.nupkg run: choco install autopkg -s "$env:USERPROFILE\Library\AutoPkg\Cache\com.github.jgstew.nupkg.AutoPkg\nupkgs\" --pre --no-progress --yes --force --verbose From 082d94ac64063ff6ff6d60feedaf3e5792c0874a Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 2 Feb 2024 11:22:50 -0500 Subject: [PATCH 20/52] add example datadog agent recipe --- ...taDogAgent-Win-Install_Update.bes.mustache | 56 +++++++++++++++++++ DataDog/DataDogAgent-Win.bigfix.recipe.yaml | 38 +++++++++++++ DataDog/DataDogAgent-Win.download.recipe.yaml | 38 +++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 DataDog/DataDogAgent-Win-Install_Update.bes.mustache create mode 100644 DataDog/DataDogAgent-Win.bigfix.recipe.yaml create mode 100644 DataDog/DataDogAgent-Win.download.recipe.yaml diff --git a/DataDog/DataDogAgent-Win-Install_Update.bes.mustache b/DataDog/DataDogAgent-Win-Install_Update.bes.mustache new file mode 100644 index 0000000..a640ae3 --- /dev/null +++ b/DataDog/DataDogAgent-Win-Install_Update.bes.mustache @@ -0,0 +1,56 @@ + + + <{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}> + {{^patch}}Install/{{/patch}}Update: {{DisplayName}} v{{version}} - Windows{{#64BitOnly}} (x64){{/64BitOnly}} +
Run Command As: System User

Download Size: {{DownloadSize}} +{{^patch}}{{#icon_base64}}

Icon:
{{/icon_base64}}{{/patch}} + ]]>
+ windows of operating system + {{#64BitOnly}} + + {{/64BitOnly}} + + {{#patch}}{{#DisplayName}} + + {{/DisplayName}}{{/patch}} + = "{{version}}") of values "DisplayVersion" of keys whose(value "DisplayName" of it as string starts with "{{DisplayName}}") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries) + ]]> + + {{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}} + {{DisplayName}} + + {{SourceReleaseDate}} + + + + + action-ui-metadata + { {{#version}}"version":"{{version}}",{{/version}}"size":{{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}}{{^patch}}{{#icon_base64}},"icon":"data:{{icon_type}}{{^icon_type}}image/png{{/icon_type}};base64,{{icon_base64}}"{{/icon_base64}}{{/patch}} } + + + x-fixlet-modification-time + {{x-fixlet-modification-time}} + + BESC + + + Click + here + to deploy {{DisplayName}} v{{version}}. + + + + + +
diff --git a/DataDog/DataDogAgent-Win.bigfix.recipe.yaml b/DataDog/DataDogAgent-Win.bigfix.recipe.yaml new file mode 100644 index 0000000..67fb294 --- /dev/null +++ b/DataDog/DataDogAgent-Win.bigfix.recipe.yaml @@ -0,0 +1,38 @@ +--- +Description: Generates a BigFix Task for the latest DataDog Agent +Identifier: com.github.jgstew.bigfix.DataDog-Win +Input: + NAME: DataDogAgent-Win + DisplayName: Datadog Agent + 64BitOnly: TRUE +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.DataDog-Agent-Win +Process: + - Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem + + - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary + # Arguments: + # template_version: "%version_maximum%" + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # use UNIX style paths so this works on Windows and non-Windows: + template_file_path: ./DataDog/DataDogAgent-Win-Install_Update.bes.mustache + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallUpdate.bes" + + - Processor: com.github.jgstew.SharedProcessors/BESImport + + - Processor: com.github.jgstew.SharedProcessors/BigFixActioner + + # create update(patch) only content: + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "patch" + append_value: true + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # template_file_path: "./%VendorFolder%/%NAME%-Win-Install_Update.bes.mustache" + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Update.bes" diff --git a/DataDog/DataDogAgent-Win.download.recipe.yaml b/DataDog/DataDogAgent-Win.download.recipe.yaml new file mode 100644 index 0000000..fd1d708 --- /dev/null +++ b/DataDog/DataDogAgent-Win.download.recipe.yaml @@ -0,0 +1,38 @@ +--- +Description: Downloads the latest DataDog Agent for Windows +Identifier: com.github.jgstew.download.DataDog-Agent-Win +Input: + NAME: DataDog-Agent-Win + DisplayName: Datadog Agent +MinimumVersion: "2.3" +Process: + # get all versions found in this JSON doc: + - Processor: com.github.jgstew.SharedProcessors/URLTextSearcherArray + Arguments: + url: https://ddagent-windows-stable.s3.amazonaws.com/installers_v2.json + re_pattern: '(\d+\.\d+\.\d+)-' + + # get the maximum version: + - Processor: com.github.jgstew.SharedProcessors/VersionMaximumArray + + - Processor: URLDownloaderPython + Arguments: + # %version_maximum% + url: https://s3.amazonaws.com/ddagent-windows-stable/ddagent-cli-%version_maximum%.msi + filename: datadog-agent-x86_64.msi + download_version: "" + COMPUTE_HASHES: True + + - Processor: EndOfCheckPhase + + # Get apparent SourceReleaseDate from MSI metadata: + - Processor: com.github.jgstew.SharedProcessors/FileMsiGetInfoOLE + + # Get version number from MSI ProductVersion: + - Processor: com.github.jgstew.SharedProcessors/FileMsiGetProperty + + # verify version is set correctly, at least major.minor: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%version%" + re_pattern: '^\d+\.\d+' From 3f15e4cdada7427313c74440ff3f53d1c6d60669 Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 2 Feb 2024 11:27:13 -0500 Subject: [PATCH 21/52] add prereq --- .github/workflows/Test_Changed_Recipes.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Test_Changed_Recipes.yaml b/.github/workflows/Test_Changed_Recipes.yaml index b4572f3..2e302ac 100644 --- a/.github/workflows/Test_Changed_Recipes.yaml +++ b/.github/workflows/Test_Changed_Recipes.yaml @@ -43,6 +43,10 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' run: pip install --requirement requirements.txt + - name: Install prereq + if: steps.changed-files.outputs.any_changed == 'true' + run: apt-get install msitools -y + - name: run recipe autopkg if: steps.changed-files.outputs.any_changed == 'true' run: python autopkg/Code/autopkg run -vv --recipe-list TestRecipesAction.txt From 779dbadf5db11f4a8d2f7fd7b851db500ea6d488 Mon Sep 17 00:00:00 2001 From: jgstew Date: Thu, 8 Feb 2024 15:16:33 -0500 Subject: [PATCH 22/52] tweak nessus agent download recipe --- .../Nessus-Agent-Win64.download.recipe.yaml | 18 ++++++++++++++++-- .../Nessus-Agent-Win64.versionwin.recipe.yaml | 10 ---------- 2 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 Tenable/Nessus-Agent-Win64.versionwin.recipe.yaml diff --git a/Tenable/Nessus-Agent-Win64.download.recipe.yaml b/Tenable/Nessus-Agent-Win64.download.recipe.yaml index 8c62b2a..50f8c66 100644 --- a/Tenable/Nessus-Agent-Win64.download.recipe.yaml +++ b/Tenable/Nessus-Agent-Win64.download.recipe.yaml @@ -4,20 +4,34 @@ Description: Downloads the latest Nessus Windows 64bit agent Identifier: com.github.jgstew.download.Nessus-Agent-Win64 Input: NAME: Nessus-Agent-Win64 -MinimumVersion: '2.3' +MinimumVersion: "2.3" Process: - Processor: com.github.jgstew.SharedProcessors/URLTextSearcher Arguments: url: https://www.tenable.com/downloads/nessus-agents?loginAttempted=true re_pattern: '"id":(?P\d+),"file":"NessusAgent-(?P\d+\.\d+\.\d+)\-x64.msi"' + - Processor: URLDownloaderPython Arguments: url: https://www.tenable.com/downloads/api/v1/public/pages/nessus-agents/downloads/%id%/download?i_agree_to_tenable_license_agreement=true # NOTE: the filename isn't in the url tail - prefetch_filename: True + filename: Nessus-x64.msi # NOTE: `www.tenable.com/downloads` doesn't seem to provide etag or last modified header info so we can't be smart about this COMPUTE_HASHES: True User_Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 CHECK_FILESIZE_ONLY: True download_version: "%version%" + - Processor: EndOfCheckPhase + + # get SourceReleaseDate from HTTP `Last-Modified` header: + - Processor: com.github.jgstew.SharedProcessors/DateTimeFromString + Arguments: + # parse last_modified header info from URLDownloaderPython + datetime_string: "%last_modified%" + datetime_strptime: "%a, %d %b %Y %H:%M:%S %Z" + datetime_strftime: "%Y-%m-%d" + datetime_parsed_name: SourceReleaseDate + + # get version from MSI: + - Processor: com.github.jgstew.SharedProcessors/FileMsiGetProperty diff --git a/Tenable/Nessus-Agent-Win64.versionwin.recipe.yaml b/Tenable/Nessus-Agent-Win64.versionwin.recipe.yaml deleted file mode 100644 index 7abc7f3..0000000 --- a/Tenable/Nessus-Agent-Win64.versionwin.recipe.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -Description: Gets the version from the Nessus Windows 64bit agent -# based upon https://github.com/autopkg/neilmartin83-recipes/blob/master/Tenable/Nessus%20Agent.download.recipe -Identifier: com.github.jgstew.versionwin.Nessus-Agent-Win64 -Input: - NAME: Nessus-Agent-Win64 -MinimumVersion: '2.3' -ParentRecipe: com.github.jgstew.download.Nessus-Agent-Win64 -Process: - - Processor: com.github.jgstew.SharedProcessors/WinGetPropertyMSI From e922dbf4f77a74c25eebfbcb163258e54963164c Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 1 Mar 2024 11:31:42 -0500 Subject: [PATCH 23/52] work in progress screenconnect --- ...eenConnect-Win-Install_Update.bes.mustache | 53 +++++++++++++++++++ .../ScreenConnect-Win.bigfix.recipe.yaml | 36 +++++++++++++ .../ScreenConnect-Win.download.recipe.yaml | 33 ++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache create mode 100644 ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml create mode 100644 ConnectWise/ScreenConnect-Win.download.recipe.yaml diff --git a/ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache b/ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache new file mode 100644 index 0000000..e7573f6 --- /dev/null +++ b/ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache @@ -0,0 +1,53 @@ + + + <{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}> + {{^patch}}Install/{{/patch}}Update: {{DisplayName}} v{{version}} - Windows{{#64BitOnly}} (x64){{/64BitOnly}} +
Run Command As: System User

Download Size: {{DownloadSize}} +{{^patch}}{{#icon_base64}}

Icon:
{{/icon_base64}}{{/patch}} + ]]>
+ windows of operating system + {{#64BitOnly}} + + {{/64BitOnly}} + {{#patch}}{{#DisplayName}} + + {{/DisplayName}}{{/patch}} + = "{{version}}") of values "DisplayVersion" of keys whose(value "DisplayName" of it as string starts with "{{DisplayName}}") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)]]> + + {{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}} + {{DisplayName}} + + {{SourceReleaseDate}} + + + + + action-ui-metadata + { {{#version}}"version":"{{version}}",{{/version}}"size":{{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}}{{^patch}}{{#icon_base64}},"icon":"data:{{icon_type}}{{^icon_type}}image/png{{/icon_type}};base64,{{icon_base64}}"{{/icon_base64}}{{/patch}} } + + + x-fixlet-modification-time + {{x-fixlet-modification-time}} + + BESC + + + Click + here + to deploy {{DisplayName}} v{{version}}. + + + + + +
diff --git a/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml b/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml new file mode 100644 index 0000000..13ff533 --- /dev/null +++ b/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml @@ -0,0 +1,36 @@ +--- +Description: Generates a BigFix Task for ScreenConnect +Identifier: com.github.jgstew.bigfix.ScreenConnect-Win +Input: + NAME: ScreenConnect-Win + DisplayName: ScreenConnect + # 64BitOnly: TRUE +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.ScreenConnect-Win +Process: + - Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem + + - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # use UNIX style paths so this works on Windows and non-Windows: + template_file_path: ./ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallUpdate.bes" + + - Processor: com.github.jgstew.SharedProcessors/BESImport + + - Processor: com.github.jgstew.SharedProcessors/BigFixActioner + + # create update(patch) only content: + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "patch" + append_value: true + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # template_file_path: "./%VendorFolder%/%NAME%-Win-Install_Update.bes.mustache" + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Update.bes" diff --git a/ConnectWise/ScreenConnect-Win.download.recipe.yaml b/ConnectWise/ScreenConnect-Win.download.recipe.yaml new file mode 100644 index 0000000..bba9fb9 --- /dev/null +++ b/ConnectWise/ScreenConnect-Win.download.recipe.yaml @@ -0,0 +1,33 @@ +--- +Description: Downloads the latest ScreenConnect +Identifier: com.github.jgstew.download.ScreenConnect-Win +Input: + NAME: ScreenConnect-Win + DisplayName: ScreenConnect +MinimumVersion: "2.3" +Process: + # get all versions found in this JSON doc: + - Processor: URLTextSearcher + Arguments: + url: https://screenconnect.connectwise.com/download + re_pattern: "(?Phttps://d1kuyuqowve5id.cloudfront.net/ScreenConnect_23.9.10.8817_Release.msi)" + + - Processor: URLDownloaderPython + Arguments: + filename: ScreenConnect_Release.msi + download_version: "" + COMPUTE_HASHES: True + + - Processor: EndOfCheckPhase + + # Get apparent SourceReleaseDate from MSI metadata: + - Processor: com.github.jgstew.SharedProcessors/FileMsiGetInfoOLE + + # Get version number from MSI ProductVersion: + - Processor: com.github.jgstew.SharedProcessors/FileMsiGetProperty + + # verify version is set correctly, at least major.minor: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%version%" + re_pattern: '^\d+\.\d+' From 0388c2c154efa9ecd35480f0eded05cc24e7b5f9 Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 1 Mar 2024 11:37:48 -0500 Subject: [PATCH 24/52] fix download recipe ScreenConnect --- ConnectWise/ScreenConnect-Win.download.recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConnectWise/ScreenConnect-Win.download.recipe.yaml b/ConnectWise/ScreenConnect-Win.download.recipe.yaml index bba9fb9..78acd52 100644 --- a/ConnectWise/ScreenConnect-Win.download.recipe.yaml +++ b/ConnectWise/ScreenConnect-Win.download.recipe.yaml @@ -10,7 +10,7 @@ Process: - Processor: URLTextSearcher Arguments: url: https://screenconnect.connectwise.com/download - re_pattern: "(?Phttps://d1kuyuqowve5id.cloudfront.net/ScreenConnect_23.9.10.8817_Release.msi)" + re_pattern: "(?Phttps://.+?.cloudfront.net/ScreenConnect_.+?_Release.msi)" - Processor: URLDownloaderPython Arguments: From 6a5e0c7569a2e8abd2e9a168a0193850aafe952b Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 1 Mar 2024 11:43:57 -0500 Subject: [PATCH 25/52] add missing import --- ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml b/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml index 13ff533..b913908 100644 --- a/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml +++ b/ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml @@ -34,3 +34,5 @@ Process: Arguments: # template_file_path: "./%VendorFolder%/%NAME%-Win-Install_Update.bes.mustache" content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Update.bes" + + - Processor: com.github.jgstew.SharedProcessors/BESImport From 401863cf97e8a386fba282cda5f969c124896a6b Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 10 Apr 2024 10:29:33 -0400 Subject: [PATCH 26/52] add ability for BigFixActioner to make an action instead of an offer... like it used to. --- SharedProcessors/BigFixActioner.py | 33 ++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/SharedProcessors/BigFixActioner.py b/SharedProcessors/BigFixActioner.py index 3b135ab..ecb76ca 100644 --- a/SharedProcessors/BigFixActioner.py +++ b/SharedProcessors/BigFixActioner.py @@ -11,7 +11,8 @@ __all__ = ["BigFixActioner"] # noqa: B950 -BES_SourcedFixletAction = """\ +# if this template is used, you get an offer: +BES_SourcedFixletActionOffer = """\ @@ -54,6 +55,22 @@ """ +# if this template is used, you get an action: +BES_SourcedFixletAction = """\ + + + + {{bes_customsite}} + {{bes_id}} + {{bes_action}} + + + true + + + +""" + class BigFixActioner(BESImport): """AutoPkg Processor to create a BigFix action from imported content""" @@ -75,6 +92,11 @@ class BigFixActioner(BESImport): "default": "Action1", "description": "Which Action to run", }, + "bes_action_type": { + "required": False, + "default": "Offer", + "description": "Tells autopkg to create an action or offer.", + }, } output_variables = { "bes_action_id": { @@ -90,6 +112,8 @@ def main(self): """BigFixActioner Main Method""" template_dict = {} template_dict["bes_id"] = self.env.get("bes_id", 0) + bes_action_type = str(self.env.get("bes_action_type", "Offer")) + if template_dict["bes_id"] == 0: self.output("Nothing to action.", 0) else: @@ -104,7 +128,12 @@ def main(self): # clear password from ENV self.env["BES_PASSWORD"] = "" - bes_action_data = chevron.render(BES_SourcedFixletAction, template_dict) + if "action" in bes_action_type.lower(): + bes_action_data = chevron.render(BES_SourcedFixletAction, template_dict) + else: + bes_action_data = chevron.render( + BES_SourcedFixletActionOffer, template_dict + ) self.output(bes_action_data, 4) From 778ccd31fa00771a69378c835980bbac67795805 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:31:42 +0000 Subject: [PATCH 27/52] Bump tj-actions/changed-files from 41 to 44 Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 41 to 44. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v41...v44) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Test_Changed_Recipes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Test_Changed_Recipes.yaml b/.github/workflows/Test_Changed_Recipes.yaml index 2e302ac..098736d 100644 --- a/.github/workflows/Test_Changed_Recipes.yaml +++ b/.github/workflows/Test_Changed_Recipes.yaml @@ -20,7 +20,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v41 + uses: tj-actions/changed-files@v44 with: files: "**.recipe.yaml" # Ignore windows only recipes: From 578c969f972d830df62261c395eadd6798224822 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:52:45 +0000 Subject: [PATCH 28/52] Bump pre-commit/action from 3.0.0 to 3.0.1 Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/pre-commit/action/releases) - [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: pre-commit/action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index cdd1af6..7374c16 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -12,6 +12,6 @@ jobs: # requites to grab the history of the PR fetch-depth: 0 - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 with: extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} From ca1ac9d9579a8bcb0e0c281c1528675f05beb877 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:55:55 +0000 Subject: [PATCH 29/52] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 7771d58..2c075ec 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -37,7 +37,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -48,7 +48,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # Command-line programs to run using the OS shell. # https://git.io/JvXDl @@ -62,4 +62,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From ddc00cd8715a67fa5480f0e662a80f73927e0430 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:55:46 +0000 Subject: [PATCH 30/52] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/AutoPkgReleaseMSI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoPkgReleaseMSI.yaml b/.github/workflows/AutoPkgReleaseMSI.yaml index 6317220..6a17797 100644 --- a/.github/workflows/AutoPkgReleaseMSI.yaml +++ b/.github/workflows/AutoPkgReleaseMSI.yaml @@ -90,7 +90,7 @@ jobs: if: runner.os == 'Windows' # https://github.com/actions/upload-artifact # TODO: get artifact path dynamically - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: autopkg.msi path: C:\Users\runneradmin\Library\AutoPkg\Cache\com.github.jgstew.msibuild.AutoPkg\autopkg.msi From 8ff658915972a1beeab33cc9d8f98debc9fc1016 Mon Sep 17 00:00:00 2001 From: jgstew Date: Thu, 11 Apr 2024 10:07:47 -0400 Subject: [PATCH 31/52] tweak dependabot --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d270f61..24d901f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +# Set update schedule for GitHub Actions version: 2 # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file @@ -7,3 +8,6 @@ updates: directory: "/" schedule: interval: "weekly" + # Add assignees + assignees: + - "jgstew" From 2b0f11b2d5e80356701f7c889774102b587b83ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:08:44 +0000 Subject: [PATCH 32/52] Bump microsoft/setup-msbuild from 1.3 to 2 Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1.3 to 2. - [Release notes](https://github.com/microsoft/setup-msbuild/releases) - [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md) - [Commits](https://github.com/microsoft/setup-msbuild/compare/v1.3...v2) --- updated-dependencies: - dependency-name: microsoft/setup-msbuild dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/AutoPkgReleaseMSI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoPkgReleaseMSI.yaml b/.github/workflows/AutoPkgReleaseMSI.yaml index 6a17797..7bd2d59 100644 --- a/.github/workflows/AutoPkgReleaseMSI.yaml +++ b/.github/workflows/AutoPkgReleaseMSI.yaml @@ -40,7 +40,7 @@ jobs: - name: Add msbuild to PATH # https://github.com/microsoft/setup-msbuild if: runner.os == 'Windows' - uses: microsoft/setup-msbuild@v1.3 + uses: microsoft/setup-msbuild@v2 - name: Set token # required for githubreleaseinfoprovider in github actions From 0e07c13a66bb2147ce124703479a0d3d325c5534 Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 8 May 2024 12:52:59 -0400 Subject: [PATCH 33/52] Update Sleep.py change default sleep time to 15s --- SharedProcessors/Sleep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedProcessors/Sleep.py b/SharedProcessors/Sleep.py index 9be47b3..52a832a 100644 --- a/SharedProcessors/Sleep.py +++ b/SharedProcessors/Sleep.py @@ -24,7 +24,7 @@ class Sleep(Processor): # pylint: disable=invalid-name input_variables = { "sleep_seconds": { "required": False, - "default": 2, + "default": 15, "description": "seconds to sleep", }, } @@ -34,7 +34,7 @@ class Sleep(Processor): # pylint: disable=invalid-name def main(self): """Execution starts here""" - sleep_seconds = int(self.env.get("sleep_seconds", 2)) + sleep_seconds = int(self.env.get("sleep_seconds", 15)) self.output(f"Pausing Execution for {sleep_seconds} seconds") From a91f0881a84642d4ca785abeea5c832b5a482b0e Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 4 Jun 2024 14:00:51 -0400 Subject: [PATCH 34/52] add KVRT download recipe --- ...yVirusRemovalTool-Win.download.recipe.yaml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml new file mode 100644 index 0000000..633e929 --- /dev/null +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml @@ -0,0 +1,25 @@ +--- +Description: Downloads the latest DataDog Agent for Windows +Identifier: com.github.jgstew.download.KasperskyVirusRemovalTool-Win +Input: + NAME: KasperskyVirusRemovalTool-Win + DisplayName: KasperskyVirusRemovalTool +MinimumVersion: "2.3" +Process: + - Processor: URLDownloaderPython + Arguments: + url: https://devbuilds.s.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe + filename: KVRT.exe + download_version: "" + COMPUTE_HASHES: True + + - Processor: EndOfCheckPhase + + # get FileVersion from EXE and save to `version` variable + - Processor: com.github.jgstew.SharedProcessors/FileExeGetInfoPE + + # verify version is set correctly, at least major.minor: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%version%" + re_pattern: '^\d+\.\d+' From 2b63477cef93456b1040f19ffde80db68711b98d Mon Sep 17 00:00:00 2001 From: JGStew Date: Tue, 4 Jun 2024 20:08:46 -0400 Subject: [PATCH 35/52] Update GitForWindows-Win64.download.recipe.yaml Remove unneeded arg --- GitForWindows/GitForWindows-Win64.download.recipe.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/GitForWindows/GitForWindows-Win64.download.recipe.yaml b/GitForWindows/GitForWindows-Win64.download.recipe.yaml index bfc787b..0c16ba4 100644 --- a/GitForWindows/GitForWindows-Win64.download.recipe.yaml +++ b/GitForWindows/GitForWindows-Win64.download.recipe.yaml @@ -10,6 +10,4 @@ Process: github_repo: git-for-windows/git asset_regex: Git-.*-64-bit.exe - Processor: URLDownloaderPython - Arguments: - download_version: "%version%" - Processor: EndOfCheckPhase From 29020e21bb0bfda5bf09f4916a842347c2b1f628 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 4 Jun 2024 21:32:20 -0400 Subject: [PATCH 36/52] work in progress KVRT --- .github/workflows/Test_Changed_Recipes.yaml | 2 +- ...erskyVirusRemovalTool-Win-Run.bes.mustache | 53 +++++++++++++++++++ ...skyVirusRemovalTool-Win.bigfix.recipe.yaml | 24 +++++++++ ...yVirusRemovalTool-Win.download.recipe.yaml | 2 +- 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache create mode 100644 Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml diff --git a/.github/workflows/Test_Changed_Recipes.yaml b/.github/workflows/Test_Changed_Recipes.yaml index 098736d..e1c899e 100644 --- a/.github/workflows/Test_Changed_Recipes.yaml +++ b/.github/workflows/Test_Changed_Recipes.yaml @@ -45,7 +45,7 @@ jobs: - name: Install prereq if: steps.changed-files.outputs.any_changed == 'true' - run: apt-get install msitools -y + run: sudo apt-get install msitools -y - name: run recipe autopkg if: steps.changed-files.outputs.any_changed == 'true' diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache new file mode 100644 index 0000000..18d8cfa --- /dev/null +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -0,0 +1,53 @@ + + + <{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}> + Run: {{DisplayName}} v{{version}} - Windows + + windows of operating system + + + {{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}} + {{DisplayName}} + jgstew + {{SourceReleaseDate}} + + + + + action-ui-metadata + { {{#version}}"version":"{{version}}",{{/version}}"size":{{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}}{{^patch}}{{#icon_base64}},"icon":"data:{{icon_type}}{{^icon_type}}image/png{{/icon_type}};base64,{{icon_base64}}"{{/icon_base64}}{{/patch}} } + + + x-fixlet-modification-time + {{x-fixlet-modification-time}} + + BESC + + + Click + here + to deploy {{DisplayName}} v{{version}}. + + + + + + diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml new file mode 100644 index 0000000..3ad309b --- /dev/null +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml @@ -0,0 +1,24 @@ +--- +Description: Generates a BigFix Task for the latest KasperskyVirusRemovalTool +Identifier: com.github.jgstew.bigfix.KasperskyVirusRemovalTool-Win +Input: + NAME: KasperskyVirusRemovalTool-Win + DisplayName: KasperskyVirusRemovalTool +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.KasperskyVirusRemovalTool-Win +Process: + - Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem + + - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary + # Arguments: + # template_version: "%version_maximum%" + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput + + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + # use UNIX style paths so this works on Windows and non-Windows: + template_file_path: ./DataDog/DataDogAgent-Win-Install_Update.bes.mustache + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallUpdate.bes" + + - Processor: com.github.jgstew.SharedProcessors/BESImport diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml index 633e929..a500f30 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml @@ -1,5 +1,5 @@ --- -Description: Downloads the latest DataDog Agent for Windows +Description: Downloads the latest KasperskyVirusRemovalTool for Windows Identifier: com.github.jgstew.download.KasperskyVirusRemovalTool-Win Input: NAME: KasperskyVirusRemovalTool-Win From 2d742b333b0a2a9acaa1e59fc166f1d587ee95e2 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 16:12:57 -0400 Subject: [PATCH 37/52] fix template usage --- Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml index 3ad309b..1bbd5c4 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml @@ -18,7 +18,7 @@ Process: - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate Arguments: # use UNIX style paths so this works on Windows and non-Windows: - template_file_path: ./DataDog/DataDogAgent-Win-Install_Update.bes.mustache - content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallUpdate.bes" + template_file_path: ./Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache + content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Run.bes" - Processor: com.github.jgstew.SharedProcessors/BESImport From 9ef5a8956f15bb0c0c67decec4fda8b3b7631070 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 17:29:37 -0400 Subject: [PATCH 38/52] fix download --- Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml index a500f30..2084232 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml @@ -6,7 +6,7 @@ Input: DisplayName: KasperskyVirusRemovalTool MinimumVersion: "2.3" Process: - - Processor: URLDownloaderPython + - Processor: com.github.jgstew.SharedProcessors/URLDownloaderPython Arguments: url: https://devbuilds.s.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe filename: KVRT.exe From ce2b39012873264885e05c8c7f6e566b295678a5 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 17:36:08 -0400 Subject: [PATCH 39/52] add parameter --- Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache index 18d8cfa..6ab8fd3 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -44,7 +44,7 @@ copy __Download\KVRT.exe "{parameter "RunFolder"}\KVRT.exe" // https://support.kaspersky.com/kvrt2015/howto/8537 // Run: -run "{parameter "RunFolder"}\KVRT.exe" -accepteula -d "{parameter "RunFolder"}" -silent -adinsilent -processlevel 1 +run "{parameter "RunFolder"}\KVRT.exe" -accepteula -d "{parameter "RunFolder"}" -silent -adinsilent -processlevel 1 -dontcryptsupportinfo // End]]> From 7467f0eda568d60cea028d9deb7056f74bd7da91 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 17:39:33 -0400 Subject: [PATCH 40/52] add proper relevance --- Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache index 6ab8fd3..97ca87c 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -6,7 +6,7 @@ This task will run {{DisplayName}} on the system. ]]> windows of operating system - + {{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}} {{DisplayName}} From 1e24bcc76135e7b41ec4d366be90d380c999c5b7 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 17:46:45 -0400 Subject: [PATCH 41/52] fix success criteria --- Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache index 97ca87c..b91cb9b 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -47,7 +47,7 @@ copy __Download\KVRT.exe "{parameter "RunFolder"}\KVRT.exe" run "{parameter "RunFolder"}\KVRT.exe" -accepteula -d "{parameter "RunFolder"}" -silent -adinsilent -processlevel 1 -dontcryptsupportinfo // End]]> - + From d33284154802233c93ec8c74f1f5630d9848db61 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 5 Jun 2024 17:53:00 -0400 Subject: [PATCH 42/52] fix for etag/lastmodified issue --- Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml index 2084232..afded68 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml @@ -12,6 +12,8 @@ Process: filename: KVRT.exe download_version: "" COMPUTE_HASHES: True + # Seems like ETag and Last-Modified change every time, which is annoying + CHECK_FILESIZE_ONLY: True - Processor: EndOfCheckPhase From 14f26f9535f07eefa49df055e01096580c53dadf Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 7 Jun 2024 11:49:51 -0400 Subject: [PATCH 43/52] fix template --- Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache index b91cb9b..37a92bf 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -36,7 +36,9 @@ This task will run {{DisplayName}} on the system. parameter "RunFolder" = "{ (it & "\KVRT") of pathnames of folders "temp" of windows folder }" -folder delete "{ parameter "RunFolder" }" +// Delete RunFolder if it exists: +wait CMD /C "del /F /Q /S "{parameter "RunFolder"}"" + folder create "{ parameter "RunFolder" }" // Copy to RunFolder From 038e9659ff05f31e41f4f38a405a8522005e97d5 Mon Sep 17 00:00:00 2001 From: jgstew Date: Fri, 7 Jun 2024 11:58:34 -0400 Subject: [PATCH 44/52] add build time --- .../KasperskyVirusRemovalTool-Win-Run.bes.mustache | 2 +- ...asperskyVirusRemovalTool-Win.bigfix.recipe.yaml | 5 +++++ ...perskyVirusRemovalTool-Win.download.recipe.yaml | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache index 37a92bf..ca21397 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache +++ b/Kaspersky/KasperskyVirusRemovalTool-Win-Run.bes.mustache @@ -1,7 +1,7 @@ <{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}> - Run: {{DisplayName}} v{{version}} - Windows + Run: {{DisplayName}} v{{version}} {{build_time}} - Windows diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml index 1bbd5c4..c52b53e 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.bigfix.recipe.yaml @@ -15,6 +15,11 @@ Process: - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + append_key: "build_time" + append_value: "%build_time%" + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate Arguments: # use UNIX style paths so this works on Windows and non-Windows: diff --git a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml index afded68..6352a2b 100644 --- a/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml +++ b/Kaspersky/KasperskyVirusRemovalTool-Win.download.recipe.yaml @@ -25,3 +25,17 @@ Process: Arguments: input_string: "%version%" re_pattern: '^\d+\.\d+' + + # validate file signature and get signature date as SourceReleaseDate: + - Processor: com.github.jgstew.SharedProcessors/FileExeVerifySignature + + # verify SourceReleaseDate is set correctly: + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%SourceReleaseDate%" + re_pattern: '^20\d{2}-[0-1]\d{1}-[0-3]\d{1}$' + + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%file_signature_datetime%" + re_pattern: '(?P.+)\+' From 1770f5c45077f157e212ab86ef311b1ffea421d1 Mon Sep 17 00:00:00 2001 From: JGStew Date: Mon, 1 Jul 2024 17:49:32 -0400 Subject: [PATCH 45/52] add text to speech autopkg processor and test recipe --- SharedProcessors/TextToSpeech.py | 67 ++++++++++++++++++++++ Test-Recipes/TextToSpeech.test.recipe.yaml | 11 ++++ 2 files changed, 78 insertions(+) create mode 100644 SharedProcessors/TextToSpeech.py create mode 100644 Test-Recipes/TextToSpeech.test.recipe.yaml diff --git a/SharedProcessors/TextToSpeech.py b/SharedProcessors/TextToSpeech.py new file mode 100644 index 0000000..d53bc4c --- /dev/null +++ b/SharedProcessors/TextToSpeech.py @@ -0,0 +1,67 @@ +#!/usr/local/autopkg/python +# +# James Stewart @JGStew - 2024 +# +# Related: +# - https://github.com/jgstew/bigfix_prefetch/blob/master/prefetch_from_dictionary.py +# +"""See docstring for TextToSpeech class""" + +import os +import platform + +from autopkglib import ( # pylint: disable=import-error,wrong-import-position,unused-import + Processor, + ProcessorError, +) + +__all__ = ["TextToSpeech"] + + +class TextToSpeech(Processor): # pylint: disable=invalid-name + """checks that assert_string is within input_string""" + + description = __doc__ + input_variables = { + "input_string": {"required": True, "description": "string to say"}, + } + output_variables = {} + __doc__ = description + + def speak(self, input_string): + """speak text aloud""" + tx = input_string + + # from: https://stackoverflow.com/a/59118441/861745 + syst = platform.system() + if syst == "Linux" and platform.linux_distribution()[0] == "Ubuntu": + os.system("spd-say %s" % tx) + elif syst == "Windows": + os.system( + 'PowerShell -Command "Add-Type –AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak(%s);"' + % tx + ) + elif syst == "Darwin": + # add & at end of command to NOT wait. + os.system("say %s" % tx) + else: + # use pyttsx3 to handle other OSes: + import pyttsx3 + + engine = pyttsx3.init() + engine.say(input_string) + engine.runAndWait() + + def main(self): + """Execution starts here""" + + input_string = str(self.env.get("input_string")) + + self.output(f"say `{input_string}` aloud", 1) + + self.speak(input_string) + + +if __name__ == "__main__": + PROCESSOR = TextToSpeech() + PROCESSOR.execute_shell() diff --git a/Test-Recipes/TextToSpeech.test.recipe.yaml b/Test-Recipes/TextToSpeech.test.recipe.yaml new file mode 100644 index 0000000..c77f3e1 --- /dev/null +++ b/Test-Recipes/TextToSpeech.test.recipe.yaml @@ -0,0 +1,11 @@ +--- +Description: Test TextToSpeech Processor +Identifier: com.github.jgstew.test.TextToSpeech +Input: + NAME: TextToSpeechTest +MinimumVersion: "2.3" +Process: + - Processor: com.github.jgstew.SharedProcessors/TextToSpeech + Arguments: + input_string: "Hello World from AutoPkg!" + # so far tested on macos only, but should support windows and ubuntu as well with no deps or any os with pyttsx3 From 3918f2afb14f643193a810d2b6ffeaf89cee844d Mon Sep 17 00:00:00 2001 From: JGStew Date: Mon, 1 Jul 2024 17:50:42 -0400 Subject: [PATCH 46/52] add comment --- SharedProcessors/TextToSpeech.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SharedProcessors/TextToSpeech.py b/SharedProcessors/TextToSpeech.py index d53bc4c..a068b48 100644 --- a/SharedProcessors/TextToSpeech.py +++ b/SharedProcessors/TextToSpeech.py @@ -52,6 +52,8 @@ def speak(self, input_string): engine.say(input_string) engine.runAndWait() + # related: https://stackoverflow.com/a/39647762/861745 + def main(self): """Execution starts here""" From 2b557ae1bbdf7722af550baceb35885c9810a486 Mon Sep 17 00:00:00 2001 From: JGStew Date: Mon, 1 Jul 2024 18:07:44 -0400 Subject: [PATCH 47/52] text to speech example random wiki article, commented out. --- Test-Recipes/TextToSpeech.test.recipe.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Test-Recipes/TextToSpeech.test.recipe.yaml b/Test-Recipes/TextToSpeech.test.recipe.yaml index c77f3e1..41b880b 100644 --- a/Test-Recipes/TextToSpeech.test.recipe.yaml +++ b/Test-Recipes/TextToSpeech.test.recipe.yaml @@ -9,3 +9,12 @@ Process: Arguments: input_string: "Hello World from AutoPkg!" # so far tested on macos only, but should support windows and ubuntu as well with no deps or any os with pyttsx3 + + # - Processor: URLTextSearcher + # Arguments: + # url: https://en.wikipedia.org/wiki/Special:Random + # re_pattern: 'class="mw-page-title-main">([a-zA-Z0-9 ]+)' + + # - Processor: com.github.jgstew.SharedProcessors/TextToSpeech + # Arguments: + # input_string: "Random Wikipedia article: %match%" From 6ad7baeb2b592f4e3616adbe3865a873879698c3 Mon Sep 17 00:00:00 2001 From: JGStew Date: Tue, 2 Jul 2024 23:07:41 -0400 Subject: [PATCH 48/52] firefox macos download recipe example --- Mozilla/Firefox-Mac.download.recipe.yaml | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Mozilla/Firefox-Mac.download.recipe.yaml diff --git a/Mozilla/Firefox-Mac.download.recipe.yaml b/Mozilla/Firefox-Mac.download.recipe.yaml new file mode 100644 index 0000000..09e636d --- /dev/null +++ b/Mozilla/Firefox-Mac.download.recipe.yaml @@ -0,0 +1,33 @@ +# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US +--- +Description: Downloads the latest version of Firefox +# based upon https://github.com/autopkg/moofit-recipes/blob/master/Adobe/RemoteUpdateManager.download.recipe +Identifier: com.github.jgstew.download.Firefox-Mac +Input: + NAME: "Firefox" + OS: osx + filename: Firefox.dmg +MinimumVersion: "2.3" +Process: + - Processor: com.github.jgstew.SharedProcessors/URLDownloaderPython + Arguments: + # Example URLs: + # - https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US + url: https://download.mozilla.org/?product=firefox-latest-ssl&os=%OS%&lang=en-US + COMPUTE_HASHES: True + + - Processor: EndOfCheckPhase + + - Processor: com.github.jgstew.SharedProcessors/TextSearcher + Arguments: + input_string: "%download_url%" + re_pattern: 'releases/(?P\d+\.\d+\.\d+)/' + + # get SourceReleaseDate from HTTP `Last-Modified` header: + - Processor: com.github.jgstew.SharedProcessors/DateTimeFromString + Arguments: + # parse last_modified header info from URLDownloaderPython + datetime_string: "%last_modified%" + datetime_strptime: "%a, %d %b %Y %H:%M:%S %Z" + datetime_strftime: "%Y-%m-%d" + datetime_parsed_name: SourceReleaseDate From 89a15148f24217a0852c5925f5baddb86557e1d1 Mon Sep 17 00:00:00 2001 From: JGStew Date: Tue, 2 Jul 2024 23:17:23 -0400 Subject: [PATCH 49/52] add firefox-win, modify firefox-mac --- Mozilla/Firefox-Mac.download.recipe.yaml | 3 ++- Mozilla/Firefox-Win.download.recipe.yaml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Mozilla/Firefox-Win.download.recipe.yaml diff --git a/Mozilla/Firefox-Mac.download.recipe.yaml b/Mozilla/Firefox-Mac.download.recipe.yaml index 09e636d..88f6510 100644 --- a/Mozilla/Firefox-Mac.download.recipe.yaml +++ b/Mozilla/Firefox-Mac.download.recipe.yaml @@ -5,6 +5,7 @@ Description: Downloads the latest version of Firefox Identifier: com.github.jgstew.download.Firefox-Mac Input: NAME: "Firefox" + product: firefox-latest-ssl OS: osx filename: Firefox.dmg MinimumVersion: "2.3" @@ -13,7 +14,7 @@ Process: Arguments: # Example URLs: # - https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US - url: https://download.mozilla.org/?product=firefox-latest-ssl&os=%OS%&lang=en-US + url: https://download.mozilla.org/?product=%product%&os=%OS%&lang=en-US COMPUTE_HASHES: True - Processor: EndOfCheckPhase diff --git a/Mozilla/Firefox-Win.download.recipe.yaml b/Mozilla/Firefox-Win.download.recipe.yaml new file mode 100644 index 0000000..6498eff --- /dev/null +++ b/Mozilla/Firefox-Win.download.recipe.yaml @@ -0,0 +1,15 @@ +# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US +--- +Description: Downloads the latest version of Firefox +# based upon https://github.com/autopkg/moofit-recipes/blob/master/Adobe/RemoteUpdateManager.download.recipe +Identifier: com.github.jgstew.download.Firefox-Win64 +Input: + NAME: "Firefox" + product: firefox-stub + OS: win64 + filename: FirefoxInstaller.exe + # https://download.mozilla.org/?product=firefox-stub&os=win64&lang=en-US +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.Firefox-Mac +Process: + - Processor: EndOfCheckPhase From c2aab3ed1c4eaba21d7775070d8a0e1e1425d1d4 Mon Sep 17 00:00:00 2001 From: JGStew Date: Tue, 2 Jul 2024 23:19:22 -0400 Subject: [PATCH 50/52] remove forbid overrides hook. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 451441f..72335ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: check-autopkg-recipes args: ["--recipe-prefix=com.github.jgstew.", "--strict", "--"] exclude: ".*.test.recipe.yaml" - - id: forbid-autopkg-overrides + # - id: forbid-autopkg-overrides - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: From 5f89ba64f289eaccda838866f65a711515c7ad7f Mon Sep 17 00:00:00 2001 From: JGStew Date: Tue, 2 Jul 2024 23:33:31 -0400 Subject: [PATCH 51/52] tweak devcontainer --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3ff6d81..632d7c0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -26,7 +26,7 @@ RUN sudo pip3 install --upgrade setuptools wheel build # setup autopkg: RUN cd /tmp && git clone https://github.com/autopkg/autopkg.git -RUN cd /tmp/autopkg && sudo pip3 install --requirement gh_actions_requirements.txt +RUN cd /tmp/autopkg && sudo pip3 --disable-pip-version-check --no-cache-dir install --requirement gh_actions_requirements.txt # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. # COPY requirements.txt /tmp/pip-tmp/ From 46ca9b4d97831719f753d2644124bbebd3756c7c Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 3 Jul 2024 00:25:54 -0400 Subject: [PATCH 52/52] add firefox for linux download recipe --- Mozilla/Firefox-Linux.download.recipe.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Mozilla/Firefox-Linux.download.recipe.yaml diff --git a/Mozilla/Firefox-Linux.download.recipe.yaml b/Mozilla/Firefox-Linux.download.recipe.yaml new file mode 100644 index 0000000..f47c34b --- /dev/null +++ b/Mozilla/Firefox-Linux.download.recipe.yaml @@ -0,0 +1,15 @@ +# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US +--- +Description: Downloads the latest version of Firefox +# based upon https://github.com/autopkg/moofit-recipes/blob/master/Adobe/RemoteUpdateManager.download.recipe +Identifier: com.github.jgstew.download.Firefox-Linux +Input: + NAME: "Firefox" + product: firefox-latest-ssl + OS: linux64 + filename: firefox.tar.bz2 + # https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.Firefox-Mac +Process: + - Processor: EndOfCheckPhase