Commit Graph

365 Commits

Author SHA1 Message Date
undergroundwires
87de017afd Fix failing of functions without revert code
Add missing empty/undefined handling to fix a bug where defining new
functions without `revertCode:` fails.
2021-12-21 06:01:16 +01:00
undergroundwires
5a2c263af3 Restructure pipelines and badges
- Seperate test pipeline into E2E, integration and unit test pipelines.
- Improve documenetation for pipelines (ci-cd.md).
- Introduce naming convention for worklow files and names.
- Center badges with multiple files on README file.
2021-12-19 01:48:29 +01:00
undergroundwires
ddd2e704db Add initial e2e testing with cypress
Add e2e tests with cypress using `vue add e2e-cypress`.

Vue CLI does not support creating typescript tests at this moment
(vuejs/vue-cli#1350).
2021-12-16 22:37:58 +01:00
undergroundwires
9b5e0b0591 Document and unrecommend Cloud Experience Host
Removing Cloud Experience Host has caused many unexpected issues
for users (see #99, #64, #67). It's now excluded from "Strict"
recommendation pool until a better warning mechanism is implemented.
2021-12-13 23:11:13 +01:00
undergroundwires
9b6636e21a Fix clearing Windows product key showing dialog
It's now handled silently instead of prompting user.
2021-12-12 12:21:50 +01:00
undergroundwires
a8358b8e7a Fix OS desktop detection tests and edge cases
- Fix test cases not running for desktop OS detection.
- Fixes application throwing error when user agent is undefined.
- Refactor by making os property optional in Environment to explicit
describe its potential undefined state.
2021-12-11 11:55:43 +01:00
undergroundwires
5f091bb6ab Fix double backlashes in Windows vscode scripts 2021-12-06 20:07:42 +01:00
undergroundwires-bot
17b334aaad ⬆️ bump everywhere to 0.11.2 2021-12-04 16:06:15 +00:00
undergroundwires
c65209e6a9 Unrecommend and complete Windows Push Notif. #101
- Add more script documentation in code and reference URLs.
- Unrecommend as "Standard" recommend as "Strict" due to lack of
  documentation for its privacy intrusive behavior.
- Add mising WpnUserService for disabling it completely.
0.11.2
2021-12-03 01:08:55 +01:00
undergroundwires
d2518b11a7 Improve Windows defender docs and errors #104
- Improve error messages with cause of the problem and suggested solution.
- Document:
  * Disabling `WinDefend` breaks `Set-MpPreference` and Microsoft Store
    (as reported in #104).
  * Document services that `netsh advfirewall` depends on.
- Fix some bad whitespace character in documentation.
2021-11-27 20:22:18 +01:00
undergroundwires
70cdf3865a Improve and unify disabling of Windows services
Refactor, unify and improve the logic to to start/stop and
enable/disable services, and also add more documentation.

Rework functions:
  - Unify way of disabling Windows services using templating.
  - Capitalize as `startupMode` (where startup is single word) everywhere.
  - Use also text parameters (automatic, manual..) instead of numeric
    values (2,3...) when providing parameters to any service disable
    function.

Improve documentation:
  - Add reference URLs about disabled services.
  - Add more code documentation for querying status and allowed values.

Logic improvements include:
  - Check if service is running before stopping/starting the service.
  - Do not start the service it's not an Automatic service.
  - Check whether service is already disabled.
  - When reverting, start the service if it has Automatic startup. But
    do not start the service it has different startup (e.g. manual).
    Also starts the service even though start up is configured as
    desired (before it quit before doing service start).

Improve outputs (logs):
  - Remove false-positive error messages.
  - When a service cannot be stopped/start; mention in output that the
    service will be started/stopped after reboot.
  - Show success message once service is enabled/disabled.
  - Fix reboot messages when enabling/disabling services,
  - Do not write stderr if service cannot be stopped/started as it's not
    not the main goal of the function.

Add missing revert code for the ones missing them:
  - Disable diagnostics telemetry
  - Disable Windows Media Player Network Sharing Service

> Function: DisableServiceInRegistry
- Fix not exitting if service does not exist when reverting
- Show success message once service is enabled/disabled
- Fix double "Enabled.." messages
- Fix unintended registry addition

> Function: DisablePerUserService
- Change implementation to call DisableServiceInRegistry.
- Fix both services are skipped if one of them fails.
- Fix reverting a service sets wrong startup mode.
2021-11-25 21:34:15 +01:00
undergroundwires
7c02ffb6c9 Fix Defender error due to non-english Windows #104
German edition of Windows returns German output for `schtasks.exe`
commands. So checking for "Running" fails immediately as reported #104.

Revert recent change from using `Get-ScheduledTask` and
`Unregister-ScheduledTask` to `schtasks.exe`. Also remove unused
`$powershellFile` variable.
2021-11-21 13:14:58 +01:00
undergroundwires
f2d9881382 Fix unintendedly inlined Windows scripts
- Fix reverting "Disable SQM OS key".
- Fix applying "Disable Visual Studio Code data collection" scripts.
- Fix reverting "Do not show recently used files in Quick Access".
- Add unit tests for automatically checking similar issues in future.
2021-11-19 21:07:22 +01:00
undergroundwires
d7761ab30e Fix Defender features errors in Windows #104
- Refactor to use `Set-MpPreference` in a function instead.
- Better support for both Windows and Windows 11 with platform-specific
  logic, due to poor `Remove-MpPreference` used in Windows 10:
     * Use `Remove-MpPreference` on Windows 11, but switch to
       `Set-MpPreference` for some edge cases using a flag.
     * Use `Set-MpPreference` on Windows 10 by default, and use
       `Remove-MpPreference` for only small amount of cases where it is
       supported.
- Set default value instead of `Remove-MpPreference` on Windows 10 when
  it does not work as expected.
- Improve error messages when:
  * Command name (cmdlet) is not supported
  * Command parameter is not support
  * Failing due to Defender service not working
  * Argument is not supported (e.g. for 'Broad')
- Skip if a parameter or argument is not supported instead of failing.
- Set OS defaults when using `Set-MpPreference` when `Remove-MpPreference`
  does not set the OS defaults.
- Skip setting the setting if it already is as desired.
- Remove redundant scripts in "Disable remediation actions" setting
  `LowThreatDefaultAction`, `ModerateThreatDefaultAction`,
  `HighThreatDefaultAction` and `SevereThreatDefaultAction`. As they are
  all controlled by and limited to value of `UnknownThreatDefaultAction`.
- Fix registry policies not matching cmdlet behavior:
     > CheckForSignaturesBeforeRunningScan
     > SignatureUpdateCatchupInterval
- Fix reverting registry policies (`reg delete` command and error
  output):
    > Disable Malicious Software Reporting tool diagnostic data
    > Turn off block at first sight
- Fix DisableCatchupQuickScan MpPreference command being in wrong
  category by moving it to its right category and adding its correct
  equivalent.
2021-11-17 00:03:59 +01:00
undergroundwires
bf83c58982 Refactor Saas naming, structure and modules
- Add more documentation.
- Use `main.scss` instead of importing components individually. This
  improves productivity without compilation errors due to missing
  imports and allows for easier future file/folder changes and
  refactorings inside `./styles`.
- Use partials with underscored naming. Because it documents that the
  files should not be individually imported.
- Introduce `third-party-extensions` folder to group styles that
  overwrites third party components.
- Refactor variable names from generic to specific.
- Use Sass modules (`@use` and `@forward`) over depreciated `@import`
  syntax.
- Separate font assets from Sass files (`styles/`). Create `assets/`
  folder that will contain both.
- Create `_globals.css` for global styling of common element instead of
  using `App.vue`.
2021-11-14 17:48:49 +01:00
undergroundwires
2e082932c9 Fix disabling/enabling Defender on Windows #104
Change behavior of registry reverting from adding default value to
removing value that overrides. It then leaves the system in cleaner
state, removes "managed by your organization" warning, and makes the
scripts more future-proof providing compatibility with Microsoft patches
updating the defaults. This is implemented by using `reg delete` over
`reg add` and `Remove-MpPreference` over `Set-MpPreference`.

> Disable Windows Defender Scheduled Scan task
Surpress the error when reverting the script as the task may not exist
in some Windows versions.

> Limit catch-up security intelligence (signature) updates
Change to "Disable" instead of "Limit", and bring back its revert code.

Fix reverting of following scripts setting non-default values:
  > Turn off Windows Defender SpyNet reporting
  > Disable checking for signatures before scan
  > Limit CPU usage during idle scans to minumum
  > Disable scanning when not idle
  > Disable scanning on mapped network drives on full-scan

Fix following scripts setting unexpected behavior:
  > Disable running scheduled auto-remediation
  > Limit CPU usage during idle scans to minumum
  > Disable randomizing scheduled task times
  > Disable creating system restore point on a daily basis

Add more documentation for MpPreference module:
  - Add more reference URLs
  - Add status query as documentation
  - Add information regarding default values
  - Describe meaning of enumeration values
  - Document commands not doing expected in Windows 11
2021-11-12 17:26:22 +01:00
undergroundwires
2f90cac52a Improve tests for UserSelection
- Refactor for more logic reuse
- Adds more assertments for events
2021-11-09 21:49:56 +01:00
undergroundwires
20a0071c0d Fix Windows TrustedInstaller session errors
- Fix errors (stderr stream) not being logged.
- Use `schtasks /delete` instead of `Unregister-ScheduledTask` as
  PowerShell command sometimes fail for existing tasks.
- Refactor to use `-TaskName` to explicit describe parameter, and use
  linebreaks for `Register-ScheduledTask` call with many parameters.
2021-11-09 00:14:56 +01:00
undergroundwires-bot
a40f83d6b6 ⬆️ bump everywhere to 0.11.1 2021-11-06 17:47:52 +00:00
undergroundwires
0db8cc4206 Fix website not loading on Safari
It's caused by lookahead regex used in dash comment regex for inlining
PowerShell. This commit changes dash comment inlining.

- Change regex to one without lookahead.
- Add more test cases for inlining dash comment in tricky situations.
- Refactor makeInlineComment to be it's own function to easily test
  other regex options.
- Document all regex alternatives.
- Remove redundant null check (`||`) with adding safe navigation
  operator  (`?`) to allow variable before check to be null instead of
  throwing exception.
0.11.1
2021-11-04 18:42:44 +01:00
undergroundwires
97ddc027cb Fix dead URLs and use forks as GitHub references
Change all GitHub URLs with forks so they survive if their maintainer
decides to remove them.

Fix dead URLs in:
  - "Windows Push Notification Service" (#101)
  - "Limit CPU usage during scans to minimum"
  - "Disable NVIDIA telemetry"
2021-11-03 20:08:56 +01:00
undergroundwires
82c43ba2e3 Refactor to remove "Async" function name suffix
Remove convention where Async suffix is added to functions that returns
a Promise. It was a habit from C#, but is not widely used in JavaScript
/ TypeScript world, also bloats the code. The code is more consistent
with third party dependencies/frameworks without the suffix.
2021-11-01 19:02:22 +01:00
undergroundwires
799fb091b8 Fix failing URL status checking integration tests
Implement following redirects over `fetch` supporting cookies.
`node-fetch` does not support sending cookies during redirect. However,
this is needed to not end-up in a redirect loop for a sign-in callback.

Fix integration tests failing due to redirects and 403 errors:
  - Many redirects from `answers.microsoft.com` was throwing: throwing
    `FetchError: maximum redirect reached` error. It was caused by not
    having cookies when following redirects therefore having an infinite
    sign-in callback for the webpage.
  - Fixes integration tests failing due to additional referer header being
    sent by the application. It adds support for making exceptions to
    additional header sending through a list of regexes.

Add in-depth documentation for URL status checking.
2021-10-30 16:19:10 +01:00
undergroundwires
5ead1a087d Fix, document, unrecommend Windows browser cleanup
The main goal is to highlight and exclude scripts that clears user data
(such as Chrome bookmarks) from standard recommendation, thus allowing
more granular and intentional user selection. Because scripts that are
recommended as "standard" should be non-breaking.

Standard: Recommend only clearing data that would not be noticable by
user. E.g. caches and logs.
Strict	: Recommend clearing data that may be noticable by user, but
does not affect stored consciously data by user. E.g. cookies.
Do not recommend if data is stored consciously by user. E.g. favorites
/ bookmarks.

[General]
  - Change wording from "Clear xx traces" to "Clean xx history" to make
  it more clear and unify the naming with macOS scripts.
  - More documentation both in code and both as more references.

[Chrome]
  - Unrecommend deleting Chrome user profile.
  - Document what each chrome clean-up script is doing in more detail.

[Internet Explorer]
  - Document IE scripts better.
  - For Cookie cleanup, add solutions for later Windows version.
  - Unrecommend some from standard.
  - Remove undocumented `Local Settings\Traces` folder.
  - Take ownership before deleting Temporary Internet Files. Fixes
    permission error.
  - Remove `INetCookies\PrivacIE` script because it's undocumented and
    we already have cleanup for its parent folder (`INetCookies`).
  - Remove "%USERPROFILE%\Local Settings\Traces" due to lack of
    documentation.

[Safari]
  - Remove cleanup for undocumented traces folders `Safari\Traces`.
  - Document with subcategories and references.
  - Fix clearing all data not pointing to `localappdata`.
  - Unrecomend clearing all data.

[Opera]
  - Rename to "Clear all.." to show intent.
  - Unrecommend as it removes everything.
2021-10-28 17:43:04 +01:00
undergroundwires
64631a4552 Update dependencies
- Bump dependencies to latest.
- Remove unused inversify dependency.
- Lock sass-loader to a version that's compatible to 10. Because later
  versions (>=11) require Webpack v5 while Vue CLI v4 uses Webpack v4.
- Changes slashes as division to `math.div` as it's depreciated by SASS
  https://sass-lang.com/documentation/breaking-changes/slash
2021-10-23 20:25:03 +01:00
undergroundwires-bot
f47cb04860 ⬆️ bump everywhere to 0.11.0 2021-10-21 14:57:54 +00:00
undergroundwires
504fa056d7 Update screenshot 0.11.0 2021-10-21 15:48:43 +01:00
undergroundwires
739287ac71 Fix minor issues with Defender scripts
Suppress errors:
  - when deleting registry keys because the condition where key does
    not exist is not really an error,
  - when disabling a task that does not exist because absence of a task
    when trying to disable it is still a positive condition for goal to
    get rid of it,
  - when stopping or starting a service because goal is to
    disable/enable the service.

> Turn off SmartScreen App Install Control feature
- Add missing `/f` flag

> Remove "Scan with Windows Defender" option from context menu
- Add missing `/f` flag
- Remove redundant delete line in revert code
- Add missing whitespace before `/v` flag
- Instead of deleting with `/v ""`, use `/va` for explicit indent

> Disable Malicious Software Reporting tool diagnostic data
- Fix typo in revert scripts

> Turn off tamper protection
> Restrict threat history to administrators
Fix permission errors using TrustedInstaller session

> `Set-MpPreference` scripts
- Show warning when Set-MpPreference parameter is missing instead of an
  error The reasons include:
    - If the parameter is missing, functionality may be missing i.e.
      there's nothing to disable
    - In most cases different way of disabling registry is provided
    - Error is not clear and too verbose and should be implemented in a
      better way
- Add back "Limiting Defender definition updates" script due to being
  able to handle if aparameter is missing
- Add documentation for command in its script

> Disable the Potentially Unwanted Application (PUA) feature
- Fix revert code disabling another functionality

> Disable bidirectional scanning of incoming
- Fix typo

> Disable Microsoft Defender Antivirus
- Correct wrong comment regarding deprecation

> Disable Windows Defender Security Center Service
- Fix disabling not working on Windows 11
2021-10-21 15:37:09 +01:00
undergroundwires
ab8bce7686 Support disabling of protected services #74
Add new ways to disable Defender on Windows:
  1. Disable through renaming required files
  2. Disable using registry changes
  3. Disable using TrustedInstaller user

Add support for running code as TrustedInstaller 🥳. It allows running
commands in OS-protected areas. It is written in PowerShell and it uses
PowerShell syntax like backticks that are inlined in special way. So the
commit extends inlining support and allows writing PowerShell using:
  - Comments
  - Here-strings
  - Backticks

Add disabling of more Defender service

Improve documentation and categorization of services.
2021-10-20 21:12:47 +02:00
undergroundwires
e6152fa76f Improve security hardening for macOS
- Moves security improvements to its own action.
- Add more scripts and documentation for security improvements
- Move "Disable Spotlight indexing" out of wrong firewall category
- Add more documentation
2021-10-19 22:16:40 +02:00
undergroundwires
a8031d18d5 Change theme colors
Change almost all colors for better look.
2021-10-18 21:23:04 +01:00
undergroundwires
9aa8166891 Change PowerShell double quotes escape
It changes the way privacy.sexy escape double quotes inside batch
command when running PowerShell scripts as an argument to
PowerShell.exe. It uses more robust and stable way offering support for
wider use-cases.
2021-10-17 15:37:06 +01:00
undergroundwires
236a0f6c82 Add privacy over security scripts for macOS #83
It adds scripts to:
  - Disable OS security modules.
  - Clean quarantine data.
  - Disable auto-updates.
2021-10-16 19:49:41 +02:00
undergroundwires
2492f2d814 Add more ways to disable and clean Defender #74
Adds more scripts to:
 - disable Windows Defender functions,
 - remove it from the user interface,
 - clean its scan history.

Improves the documentation:
 - Adds more documentation reference URLs.
 - Restructures scripts in a way to better document their behavior. All
   Defender scripts are now under "Disable Windows Defender" and
   "Privacy over security".

Changes recommendations, and simply recommends less:
 - Defender cloud configurations are now only documented on "Strict"
   mode.
 - Watson event sending with "DisableGenericReports" is disabled due to
   lack of documentation and depreciation.
2021-10-15 17:21:37 +01:00
undergroundwires
410bcd8244 Add semi-automatic update support for macOS
For fully automatic macOS updates, electron-updater requires:
  1. Distributing macOS file as .zip (electron-userland/electron-builder#2199)
  2. Code signing for the application

privacy.sexy as of today lacks both the distribution and code signing.
This commit introduces auto-updates through automatically checking for
updates, downloading them but requiring user to drag application icons
to Applications by opening dmg file.

This commit also fixes:
  1. Progress state in update progress bar not being shown.
  2. Downloading updates were being triggered even though it was not
desired as downloads are being handled using different based on OS and
user choice.

In the end it refactors the code for handling updates of two different
kinds, and making message dialog use enums for results instead of
response integers as well as setting default and cancel button behavior.
Refactorings make behaviors more explicit and extends the control.
2021-10-13 21:25:09 +01:00
undergroundwires
b08a6b5cec Use a consistent color system
1. Renames color names in palette. Using names such as "primary" and
"secondary" that are in consistent with designs such as material,
bootstrap and metro UI palettes. It adds `color-` prefix on color
variables in line with Vue Design System.
2. Introduces necessary changes to follow the system color system
   everywhere without using any other color:
     - It changes tooltip background from black to darker primary
     colors.
     - It overrides unset styles from tree component
     - It ensures footer has same color as top menu.
3. Removes opacity CSS changes to have better control on choices. To
   achieve that:
     - It introduces new "light" variants of main colors
     - It switches to colors with different variants (e.g. in Dialogs it
       uses primary color as button as it has variants that can be
       activated on hover meanwhile on-surface color is single).
4. Styles a tags (anchor elements) globally for consistency
2021-10-11 19:33:34 +02:00
undergroundwires
37ad26a082 Remove integration tests from deployments #90
Integration tests may depend on third parties and can fail from time to
time. In some situations failing tests can be acceptable to go forward
with deployments. They should not be a requirement that blocks
deployments. They may lead to unintended lack of distributed packages as
seen in #90.
2021-10-09 12:39:05 +01:00
undergroundwires
0696ed8396 Improve disabling of SmartScreen #74
This commit renames "smart screen" to "SmartScreen" which is the
official name from Microsoft.

It categorizes scripts to document the behavior in a more clear way. It
adds structured depth. It moves all SmartScreen scripts under Defender,
as it's now part of Defender offering since latest branding.

In addition, the commit adds more documentation and more scripts such as
disabling SmartScreen for Edge.
2021-10-08 22:38:41 +02:00
undergroundwires
9942df16c8 Increase default screen width on desktop app
Goal is to show 3 card in a row as default. It gives more consistent
look to privacy.sexy across web and desktop.
2021-10-05 22:25:59 +01:00
undergroundwires
20b7d283b0 Add support for more depth in function calls
It allow pipes to be used in nested functions. Before, pipes were added
to a variable before variable content was evaluated/compiled by
another function. This commit ensures that the commits are evaluted in
expected order.

The issue is solved by stopping precompiling functions. It makes code
less complex. It adds to compile time of the script file but nothing
noticable and something optimizable.

The problem was that the call trees we're not executed in expected
order. E.g. let's say we have functionA that outputs something like
"Hello {{ $name| pipe }}", and we have function B calling with "name:
dear {{ $firstName}}", and at last we have a script that's calling
function B with "firstName: undergroundwires". Before, expressions were
evaluated directly, meaning that function A would become:
"Hello Dear {{ $firstName}}", as you see the pipe in function A
is lost here after being applied to function B and not reaching
$firstTime input value. Parsing expressions in the end allows for pipes
etc. to not get lost.

The commit also does necessary name refactorings and folder refactorings
to reflect logical changes. `FunctionCompiler` is renamed to
`SharedFunctionsParser` as precompiling is removed and it just simply
parses now. `/FunctionCall/` is moved to `/Function/Call`.

Finally, it improves documentation and adds more tests.
2021-10-04 18:13:25 +01:00
undergroundwires
f39ee76c0c Add script to remove Meet Now icon in Windows 2021-09-24 19:22:09 +01:00
undergroundwires
4b2390736a Support disabling per-user services in Windows #16
Some services in Windows have random characters appended to them. This
commit fixes the scripts that has been trying to disable them but
failing in newer Windows versions where they become per-user.
2021-09-20 23:05:15 +01:00
undergroundwires
c8cb7a5c28 Improve alignment, padding/margin issues on UI
1. It vertically centers top script menu (including selectors for view,
   OS and recommendation levels). Before, it did not utilize the empty
   space on smaller screens when of the menu items overflowed to a new
   line. This commit fixes it, also adds margin on top selectors on
   small screens.
2. It adds vertical margin between slider items on vertical view. It
   also refactors slider component so that the `v-deep` is no longer
   used, instead style is set through properties.
3. It ensures symmetrical margin on both sides of the handle in slider
   during horizontal view. Before, the left margin did not exist and
   right margin was too wide. This commit balances right and left margin
   of the arrow.
4. It changes the way margining is done for the card list. It removes
   internal margin from cards, because when they have them they also add
   that to the outer card list. This commit solves it in a way that
   unifies setting gap between cards and setting gap between cards.
   The styles are controlled on card list instead. This way same margins
   and paddings is also applied to non-card view (i.e. scripts tree).
   Before margining was done separately and those views looked
   diferently.
5. It improves styling of cards. It uses variables instead of hardcoded
   values and also refactors and renames variables for simpler
   understanding.
2021-09-19 15:33:40 +01:00
undergroundwires
5217b0b758 Add pipes to write pretty PowerShell #53
This commit introduces two pipes: `inlinePowerShell`,
`escapeDoubleQuotes`. The types when used together allows writing adding
clean and real PowerShell scripts as they are (without inlinining or
escaping them), removing the need to have hard-coded inlining/escaping.

It enables writing better PowerShell, makes it easier to maintain and
extend PowerShell scripts. Also allows writing more stable code with
less "unseen" bugs due to manual escaping/inlining. This commit
naturally reveals and fixes double quotes not being escaped in "Empty
trash bin" script.

This is solved by unifying the use of RunPowerShell function by all
scripts using PowerShell. The function inlines and escapes the scripts
as compile time to be send them to PowerShell.exe as an argument and
then invokes PowerShell.exe with generated ugly code.
2021-09-13 21:23:57 +01:00
undergroundwires
ddf417a16a Add new UX for optionally downloading updates
Before we used native method from electron for updating and notifying
(`checkForUpdatesAndNotify`). It simply checked if there's an update,
downloaded it, applied in the background and showed OS notification.

The flow is now updated. Updates will be checked, user will be asked to
confirm about whether to download and apply the updates, then a UI with
progress bar will be shown and user will be asked to restart the
application.

This commit also moves electron related logic to `/electron/` folder (as
there are now multiple files) to keep them structured. Also the electon
entrypoint `background.ts` is renamed to `main.ts`. The reason it was
named  `background.ts` by vue-cli-plugin-electron-builder was to remove
the confusion between `main.ts` of Vue itself. However, as they are
kept in different folders, but this is not the case for us.

Better than `checkForUpdatesAndNotify`.
Organizes electron desktop app logic in same folder to allow using
multiple files in a structured manner.
2021-09-11 11:04:08 +01:00
undergroundwires
2f0321f315 Bump node environment to 15.x
It updates node version to 15.x to be able to use
`String.prototype.replaceAll()`
2021-09-09 22:12:59 +01:00
undergroundwires
4d7ff7edc5 Add support for pipes in templates #53
The goal is to be able to modify values of variables used in templates.
It enables future functionality such as escaping, inlining etc.

It adds support applying predefined pipes to variables. Pipes
can be applied to variable substitution in with and parameter
substitution expressions. They work in similar way to piping in Unix
where each pipe applied to the compiled result of pipe before.

It adds support for using pipes in `with` and parameter substitution
expressions. It also refactors how their regex is build to reuse more of
the logic by abstracting regex building into a new class.

Finally, it separates and extends documentation for templating.
2021-09-08 18:58:30 +01:00
undergroundwires
862914b06e Add "with" expression for templating #53
Allows optionally rendering content if an argument is given. The
expression is designed to be used with `optional` parameters.

Goal is to allow using `RunPowerShell` function on every function that
consists of PowerShell code. Before this commit, they were all required
to provide revertCode, or none of them could be able to have it. It
would not work because some scripts can be reverted, meanwhile some are
one-way scripts that cannot be reverted (such as cleaning scripts). In
this case a way to optionally render revertCode was required. `with`
expression give each callee script ability to turn off `revertCode` if
not needed, therefore enables using `RunPowerShell` everywhere.

This commit also improves error message for script code for better
debugging and refactors parser tests for more code reuse. It also adds
more tests to parameter substitution, and renames some tests of both
expressions for consistency.
2021-09-06 21:02:41 +01:00
undergroundwires
6c3c2e6709 Improve macOS scripts for cleaning OS logs
Categorizes existing scripts on deeper level and adds more
documentation, also adds new scripts for other system log artifacts.
2021-09-05 21:51:33 +02:00
undergroundwires
c92dc1e253 Add scripts to disable, hide and opt-out from Siri 2021-09-04 23:39:14 +02:00