Commit Graph

260 Commits

Author SHA1 Message Date
Richard Kuhnt d68cb3ce52 Add config option "show_update_log" (#2133) 2018-03-21 17:10:42 +01:00
Richard Kuhnt f3f559c460 Improve is_scoop_outdated() and add last_scoop_update() 2018-03-21 17:09:11 +01:00
Richard Kuhnt 0daa25c630 Fix update log output 2018-03-21 16:30:49 +01:00
Richard Kuhnt 12962acfa8 Use consistent User-Agent Header on all webrequests 2018-03-18 16:35:01 +01:00
Philippe Crama 91a02ce03d Followup to PR #1918: scoop-virustotal.ps1 fixes (#1934)
* Fix interpretation of response's status code to detect redirections

* Improve documentation of virustotal subcommand

- usage & configuration of virustotal_api_key
- special parameter '*' to test all installed apps
- make necessity of having a virustotal_api_key for --scan explicit
- show that it's possible to check several packages at once

* Never use virustotal_api_key to query if a package is safe

The URL in the code wasn't an API end-point anyway.

* Refactor logic to warn user about apps unknown to VirusTotal

* Warn once when virustotal_api_key's absence prevents VirusTotal submission

This is preparation for changes to come in the package submission logic.

* Use API to submit download link to VirusTotal, rate limited in EAFP fashion

This is a roundabout way to get the file to be scanned without having
to download & upload it ourselves.

Rate limiting is implemented using EAFP: if submission fails, we wait
at least 60s before retrying at most once.

* Color undecided VirusTotal information the same way as `dangerous' files

If the scanning is still in progress, VirusTotal returns 0 malicious,
0 suspicious and 0 undetected.  Err on the safe side and color this
the same way as `dangerous' files.

* Remove requirement to only verify installed apps

The initial use case for this feature was to scan packages to avoid
installing dangerous apps.  Assuming they are infected, we want if
possible to avoid downloading them at all.

* Check dependencies with VirusTotal, too (by default)

* Manually apply `Lint: PSAvoidUsingCmdletAliases' (see e1bb1e91, #2075)

This is to avoid conflicts when merging lukesampson:master

* Explain applist's return value transformation: drop `global' flag for each app

* Move variable declarations and apps list generation to the top

* Reformat code and comply to linted function names

* Reduce nesting, remove hacky hash/url retrieval

* Remove $global variables

* Fix regression bug in Search-VirusTotal()

* Remove applist() because it's irrelevant if app is installed globally
2018-03-14 19:04:18 +01:00
Chawye Hsu 731247876d [Pending] Finally we add the code linting and its tests! (#2108)
* Lint: PSPossibleIncorrectComparisonWithNull

* Lint: PSUseLiteralInitializerForHashtable

* Lint: PSUseBOMForUnicodeEncodedFile

* Lint: PSUseApprovedVerbs

* Lint: PSAvoidGlobalVars

* Lint: PSAvoidUsingEmptyCatchBlock

* Lint: PSUseShouldProcessForStateChangingFunctions

* Lint helper: Add PSScriptAnalyzer integration for vscode

* Fix lint: PSUseBOMForUnicodeEncodedFile

* Tests: ignore previous TestResults.xml

* Tests: add PowerShell script linting into tests!

* Add PSScriptAnalyzer into appveyor ci

* Update Scoop-Linting.Tests.ps1
2018-03-13 14:26:55 +01:00
Vladimir Chebotarev 4d956c2e30 Checked if uninstaller removed its directory. (#2078) 2018-03-12 18:54:58 +01:00
Steve Baker 31075f6200 Clean up some error messages (#2032)
Removes extra 'ERROR' in text where the `error` method is used.
Converts some `write-host "error message"` to use the `error` method
Converts some `write-host "error message"; exit 1` to use the `abort`
method.
2018-03-12 18:32:57 +01:00
Richard Kuhnt 56c35f8f05 Show changelog after updating scoop and buckets 2018-03-11 23:01:06 +01:00
Tres Finocchiaro 16f59b4401 Add scoop prefix command (#2117) 2018-03-11 21:02:10 +01:00
Richard Kuhnt 79bf99c3c1 Also show other applications in PATH with 'scoop which' 2018-03-11 19:53:02 +01:00
Chawye Hsu e1bb1e91d0 Lint: PSAvoidUsingCmdletAliases (#2075) 2018-03-03 18:41:19 +01:00
Richard Kuhnt 7176719501 Improve reset command
Allow resetting:
* global apps
* multiple apps
* all apps by using * parameter (skips global apps if not admin)
2018-02-16 14:34:52 +01:00
Steve Baker eadba0116f Fix: scoop cache command not using $SCOOP_CACHE (#1990) 2018-01-28 23:52:04 +01:00
Richard Kuhnt 43a02b2a3b Add NTFS check to checkup command (#1944) 2018-01-08 14:56:39 +01:00
Ross Smith II af41fc6efb Update virustotal command (#1918)
- Add * option to check all installed apps
- Add 60+ sec. pause after 4 queries/min to avoid 429/Too Many Requests
- Add immediate abort if query limit is exceeded
- Add INFO/WARN/ERROR prefixes to messages
- Add DarkGray/DarkCyan/DarkRed colors to INFO/WARN/ERROR messages
- Add using apikey if stored via: scoop config virustotal_api_key apikey
- Change colors to DarkGreen/DarkYellow/Yellow/Red for 0/1/2/3+ hit count
- Remove fragment from URL when submitting to virustotal.com
- Standardized INFO/WARN/ERROR messages
- virustotal: clean up per r15ch13's feedback
2017-12-28 17:24:02 +01:00
Philippe Crama d2f191966c Refactor code to reduce nesting (suggested by r15ch13)
Nearly equivalent to the code in his comment on #1902, with minor fixes
2017-12-21 12:40:49 +01:00
Philippe Crama 13092271c0 Add option to submit package's download link to VirusTotal for unknown hashes 2017-12-21 12:40:49 +01:00
Philippe Crama d512d41f6f Fix handling of manifests with multiple download links & hashes 2017-12-21 12:40:49 +01:00
Philippe Crama 4324b5a520 Return status information in exit code 2017-12-21 12:40:49 +01:00
Philippe Crama b9a52b4868 Update help to mention supported hash types (see also de84308d) 2017-12-21 12:40:49 +01:00
Philippe Crama f34232298f Handle exceptions and suggest submitting to VirusTotal in case of a 404 2017-12-21 12:40:49 +01:00
Philippe Crama 38bf726de3 Report results in console instead of opening new tabs
I took the initial implementation by r15ch13 in #1902, then added a
link to the webpages with the scan results (links are clickable in my
console, so it's an easy way to get at the details).
2017-12-21 12:40:49 +01:00
Philippe Crama 879c89cb40 Enable MD5 & SHA1: VirusTotal allows to query those hashes, too 2017-12-21 12:40:49 +01:00
Philippe Crama 8c09093404 Lower-case the hash value in the VirusTotal URL 2017-12-21 12:40:49 +01:00
Philippe Crama 410ec72c1b Handle non-SHA256 unsupported hashes more gracefully + code cleanup 2017-12-21 12:40:49 +01:00
Philippe Crama 4589caf02e Initial implementation of command to query virustotal.com 2017-12-21 12:40:49 +01:00
Richard Kuhnt 799321cbd2 Quietly clone buckets 2017-12-16 02:02:32 +01:00
Richard Kuhnt 36dc7a880c Allow more architecture naming conventions for --arch parameters
closes #1908
2017-12-15 17:05:12 +01:00
Richard Kuhnt 5f8577dda7 Add missing exit codes to various scoop commands 2017-12-15 00:31:37 +01:00
Richard Kuhnt 9e124dae23 Prepend bucket name to app name before updating (closes #1904)
If an app exists in both buckets, this fix prevents updating it to the main version instead of the bucket version
2017-12-13 13:12:17 +01:00
Richard Kuhnt 46cf8bf355 Better description for the scoop which command 2017-11-02 21:21:25 +01:00
Richard Kuhnt 4a32c0de0c Show warning instead of error if bucket already exists (closes #1764) 2017-10-27 18:43:46 +02:00
Richard Kuhnt a3e84bd504 Remove two more abort functions and improve output (fixes #1758) 2017-10-11 18:13:49 +02:00
Richard Kuhnt f381b5865f Fix scoop update force option (closes #1701) 2017-09-11 21:07:01 +02:00
Ross Smith II 927fdf39da Add bucket and arch to list/export output (#1613)
* Add bucket and arch to list/export output
* Use write-host
* Add colors to scoop list
2017-09-10 22:38:35 +02:00
Winter Young c86c727084 Fix scoop status error by improving scoop update (#1699)
* fix git status error
* Fix setting the lastupdate in is_scoop_outdated()
2017-09-10 19:46:19 +02:00
Dave Andersen 330fcaf93e fix #1628 (scoop update --ignore-cache option broken) (#1629)
* fix #1628

* remove unintended change in merge

* Add --no-cache to install and to all parts of the update command
2017-09-01 22:47:11 +02:00
Richard Kuhnt 2842693031 Fix cleanup command not working with global apps (fixes #1683) 2017-08-31 20:28:44 +02:00
Richard Kuhnt 86c94526fd Add ensure_all_installed() to uninstall command 2017-08-31 00:47:37 +02:00
Richard Kuhnt 52d1de5576 Add success message to cleanup command 2017-08-30 22:23:20 +02:00
Richard Kuhnt 0b5813563d Improve update command output and behavior 2017-08-30 22:13:32 +02:00
Richard Kuhnt 65a804d15f Improve cleanup command output and behavior 2017-08-30 22:13:09 +02:00
Richard Kuhnt 2020a47506 Use app_status() in the actual status command 2017-08-30 22:11:27 +02:00
Richard Kuhnt 51564672c4 Use show as default option for cache command 2017-08-30 21:41:43 +02:00
Richard Kuhnt 4ab82f60bb Run scoop update every so often before installing/updating apps
This change should reduce issues with outdated manifests/hashes/URLs.
Every successful execution of `scoop update` will save the date/time to `~\.scoop`
Every execution of `scoop update x` or `scoop install x` will check last saved date/time and run `scoop update` beforehand if the last run was more than 3 hours ago.
2017-08-30 17:17:38 +02:00
Richard Kuhnt e57c2ce08e Use write-host in update command 2017-08-30 17:08:30 +02:00
Richard Kuhnt e74d7de883 Remove unused and commented code from update command 2017-08-30 15:11:14 +02:00
Richard Kuhnt 84bd16b82d Improve ensure_all_installed() behavior and move it to core.ps1
This change removes the use of abort() and exit 1 from ensure_all_installed() so the command doesn't stop if only one app in the list is not found.
2017-08-30 15:10:45 +02:00
Richard Kuhnt 9b3e7c83f9 Move applist() from update/cleanup commad to core 2017-08-30 15:06:54 +02:00