-
Notifications
You must be signed in to change notification settings - Fork 1
Adds actual functionality ("run content") to the skeleton-project #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
62636c3
Add base/template content
ferricoxide ad246c5
Run EXE-based installer
ferricoxide d55bd62
Set all 'notepad__plusplus' references to 'notepad_plusplus'
ferricoxide c9fb0f2
Update onlyif requisite
ferricoxide c59954d
Use 'latest' logic if no URI specified
ferricoxide 0225fee
assign dynami vars to 'npp' namespace
ferricoxide e46b60e
Remove calls to not-implemented 'service' and 'subcomponent' modules
ferricoxide e228e68
Configure appropriate update-nagging
ferricoxide cea3645
Externalize the EXE-installer logic
ferricoxide 9561e6e
Use better onlyif condition
ferricoxide 96a1937
Disable auto-updater service
ferricoxide ce15930
oops: don't hardcode the version!
ferricoxide aaec568
Illustrate pillar content
ferricoxide 19a63dd
Add some nice-to-have registry values
ferricoxide 11809ed
Move 'fallback' logic to map.jinja
ferricoxide c408085
fix attribute-type
ferricoxide e56ee8e
Replace 'value' with 'vname' and 'vdata' attributes
ferricoxide d82a74b
Ensure only the EXE is pulled
ferricoxide db988de
Make script exit properly on install-failures
ferricoxide 104f30c
Need to nest these to aligne to Pillar
ferricoxide 52d5f35
Start adding 'clean' logic (packages only)
ferricoxide c96a00d
Iterate through HKeys and nuke
ferricoxide 446c6f0
Localize templated README content
ferricoxide 0c1e921
Address tardigradelint findings
ferricoxide 01abcc6
Construct test-matrix for Windows envs
ferricoxide be66ea3
Update Windows 'test' workflow commit-id
ferricoxide f225867
Add config:npp_admins as an empty list
ferricoxide 6d5ae49
Define a default list of privileged users
ferricoxide 6598af5
Add testing Pillar-content
ferricoxide 4f0208d
Moar repo-std actions
ferricoxide 87e4595
Try to make more resilient
ferricoxide f7df02f
Use trim() method to clip off extraneous single-quotes
ferricoxide 0e82c75
Add PS-linting to CI tests
ferricoxide 3c7189e
Fix fouls IDed by PS-linting CI tests
ferricoxide ef210af
Dump-out if not Windows
ferricoxide 696d2b1
Shoulda nuked this, already
ferricoxide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,40 @@ | ||
| # repo-template | ||
| Generic repo template for Plus3IT repositories | ||
|
|
||
| To use this template: | ||
|
|
||
| 1. Select the green "Use this template" button, or [click here](https://github.com/plus3it/repo-template/generate). | ||
| 2. Select the repo Owner, give the repo a name, enter a description, select Public or Private, and click "Create repository from template". | ||
| 3. Clone the repository and create a new branch. | ||
| 4. Configure the following settings on your new repo. | ||
| * `GENERAL` | ||
| * `Features` | ||
| * Turn off Wikis, Sponsorships, Discussions, and Projects | ||
| * `Pull Requests` | ||
| * Turn off Squash Merging | ||
| * Turn off Rebase Merging | ||
| * Turn on Allow Auto-Merge | ||
| * Turn on Automatically delete head branches | ||
| * `Pushes` | ||
| * Limit how many branches can be updated in a single push: 2 | ||
| * `COLLABORATORS and TEAMS` | ||
| * `Manage Access` | ||
| * Add relevant team roles, for example | ||
| * `tardigrade-admins` (Admin) | ||
| * `terraform` (Write) | ||
| * `releasebot` (Write) | ||
| * `Branches` | ||
| * `Create Branch Protection rule` for `main` | ||
| * Turn on Require pull request before merging | ||
| * Turn on Require approvals | ||
| * Turn on Dismiss stale pull requests... | ||
| * `Required Status Checks` | ||
| * As relevant to projects, for example | ||
| * WIP | ||
| * lint/actionlint | ||
| * lint/tardigradelint | ||
| * test / mockstacktest | ||
| * Turn on Do not allow bypassing the above settings | ||
| 5. Edit the following files to customize them for the new repository: | ||
| * `LICENSE` | ||
| * Near the end of the file, edit the date and change the repository name | ||
| * `CHANGELOG.template.md` | ||
| * Rename to `CHANGELOG.md`, replacing the repo-template changelog | ||
| * Edit templated items for the new repo | ||
| * `.bumpversion.cfg` | ||
| * Edit the version number for the new repo, ask team if not sure what to | ||
| start with | ||
| * `README.md` | ||
| * Replace contents for the new repo | ||
| * `.github/` | ||
| * Inspect dependabot and workflow files in case changes are needed for | ||
| the new repo | ||
| 6. Commit the changes and open a pull request | ||
| # notepad-plusplus-formula | ||
|
|
||
| A Saltstack formula designed to install and configure the [Notepad++](https://notepad-plus-plus.org/) text-editor (and to uninstall it later). | ||
|
|
||
| It is primarily expected that this formula will be run via [P3](https://www.plus3it.com/)'s "[watchmaker](https://watchmaker.readthedocs.io/en/stable/)" framework. | ||
|
|
||
| This formula is able to install and configure the Notepad++ text-editor on Windows-based systems. Linux functionality would also have been provided, but there's currently no Linux variant from the same makers. | ||
|
|
||
| ## Available states | ||
|
|
||
| - [notepad-plusplus](#notepad-plusplus) | ||
| - [notepad-plusplus.clean](#notepad-plusplus.clean) | ||
| - [notepad-plusplus.package](#notepad-plusplus.package) | ||
| - [notepad-plusplus.package.clean](#notepad-plusplus.package.clean) | ||
| - [notepad-plusplus.config](#notepad-plusplus.config) | ||
| - [notepad-plusplus.config.clean](#notepad-plusplus.config.clean) | ||
|
|
||
| ### notepad-plusplus | ||
|
|
||
| Executes the `package` and `config` states to install and configure the Notepad++ editor. This includes the editor binaries, as well as some Windows Registry settings and user-configuration template files. | ||
|
|
||
| ### notepad-plusplus.clean | ||
|
|
||
| Executes the `package` and `config` states' `clean` actions to fully uninstall the Notepad++ editor and associated registry entries | ||
|
|
||
| ### notepad-plusplus.package | ||
|
|
||
| Executes _just_ the `package` state to install the Notepad++ package. | ||
|
|
||
| ### notepad-plusplus.package.clean | ||
|
|
||
| Executes _just_ the `package` state's `clean` module to uninstall the Notepad++ binaries. | ||
|
|
||
| ### notepad-plusplus.config | ||
|
|
||
| Executes _just_ the `config` state to install registry-keys and other configuration-items to support the healthy running of the Notepad++ application | ||
|
|
||
| ### notepad-plusplus.config.clean | ||
|
|
||
| Executes _just_ the `config` state's `clean` module to uninstall the Notepad++ application's registry keys and other configuration-items set up during a prior, formula-managed installation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # yamllint disable rule:indentation rule:line-length | ||
| # {{ grains.get("osfinger", grains.os) }} | ||
| --- | ||
| {#- use salt.slsutil.serialize to avoid encoding errors on some platforms #} | ||
| {{ salt["slsutil.serialize"]( | ||
| "yaml", | ||
| map, | ||
| default_flow_style=False, | ||
| allow_unicode=True, | ||
| ) | ||
| | regex_replace("^\s+'$", "'", multiline=True) | ||
| | trim | ||
| }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # vim: ft=sls | ||
| --- | ||
| {#- Get the `tplroot` from `tpldir` #} | ||
| {%- set tplroot = tpldir.split("/")[0] %} | ||
| {%- from tplroot ~ "/map.jinja" import mapdata with context %} | ||
|
|
||
| {%- set _mapdata = { | ||
| "values": mapdata, | ||
| } %} | ||
| {%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %} | ||
|
|
||
| {%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %} | ||
| {%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %} | ||
|
|
||
| {{ tplroot }}-mapdata-dump: | ||
| file.managed: | ||
| - name: {{ output_file }} | ||
| - source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja | ||
| - template: jinja | ||
| - context: | ||
| map: {{ _mapdata | yaml }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # vim: ft=sls | ||
|
|
||
| {%- if grains.os_family == "Windows" %} | ||
| include: | ||
| - .config.clean | ||
| - .package.clean | ||
| {%- else %} | ||
| Invalid Platform | ||
| test.show_notification: | ||
| - text: | | ||
| ---------------------------------------- | ||
| The notepad++ application is not | ||
| published for non-Windows platform. | ||
| Skipping all further actions. | ||
| ---------------------------------------- | ||
| {%- endif %} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # vim: ft=sls | ||
|
|
||
| {#- Get the `tplroot` from `tpldir` #} | ||
| {%- set tplroot = tpldir.split('/')[0] %} | ||
| {%- from tplroot ~ "/map.jinja" import mapdata as notepad_plusplus with context %} | ||
| {%- set npp_admins = notepad_plusplus.config.npp_admins or ['Administrator'] %} | ||
| {%- set npp_dir = 'C:\\Program Files\\Notepad++' %} | ||
|
|
||
| {# Map descriptive IDs to their respective Registry paths #} | ||
| {%- set npp_registry_map = { | ||
| 'NPP Application Path': 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\notepad++.exe', | ||
| 'NPP Context Menu Entry': 'HKEY_CLASSES_ROOT\\*\\shell\\Open with Notepad++', | ||
| 'NPP MuiCache Entry': 'HKEY_CLASSES_ROOT\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\MuiCache', | ||
| 'NPP OpenWithList txt': 'HKEY_CLASSES_ROOT\\.txt\\OpenWithList\\notepad++.exe', | ||
| 'NPP System Notepad Replacement': 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Opt | ||
| ions\\notepad.exe' | ||
| } | ||
| %} | ||
|
|
||
| {%- for desc, reg_path in npp_registry_map.items() %} | ||
| Remove {{ desc }}: | ||
| reg.absent: | ||
| - name: '{{ reg_path }}' | ||
| {%- endfor %} | ||
|
|
||
| {%- for admin in npp_admins %} | ||
| Remove NPP AppData for {{ admin }}: | ||
| file.absent: | ||
| - name: 'C:\Users\{{ admin }}\AppData\Roaming\Notepad++' | ||
| {%- endfor %} | ||
|
|
||
| Remove NPP System Config Files: | ||
| file.absent: | ||
| - names: | ||
| - '{{ npp_dir }}\updater\gup.xml' | ||
| - '{{ npp_dir }}\config.model.xml' |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.