├── docs
├── partials
│ └── guide.md
├── CODEOWNERS
└── ECOSYSTEM.md
├── .config
├── husky
│ ├── .gitignore
│ ├── prepare-commit-msg
│ ├── post-merge
│ ├── commit-msg
│ ├── pre-push
│ ├── post-commit
│ ├── post-checkout
│ ├── post-rewrite
│ └── pre-commit
├── requirements.txt
├── docs
│ ├── readme-library
│ │ ├── installation.md
│ │ ├── quick-description.md
│ │ └── subheader.md
│ ├── .devcontainer
│ │ ├── Dockerfile
│ │ └── devcontainer.json
│ ├── contributing
│ │ ├── contributors.md
│ │ ├── code-of-conduct.md
│ │ ├── header.md
│ │ ├── philosophy.md
│ │ ├── pull-requests.md
│ │ ├── styleguides.md
│ │ ├── getting-started.md
│ │ ├── formatting.md
│ │ └── overview.md
│ ├── common
│ │ ├── contributing
│ │ │ ├── contributors.md
│ │ │ ├── code-of-conduct.md
│ │ │ ├── header.md
│ │ │ └── styleguides.md
│ │ └── readme
│ │ │ ├── license.md
│ │ │ ├── header.md
│ │ │ └── contribute.md
│ ├── readme-cli
│ │ ├── quick-description.md
│ │ ├── usage.md
│ │ ├── installation.md
│ │ └── subheader.md
│ ├── readme
│ │ ├── quick-description.md
│ │ ├── requirements.md
│ │ ├── quick-start.md
│ │ ├── overview.md
│ │ └── creating-box.md
│ ├── readme-desktop
│ │ └── updating.md
│ ├── blueprint-contributing.md
│ ├── blueprint-readme-cli.md
│ ├── blueprint-readme-library.md
│ ├── blueprint-readme-server.md
│ ├── blueprint-readme-desktop.md
│ └── readme-server
│ │ └── updating.md
├── pyproject.partial.toml
├── nodemon.json
├── proselint.json
├── taskfiles
│ ├── cloud
│ │ ├── Taskfile.yml
│ │ ├── Taskfile-heroku.yml
│ │ ├── Taskfile-cloudflare.yml
│ │ └── Taskfile-s3.yml
│ ├── web
│ │ ├── Taskfile.yml
│ │ ├── Taskfile-nx.yml
│ │ ├── Taskfile-cloudflare.yml
│ │ ├── Taskfile-profile.yml
│ │ └── Taskfile-ionic.yml
│ ├── publish
│ │ ├── Taskfile-menubar.yml
│ │ ├── Taskfile-firefox.yml
│ │ ├── Taskfile-opera.yml
│ │ ├── Taskfile-chrome.yml
│ │ ├── Taskfile-brew.yml
│ │ ├── Taskfile-ios.yml
│ │ ├── Taskfile-android.yml
│ │ ├── Taskfile-snap.yml
│ │ └── Taskfile.yml
│ ├── ui
│ │ └── Taskfile.yml
│ ├── lint
│ │ ├── Taskfile-esprint.yml
│ │ ├── Taskfile-codeclimate.yml
│ │ ├── Taskfile-markdown.yml
│ │ └── Taskfile-prose.yml
│ ├── install
│ │ ├── Taskfile-service.yml
│ │ ├── Taskfile-qubes.yml
│ │ ├── Taskfile-rust.yml
│ │ ├── Taskfile-ansible.yml
│ │ ├── Taskfile-tap.yml
│ │ ├── Taskfile-github.yml
│ │ ├── Taskfile-go.yml
│ │ ├── Taskfile-ventoy.yml
│ │ └── Taskfile-requirements.yml
│ ├── update
│ │ └── Taskfile.yml
│ ├── dotfiles
│ │ └── Taskfile.yml
│ ├── git
│ │ ├── Taskfile-gitomatic.yml
│ │ ├── Taskfile-bug.yml
│ │ ├── Taskfile-issues.yml
│ │ └── Taskfile-hook.yml
│ ├── README.md
│ ├── go
│ │ ├── Taskfile-test.yml
│ │ ├── Taskfile-goreleaser.yml
│ │ └── Taskfile.yml
│ ├── common
│ │ ├── Taskfile-code.yml
│ │ └── Taskfile-util.yml
│ ├── app
│ │ ├── Taskfile.yml
│ │ └── Taskfile-virtualbox.yml
│ ├── vagrant
│ │ ├── Taskfile-qubes.yml
│ │ └── Taskfile.yml
│ ├── nest
│ │ └── Taskfile.yml
│ ├── upstream
│ │ ├── Taskfile-shared.yml
│ │ ├── Taskfile-commondocs.yml
│ │ └── Taskfile-docs.yml
│ ├── python
│ │ ├── Taskfile-test.yml
│ │ └── Taskfile.yml
│ ├── ci
│ │ └── Taskfile-github.yml
│ ├── npm
│ │ ├── Taskfile-doc.yml
│ │ └── Taskfile-cov.yml
│ ├── log
│ │ └── Taskfile.yml
│ ├── security
│ │ ├── Taskfile-ssh.yml
│ │ ├── Taskfile-gpg.yml
│ │ └── Taskfile-disk.yml
│ ├── symlink
│ │ └── Taskfile.yml
│ └── ansible
│ │ └── Taskfile-ansibler.yml
├── commitlintrc.cjs
├── Dockerfile
├── run
├── hadolint.yml
├── flake8.toml
├── common-keywords.json
├── prettierignore
├── golangci.yml
├── yamllint.yml
├── codeclimate.yml
├── hbs.cjs
└── bash
│ └── try-catch.sh
├── floppy
├── PinTo10.exe
└── WindowsPowershell.lnk
├── scripts
├── install-python.custom.ps1
├── compact.symlink.bat
├── openssh.symlink.ps1
├── enable-rdp.symlink.bat
├── fixnetwork.symlink.ps1
├── uac-enable.symlink.bat
├── dis-updates.symlink.bat
├── disable-tasks.symlink.bat
├── disable-winrm.symlink.ps1
├── enable-winrm.symlink.ps1
├── set-powerplan.symlink.ps1
├── win-updates.symlink.ps1
├── debloat-windows.symlink.ps1
├── pin-powershell.symlink.bat
├── vm-guest-tools.symlink.ps1
├── microsoft-updates.symlink.bat
├── disable-screensaver.symlink.ps1
├── set-winrm-automatic.symlink.bat
├── cleanup.custom.ps1
├── compile-dotnet-assemblies.symlink.bat
├── disable-windows-defender.symlink.ps1
├── vagrant.custom.ps1
└── install-chocolatey.custom.ps1
├── logo.png
├── .devcontainer
├── Dockerfile
└── devcontainer.json
├── .github
├── FUNDING.yml
├── PULL_REQUEST_TEMPLATE.md
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── FeatureRequest.yml
│ ├── SupportRequest.yml
│ └── BugReport.yml
└── stale.yml
├── local
├── virtio-download.sh
└── windows-download.sh
├── .gitlab-ci.yml
├── .gitmodules
├── .editorconfig
├── .gitlab
├── issue_templates
│ ├── Testing.md
│ ├── Feature.md
│ └── Defect.md
└── merge_request_templates
│ └── template.md
├── LICENSE
├── .vscode
├── extensions.json
└── settings.json
├── .gitignore
├── Vagrantfile.template
└── Vagrantfile
/docs/partials/guide.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.config/husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.config/requirements.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.config/docs/readme-library/installation.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/floppy/PinTo10.exe:
--------------------------------------------------------------------------------
1 | ../.modules/windows/floppy/PinTo10.exe
--------------------------------------------------------------------------------
/scripts/install-python.custom.ps1:
--------------------------------------------------------------------------------
1 | choco install python3 -y
2 |
--------------------------------------------------------------------------------
/scripts/compact.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/compact.bat
--------------------------------------------------------------------------------
/scripts/openssh.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/openssh.ps1
--------------------------------------------------------------------------------
/scripts/enable-rdp.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/enable-rdp.bat
--------------------------------------------------------------------------------
/scripts/fixnetwork.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/fixnetwork.ps1
--------------------------------------------------------------------------------
/scripts/uac-enable.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/uac-enable.bat
--------------------------------------------------------------------------------
/floppy/WindowsPowershell.lnk:
--------------------------------------------------------------------------------
1 | ../.modules/windows/floppy/WindowsPowershell.lnk
--------------------------------------------------------------------------------
/scripts/dis-updates.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/dis-updates.bat
--------------------------------------------------------------------------------
/scripts/disable-tasks.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/disable-tasks.bat
--------------------------------------------------------------------------------
/scripts/disable-winrm.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/disable-winrm.ps1
--------------------------------------------------------------------------------
/scripts/enable-winrm.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/enable-winrm.ps1
--------------------------------------------------------------------------------
/scripts/set-powerplan.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/set-powerplan.ps1
--------------------------------------------------------------------------------
/scripts/win-updates.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/win-updates.ps1
--------------------------------------------------------------------------------
/.config/docs/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM megabytelabs/devcontainer:latest
2 |
--------------------------------------------------------------------------------
/.config/pyproject.partial.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry.dependencies]
2 | latestos = "*"
3 |
--------------------------------------------------------------------------------
/scripts/debloat-windows.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/debloat-windows.ps1
--------------------------------------------------------------------------------
/scripts/pin-powershell.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/pin-powershell.bat
--------------------------------------------------------------------------------
/scripts/vm-guest-tools.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/vm-guest-tools.ps1
--------------------------------------------------------------------------------
/scripts/microsoft-updates.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/microsoft-updates.bat
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProfessorManhattan/packer-windows-desktop/HEAD/logo.png
--------------------------------------------------------------------------------
/scripts/disable-screensaver.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/disable-screensaver.ps1
--------------------------------------------------------------------------------
/scripts/set-winrm-automatic.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/set-winrm-automatic.bat
--------------------------------------------------------------------------------
/.config/docs/contributing/contributors.md:
--------------------------------------------------------------------------------
1 | ## Contributors
2 |
3 | {{ contributors_list }}
4 |
--------------------------------------------------------------------------------
/.config/nodemon.json:
--------------------------------------------------------------------------------
1 | {
2 | "exec": "task project:livereload",
3 | "ext": "json,hcl"
4 | }
5 |
--------------------------------------------------------------------------------
/.config/proselint.json:
--------------------------------------------------------------------------------
1 | {
2 | "checks": {
3 | "typography.symbols": false
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.config/taskfiles/cloud/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | launch: 'true'
6 |
--------------------------------------------------------------------------------
/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # hadolint disable=DL3007
2 | FROM megabytelabs/devcontainer:latest
3 |
--------------------------------------------------------------------------------
/.config/taskfiles/web/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | donothing: 'true'
6 |
--------------------------------------------------------------------------------
/scripts/cleanup.custom.ps1:
--------------------------------------------------------------------------------
1 | Remove-Item 'C:\PerfLogs' -Recurse
2 | Remove-Item 'C:\tmp' -Recurse
3 |
--------------------------------------------------------------------------------
/scripts/compile-dotnet-assemblies.symlink.bat:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/compile-dotnet-assemblies.bat
--------------------------------------------------------------------------------
/.config/commitlintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['@commitlint/config-conventional']
3 | }
4 |
--------------------------------------------------------------------------------
/scripts/disable-windows-defender.symlink.ps1:
--------------------------------------------------------------------------------
1 | ../.modules/windows/scripts/docker/disable-windows-defender.ps1
--------------------------------------------------------------------------------
/.config/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scratch AS binary
2 |
3 | ENTRYPOINT ["/"]
4 | CMD ["--version"]
5 |
6 | COPY /
7 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-menubar.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | release: 'true'
6 |
--------------------------------------------------------------------------------
/.config/docs/readme-library/quick-description.md:
--------------------------------------------------------------------------------
1 | >
**{{ pkg.description }}**
2 |
--------------------------------------------------------------------------------
/.config/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # @file .config/run
4 | # @brief Wrapper for Task (the Taskfile.yml runner)
5 |
--------------------------------------------------------------------------------
/.config/taskfiles/ui/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | launch:
6 | cmds:
7 | - 'true'
8 |
--------------------------------------------------------------------------------
/.config/taskfiles/web/Taskfile-nx.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | install:
6 | deps:
7 | - :install:npm:nx
8 |
--------------------------------------------------------------------------------
/.config/docs/common/contributing/contributors.md:
--------------------------------------------------------------------------------
1 | ## Contributors
2 |
3 | Thank you so much to our contributors!
4 |
5 | {{ contributors_list }}
6 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ---
2 | github: ProfessorManhattan
3 | open_collective: megabytelabs
4 | patreon: ProfessorManhattan
5 | custom: [donate.givedirectly.org]
6 |
--------------------------------------------------------------------------------
/local/virtio-download.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.190-1/virtio-win.iso
3 |
--------------------------------------------------------------------------------
/.config/taskfiles/lint/Taskfile-esprint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | esprint:
6 | todo: Remove this file
7 | cmds:
8 | - echo 'Stale file'
9 |
--------------------------------------------------------------------------------
/.config/hadolint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | ignored:
3 | # Last USER should not be root
4 | - DL3002
5 | # Do not use sudo
6 | - DL3004
7 | # Do not use `latest` images
8 | - DL3007
9 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-service.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | start:
6 | cmds:
7 | - sudo service {{.SERVICE}} start
8 | status:
9 | - '[ "{{OS}}" == "darwin" ]'
10 |
--------------------------------------------------------------------------------
/.config/taskfiles/update/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | finish:
6 | cmds:
7 | - task: :common:start:update
8 |
9 | init:
10 | cmds:
11 | - task: :common:start:init
12 |
--------------------------------------------------------------------------------
/.config/docs/common/readme/license.md:
--------------------------------------------------------------------------------
1 | ## License
2 |
3 | Copyright © {{ copyright }} [{{ company }}]({{ link.home }}). This project is [{{ license }}]({{ repository.gitlab }}{{ repository.location.license.gitlab }}) licensed.
4 |
--------------------------------------------------------------------------------
/.config/docs/readme-cli/quick-description.md:
--------------------------------------------------------------------------------
1 | > **{{ subheaderDescription }}**
2 |
3 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | ---
2 | include:
3 | - remote: https://gitlab.com/megabyte-labs/gitlab-ci/-/raw/master/common.gitlab-ci.yml
4 | - remote: https://gitlab.com/megabyte-labs/gitlab-ci/-/raw/master/publish/semantic-release.gitlab-ci.yml
5 |
--------------------------------------------------------------------------------
/.config/docs/readme/quick-description.md:
--------------------------------------------------------------------------------
1 | >
**{{ pkg.description }}**
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.config/flake8.toml:
--------------------------------------------------------------------------------
1 | [flake8]
2 | exclude = ".autodoc, .cache, .common, .config, .git, .github, .gitlab, .husky, .modules, .npm, .pnpm-store, .shared, .task, .venv, .vscode, build, dist, node_modules, roles, venv"
3 | ignore = "E402"
4 | max-line-length = 120
5 |
--------------------------------------------------------------------------------
/.config/taskfiles/web/Taskfile-cloudflare.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | deploy:
6 | deps:
7 | - :install:npm:wrangler
8 |
9 | login:wrangler:
10 | deps:
11 | - :install:npm:wrangler
12 | cmds:
13 | - wrangler
14 |
--------------------------------------------------------------------------------
/.config/taskfiles/dotfiles/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | donothing:
6 | summary: |
7 | Add CLOUDFLARE_ACCOUNT_ID to package.json blueprint
8 | Add Cloudflare_API_TOKEN to globals
9 | cmds:
10 | - task donothing
11 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule ".modules/bento"]
2 | path = .modules/bento
3 | url = https://github.com/chef/bento.git
4 | branch = master
5 | [submodule ".modules/windows"]
6 | path = .modules/windows
7 | url = https://github.com/StefanScherer/packer-windows
8 | branch = main
9 |
--------------------------------------------------------------------------------
/docs/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Prevents modifications to CI configurations
2 | .config/taskfiles/ @ProfessorManhattan
3 | .github/ @ProfessorManhattan
4 | .gitlab-ci.yml @ProfessorManhattan
5 | .gitlab/ @ProfessorManhattan
6 | .travis.yml @ProfessorManhattan
7 | start.sh @ProfessorManhattan
8 |
--------------------------------------------------------------------------------
/local/windows-download.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Calculating SHA256 of windows.iso"
4 | SHA256=$(sha256sum windows.iso)
5 | echo "Injecting SHA256 into template.json"
6 | jq --arg a "${SHA256%% *}" '.variables.iso_checksum = $a' template.json >__jq.json && mv __jq.json template.json
7 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-firefox.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | log:
6 | error: Encountered error while publishing Firefox add-on
7 | start: Publishing Firefox add-on
8 | success: Successfully published Firefox add-on
9 | release: Publishes Firefox add-on
10 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | - **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
2 |
3 | - **What is the current behavior?** (You can also link to an open issue here)
4 |
5 | - **What is the new behavior (if this is a feature change)?**
6 |
7 | - **Other information**:
8 |
--------------------------------------------------------------------------------
/scripts/vagrant.custom.ps1:
--------------------------------------------------------------------------------
1 | try {
2 | New-Item -ItemType directory -Path C:\Users\vagrant\.ssh
3 | } catch {
4 | Write-Host "The vagrant .ssh folder already exists"
5 | }
6 | Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub" -OutFile "C:\Users\vagrant\.ssh\authorized_keys"
7 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-opera.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | release:
6 | desc: Publishes Opera extension
7 | log:
8 | error: Encountered error while publishing Opera extension
9 | start: Publishing Opera extension
10 | success: Successfully published Opera extension
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # https://editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | insert_final_newline = false
15 | trim_trailing_whitespace = false
16 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-chrome.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | release:
6 | desc: Publishes Chrome extension
7 | log:
8 | error: Encountered error while publishing Chrome extension
9 | start: Publishing Chrome extension
10 | success: Successfully published Chrome extension
11 |
--------------------------------------------------------------------------------
/.config/docs/contributing/code-of-conduct.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 |
3 | This project and everyone participating in it is governed by the [Code of Conduct]({{ repository.github }}{{ repository.location.conduct.github }}). By participating, you are expected to uphold this code. Please report unacceptable behavior to [{{ email.help }}](mailto:{{ email.help }}).
4 |
--------------------------------------------------------------------------------
/.config/docs/common/contributing/code-of-conduct.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 |
3 | This project and everyone participating in it is governed by the [Code of Conduct]({{ repository.github }}{{ repository.location.conduct.github }}). By participating, you are expected to uphold this code. Please report unacceptable behavior to [{{ email.help }}](mailto:{{ email.help }}).
4 |
--------------------------------------------------------------------------------
/.gitlab/issue_templates/Testing.md:
--------------------------------------------------------------------------------
1 | ### Why
2 |
3 |
4 |
5 | ### Expected Behavior
6 |
7 |
8 |
9 | ### Additional Information
10 |
11 |
12 |
13 | /label ~testing
14 |
--------------------------------------------------------------------------------
/.config/docs/contributing/header.md:
--------------------------------------------------------------------------------
1 |
2 |
Contributing Guide
3 |
4 |
5 | First of all, thanks for visiting this page 😊 ❤️ ! We are *stoked* that you may be considering contributing to this project. You should read this guide if you are considering creating a pull request or plan to modify the code for your own purposes.
6 |
--------------------------------------------------------------------------------
/.config/common-keywords.json:
--------------------------------------------------------------------------------
1 | {
2 | "keywords": [
3 | "accelerated",
4 | "compressed",
5 | "desktop",
6 | "kvm",
7 | "mblabs",
8 | "megabytelabs",
9 | "optimized",
10 | "packer",
11 | "parallels",
12 | "professormanhattan",
13 | "qemu",
14 | "virtualbox",
15 | "vmware",
16 | "washingtondc",
17 | "workstation"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/.config/docs/common/contributing/header.md:
--------------------------------------------------------------------------------
1 |
2 |
Contributing Guide
3 |
4 |
5 | First of all, thanks for visiting this page 😊 ❤️ ! We are *stoked* that you may be considering contributing to this project. You should read this guide if you are considering creating a pull request or plan to modify the code for your own purposes.
6 |
--------------------------------------------------------------------------------
/.config/docs/readme/requirements.md:
--------------------------------------------------------------------------------
1 | ## Requirements
2 |
3 | - At least one of the above virtualization platforms installed ([VirtualBox](https://github.com/megabyte-labs/ansible-virtualbox) is a good starting point if you do not already have one of the platforms installed)
4 | - [Packer](https://github.com/megabyte-labs/ansible-packer)
5 | - [Vagrant](https://github.com/megabyte-labs/ansible-vagrant)
6 |
--------------------------------------------------------------------------------
/.config/docs/readme-desktop/updating.md:
--------------------------------------------------------------------------------
1 | ## Updating Your Box
2 |
3 | If a new release of the {{ template_json.variables.description }} system is available, you can update your VagrantUp box. You can do this by changing the `"iso_checksum_url"`, `"iso_url"`, and `"iso_version"` variables in the `template.json` file. After that, run `packer build -only=virtualbox-iso template.json` to build the image again.
4 |
--------------------------------------------------------------------------------
/.config/prettierignore:
--------------------------------------------------------------------------------
1 | .autodoc/
2 | .cache/
3 | .common/
4 | .config/
5 | .git/
6 | .github/
7 | .gitlab/
8 | .gitmodules
9 | .husky/
10 | .modules/
11 | .npm/
12 | .pnpm-store/
13 | .shared/
14 | .task/
15 | .venv/
16 | .vscode/
17 | .variables.json
18 | **/.cache/
19 | **/Dockerfile
20 | **/*.handlebars
21 | build/
22 | coverage/
23 | dist/
24 | node_modules/
25 | pnpm-lock.yaml
26 | venv/
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | - **I'm submitting a ...**
2 | [ ] bug report
3 | [ ] feature request
4 | [ ] question about the decisions made in the repository
5 | [ ] question about how to use this project
6 |
7 | - **Description**
8 |
9 | - **Other information** (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
10 |
--------------------------------------------------------------------------------
/.config/taskfiles/git/Taskfile-gitomatic.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | key:generate:
6 | cmds:
7 | - ssh-keygen -t ecdsa -b 521 -C "$GITLAB_EMAIL" -f ~/.ssh/id_ecdsa_gitomatic -P ""
8 |
9 | sync:
10 | deps:
11 | - :install:go:gitomatic
12 | cmds:
13 | - gitomatic -privkey ~/.ssh/id_ecdsa_gitomatic -interval 14m -pull=true -push=true -author "gitomatic sync" -email "gitomatic@megabyte.space" ./
14 |
--------------------------------------------------------------------------------
/.config/docs/readme/quick-start.md:
--------------------------------------------------------------------------------
1 | ## Quick Start
2 |
3 | If you have [VirtualBox](https://github.com/megabyte-labs/ansible-virtualbox) and [Vagrant](https://github.com/megabyte-labs/ansible-vagrant) installed, you can quickly spin up the finished product of this repository by running the following code in the root directory of this repository:
4 |
5 | ```shell
6 | vagrant up
7 | ```
8 |
9 | The default username and password are both _vagrant_.
10 |
--------------------------------------------------------------------------------
/.config/taskfiles/README.md:
--------------------------------------------------------------------------------
1 | # Shared Taskfiles
2 |
3 | All of the taskfiles in this folder are kept in sync with the [Shared common file repository](https://gitlab.com/megabyte-labs/common/shared). If you need to make a change to any of the taskfiles, open the PR against the Shared common file repository. Once the PR is merged, the taskfiles will propagate down to the project-type specific common file repositories and then down to the project repositories.
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | ---
2 | blank_issues_enabled: false
3 | contact_links:
4 | - name: 💬 Slack Channel
5 | url: 'https://app.slack.com/client/T01ABCG4NK1/C01NN74H0LW/details/'
6 | about: Join our community on Slack. Get answers and share ideas with kindreds.
7 | - name: 📟 Paid Support
8 | url: https://megabyte.space/commercial-support
9 | about: For the fastest, most-thorough solutions we encourage you to consider paid support.
10 |
--------------------------------------------------------------------------------
/.config/docs/readme-cli/usage.md:
--------------------------------------------------------------------------------
1 | ## Usage
2 |
3 | All of the usage instructions can be found by running `{{ binName }} --help`. After running the command, you should be greeted with the following output:
4 |
5 | ```
6 | {{ help_menu_output }}
7 | ```
8 |
9 | ### Man Page
10 |
11 | Alternatively, if you installed the package via NPM or an installer that set up the man page (e.g. `.deb` or `.rpm`), then you can find usage instructions by running `man {{ binName }}`.
12 |
--------------------------------------------------------------------------------
/.gitlab/issue_templates/Feature.md:
--------------------------------------------------------------------------------
1 | ### Problem
2 |
3 |
4 |
5 | ### Instructions
6 |
7 |
8 |
9 | ### Further Details
10 |
11 |
12 |
13 | ### Links/References
14 |
15 |
16 |
17 | /label ~feature
18 |
--------------------------------------------------------------------------------
/.config/docs/blueprint-contributing.md:
--------------------------------------------------------------------------------
1 | {{ load:.config/docs/contributing/header.md }}
2 | {{ template:toc }}
3 | {{ load:.config/docs/contributing/code-of-conduct.md }}
4 | {{ load:.config/docs/contributing/overview.md }}
5 | {{ load:.config/docs/contributing/philosophy.md }}
6 | {{ load:.config/docs/contributing/getting-started.md }}
7 | {{ load:.config/docs/contributing/pull-requests.md }}
8 | {{ load:.config/docs/contributing/formatting.md }}
9 | {{ load:.config/docs/common/contributing/troubleshooting.md }}
10 |
--------------------------------------------------------------------------------
/.gitlab/merge_request_templates/template.md:
--------------------------------------------------------------------------------
1 | ## Issues Fixed
2 |
3 |
10 |
11 | ## Notes
12 |
13 |
--------------------------------------------------------------------------------
/.config/docs/blueprint-readme-cli.md:
--------------------------------------------------------------------------------
1 | {{ load:.config/docs/common/readme/header.md }}
2 | {{ load:.config/docs/readme-cli/subheader.md }}
3 | {{ load:.config/docs/readme-cli/quick-description.md }}
4 | {{ template:toc }}
5 | {{ load:.config/docs/readme/overview.md }}
6 | {{ load:docs/partials/features.md }}
7 | {{ load:.config/docs/readme-cli/installation.md }}
8 | {{ load:.config/docs/readme-cli/usage.md }}
9 | {{ load:.config/docs/common/readme/contribute.md }}
10 | {{ load:.config/docs/common/readme/license.md }}
11 |
--------------------------------------------------------------------------------
/.config/docs/blueprint-readme-library.md:
--------------------------------------------------------------------------------
1 | {{ load:.config/docs/common/readme/header.md }}
2 | {{ load:.config/docs/readme-library/subheader.md }}
3 | {{ load:.config/docs/readme-library/quick-description.md }}
4 | {{ template:toc }}
5 | {{ load:.config/docs/readme/overview.md }}
6 | {{ load:docs/partials/features.md }}
7 | {{ load:.config/docs/readme-library/installation.md }}
8 | {{ load:docs/partials/usage.md }}
9 | {{ load:.config/docs/common/readme/contribute.md }}
10 | {{ load:.config/docs/common/readme/license.md }}
11 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-brew.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | cask:
6 | desc: Publishes a Homebrew Cask
7 | log:
8 | error: Encountered error while publishing Homebrew Cask
9 |
10 | start: Publishing Homebrew Cask
11 | success: Published Homebrew Cask successfully
12 | formula:
13 | desc: Publishes a Homebrew Formulae
14 | log:
15 | error: Encountered error while publishing Homebrew Formulae
16 | start: Publishing Homebrew Formulae
17 | success: Published Homebrew Formulae
18 |
--------------------------------------------------------------------------------
/.config/golangci.yml:
--------------------------------------------------------------------------------
1 | ---
2 | linters:
3 | disable-all: true
4 | enable:
5 | - bodyclose
6 | - deadcode
7 | - dupl
8 | - errcheck
9 | - exhaustive
10 | - goconst
11 | - gocritic
12 | - gocyclo
13 | - gofumpt
14 | - goimports
15 | - gomnd
16 | - gosec
17 | - ineffassign
18 | - lll
19 | - noctx
20 | - prealloc
21 | - revive
22 | - staticcheck
23 | - structcheck
24 | - stylecheck
25 | - unconvert
26 | - unparam
27 | - unused
28 | - varcheck
29 | - wrapcheck
30 |
--------------------------------------------------------------------------------
/.config/docs/blueprint-readme-server.md:
--------------------------------------------------------------------------------
1 | {{ load:.config/docs/common/readme/header.md }}
2 | {{ load:.config/docs/readme/subheader.md }}
3 | {{ load:.config/docs/readme/quick-description.md }}
4 | {{ template:toc }}
5 | {{ load:.config/docs/readme/overview.md }}
6 | {{ load:.config/docs/readme/requirements.md }}
7 | {{ load:.config/docs/readme/quick-start.md }}
8 | {{ load:.config/docs/readme/creating-box.md }}
9 | {{ load:.config/docs/readme-server/updating.md }}
10 | {{ load:.config/docs/common/readme/contribute.md }}
11 | {{ load:.config/docs/common/readme/license.md }}
12 |
--------------------------------------------------------------------------------
/.config/docs/blueprint-readme-desktop.md:
--------------------------------------------------------------------------------
1 | {{ load:.config/docs/common/readme/header.md }}
2 | {{ load:.config/docs/readme/subheader.md }}
3 | {{ load:.config/docs/readme/quick-description.md }}
4 | {{ template:toc }}
5 | {{ load:.config/docs/readme/overview.md }}
6 | {{ load:.config/docs/readme/requirements.md }}
7 | {{ load:.config/docs/readme/quick-start.md }}
8 | {{ load:.config/docs/readme/creating-box.md }}
9 | {{ load:.config/docs/readme-desktop/updating.md }}
10 | {{ load:.config/docs/common/readme/contribute.md }}
11 | {{ load:.config/docs/common/readme/license.md }}
12 |
--------------------------------------------------------------------------------
/.config/taskfiles/go/Taskfile-test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | ci:
6 | deps:
7 | - :install:go:gotestsum
8 | cmds:
9 | - gotestsum --junitfile report.xml --format testname
10 |
11 | convey:
12 | deps:
13 | - :install:go:goconvey
14 | desc: Run tests through the browser with GoConvey
15 | summary: |
16 | # Open Go Testing Web UI
17 |
18 | [GoConvey](http://goconvey.co/) allows you to write tests in your IDE
19 | and get live updates in a browser window while writing the tests.
20 | cmds:
21 | - goconvey
22 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-qubes.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | dom0:
6 | summary: |
7 | # Tasks to Run to Setup dom0
8 |
9 | 1. https://www.qubes-os.org/news/2021/11/12/new-qubes-application-menu/
10 | cmds:
11 | - sudo qubes-dom0-update --enablerepo=qubes-dom0-unstable qubes-desktop-linux-menu
12 | - qubes-app-menu &
13 | - qvm-create --class StandaloneVM --label blue --property virt_mode=hvm
14 | - qvm-create --class StandaloneVM --label --property virt_mode=hvm
15 |
--------------------------------------------------------------------------------
/.config/docs/common/readme/header.md:
--------------------------------------------------------------------------------
1 |
8 |
9 |
{{ docs.header_title_pre }}{{ title }}{{ docs.header_title_post }}
10 |
{{ docs.header_description_post }}
11 |
12 |
--------------------------------------------------------------------------------
/.config/taskfiles/cloud/Taskfile-heroku.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | sync:ssh-keys:
6 | deps:
7 | - :install:software:heroku
8 | cmds:
9 | - .config/log info 'Clearing Heroku SSH keys'
10 | - heroku keys:clear
11 | - .config/log start 'Syncing SSH keys with Heroku'
12 | - |
13 | for KEY in `ls $HOME/.ssh/*.pub`; do
14 | heroku keys:add "$KEY"
15 | done
16 | - .config/log success 'Finished syncing SSH keys with Heroku'
17 | preconditions:
18 | - sh: '[ -n "$HEROKU_API_KEY" ]'
19 | msg: The HEROKU_API_KEY must be set to a personal access token.
20 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-ios.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | beta:
6 | desc: Publishes iOS app to Firebase beta channel
7 | log:
8 | error: Encountered error while publishing iOS app to the Firebase beta channel
9 |
10 | start: Publishing iOS app to the Firebase beta channel
11 | success: Successfully published iOS app to the Firebase beta channel
12 | release:
13 | desc: Publishes iOS app to iTunes
14 | log:
15 | error: Encountered error while publishing iOS app to iTunes
16 | start: Publishing iOS app to iTunes
17 | success: Successfully published iOS app to iTunes
18 |
--------------------------------------------------------------------------------
/scripts/install-chocolatey.custom.ps1:
--------------------------------------------------------------------------------
1 | #iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
2 | (new-object net.webclient).DownloadFile('https://chocolatey.org/install.ps1', 'C:\Windows\Temp\install-choco.ps1')
3 |
4 | $env:chocolateyUseWindowsCompression = 'false'
5 | for($try = 0; $try -lt 5; $try++)
6 | {
7 | & C:/Windows/Temp/install-choco.ps1
8 | if ($?) { exit 0 }
9 | if (Test-Path C:\ProgramData\chocolatey) { exit 0 }
10 | Write-Host "Failed to install chocolatey (Try #${try})"
11 | Start-Sleep 2
12 | }
13 | Write-Error "Chocolatey failed to install, please re-build your machine again"
14 | exit 2
15 |
--------------------------------------------------------------------------------
/.gitlab/issue_templates/Defect.md:
--------------------------------------------------------------------------------
1 | ### Defect Summary
2 |
3 |
4 |
5 | ### Steps to Reproduce
6 |
7 |
8 |
9 | ### What is the current behavior?
10 |
11 |
12 |
13 | ### What is the expected (correct) behavior?
14 |
15 |
16 |
17 | ### Relevant Logs/Screenshots
18 |
19 |
21 |
22 | ### Possible Fixes
23 |
24 |
25 |
26 | /label ~defect
27 |
--------------------------------------------------------------------------------
/.config/docs/contributing/philosophy.md:
--------------------------------------------------------------------------------
1 | ## Philosophy
2 |
3 | We create these Packer images because the desktop versions of operating systems on VagrantUp are sparse. During development it is useful to be able to navigate through an operating system using a GUI. Also, if you want to test some of your software on various operating systems then you should use what your end-user is using. Sometimes that means using a desktop.
4 |
5 | There are a few core principles that we stick to when designing these Packer projects. All of our desktop VM images should be:
6 |
7 | - **Minimal** and include no bloatware
8 | - **Compact** in size so people can download/provision their VM quicker
9 | - **Pretty** (e.g. the Plymouth loader should be installed so that the boot screen looks good)
10 | - **Performant**
11 |
--------------------------------------------------------------------------------
/.config/docs/readme-server/updating.md:
--------------------------------------------------------------------------------
1 | ## Updating Your Box
2 |
3 | If a new release of the {{ template_json.variables.description }} system is available, you can update your VagrantUp box. You can do this by changing the `"iso_checksum_url"`, `"iso_url"`, and `"iso_version"` variables in the `template.json` file. After that, run `packer build -only=virtualbox-iso template.json` to build the image again.
4 |
5 | You can also automate the process of retrieving the latest ISO and checksum URL by leveraging our [LatestOS](https://github.com/megabyte-labs/latestos/) Python package. This can be accomplished by running the following code with Python and pip already installed:
6 |
7 | ```shell
8 | pip3 install latestos
9 | latestos {{ template_json.variables.latestos_tag }} # Options include arch, centos, debian, fedora, and ubuntu
10 | packer build -only=virtualbox-iso template.json
11 | ```
12 |
--------------------------------------------------------------------------------
/.config/taskfiles/common/Taskfile-code.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | count:
6 | deps:
7 | - :install:software:tokei
8 | desc: Display a chart detailing the lines of code for each language used
9 | log:
10 | error: Encountered error while running `tokei . --exclude .common .modules`
11 | start: Analyzing project for code-language statistics
12 | cmds:
13 | - tokei . --exclude .common .modules
14 |
15 | find:todo:
16 | deps:
17 | - :install:npm:leasot
18 | desc: Scan code base for TODOs and FIXMEs
19 | vars:
20 | LEASOT_IGNORE: .common .modules .venv node_modules venv
21 | log:
22 | error: Encountered error while running `leasot --ignore {{.LEASOT_IGNORE}} {{.CLI_ARGS}}`
23 | start: Scanning project for TODOs and FIXMEs
24 | cmds:
25 | - leasot --ignore {{.LEASOT_IGNORE}} {{.CLI_ARGS}}
26 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-android.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | beta:
6 | desc: Publishes Android app to Firebase beta channel
7 | log:
8 | error: Encountered error while publishing Android app to Firebase beta channel
9 | start: Publishing Android app to Firebase beta channel
10 | success: Published Android app to Firebase beta channel
11 | cmds:
12 | - fastlane add_plugin firebase_app_distribution
13 | - fastlane run firebase_app_distribution_login
14 | - fastlane beta
15 |
16 | release:
17 | desc: Publishes Android app to Google Play
18 | log:
19 | error: Encountered error while publishing Android app to Google Play
20 | start: Publishing Android app to Google Play
21 | success: Successfully published Android app to Google Play
22 | cmds:
23 | - fastlane add_plugin ionic
24 | - fastlane deploy
25 |
--------------------------------------------------------------------------------
/.config/taskfiles/web/Taskfile-profile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | detect-memory-leaks:
6 | deps:
7 | - :install:npm:fuite
8 | summary: |
9 | # Detect memory leaks
10 |
11 | Detect memory leaks in web applications with [fuite](https://github.com/nolanlawson/fuite).
12 | By default, fuite will assume that the site is a client-rendered web application, and it will
13 | search for internal links on the given page. Then for each link, it will:
14 |
15 | 1. Click the link
16 | 2. Press the browser back button
17 | 3. Repeat to see if the scenario is leaking
18 |
19 | **Example usage:**
20 | `task web:profile:detect-memory-leaks -- https://example.com`
21 | log:
22 | error: Failed to run `fuite {{.CLI_ARGS}}`
23 | start: Running `fuite {{.CLI_ARGS}}`
24 | success: Successfully ran `fuite {{.CLI_ARGS}}`
25 | cmds:
26 | - |
27 | fuite {{.CLI_ARGS}}
28 |
--------------------------------------------------------------------------------
/docs/ECOSYSTEM.md:
--------------------------------------------------------------------------------
1 | # Megabyte Labs Ecosystem
2 |
3 | This project incorporates design patterns from the [Megabyte Labs](https://megabyte.space) ecosystem. The ecosystem is a set of repositories that integrate with one another through CI/CD. The repositories share configurations, common documentation partials, and developer tools. The ecosystem's main goals are to:
4 |
5 | 1. Keep projects up-to-date
6 | 2. Make the management of large amounts of repositories easy
7 | 3. Be prepared by implementing development features before they are necessary (within reason)
8 | 4. Maximize developer efficiency
9 | 5. Improve developer onboarding by providing the tools necessary to adhere to the design patterns of the ecosystem with minimal oversight
10 | 6. Serve and provide an example of a bleeding-edge, production-ready full-stack development platform
11 |
12 | ## Language Support
13 |
14 | There are currently boilerplates and templates written in the following languages:
15 |
16 | * TypeScript (primary language)
17 | * Python
18 | * Go
19 |
--------------------------------------------------------------------------------
/.config/taskfiles/app/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | ROWY_HOMEPAGE: https://megabyte.space/tables
6 | ROWY_PATH: ./rowy
7 | ROWY_SLUG: tables
8 |
9 | tasks:
10 | rowy:build:
11 | deps:
12 | - :install:npm:browserslist
13 | - :install:software:yarn
14 | env:
15 | REACT_APP_FIREBASE_PROJECT_ID:
16 | sh: jq -r '.blueprint.firebase.projectId' package.json
17 | REACT_APP_FIREBASE_PROJECT_WEB_API_KEY:
18 | sh: jq -r '.blueprint.firebase.webApiKey' package.json
19 | cmds:
20 | - mkdir -p "$(dirname '{{.ROWY_PATH}}')"
21 | - git clone https://github.com/rowyio/rowy.git {{.ROWY_PATH}}
22 | - cd {{.ROWY_PATH}} && yarn
23 | - browserslist --update-db
24 | - |
25 | TMP="$(mktemp)"
26 | jq --arg rowy '{{.ROWY_HOMEPAGE}}' '.homepage = $rowy' {{.ROWY_PATH}}/package.json > "$TMP"
27 | mv "$TMP" {{.ROWY_PATH}}/package.json
28 | - cd {{.ROWY_PATH}} && yarn build
29 | - mv {{.ROWY_PATH}}/build dist/{{.ROWY_SLUG}}
30 |
--------------------------------------------------------------------------------
/.config/yamllint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | ignore: |
3 | .autodoc/
4 | .cache/
5 | .common/
6 | .config/
7 | .git/
8 | .husky/
9 | .modules/
10 | .npm/
11 | .pnpm-store/
12 | .shared/
13 | .task/
14 | .venv/
15 | .vscode/
16 | .tox
17 | .travis.yml
18 | *.hbs.yml
19 | build/
20 | dist/
21 | node_modules/
22 | pnpm-lock.yaml
23 | roles/
24 | testdata/
25 | test/output-example/
26 | venv/
27 |
28 | extends: default
29 |
30 | rules:
31 | braces:
32 | level: error
33 | max-spaces-inside: 1
34 | brackets:
35 | level: error
36 | max-spaces-inside: 1
37 | comments:
38 | min-spaces-from-content: 1
39 | document-start:
40 | ignore: |
41 | environments/prod/
42 | indentation:
43 | indent-sequences: consistent
44 | level: error
45 | line-length:
46 | level: error
47 | max: 160
48 | ignore: |
49 | .config/taskfiles/
50 | common/.config/taskfiles/
51 | truthy:
52 | # eslint-disable-next-line yml/plain-scalar
53 | allowed-values: ['false', 'on', 'true']
54 |
--------------------------------------------------------------------------------
/.config/codeclimate.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '2'
3 |
4 | plugins:
5 | editorconfig:
6 | enabled: true
7 | eslint:
8 | enabled: true
9 | jscpd:
10 | enabled: true
11 | exclude_patterns:
12 | - common/.config/taskfiles/
13 | proselint:
14 | enabled: true
15 | shellcheck:
16 | enabled: true
17 | semgrep:
18 | enabled: true
19 | yamllint:
20 | enabled: true
21 |
22 | exclude_patterns:
23 | - _generated_/
24 | - .common/
25 | - .config/
26 | - .git/
27 | - .go/
28 | - .modules/
29 | - .npm/
30 | - .pnpm-store/
31 | - .task/
32 | - .travis.yml
33 | - .venv/
34 | - .vscode/
35 | - '*.hbs.yml'
36 | - '**/*_test.go'
37 | - '**/*.d.ts'
38 | - '**/node_modules/'
39 | - '**/spec/'
40 | - '**/test/'
41 | - '**/tests/'
42 | - '**/vendor/'
43 | - build/
44 | - config/
45 | - db/
46 | - deprecated/
47 | - dist/
48 | - features/
49 | - gl-code-quality-report.json
50 | - pnpm-lock.yaml
51 | - roles/
52 | - script/
53 | - test-output/
54 | - testdata/
55 | - tests/
56 |
--------------------------------------------------------------------------------
/.config/taskfiles/cloud/Taskfile-cloudflare.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | cloudflare:dns:
6 | summary: |
7 | This task sets up CNAME Record pointing to the given Value, in Cloudflare DNS. This is primarily used in
8 | conjunciton with Heroku tasks to setup custom domains. These variables are needed:
9 | CONFIGURE_CLOUDFLARE_DNS: Set to `true` to configure Cloudflare DNS
10 | CLOUDFLARE_DNS_ZONE: Name of the DNS Zone where the record should be added to
11 | CLOUDFLARE_API_TOKEN: API Token to authenticate to Cloudflare
12 | CLOUDFLARE_RECORD_NAME: The name of the record
13 | CLOUDFLARE_RECORD_VALUE: Target for the CNAME record
14 | cmds:
15 | - |
16 | {{if eq .CONFIGURE_CLOUDFLARE_DNS "true")}}curl -X POST "https://api.cloudflare.com/client/v4/zones/{{.CLOUDFLARE_DNS_ZONE}}/dns_records/" \
17 | -H "Authorization: Bearer {{.CLOUDFLARE_API_TOKEN}}" \
18 | -H "Content-Type: application/json" \
19 | --data '{"type":"CNAME","name":"{{.CLOUDFLARE_RECORD_NAME}}","content":"{{.CLOUDFLARE_RECORD_VALUE}}","proxied":true,"ttl":3600}'{{end}}
20 |
--------------------------------------------------------------------------------
/.config/taskfiles/vagrant/Taskfile-qubes.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | convert:hvm:
6 | summary: |
7 | # Converts VirtualBox Image to Qubes HVM
8 |
9 | Qubes documentation details the process of converting a VirtualBox image
10 | to an HVM in [this link](https://www.qubes-os.org/doc/standalones-and-hvms/#converting-virtualbox-vms-to-qubes-hvms).
11 |
12 | This task assumes that the VirtualBox image is already built and hosted on
13 | VagrantUp or a similar registry. It downloads the `.box` file, extracts the required disk
14 | image, and then converts it to an HVM to integrate it with QubesOS.
15 |
16 | A sample `.box` file can be found [here](https://app.vagrantup.com/Megabyte/boxes/Ubuntu-Desktop/versions/21.10/providers/virtualbox.box).
17 |
18 | Note: It is also possible to extract the VirtualBox files that QubesOS needs during build time with Packer (the .ova file). However,
19 | it would better to use the `.box` file available on VagrantUp, if possible.
20 | [This guide](https://gist.github.com/aondio/66a79be10982f051116bc18f1a5d07dc) shows how to convert a `.ova` into `.box`. This
21 | script essentially needs to do the opposite.
22 |
--------------------------------------------------------------------------------
/.config/taskfiles/nest/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | benchmark:
6 | deps:
7 | - :install:npm:autocannon
8 | - :install:npm:clinic
9 | desc: Initiate a web server benchmarking session (with `clinic`)
10 | hide: '{{ne (print .REPOSITORY_TYPE "-" .REPOSITORY_SUBTYPE) "npm-app"}}'
11 | summary: |
12 | # Initiate a web server benchmarking session with `clinic`
13 |
14 | This task runs a basic stress test on an endpoint that is `/` by default.
15 | See the examples below for stress testing an endpoint other than the default.
16 | For more information, see the [`clinic` GitHub page](https://github.com/clinicjs/node-clinic).
17 |
18 | **Example usage:**
19 | `task npm:benchmark`
20 |
21 | **Example with custom endpoint:**
22 | `task npm:benchmark -- /custom/endpoint`
23 | log:
24 | error: Error encountered while running clinic with autocannon on `dist/main.js`
25 | start: Running clinic with autocannon on `dist/main.js`
26 | success: Finished running clinic with autocannon on `dist/main.js`
27 | cmds:
28 | - clinic doctor --autocannon [ {{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}/{{end}} --method POST ] -- node ./dist/main.js
29 |
--------------------------------------------------------------------------------
/.config/docs/contributing/pull-requests.md:
--------------------------------------------------------------------------------
1 | ## Pull Requests
2 |
3 | All pull requests should be associated with issues. You can find the [issues board on GitLab]({{ repository.group.packer }}/{{ variables.box_basename }}/-/issues). The pull requests should be made to [the GitLab repository]({{ repository.group.packer }}/{{ variables.box_basename }}) instead of the [GitHub repository]({{ profile.github }}/packer-{{ variables.box_basename }}). This is because we use GitLab as our primary repository and mirror the changes to GitHub for the community.
4 |
5 | ### How to Commit Code
6 |
7 | Instead of using `git commit`, we prefer that you use `npm run commit`. You will understand why when you try it but basically it streamlines the commit process and helps us generate better CHANGELOG.md files.
8 |
9 | ### Pre-Commit Hook
10 |
11 | Even if you decide not to use `npm run commit`, you will see that `git commit` behaves differently because there is a pre-commit hook that installs automatically after you run `npm i`. This pre-commit hook is there to test your code before committing and help you become a better coder. If you need to bypass the pre-commit hook, then you may add the `--no-verify` tag at the end of your `git commit` command (e.g. `git commit -m "Commit" --no-verify`).
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020-2021 Brian Zalewski, Megabyte LLC (https://megabyte.space)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 | GitHub: https://github.com/megabyte-labs/packer-windows-desktop
24 | GitLab: https://gitlab.com/megabyte-labs/packer/windows-desktop
25 |
--------------------------------------------------------------------------------
/.config/taskfiles/app/Taskfile-virtualbox.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | clear:
6 | deps:
7 | - :install:software:virtualbox
8 | summary: |
9 | # Remove All VMs / Reset
10 |
11 | This task will remove all the VirtualBox VMs. It is useful in scenarios
12 | where VirtualBox is being called through automation and things can
13 | potentially break. When they break, they need a reset.
14 |
15 | **Example resetting all VMs:**
16 | `task app:virtualbox:clear`
17 |
18 | There is the capability of only resetting VMs that match a certain pattern.
19 |
20 | **Example resetting all VMs matching a pattern:**
21 | `task app:virtualbox:clear -- 'macOS'`
22 | vars:
23 | DEFAULT_PATTERN: default_
24 | cmds:
25 | - cmd: killall -9 VBoxHeadless
26 | ignore_error: true
27 | - |
28 | while read VM; do
29 | VM_NAME="$(echo $VM | sed 's/^"\(.*\)" {.*}/\1/')"
30 | VM_UUID="$(echo $VM | sed 's/^".*".{\(.*\)}/\1/')"
31 | vboxmanage startvm "$VM_UUID" --type emergencystop || true
32 | vboxmanage unregistervm "$VM_UUID" || true
33 | rm -rf "$HOME/VirtualBox VMs/$VM_NAME" || true
34 | done < <(vboxmanage list vms | grep '{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.DEFAULT_PATTERN}}{{end}}')
35 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "chrmarti.regex",
4 | "DavidAnson.vscode-markdownlint",
5 | "dbaeumer.vscode-eslint",
6 | "eamodio.gitlens",
7 | "EditorConfig.EditorConfig",
8 | "esbenp.prettier-vscode",
9 | "ericadamski.carbon-now-sh",
10 | "formulahendry.code-runner",
11 | "GitHub.vscode-pull-request-github",
12 | "GitLab.gitlab-workflow",
13 | "GoogleCloudTools.cloudcode",
14 | "hediet.vscode-drawio",
15 | "IBM.output-colorizer",
16 | "Kelvin.vscode-sshfs",
17 | "mads-hartmann.bash-ide-vscode",
18 | "ms-azuretools.vscode-docker",
19 | "ms-vscode-remote.remote-containers",
20 | "ms-vscode-remote.remote-ssh",
21 | "ms-vscode-remote.remote-wsl",
22 | "ms-vscode.PowerShell",
23 | "MS-vsliveshare.vsliveshare",
24 | "MS-vsliveshare.vsliveshare-audio",
25 | "philnash.ngrok-for-vscode",
26 | "PKief.material-icon-theme",
27 | "redhat.vscode-yaml",
28 | "richie5um2.vscode-sort-json",
29 | "Rubymaniac.vscode-paste-and-indent",
30 | "shd101wyy.markdown-preview-enhanced",
31 | "softwaredotcom.swdc-vscode",
32 | "timonwong.shellcheck",
33 | "tyriar.sort-lines",
34 | "usernamehw.errorlens",
35 | "valentjn.vscode-ltex",
36 | "vsls-contrib.codetour",
37 | "vsls-contrib.gistfs",
38 | "wayou.vscode-todo-highlight"
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/.config/taskfiles/git/Taskfile-bug.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | bridge:
6 | deps:
7 | - bridge:github
8 | - bridge:gitlab
9 |
10 | run: once
11 | bridge:github:
12 | deps:
13 | - :install:software:git-bug
14 | run: once
15 | cmds:
16 | - git bug bridge configure --name="$(jq -r '.name' package.json)" --target=github
17 | --url="$(jq -r '.blueprint.repository.github' package.json)" --token="$GITHUB_TOKEN"
18 | status:
19 | - '[ -z "$GITHUB_TOKEN" ]'
20 |
21 | bridge:gitlab:
22 | deps:
23 | - :install:software:git-bug
24 | run: once
25 | cmds:
26 | - git bug bridge configure --name="$(jq -r '.name' package.json)" --target=gitlab
27 | --url="$(jq -r '.blueprint.repository.gitlab' package.json)" --token="$GITLAB_TOKEN" --base-url=https://gitlab.com/
28 | status:
29 | - '[ -z "$GITLAB_TOKEN" ]'
30 |
31 | pull:
32 | deps:
33 | - bridge
34 | - :git:remotes
35 | - :install:software:git-bug
36 | cmds:
37 | - git bug pull all
38 |
39 | push:
40 | deps:
41 | - bridge
42 | - :git:remotes
43 | - :install:software:git-bug
44 | cmds:
45 | - git bug push all
46 |
47 | webui:
48 | deps:
49 | - bridge
50 | - pull
51 | - :install:software:git-bug
52 | cmds:
53 | - git bug webui
54 |
--------------------------------------------------------------------------------
/.config/taskfiles/upstream/Taskfile-shared.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | SHARED_COMMON_FOLDER: common
6 | VARIABLES_URL: https://gitlab.com/megabyte-labs/documentation/shared/-/raw/master/common.json
7 |
8 | tasks:
9 | copy:
10 | log:
11 | error: Finished copying common files
12 | start: Copying common files
13 | success: Copied common files
14 | cmds:
15 | - mv .gitlab-ci.yml .gitlab-ci.yml.bak
16 | - cd ./{{.SHARED_COMMON_FOLDER}} && cp -rf . .. && cd ..
17 | - mv .gitlab-ci.yml.bak .gitlab-ci.yml
18 | - task: :common:husky:permissions
19 |
20 | template:
21 | cmds:
22 | - task: template:files
23 |
24 | template:files:
25 | deps:
26 | - template:files:liquidjs
27 |
28 | template:files:liquidjs:
29 | cmds:
30 | - task: :upstream:template:liquidjs
31 | vars:
32 | ADDITIONAL_IGNORE_FOLDERS: -path './{{.SHARED_COMMON_FOLDER}}*' -o -path './deprecated*' -o
33 |
34 | variables:
35 | log:
36 | error: Encountered error in `.variables.json` generation sequence
37 | start: Beginning `.variables.json` generation sequence
38 | success: Completed `.variables.json` generation sequence
39 | cmds:
40 | - curl -s {{.VARIABLES_URL}} > .variables.json
41 | - task: :upstream:variables
42 | vars:
43 | INPUT_FILE: .variables.json
44 | OUTPUT_FILE: .variables.json
45 |
--------------------------------------------------------------------------------
/.config/docs/readme/overview.md:
--------------------------------------------------------------------------------
1 | ## Overview
2 |
3 | {{overview}}
4 |
5 | This project:
6 |
7 | * Currently builds a minimal {{ template_json.variables.description }} VM image by default
8 | * May contain multiple templates which will all end in `template.json` and be present in the root of the project
9 | * Automates the process of keeping our [{{ template_json.variables.description }} VM images](https://app.vagrantup.com/{{ template_json.variables.vagrantup_user }}/boxes/{{ template_json.variables.box_basename }}) up-to-date with the latest upstream source by (1) using the `vagrant-cloud` post-processor to automatically upload the box after it is built and (2) running the build with a cronjob
10 | * In some cases, [LatestOS](https://pypi.org/project/latestos/) is used to automatically update the link to the base image / checksums to the latest release
11 |
12 | ### Supported Virtualization Platforms
13 |
14 | This project supports creating boxes for the following virtualization platforms:
15 |
16 | - [Hyper-V]({{ repository.group.ansible_roles }}/hyperv)
17 | - [KVM]({{ repository.group.ansible_roles }}/kvm)
18 | - [Parallels]({{ repository.group.ansible_roles }}/parallels)
19 | - [VirtualBox]({{ repository.group.ansible_roles }}/virtualbox)
20 | - [VMWare]({{ repository.group.ansible_roles }}/vmware)
21 |
--------------------------------------------------------------------------------
/.config/husky/prepare-commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1091,SC2016
3 |
4 | # @file .config/husky/prepare-commit-msg
5 | # @brief A git hook script for the `prepare-commit-msg` hook. Add the `-n` flag to bypass.
6 | # @arg $1 string The full path to the MERGE_MSG
7 | # @arg $2 string The type of the `prepare-commit-msg` event. For a `git pull origin master`
8 | # command, the event type is 'merge'.
9 |
10 | # @description Register appropriate logging utility
11 | if [ -f "$(dirname "$0")/../.config/log" ]; then
12 | alias logger="$(dirname "$0")/../.config/log"
13 | chmod +x "$(dirname "$0")/../.config/log"
14 | elif command -v logg > /dev/null; then
15 | alias logger='logg'
16 | fi
17 |
18 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
19 | . "$(dirname "$0")/_/husky.sh"
20 | if [ "$2" != 'merge' ]; then
21 | logger info 'This git hook is configured to run even when --no-verify is used. In order to bypass this prompt, use the -n flag instead.'
22 | logger info 'Opening a `git commit` dialog'
23 | if ! type pnpx > /dev/null && type npm > /dev/null; then
24 | npm install -g pnpm
25 | elif ! type pnpx > /dev/null; then
26 | logger error '`pnpm` or `npm` must be installed'
27 | fi
28 | if ! type git-cz &> /dev/null; then
29 | pnpm install -g commitizen
30 | fi
31 | exec < /dev/tty && (git-cz --hook || true)
32 | fi
33 | else
34 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
35 | fi
36 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-rust.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | bundle:
6 | deps:
7 | - grex
8 | - htmlq
9 | - hyperfine
10 |
11 | catfs:
12 | run: once
13 | cmds:
14 | - task: install:rust
15 | vars:
16 | BIN_NAME: catfs
17 | PACKAGE: catfs
18 |
19 | clean:
20 | cmds:
21 | - rm -rf "$HOME/.cargo/registry"
22 |
23 | grex:
24 | run: once
25 | cmds:
26 | - task: install:rust
27 | vars:
28 | BIN_NAME: grex
29 | PACKAGE: grex
30 |
31 | htmlq:
32 | run: once
33 | cmds:
34 | - task: install:rust
35 | vars:
36 | BIN_NAME: htmlq
37 | PACKAGE: htmlq
38 |
39 | hyperfine:
40 | run: once
41 | cmds:
42 | - task: install:rust
43 | vars:
44 | BIN_NAME: hyperfine
45 | PACKAGE: hyperfine
46 |
47 | install:rust:
48 | vars:
49 | BIN: '{{if .BIN_NAME}}{{.BIN_NAME}}{{else}}{{.PACKAGE}}{{end}}'
50 | run: when_changed
51 | log:
52 | error: Failed to install Cargo crate `{{.PACKAGE}}`
53 | start: Installing Cargo crate `{{.PACKAGE}}`
54 | success: Installed Cargo crate `{{.PACKAGE}}`
55 | cmds:
56 | - task: :install:software:rust
57 | - |
58 | if [ -n "$CI" ]; then echo "*************** cargo --> {{.PACKAGE}}"; fi
59 | - cargo install {{.PACKAGE}}
60 | status:
61 | - type {{.BIN}} > /dev/null || [ -n "$NO_INSTALL_RUST" ]
62 |
--------------------------------------------------------------------------------
/.config/taskfiles/web/Taskfile-ionic.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | build:
6 | deps:
7 | - :install:npm:ionic
8 | log:
9 | error: Error building Ionic project
10 | start: Building Ionic project
11 | success: Successfully built Ionic project
12 | cmds:
13 | - ionic build
14 |
15 | build:prod:
16 | deps:
17 | - :install:npm:ionic
18 | log:
19 | error: Error building Ionic production build
20 | start: Building Ionic project in production mode
21 | success: Successfully built Ionic project in production mode
22 | cmds:
23 | - ionic build --prod
24 |
25 | config:
26 | deps:
27 | - :install:npm:ionic
28 | log:
29 | error: Failed to configure Ionic
30 | start: Configuring Ionic
31 | success: Configured Ionic
32 | cmds:
33 | - ionic config set -g npmClient {{.NPM_PROGRAM}}
34 |
35 | prepare:
36 | deps:
37 | - :install:npm:ionic
38 | log:
39 | error: Failed to prepare with Cordova via Ionic
40 | start: Preparing Cordova targets via Ionic
41 | success: Successfully prepared Ionic Cordova targets
42 | cmds:
43 | - ionic cordova prepare android
44 | - ionic cordova prepare ios
45 |
46 | serve:
47 | deps:
48 | - :install:npm:ionic
49 | log:
50 | error: Failed to run `ionic serve`
51 | start: Running `ionic serve`
52 | success: Successfully finished running `ionic serve`
53 | cmds:
54 | - ionic serve
55 |
--------------------------------------------------------------------------------
/.config/taskfiles/lint/Taskfile-codeclimate.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | load:custom-engines:
6 | deps:
7 | - :install:software:docker
8 | - :install:software:jq
9 | - :install:software:yq
10 | env:
11 | CUSTOM_ENGINES:
12 | sh: yq e -o=j '.' .codeclimate.yml | jq -r '.plugins | keys[]'
13 | cmds:
14 | - |
15 | function dockerGet() {
16 | if ! docker images {{.DOCKERHUB_PROFILE}}/$1 | grep ' slim-codeclimate ' > /dev/null; then
17 | docker pull "{{.DOCKERHUB_PROFILE}}/$1:slim-codeclimate"
18 | fi
19 | docker tag "{{.DOCKERHUB_PROFILE}}/$1:slim-codeclimate" "codeclimate/codeclimate-$1:latest"
20 | }
21 | for ENGINE in $CUSTOM_ENGINES; do
22 | if [ "$(yq e -o=j '.' .codeclimate.yml | jq --arg engine $ENGINE -r '.plugins[$engine].enabled')" == 'true' ]; then
23 | .config/log info "Loading custom CodeClimate engine ($ENGINE)"
24 | dockerGet "$ENGINE"
25 | fi
26 | done
27 |
28 | taskfiles:add:
29 | cmds:
30 | - rm -rf .config
31 | - cp -rf ../../.config .config
32 | - cp ../../start.sh start.sh
33 | - cp ../../Taskfile.yml Taskfile.yml
34 | - cp ../../package.json package.json
35 | status:
36 | - '[ -z "$CODECLIMATE_INTEGRATION_TEST" ]'
37 |
38 | taskfiles:remove:
39 | cmds:
40 | - rm -rf .config start.sh Taskfile.yml package.json
41 | status:
42 | - '[ -z "$CODECLIMATE_INTEGRATION_TEST" ]'
43 |
--------------------------------------------------------------------------------
/.config/husky/post-merge:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/post-merge
5 | # @brief A git hook script for the `post-merge` hook
6 | # @arg $1 A status flag specifying whether or not the merge being done was a squash merge
7 |
8 | # @description Register appropriate logging utility
9 | if [ -f "$(dirname "$0")/../.config/log" ]; then
10 | alias logger="$(dirname "$0")/../.config/log"
11 | chmod +x "$(dirname "$0")/../.config/log"
12 | elif command -v logg > /dev/null; then
13 | alias logger='logg'
14 | fi
15 |
16 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
17 | . "$(dirname "$0")/_/husky.sh"
18 |
19 | # Attempt to register Task from common places if it is not in PATH
20 | if ! type task > /dev/null; then
21 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
22 | if ! type task > /dev/null; then
23 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
24 | . "$HOME/$DOTFILE"
25 | if type task > /dev/null; then
26 | break
27 | fi
28 | done
29 | fi
30 | fi
31 |
32 | # Show warning if Task is still not registered/installed, else proceed with hook
33 | if ! type task > /dev/null; then
34 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
35 | logger info 'Get `task` here -> https://taskfile.dev'
36 | else
37 | task git:hook:post-merge
38 | fi
39 | else
40 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
41 | fi
42 |
--------------------------------------------------------------------------------
/.config/taskfiles/python/Taskfile-test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | ci:
6 | deps:
7 | - :install:python:pytest
8 | - :install:python:pytest-cov
9 | - :install:software:poetry
10 | log:
11 | error: Error encountered while running `pytest` and generating reports
12 | start: Running `pytest` and generating reports
13 | success: Finished running `pytest` and generating reports
14 | cmds:
15 | - poetry config virtualenvs.create false
16 | - |
17 | export "CFLAGS=-I/usr/local/include -L/usr/local/lib"
18 | poetry install --no-dev
19 | - |
20 | {{.PYTHON_HANDLE}}pytest --junitxml=report.xml --cov=src/
21 | - |
22 | {{.PYTHON_HANDLE}}coverage report
23 | - |
24 | {{.PYTHON_HANDLE}}coverage xml
25 |
26 | mypy:
27 | deps:
28 | - :install:pipx:mypy
29 | log:
30 | error: Encountered error while static type checking with `mypy`
31 | start: Running `mypy` for static type checking
32 | success: Successfully passed type checking with `mypy`
33 | cmds:
34 | - |
35 | PATH="$PATH:$HOME/.local/bin"
36 | {{.PYTHON_HANDLE}}mypy
37 |
38 | pytest:
39 | deps:
40 | - :install:pipx:pytest
41 | - :install:python:requirements
42 | log:
43 | error: '`pytest` encountered errors while running tests'
44 | start: Running `pytest`
45 | success: '`pytest` finished running without any errors to report'
46 | cmds:
47 | - |
48 | PATH="$PATH:$HOME/.local/bin"
49 | {{.PYTHON_HANDLE}}pytest
50 |
--------------------------------------------------------------------------------
/.config/husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/commit-msg
5 | # @brief A git hook script for the `commit-msg` hook
6 | # @arg $1 Path to a temporary file that contains the commit message written by the developer (e.g. .git/COMMIT_EDITMSG)
7 |
8 | # @description Register appropriate logging utility
9 | if [ -f "$(dirname "$0")/../.config/log" ]; then
10 | alias logger="$(dirname "$0")/../.config/log"
11 | chmod +x "$(dirname "$0")/../.config/log"
12 | elif command -v logg > /dev/null; then
13 | alias logger='logg'
14 | fi
15 |
16 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
17 | . "$(dirname "$0")/_/husky.sh"
18 |
19 | # Attempt to register Task from common places if it is not in PATH
20 | if ! type task > /dev/null; then
21 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
22 | if ! type task > /dev/null; then
23 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
24 | . "$HOME/$DOTFILE"
25 | if type task > /dev/null; then
26 | break
27 | fi
28 | done
29 | fi
30 | fi
31 |
32 | # Show warning if Task is still not registered/installed, else proceed with hook
33 | if ! type task > /dev/null; then
34 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
35 | logger info 'More on Task here -> `https://taskfile.dev`'
36 | else
37 | task git:hook:commit-msg -- "$1"
38 | fi
39 | else
40 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
41 | fi
42 |
--------------------------------------------------------------------------------
/.config/husky/pre-push:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/pre-push
5 | # @brief A git hook script for the `pre-push` hook
6 | # @arg $1 The name of the remote (e.g. origin)
7 | # @arg $2 The location of the remote (e.g. git@gitlab.com:megabyte-labs/common/angular.git)
8 |
9 | # @description Register appropriate logging utility
10 | if [ -f "$(dirname "$0")/../.config/log" ]; then
11 | alias logger="$(dirname "$0")/../.config/log"
12 | chmod +x "$(dirname "$0")/../.config/log"
13 | elif command -v logg > /dev/null; then
14 | alias logger='logg'
15 | fi
16 |
17 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
18 | . "$(dirname "$0")/_/husky.sh"
19 |
20 | # Attempt to register Task from common places if it is not in PATH
21 | if ! type task > /dev/null; then
22 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
23 | if ! type task > /dev/null; then
24 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
25 | . "$HOME/$DOTFILE"
26 | if type task > /dev/null; then
27 | break
28 | fi
29 | done
30 | fi
31 | fi
32 |
33 | # Show warning if Task is still not registered/installed, else proceed with hook
34 | if ! type task > /dev/null; then
35 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
36 | logger info 'Get `task` here -> https://taskfile.dev'
37 | else
38 | task git:hook:pre-push -- "$1 $2"
39 | fi
40 | else
41 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
42 | fi
43 |
--------------------------------------------------------------------------------
/.config/husky/post-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/post-commit
5 | # @brief A git hook script for the `post-commit` hook. There are no parameters but you can easily get the
6 | # last commit by running `git log -1 HEAD`. Generally, this script is used for notifications or something similar.
7 |
8 | # @description Register appropriate logging utility
9 | if [ -f "$(dirname "$0")/../.config/log" ]; then
10 | alias logger="$(dirname "$0")/../.config/log"
11 | chmod +x "$(dirname "$0")/../.config/log"
12 | elif command -v logg > /dev/null; then
13 | alias logger='logg'
14 | fi
15 |
16 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
17 | . "$(dirname "$0")/_/husky.sh"
18 |
19 | # Attempt to register Task from common places if it is not in PATH
20 | if ! type task > /dev/null; then
21 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
22 | if ! type task > /dev/null; then
23 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
24 | . "$HOME/$DOTFILE"
25 | if type task > /dev/null; then
26 | break
27 | fi
28 | done
29 | fi
30 | fi
31 |
32 | # Show warning if Task is still not registered/installed, else proceed with hook
33 | if ! type task > /dev/null; then
34 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
35 | logger info 'Get `task` here -> https://taskfile.dev'
36 | else
37 | task git:hook:post-commit
38 | fi
39 | else
40 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
41 | fi
42 |
--------------------------------------------------------------------------------
/.config/husky/post-checkout:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/post-checkout
5 | # @brief A git hook script for the `post-checkout` hook
6 | # @arg $1 The ref of the previous HEAD (e.g. f693bc50756b490f7ad067eb455338b634d01036)
7 | # @arg $2 The ref of the new HEAD
8 | # @arg $3 Equal to 1 if changing branches
9 |
10 | # @description Register appropriate logging utility
11 | if [ -f "$(dirname "$0")/../.config/log" ]; then
12 | alias logger="$(dirname "$0")/../.config/log"
13 | chmod +x "$(dirname "$0")/../.config/log"
14 | elif command -v logg > /dev/null; then
15 | alias logger='logg'
16 | fi
17 |
18 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
19 | . "$(dirname "$0")/_/husky.sh"
20 |
21 | # Attempt to register Task from common places if it is not in PATH
22 | if ! type task > /dev/null; then
23 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
24 | if ! type task > /dev/null; then
25 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
26 | . "$HOME/$DOTFILE"
27 | if type task > /dev/null; then
28 | break
29 | fi
30 | done
31 | fi
32 | fi
33 |
34 | # Show warning if Task is still not registered/installed, else proceed with hook
35 | if ! type task > /dev/null; then
36 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
37 | logger info 'Get `task` here -> https://taskfile.dev'
38 | else
39 | task git:hook:post-checkout
40 | fi
41 | else
42 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
43 | fi
44 |
--------------------------------------------------------------------------------
/.config/husky/post-rewrite:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/post-rewrite
5 | # @brief A git hook script for the `post-rewrite` hook. It is called when running commands
6 | # that rewrite commits (e.g. git pull origin master --rebase)
7 | # @arg $1 Denotes the command it was invoked by: currently one of amend or rebase
8 |
9 | # @description Register appropriate logging utility
10 | if [ -f "$(dirname "$0")/../.config/log" ]; then
11 | alias logger="$(dirname "$0")/../.config/log"
12 | chmod +x "$(dirname "$0")/../.config/log"
13 | elif command -v logg > /dev/null; then
14 | alias logger='logg'
15 | fi
16 |
17 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
18 | . "$(dirname "$0")/_/husky.sh"
19 |
20 | # Attempt to register Task from common places if it is not in PATH
21 | if ! type task > /dev/null; then
22 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
23 | if ! type task > /dev/null; then
24 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
25 | . "$HOME/$DOTFILE"
26 | if type task > /dev/null; then
27 | break
28 | fi
29 | done
30 | fi
31 | fi
32 |
33 | # Show warning if Task is still not registered/installed, else proceed with hook
34 | if ! type task > /dev/null; then
35 | logger warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
36 | logger info 'Get `task` here -> https://taskfile.dev'
37 | else
38 | task git:hook:post-rewrite
39 | fi
40 | else
41 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
42 | fi
43 |
--------------------------------------------------------------------------------
/.config/taskfiles/ci/Taskfile-github.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | actions:test:
6 | deps:
7 | - :install:software:act
8 | - :install:software:docker
9 | desc: Locally test the on-push GitHub Action event (only works for Linux containers)
10 | hide:
11 | sh: '! test -d .github/workflows'
12 | summary: |
13 | # Test GitHub Actions
14 |
15 | This task ensures Docker and Act are installed. It then uses Act to locally
16 | test Linux-based on-push GitHub Action events.
17 |
18 | See [Act's README.md](https://github.com/nektos/act) for more information.
19 | log:
20 | error: Error encountered while testing GitHub Actions locally with `act`
21 | start: Testing GitHub Actions locally with `act`
22 | success: Completed local GitHub Actions test
23 | cmds:
24 | - act
25 |
26 | synchronize:
27 | deps:
28 | - :install:software:git
29 | summary: |
30 | Forces a push to the GitHub master branch so that GitHub stays mirrored with
31 | the GitLab master branch.
32 | env:
33 | GITHUB_HTTP_REPO:
34 | sh: jq -r '.blueprint.repository.github' package.json
35 | cmds:
36 | - cmd: |
37 | if [ "$GITHUB_HTTP_REPO" != 'null' ]; then
38 | GITHUB_REPO_WITH_TOKEN="$(echo "$GITHUB_HTTP_REPO" | sed "s/github.com/${GITHUB_TOKEN}@github.com/")"
39 | git remote add github "${GITHUB_REPO_WITH_TOKEN}.git"
40 | git fetch --unshallow origin
41 | git push github master --force
42 | else
43 | .config/log warn 'The .blueprint.repository.github field is missing! Cannot synchronize to GitHub.'
44 | fi
45 | ignore_error: true
46 |
--------------------------------------------------------------------------------
/.config/docs/contributing/styleguides.md:
--------------------------------------------------------------------------------
1 | ## Style Guides
2 |
3 | All code projects have their own style. Coding style will vary from coder to coder. Although we do not have a strict style guide for each project, we do require that you be well-versed in what coding style is most acceptable and _best_. To do this, you should read through style guides that are made available by organizations that have put a lot of effort into studying the reason for coding one way or another.
4 |
5 | ### Recommended Style Guides
6 |
7 | Style guides are generally written for a specific language but a great place to start learning about the best coding practices is on [Google Style Guides](https://google.github.io/styleguide/). Follow the link and you will see style guides for most popular languages. We also recommend that you look through the following style guides, depending on what language you are coding with:
8 |
9 | * [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
10 | * [Angular Style Guide](https://angular.io/guide/styleguide)
11 | * [Effective Go](https://go.dev/doc/effective_go)
12 | * [PEP 8 Python Style Guide](https://www.python.org/dev/peps/pep-0008/)
13 | * [Git Style Guide](https://github.com/agis/git-style-guide)
14 |
15 | For more informative links, refer to the [GitHub Awesome Guidelines List](https://github.com/Kristories/awesome-guidelines).
16 |
17 | ### Strict Linting
18 |
19 | One way we enforce code style is by including the best standard linters into our projects. We normally keep the settings pretty strict. Although it may seem pointless and annoying at first, these linters will make you a better coder since you will learn to adapt your style to the style of the group of people who spent countless hours creating the linter in the first place.
20 |
--------------------------------------------------------------------------------
/.config/docs/common/contributing/styleguides.md:
--------------------------------------------------------------------------------
1 | ## Style Guides
2 |
3 | All code projects have their own style. Coding style will vary from coder to coder. Although we do not have a strict style guide for each project, we do require that you be well-versed in what coding style is most acceptable and _best_. To do this, you should read through style guides that are made available by organizations that have put a lot of effort into studying the reason for coding one way or another.
4 |
5 | ### Recommended Style Guides
6 |
7 | Style guides are generally written for a specific language but a great place to start learning about the best coding practices is on [Google Style Guides](https://google.github.io/styleguide/). Follow the link and you will see style guides for most popular languages. We also recommend that you look through the following style guides, depending on what language you are coding with:
8 |
9 | * [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
10 | * [Angular Style Guide](https://angular.io/guide/styleguide)
11 | * [Effective Go](https://go.dev/doc/effective_go)
12 | * [PEP 8 Python Style Guide](https://www.python.org/dev/peps/pep-0008/)
13 | * [Git Style Guide](https://github.com/agis/git-style-guide)
14 |
15 | For more informative links, refer to the [GitHub Awesome Guidelines List](https://github.com/Kristories/awesome-guidelines).
16 |
17 | ### Strict Linting
18 |
19 | One way we enforce code style is by including the best standard linters into our projects. We normally keep the settings pretty strict. Although it may seem pointless and annoying at first, these linters will make you a better coder since you will learn to adapt your style to the style of the group of people who spent countless hours creating the linter in the first place.
20 |
--------------------------------------------------------------------------------
/.config/taskfiles/upstream/Taskfile-commondocs.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | COMMON_FILES_URL: https://gitlab.com/megabyte-labs/common/shared.git
6 | COMMON_FOLDER: .common
7 |
8 | tasks:
9 | clean:
10 | log:
11 | error: Error while running `rm -rf {{.COMMON_FOLDER}}`
12 | start: Running `rm -rf {{.COMMON_FOLDER}}`
13 | success: Successfully ran `rm -rf {{.COMMON_FOLDER}}`
14 | cmds:
15 | - rm -rf {{.COMMON_FOLDER}}
16 |
17 | clone:
18 | log:
19 | error: Error in cloning logic for {{.COMMON_FILES_URL}}
20 | start: Cloning {{.COMMON_FILES_URL}}
21 | success: Successfully cloned {{.COMMON_FILES_URL}}
22 | cmds:
23 | - rm -rf {{.COMMON_FOLDER}}
24 | - git clone --depth=1 {{.COMMON_FILES_URL}} {{.COMMON_FOLDER}}
25 | - rm -rf {{.COMMON_FOLDER}}/.git
26 |
27 | copy:
28 | deps:
29 | - :install:software:coreutils
30 | - :install:software:yq
31 | log:
32 | error: Error copying common files
33 | start: Copying common files
34 | success: Copied common files
35 | cmds:
36 | - mv .gitlab-ci.yml old.gitlab-ci.yml
37 | - |
38 | {{if (eq OS "darwin")}}PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"{{end}}
39 | cp -rT ./{{.COMMON_FOLDER}}/common/ .
40 | - |
41 | yq eval-all -i 'select(fileIndex == 0) * select(fileIndex == 1)' old.gitlab-ci.yml .gitlab-ci.yml
42 | mv old.gitlab-ci.yml .gitlab-ci.yml
43 | - task: :common:husky:permissions
44 | - mv {{.COMMON_FOLDER}}/.gitlab-ci.yml .gitlab-ci.yml
45 |
46 | template:
47 | cmds:
48 | - task: :upstream:variables
49 | vars:
50 | INPUT_FILE: common.json
51 | OUTPUT_FILE: ./.variables.json
52 | - task: :upstream:template
53 |
--------------------------------------------------------------------------------
/.config/docs/readme/creating-box.md:
--------------------------------------------------------------------------------
1 | ## Creating Your Own Box
2 |
3 | You can quickly use this project to create your own minimal {{ template_json.variables.description }} box by:
4 |
5 | 1. Creating a box on VagrantUp titled {{ template_json.variables.box_basename }} (Note: The VagrantUp box name should match the `"box_basename"` in the `template.json` file.)
6 | 2. Changing the `"vagrantup_user"` variable in `template.json` to your VagrantUp username
7 | 3. Acquiring a VagrantUp API token from the settings page
8 | 4. Running the following code
9 |
10 | ```shell
11 | bash start.sh # Ensures Bodega is installed
12 | export VAGRANT_CLOUD_TOKEN=YourTokenHere
13 | task packer:build
14 | ```
15 | _[What is Bodega?](https://github.com/ProfessorManhattan/Bodega)_
16 |
17 | After running the code above, you will kick off a parallelized build for all the virtualization platforms that your computer currently has installed. If you want to install all of the virtualization platforms that your computer could potentially support then you can run `task packer:install:platforms`.
18 |
19 | After building the VM images, the example above will upload your images to your VagrantUp box repository _(that you have to create before running the script that is above)_. If you want to build the box for another provider then look at the `template.json` in the `"builders"` section for the types of boxes you can create (e.g. `virtualbox-iso`, `vmware-iso`, `parallels-iso`, `qemu`).
20 |
21 | If you do not want your box to be automatically uploaded to VagrantUp after you build it with Packer then you will need to remove the `"vagrant-cloud"` section under `"post-processors"`. The section is wrapped in a nested array. If you are removing the `vagrant-cloud` post-processor, then the section no longer has to be placed in a nested array.
22 |
--------------------------------------------------------------------------------
/.config/taskfiles/npm/Taskfile-doc.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | html:
6 | deps:
7 | - :npm:install:typedoc
8 | desc: Generate TypeDoc HTML documentation
9 | summary: |
10 | # Generate TypeDoc HTML Documentation
11 |
12 | [TypeDoc](https://typedoc.org/) is a CLI tool that generates documentation from specially crafted
13 | comments in TypeScript code. It also uses type information to generate
14 | the documentation.
15 |
16 | Running this command will scan the `src/` folder, extract the comments and
17 | type information and then generate HTML documentation.
18 |
19 | Be sure to read about how to decorate your comments by reading
20 | [TypeDoc's documentation on comment formatting](https://typedoc.org/guides/doccomments/).
21 | log:
22 | error: Encountered error generating HTML documentation with TypeDoc
23 | start: Generating HTML documentation with TypeDoc
24 | success: Successfully generated HTML technical documentation with TypeDoc
25 | cmds:
26 | - '{{.NPX_HANDLE}}typedoc src/ --exclude "**/*.spec.ts" --out build/docs'
27 |
28 | json:
29 | deps:
30 | - :npm:install:typedoc
31 | desc: Generate TypeDoc JSON documentation
32 | log:
33 | error: Encountered error generating JSON documentation with TypeDoc
34 | start: Generating JSON documentation with TypeDoc
35 | success: Successfully generated JSON technical documentation with TypeDoc
36 | cmds:
37 | - '{{.NPX_HANDLE}}typedoc src/ --exclude "**/*.spec.ts" --json build/docs/typedoc.json'
38 |
39 | open:
40 | deps:
41 | - html
42 | - :npm:install:open-cli
43 | log:
44 | start: Opening TypeDoc documentation (`build/docs/index.html`) in the default browser
45 | cmds:
46 | - '{{.NPX_HANDLE}}open-cli build/docs/index.html'
47 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-ansible.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | ANSIBLE_VENV:
6 | sh: echo "$HOME/.local/megabytelabs/ansible"
7 |
8 | tasks:
9 | install:ansible:
10 | cmds:
11 | - pip3 install ansible
12 |
13 | main:
14 | deps:
15 | - install:ansible
16 | cmds:
17 | - task: requirements
18 |
19 | requirements:
20 | deps:
21 | - requirements:galaxy
22 | - requirements:python
23 |
24 | requirements:galaxy:
25 | cmds:
26 | - |
27 | PATH="$PATH:$HOME/.local/bin"
28 | ansible-galaxy install -r requirements.yml
29 | status:
30 | - '[ ! -f requirements.yml ]'
31 |
32 | requirements:python:
33 | cmds:
34 | - pip3 install requirements.txt
35 | status:
36 | - '[ ! -f requirements.txt ]'
37 |
38 | role:
39 | deps:
40 | - :install:software:docker
41 | desc: Install an Ansible role by using Docker
42 | summary: |
43 | # Install an Ansible Role
44 |
45 | This task installs a single Ansible role on the localhost. It
46 | will download the role from Ansible Galaxy and then provision
47 | the localhost using a Docker container (so that Ansible dependencies
48 | are not permanently installed).
49 |
50 | **Example:**
51 | `task install:ansible:role -- professormanhattan/androidstudio
52 | cmds:
53 | - |
54 | if [ -d ~/.ansible/roles/{{.CLI_ARGS}} ]; then
55 | rm -rf ~/.ansible/roles/{{.CLI_ARGS}}
56 | fi
57 | - ansible-galaxy install --force --ignore-errors professormanhattan.androidstudio
58 | - echo "TODO - run Docker and provision"
59 |
60 | start:
61 | deps:
62 | - :install:software:python
63 | cmds:
64 | - python3 -m venv {{.ANSIBLE_VENV}}
65 | - |
66 | source {{.ANSIBLE_VENV}}/bin/activate
67 | task install:ansible:main
68 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "dockerFile": "Dockerfile",
3 | "extensions": [
4 | "chrmarti.regex",
5 | "DavidAnson.vscode-markdownlint",
6 | "dbaeumer.vscode-eslint",
7 | "eamodio.gitlens",
8 | "EditorConfig.EditorConfig",
9 | "esbenp.prettier-vscode",
10 | "ericadamski.carbon-now-sh",
11 | "formulahendry.code-runner",
12 | "GitHub.vscode-pull-request-github",
13 | "GitLab.gitlab-workflow",
14 | "GoogleCloudTools.cloudcode",
15 | "hediet.vscode-drawio",
16 | "IBM.output-colorizer",
17 | "Kelvin.vscode-sshfs",
18 | "mads-hartmann.bash-ide-vscode",
19 | "ms-azuretools.vscode-docker",
20 | "ms-vscode-remote.remote-containers",
21 | "ms-vscode-remote.remote-ssh",
22 | "ms-vscode-remote.remote-wsl",
23 | "ms-vscode.PowerShell",
24 | "MS-vsliveshare.vsliveshare",
25 | "MS-vsliveshare.vsliveshare-audio",
26 | "philnash.ngrok-for-vscode",
27 | "PKief.material-icon-theme",
28 | "redhat.vscode-yaml",
29 | "richie5um2.vscode-sort-json",
30 | "Rubymaniac.vscode-paste-and-indent",
31 | "shd101wyy.markdown-preview-enhanced",
32 | "softwaredotcom.swdc-vscode",
33 | "timonwong.shellcheck",
34 | "tyriar.sort-lines",
35 | "usernamehw.errorlens",
36 | "valentjn.vscode-ltex",
37 | "vsls-contrib.codetour",
38 | "vsls-contrib.gistfs",
39 | "wayou.vscode-todo-highlight"
40 | ],
41 | "forwardPorts": [2222, 5901, 6080, 8001, 8014],
42 | "hostRequirements": {
43 | "cpus": 1,
44 | "memory": "4gb",
45 | "storage": "16gb"
46 | },
47 | "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
48 | "name": "Megabyte Labs Development Environment",
49 | "postCreateCommand": "[ -f start.sh ] && (bash start.sh || true)",
50 | "remoteUser": "megabyte",
51 | "runArgs": ["--init", "--privileged", "--shm-size=1g"],
52 | "settings": {}
53 | }
54 |
--------------------------------------------------------------------------------
/.config/docs/contributing/getting-started.md:
--------------------------------------------------------------------------------
1 | ## Getting Started
2 |
3 | This repository leverages Node.js to provide linting, auto-fixing, and streamline the commit process. With Node.js (version 12 or higher) installed, you can start up the project's development environment by running:
4 |
5 | ```
6 | npm i
7 | ```
8 |
9 | This will install all the Node.js dependencies and automatically register a pre-commit hook.
10 |
11 | ### NPM Tasks Available
12 |
13 | With the dependencies installed, you can see a list of the available commands by running `npm run info`. This will log a help menu to the console informing you about the available commands and what they do. After running the command, you will see something that looks like this:
14 |
15 | ```
16 | ❯ npm run info
17 |
18 | > packer-project@1.0.0 info
19 | > npm-scripts-info
20 |
21 | build:
22 | Build all of the images
23 | build:hyperv:
24 | Build a Hyper-V image
25 | build:kvm:
26 | Build a QEMU/KVM image
27 | build:parallels:
28 | Build a Parallels image
29 | build:virtualbox:
30 | Build a VirtualBox image
31 | build:vmware:
32 | Build a VMWare image
33 | commit:
34 | The preferred way of running git commit (instead of git commit, we prefer running 'npm run commit')
35 | info:
36 | Logs descriptions of all the npm tasks
37 | fix:
38 | Automatically fix formatting errors
39 | launch:
40 | Runs 'vagrant up' to automatically spin up the VM
41 | prepare-release:
42 | Updates the CHANGELOG with commits made using 'npm run commit'
43 | test:
44 | Validates the Packer configuration file (i.e. template.json) and performs some other linting
45 | update:
46 | Runs .update.sh to automatically update meta files and documentation
47 | version:
48 | Used by 'npm run prepare-release' to update the CHANGELOG
49 | ```
50 |
51 | According to the help menu above, `npm run build` will run the `build` step described above. You can see exactly what each command is doing by checking out the `package.json` file.
52 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-tap.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | scan:
6 | deps:
7 | - :install:npm:leasot
8 | - :install:software:jq
9 | summary: |
10 | ```shell
11 | # @description Processes leasot data and returns .variables.json data including charts written in @appnest/readme format
12 | #
13 | # @arg $1 The file that the leasot JSON was written to
14 | # @arg $2 The tag being processed
15 | function populateChartVar() {
16 | ...
17 | }
18 | ```
19 | vars:
20 | DOC_IDS: '@binaryBrew,@npmBrew,@pythonBrew'
21 | log:
22 | error: Failed to acquire package information from comments via `leasot`
23 | start: Scanning and acquiring package information in comments via `leasot`
24 | success: Acquired package information from comments
25 | cmds:
26 | - |
27 | function populateChartVar() {
28 | CHART='[["Package", "Description"]'
29 | jq --arg tag "$(echo $2 | tr '[a-z]' '[A-Z]')" -r '.[] | select(.tag == $tag) | .
30 | | del(. ["file", "ref", "line", "tag"]) | .text' "$1" | while read COMMENT; do
31 | if [ "$CHART" != '[' ]; then
32 | CHART="${CHART},"
33 | fi
34 | LINK="$(echo $COMMENT | sed 's/ - .*//')"
35 | DESCRIPTION="$(echo $COMMENT | sed 's/.* - //' | sed 's/\"/\\\"/g')"
36 | CHART="${CHART}[\"**$LINK**\",\"$DESCRIPTION\"]"
37 | done
38 | CHART="${CHART}]"
39 | TMP_CHART="$(mktemp)"
40 | KEY="$(echo $2 | sed 's/^@//')"
41 | jq --arg chart "$CHART" --arg key "${KEY}_var_chart" '.[$key] = ($chart | fromjson)' .variables.json > "$TMP_CHART"
42 | mv "$TMP_CHART" .variables.json
43 | }
44 | TMP="$(mktemp)"
45 | leasot --tags '{{.DOC_IDS}}' --reporter json './Formula/**/*' > "$TMP" || true
46 | VARIABLES_JSON="$(jq '.' .variables.json)"
47 | for ID in {{replace "," " " .DOC_IDS}}; do
48 | populateChartVar "$TMP" "$ID"
49 | done
50 |
--------------------------------------------------------------------------------
/.config/husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # shellcheck disable=SC1090,SC1091,SC2016
3 |
4 | # @file .config/husky/pre-commit
5 | # @brief A git hook script for the `pre-commit` hook
6 |
7 | # @description Register appropriate logging utility
8 | if [ -f "$(dirname "$0")/../.config/log" ]; then
9 | alias logger="$(dirname "$0")/../.config/log"
10 | chmod +x "$(dirname "$0")/../.config/log"
11 | elif command -v logg > /dev/null; then
12 | alias logger='logg'
13 | fi
14 |
15 | if [ -f "$(dirname "$0")/_/husky.sh" ]; then
16 | . "$(dirname "$0")/_/husky.sh"
17 |
18 | # Attempt to register Task from common places if it is not in PATH
19 | if ! type task > /dev/null; then
20 | PATH="$PATH:$HOME/.local/go/bin:$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.asdf/shims"
21 | if ! type task > /dev/null; then
22 | for DOTFILE in .profile .bashrc .bash_profile .zshrc; do
23 | . "$HOME/$DOTFILE"
24 | if type task > /dev/null; then
25 | break
26 | fi
27 | done
28 | fi
29 | fi
30 |
31 | # Show warning if Task is still not registered/installed, else proceed with hook
32 | if ! type task > /dev/null; then
33 | .config/log warn '`task` does not appear to be installed or is not registered in the `PATH` variable - please manually include it'
34 | logger info 'Get `task` here -> https://taskfile.dev'
35 | else
36 | logger info "Performing various pre-commit tasks on staged files (like autofixing, detecting private keys, etc.)"
37 | STAGED_FILES=$(git diff --cached --name-only)
38 | for FILE in "$STAGED_FILES"; do
39 | if [ -f "$1" ]; then
40 | task git:hook:pre-commit -- "$FILE" &
41 | fi
42 | done
43 | wait
44 |
45 | logger info 'Linting and fixing the staged files with `lint-staged`'
46 | task lint:lint-staged
47 |
48 | logger info 'Reporting possible spelling errors in the staged files with `cspell`'
49 | task lint:spelling
50 |
51 | logger success 'Pre-commit validation complete!'
52 | fi
53 | else
54 | logger warn 'Husky pre-commit hooks are currently not properly setup.'
55 | fi
56 |
--------------------------------------------------------------------------------
/.config/taskfiles/go/Taskfile-goreleaser.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | GORELEASER_CONFIG:
6 | sh: if [ -f .goreleaser.yml ]; then echo ".goreleaser.yml"; else echo ".config/goreleaser-{{OS}}.yml"; fi
7 |
8 | tasks:
9 | build:
10 | deps:
11 | - :install:go:goreleaser
12 | - :install:go:nfpm
13 | - :install:software:jq
14 | vars:
15 | CURRENT_TAG:
16 | sh: jq -r '.blueprint.currentBuildTag' package.json
17 | log:
18 | error: GoReleaser encountered an error (config file -> `{{.GORELEASER_CONFIG}}`)
19 | start: Building with project with GoReleaser
20 | success: Completed building the project with GoReleaser
21 | cmds:
22 | - |
23 | unset GITHUB_TOKEN
24 | unset GITLAB_TOKEN
25 | export GOVERSION="$(go version)"
26 | if [ '{{.CURRENT_TAG}}' != 'null' ]; then
27 | export GORELEASER_CURRENT_TAG={{.CURRENT_TAG}}
28 | fi
29 | goreleaser build --config {{.GORELEASER_CONFIG}} --rm-dist --skip-validate
30 |
31 | check:
32 | deps:
33 | - :install:go:goreleaser
34 | log:
35 | error: GoReleaser configuration appears to be invalid (config file -> `{{.GORELEASER_CONFIG}})
36 | start: Validating the configuration file
37 | success: GoReleaser configuration is valid!
38 | cmds:
39 | - goreleaser check --config {{.GORELEASER_CONFIG}}
40 |
41 | release:
42 | deps:
43 | - :install:go:goreleaser
44 | - :install:go:nfpm
45 | - :install:software:jq
46 | vars:
47 | CURRENT_TAG:
48 | sh: jq -r '.version' package.json
49 | cmds:
50 | - .config/log start 'Publishing compiled assets with GoReleaser'
51 | - task: :publish:snap:register
52 | - |
53 | unset GITLAB_TOKEN
54 | export GOVERSION="$(go version)"
55 | export GORELEASER_CURRENT_TAG=v{{.CURRENT_TAG}}
56 | goreleaser release --config {{.GORELEASER_CONFIG}} --rm-dist --skip-validate
57 | - rm -f build/task.rb build/config.yaml
58 | - .config/log success 'Successfully published assets with GoReleaser!'
59 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | ._*
3 | *$py.class
4 | allure-reports/
5 | .angular
6 | ansible_variables.json
7 | .apdisk
8 | .AppleDB
9 | .AppleDesktop
10 | .AppleDouble
11 | artifacts/
12 | .autodoc/
13 | *.box
14 | build/
15 | !*ci/build/
16 | .c9/
17 | .cache
18 | .cache/
19 | *-latest.tar
20 | *-latest.tar.gz
21 | *-slim.tar
22 | *-slim.tar.gz
23 | .classpath
24 | *.code-workspace
25 | .com.apple.timemachine.donotpresent
26 | common-shared/
27 | .config/dummy.go
28 | .config-old/
29 | connect.lock
30 | *.cover
31 | .coverage
32 | .coverage.*
33 | coverage/
34 | coverage.xml
35 | db.sqlite3
36 | db.sqlite3-journal
37 | .directory
38 | dist/
39 | .DocumentRevisions-V100
40 | .docusaurus/
41 | .DS_Store
42 | .env
43 | env/
44 | ENV/
45 | env.bak/
46 | .fseventsd
47 | .fuse_hidden*
48 | .git/
49 | .go/
50 | htmlcov/
51 | .hypothesis/
52 | Icon
53 | .idea/
54 | .issues/
55 | .jest-cache/
56 | .junit/
57 | *.launch
58 | libpeerconnection.log
59 | local_settings.py
60 | *.log
61 | .LSOverride
62 | **/molecule/.results/junit/
63 | Network Trash Folder
64 | .nfs*
65 | node_modules/
66 | node_modules.bak/
67 | nosetests.xml
68 | .nox/
69 | .npm/
70 | .npmrc
71 | npm-debug.log
72 | .nyc_output/
73 | persistence/
74 | pip-delete-this-directory.txt
75 | pip-log.txt
76 | .pnpm-store/
77 | .project
78 | __pycache__/
79 | .pytest_cache/
80 | pytestdebug.log
81 | .release.json
82 | *.retry
83 | .sass-cache/
84 | .settings/
85 | .shared/
86 | *.so
87 | snap.login
88 | .Spotlight-V100
89 | *.sublime-workspace
90 | *.tar
91 | .task/
92 | Taskfile.yml.model
93 | .TemporaryItems
94 | Temporary Items
95 | testem.log
96 | Thumbs.db
97 | tmp/
98 | .tox/
99 | .Trash-*
100 | .Trashes
101 | *.tsbuildinfo
102 | tsconfig.build.tsbuildinfo
103 | typings/
104 | .vagrant/
105 | .variables.json
106 | .vault_pass
107 | .venv/
108 | .ventoy.json
109 | venv/
110 | venv.bak/
111 | .VolumeIcon.icns
112 | .vscode/*
113 | !.vscode/extensions.json
114 | !.vscode/launch.json
115 | !.vscode/settings.json
116 | !.vscode/tasks.json
117 | yarn-error.log
118 | .yubi.json
119 | .yubi-masterkey
120 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile-snap.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | export:
6 | deps:
7 | - :install:software:snapcraft
8 | summary: |
9 | # Export Snapcraft Login Credentials
10 |
11 | This task will export an unencrypted file called `snap.login` which you can
12 | use to extract the macaroon/unbound_discharge/email. Once extracted, save
13 | them as environment variables for use with the other tasks.
14 | log:
15 | error: Error encountered while exporting `snap.login`
16 | start: Exporting login credentials to unencrpyted file named `snap.login`
17 | success: Successfully exported `snap.login` (unencrypted)
18 | cmds:
19 | - snapcraft export-login snap.login
20 |
21 | login:
22 | deps:
23 | - :install:software:snapcraft
24 | vars:
25 | SNAP_LOGIN_TEMPLATE: |
26 | [login.ubuntu.com]
27 | macaroon = {{env "SNAPCRAFT_MACAROON"}}
28 | unbound_discharge = {{env "SNAPCRAFT_UNBOUND_DISCHARGE"}}
29 | email = {{env "SNAPCRAFT_EMAIL"}}
30 | log:
31 | error: Error encountered while logging into Snapcraft
32 | start: Logging into Snapcraft
33 | success: Successfully logged into Snapcraft
34 | cmds:
35 | - |
36 | echo '{{.SNAP_LOGIN_TEMPLATE}}' > snap.login
37 | snapcraft login --with snap.login || rm -f snap.login
38 | rm -f snap.login
39 | preconditions:
40 | - '[ -n "$SNAPCRAFT_MACAROON" ]'
41 | - '[ -n "$SNAPCRAFT_UNBOUND_DISCHARGE" ]'
42 | - '[ -n "$SNAPCRAFT_EMAIL" ]'
43 |
44 | register:
45 | deps:
46 | - :install:software:snapcraft
47 | vars:
48 | SNAP_PACKAGE:
49 | sh: jq -r '.blueprint.snapPackage' package.json
50 | log:
51 | error: Error ensuring `{{.SNAP_PACKAGE}}` is registered
52 | start: Ensuring `{{.SNAP_PACKAGE}}` is registered
53 | success: Ensured `{{.SNAP_PACKAGE}}` is registered
54 | cmds:
55 | - task: login
56 | - snapcraft register --yes {{.SNAP_PACKAGE}}
57 | status:
58 | - snapcraft list | grep {{.SNAP_PACKAGE}} || [[ "{{OS}}" != "linux" ]]
59 |
--------------------------------------------------------------------------------
/.config/taskfiles/log/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | markdown:
6 | summary: |
7 | # Render Markdown with Glow
8 |
9 | [Glow]() provides pleasently formatted markdown
10 | in the terminal. This task allows you to pass in data to be formatted
11 | by Glow as the MARKDOWN variable or a CLI argument if the MARKDOWN
12 | variable is undefined. In both cases, this task will first check if
13 | the variable is a markdown file. It will render the file in this case.
14 | It can also render markdown passed in as a string.
15 |
16 | **Example with CLI and markdown file:**
17 | task log:markdown -- path/to/markdown.md
18 |
19 | **Example with MARKDOWN variable and inlined markdown:**
20 | ```
21 | mytask:
22 | cmds:
23 | - task: :log:markdown
24 | vars:
25 | MARKDOWN: |
26 | # Markdown Title
27 |
28 | Paragraph `code` [Link to cool website](https://megabyte.space).
29 | ```
30 |
31 | If passing in inlined markdown via the MARKDOWN library, you should ensure
32 | that the inlined string is properly escaped so there are no clashes with single
33 | quotes (e.g. ''). You can escape your strings using Task's built-in templating
34 | engine by using the following syntax:
35 |
36 | ```
37 | {{'{{'}} replace "'" "\'" .MY_VARIABLE {{'}}'}}
38 | ```
39 | cmds:
40 | - |
41 | TMP="$(mktemp)"
42 | {{if .MARKDOWN}}
43 | if [ -f '{{.MARKDOWN}}' ]; then
44 | cp '{{.MARKDOWN}}' "$TMP"
45 | else
46 | tee "$TMP" < '{{.MARKDOWN}}'
47 | fi
48 | .config/log md "$TMP"
49 | {{else}}
50 | {{if .CLI_ARGS}}
51 | if [ -f '{{.CLI_ARGS}}' ]; then
52 | cp '{{.CLI_ARGS}}' "$TMP"
53 | else
54 | tee "$TMP" < '{{replace "'" "\'" .CLI_ARGS}}'
55 | fi
56 | .config/log md "$TMP"
57 | {{else}}
58 | .config/log error 'A CLI argument or the MARKDOWN variable must be passed in.'
59 | {{end}}
60 | {{end}}
61 |
--------------------------------------------------------------------------------
/.config/taskfiles/npm/Taskfile-cov.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | all:
6 | cmds:
7 | - task: :npm:build:all
8 | - task: :npm:test:unit
9 | - task: report
10 |
11 | check:
12 | deps:
13 | - :install:modules:local
14 | - :install:npm:nyc
15 | log:
16 | error: Errors encountered while running `nyc report` and `nyc check-coverage`
17 | start: Running `nyc report` and `nyc check-coverage`
18 | success: Finished running `nyc`
19 | cmds:
20 | - '{{.NPX_HANDLE}}nyc report'
21 | - '{{.NPX_HANDLE}}nyc check-coverage --lines 100 --functions 100 --branches 100'
22 |
23 | html:
24 | deps:
25 | - :install:modules:local
26 | - :install:npm:nyc
27 | log:
28 | error: Error while generating HTML report with `nyc`
29 | start: Reporting with `nyc` in HTML format
30 | success: Report generated by `nyc` in HTML format
31 | cmds:
32 | - '{{.NPX_HANDLE}}nyc report --reporter=html'
33 |
34 | lcov:
35 | deps:
36 | - :install:modules:local
37 | - :install:npm:nyc
38 | log:
39 | error: Encountered error generating `lcov` report with `nyc`
40 | start: Reporting with `nyc` in `lcov` format
41 | success: Finished `lcov` report with `nyc`
42 | cmds:
43 | - '{{.NPX_HANDLE}}nyc report --reporter=lcov'
44 |
45 | open:
46 | deps:
47 | - html
48 | - :npm:install:open-cli
49 | desc: View the code coverage report in the browser
50 | hide: '{{ne .REPOSITORY_TYPE "npm"}}'
51 | log:
52 | start: Opening `coverage/index.html` with the default browser
53 | cmds:
54 | - '{{.NPX_HANDLE}}open-cli coverage/index.html'
55 |
56 | report:
57 | deps:
58 | - html
59 | - lcov
60 |
61 | upload:
62 | deps:
63 | - lcov
64 | - :install:npm:codecov
65 | desc: Upload code coverage report to `codecov.io`
66 | hide: '{{ne .REPOSITORY_TYPE "npm"}}'
67 | log:
68 | error: Error while running `codecov`
69 | start: Running `codecov`
70 | success: Successfully ran `codecov`
71 | cmds:
72 | - '{{.NPX_HANDLE}}codecov'
73 |
--------------------------------------------------------------------------------
/.config/docs/common/readme/contribute.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Contributions, issues, and feature requests are welcome! Feel free to check the [issues page]({{ repository.github }}{{ repository.location.issues.github }}). If you would like to contribute, please take a look at the [contributing guide]({{ repository.github }}{{ repository.location.contributing.github }}).
4 |
5 |
6 | Sponsorship
7 |
8 |
9 |
10 | Dear Awesome Person,
11 | {{ sponsorship.text }}
12 |
Sincerely,
13 |
14 | **_{{ sponsorship.author }}_**
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | ### Affiliates
29 |
30 | Below you will find a list of services we leverage that offer special incentives for signing up for their services through our special links:
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/.config/docs/readme-cli/installation.md:
--------------------------------------------------------------------------------
1 | ## Installation
2 |
3 | There are several ways you can install this CLI. You can:
4 |
5 | 1. Use our bash scripts which will handle everything automatically with as few dependencies as possible
6 | 2. Compile the program using Go and add it to your `PATH`
7 | 3. Install it via an NPM convienience wrapper
8 | 4. Download the pre-built binary from the GitLab or GitHub releases page and then place it in your `PATH`
9 |
10 | ### Quick Method
11 |
12 | If you are looking to install the CLI as quickly as possible then you can run the following script which will install the binary to your `/usr/local/bin` folder on macOS or Linux:
13 |
14 | ```
15 | curl -sS https://install.doctor/{{binName}} | bash
16 | ```
17 |
18 | Or, if you are on Windows, you can install it by running:
19 |
20 | ```
21 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://install.doctor/{{binName}}?os=win'))
22 | ```
23 |
24 | ### Compile Program with Go
25 |
26 | You can install the CLI by compiling it from the source as long as you have a recent version of Go installed:
27 |
28 | ```
29 | git clone {{repository.github}}.git
30 | cd {{#withLast (split repository.github "/")}}{{this}}{{/withLast}}
31 | {{build_command}}
32 | sudo mv {{build_command_output}} /usr/local/bin
33 | ```
34 |
35 | After you compile the program, you should then move the binary file to a location that is in your `PATH` (which is what the last line does in the snippet above).
36 |
37 | ### NPM Install Method
38 |
39 | Every release is bundled into an NPM package that you can install by running the following command:
40 |
41 | ```
42 | npm install -g {{binName}}
43 | ```
44 |
45 | ### Pre-Built Binary
46 |
47 | If you trust us (and you should not.. trust.. anybody.. EVER), then you can also download the binary directly from the {{ name }} GitLab release page or the GitHub release page. After you download the release, you will have to either place the binary somewhere in your `PATH` or run the installer (in the case of the `.deb` or `.rpm` releases, for instance).
48 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Configuration for probot-stale - https://github.com/probot/stale
3 |
4 | # Number of days of inactivity before an Issue or Pull Request becomes
5 | # stale
6 | daysUntilStale: 90
7 |
8 | # Number of days of inactivity before an Issue or Pull Request with the
9 | # stale label is closed.
10 | # Set to false to disable. If disabled, issues still need to be closed
11 | # manually, but will remain marked as stale.
12 | daysUntilClose: 30
13 |
14 | # Only issues or pull requests with all of these labels are check if stale.
15 | # Defaults to `[]` (disabled)
16 | onlyLabels: []
17 |
18 | # Issues or Pull Requests with these labels will never be considered stale.
19 | # Set to `[]` to disable
20 | exemptLabels:
21 | - pinned
22 | - security
23 | - planned
24 |
25 | # Set to true to ignore issues in a project (defaults to false)
26 | exemptProjects: false
27 |
28 | # Set to true to ignore issues in a milestone (defaults to false)
29 | exemptMilestones: false
30 |
31 | # Set to true to ignore issues with an assignee (defaults to false)
32 | exemptAssignees: true
33 |
34 | # Label to use when marking as stale
35 | staleLabel: stale
36 |
37 | # Limit the number of actions per hour, from 1-30. Default is 30
38 | limitPerRun: 30
39 |
40 | pulls:
41 | markComment: "This pull request has been marked 'stale' due to lack of \
42 | recent activity. If there is no further activity, the PR will be \
43 | closed in another 30 days. Thank you for your contribution!"
44 | unmarkComment: This pull request is no longer marked for closure.
45 | closeComment: "This pull request has been closed due to inactivity. If \
46 | you feel this is in error, please reopen the pull request or file a \
47 | new PR with the relevant details."
48 |
49 | issues:
50 | markComment: "This issue has been marked 'stale' due to lack of recent \
51 | activity. If there is no further activity, the issue will be closed \
52 | in another 30 days. Thank you for your contribution!"
53 | unmarkComment: This issue is no longer marked for closure.
54 | closeComment: "This issue has been closed due to inactivity. If you feel \
55 | this is in error, please reopen the issue or file a new issue with the \
56 | relevant details."
57 |
--------------------------------------------------------------------------------
/.config/docs/contributing/formatting.md:
--------------------------------------------------------------------------------
1 | ## Formatting the Template
2 |
3 | In each of our Packer repositories, you will see a file named `template.json`. This serves as the configuration file that Packer uses when building our boxes. Please follow the guidelines below when formatting a `template.json` file:
4 |
5 | - The `"variables"` section should be at the top of the `template.json` file.
6 | - Make sure the variable names are consistent across [our Packer repositories]({{ repository.group.packer }}).
7 | - Prefer naming the variables after the section they will be placed.
8 | - For example, the variable used for `"ssh_password"` should also be named `"ssh_password"`.
9 | - All the JSON objects should be in alphabetical order with the following exceptions:
10 | - The `"variables"` section should be at the top of the file.
11 | - The `"type"` field should be at the top of its section.
12 | - All environment variables should be referenced in capitals. For example, `http_proxy` should be `HTTP_PROXY`. However, the actual user variables in the `"variables"` section should be all lowercased.
13 | - Any text that is shared between multiple builders should be stored as a variable. The only exception is data that is specific to each builder (e.g. `"guest_os_type"` which is only used for Parallels builds).
14 | - Use the https://mirror.arizona.edu as the download location.
15 | - All the variables should start with {{ and then a space. The same is true for the opposite side of the variable.
16 | - **GOOD:** `{{ user 'variable' }}`
17 | - **BAD:** `{{user 'variable'}}`
18 | - In general, the `template.json` file should look nearly identical across our different Packer repositories.
19 |
20 | ### Conversion to HCL
21 |
22 | We chose JSON for the template because nearly all the examples on the internet are written in JSON. However, the Packer team is rolling out a new markup language for creating templates called HCL. Some newer features will only be provided for use by HCL templates. Eventually, we plan on porting our templates over to HCL. If you can help with this then please open a pull request! You can actually do a lot of the work automatically by running `packer hcl2_upgrade template.json` but some manual oversight is necessary to keep the configuration neat.
23 |
--------------------------------------------------------------------------------
/.config/hbs.cjs:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const { execSync } = require('child_process')
3 |
4 | function getTaskIncludeKey(path) {
5 | return path
6 | .replace('.config/taskfiles/', '')
7 | .replace('local/', '')
8 | .replace('/Taskfile-', ':')
9 | .replace('/Taskfile.yml', '')
10 | .replace('Taskfile-', '')
11 | .replace('.yml', '')
12 | }
13 |
14 | module.exports.register = function (Handlebars) {
15 | /**
16 | * Import [handlebars-helpers](https://github.com/helpers/handlebars-helpers)
17 | */
18 | require('handlebars-helpers')({
19 | handlebars: Handlebars
20 | })
21 |
22 | /**
23 | * Used to generate the includes: section of the main Taskfile.yml
24 | * in the root of every repository
25 | */
26 | Handlebars.registerHelper('bodegaIncludes', (pattern, options) => {
27 | const readdir = Handlebars.helpers.readdir
28 | const files = readdir('.config/taskfiles/')
29 | const tasks = Handlebars.helpers.each([...files, './local'], {
30 | fn: (file) => {
31 | if (fs.lstatSync(file).isDirectory()) {
32 | return readdir(file).filter((taskfile) => taskfile.match(/.*Taskfile.*.yml/gu))
33 | } else {
34 | return []
35 | }
36 | }
37 | })
38 |
39 | return tasks
40 | .replaceAll('.config/taskfiles/', ',.config/taskfiles/')
41 | .replaceAll('local/', ',local/')
42 | .split(',')
43 | .map((path) => ({
44 | key: getTaskIncludeKey(path),
45 | taskPath: './' + path,
46 | optional: path.includes('local/Taskfile-')
47 | }))
48 | .filter((x) => !!x.key)
49 | .sort((a, b) => a.key.localeCompare(b.key))
50 | })
51 |
52 | /**
53 | * Used for returning input from synchronous commands (i.e. bash commands)
54 | */
55 | Handlebars.registerHelper('execSync', function (input, options) {
56 | const output = execSync(input)
57 |
58 | return output
59 | })
60 |
61 | /**
62 | * Used for generating Homebrew resource stanzas for Python packages.
63 | * For more information, see: https://github.com/tdsmith/homebrew-pypi-poet
64 | */
65 | Handlebars.registerHelper('poet', function (input, options) {
66 | const formulae = execSync('poetry run poet -f ' + input)
67 |
68 | return formulae
69 | })
70 | }
71 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-github.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | bundle:
6 | deps:
7 | - docker-pushrm
8 | - fusion
9 |
10 | docker-pushrm:
11 | run: once
12 | tags:
13 | - update
14 | cmds:
15 | - task: install:github
16 | vars:
17 | BIN_NAME: docker-pushrm
18 | PACKAGE: github.com/christian-korneck/docker-pushrm
19 | - mkdir -p "$HOME/.docker/cli-plugins"
20 | - |
21 | if type docker-pushrm &> /dev/null; then
22 | mv "$(which docker-pushrm)" "$HOME/.docker/cli-plugins/docker-pushrm"
23 | else
24 | mv "$HOME/.local/go/bin/docker-pushrm" "$HOME/.docker/cli-plugins/docker-pushrm"
25 | fi
26 | - chmod +x "$HOME/.docker/cli-plugins/docker-pushrm"
27 | status:
28 | - '[ -f "$HOME/.docker/cli-plugins/docker-pushrm" ]'
29 |
30 | fusion:
31 | run: once
32 | tags:
33 | - update
34 | cmds:
35 | - task: install:github
36 | vars:
37 | BIN_NAME: fusion
38 | PACKAGE: github.com/edgelaboratories/fusion
39 |
40 | install:github:
41 | deps:
42 | - :install:software:jq
43 | vars:
44 | BIN: '{{.BIN_NAME}}'
45 | run: when_changed
46 | log:
47 | error: Failed to acquire GitHub release from `{{.PACKAGE}}`
48 | start: Acquiring GitHub binary release from `{{.PACKAGE}}`
49 | success: Installed GitHub release from `{{.PACKAGE}}`, available as `{{.BIN}}`
50 | cmds:
51 | - .config/log info "PATH variable --> $PATH"
52 | - task: :install:go:bin
53 | - mkdir -p "$HOME/.config/bin"
54 | - jq '. | .default_path = "./.bin" | .bins = {}' <<< $(echo '{}') > "$HOME/.config/bin/config.json"
55 | - |
56 | if [ -n "$CI" ]; then echo "*************** GitHub --> {{.BIN}}"; fi
57 | - |
58 | if [ -z "$GOPATH" ]; then
59 | export GOPATH="$HOME/.local/go"
60 | fi
61 | export PATH="$PATH:$HOME/.local/go/bin"
62 | bin install -f {{.PACKAGE}} "$GOPATH/bin/{{.BIN}}"
63 | status:
64 | - type {{.BIN}} > /dev/null || [ -n "$NO_INSTALL_HOMEBREW" ]
65 |
66 | sentry:
67 | run: once
68 | cmds:
69 | - task: install:github
70 | vars:
71 | BIN_NAME: sentry-cli
72 | PACKAGE: github.com/getsentry/sentry-cli
73 |
--------------------------------------------------------------------------------
/.config/taskfiles/git/Taskfile-issues.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | exportall:
6 | deps:
7 | - exportall:github
8 | - exportall:gitlab
9 |
10 | exportall:github:
11 | vars:
12 | SLUG:
13 | sh: jq -r '.blueprint.slug' package.json
14 | env:
15 | GH_CURL_AUTH:
16 | sh: |
17 | echo "Authorization: token $GITHUB_TOKEN"
18 | cmds:
19 | - git issue exportall github {{.GITHUB_ORG}} {{.SLUG}}
20 | status:
21 | - '[ -z "$GITHUB_TOKEN" ]'
22 |
23 | exportall:gitlab:
24 | vars:
25 | GITLAB_PATH:
26 | sh: jq -r '.blueprint.repository.gitlab' package.json | sed 's/https:\/\/gitlab.com\///' | sed 's/\/[^\/]*$//' | sed 's/\//%2F/g'
27 | GITLAB_SLUG:
28 | sh: jq -r '.blueprint.repository.gitlab' package.json | sed 's/.*\/\([^\/]*\)$/\1/'
29 | env:
30 | GL_CURL_AUTH:
31 | sh: |
32 | echo "PRIVATE-TOKEN: $GITLAB_TOKEN"
33 | cmds:
34 | - git issue exportall gitlab {{.GITLAB_PATH}} {{.GITLAB_SLUG}}
35 | status:
36 | - '[ -z "$GITLAB_TOKEN" ]'
37 |
38 | import:
39 | deps:
40 | - import:github
41 | - import:gitlab
42 |
43 | import:github:
44 | vars:
45 | SLUG:
46 | sh: jq -r '.blueprint.slug' package.json
47 | env:
48 | GH_CURL_AUTH:
49 | sh: |
50 | echo "Authorization: token $GITHUB_TOKEN"
51 | cmds:
52 | - git issue import github {{.GITHUB_ORG}} {{.SLUG}}
53 | status:
54 | - '[ -z "$GITHUB_TOKEN" ]'
55 |
56 | import:gitlab:
57 | vars:
58 | GITLAB_PATH:
59 | sh: jq -r '.blueprint.repository.gitlab' package.json | sed 's/https:\/\/gitlab.com\///' | sed 's/\/[^\/]*$//' | sed 's/\//%2F/g'
60 | GITLAB_SLUG:
61 | sh: jq -r '.blueprint.repository.gitlab' package.json | sed 's/.*\/\([^\/]*\)$/\1/'
62 | env:
63 | GL_CURL_AUTH:
64 | sh: |
65 | echo "PRIVATE-TOKEN: $GITLAB_TOKEN"
66 | cmds:
67 | - git issue import gitlab {{.GITLAB_PATH}} {{.GITLAB_SLUG}}
68 | status:
69 | - '[ -z "$GITLAB_TOKEN" ]'
70 |
71 | init:
72 | cmds:
73 | - cmd: git issue init
74 | ignore_error: true
75 |
76 | synchronize:
77 | deps:
78 | - :install:software:git-issue:admin
79 | cmds:
80 | - task: init
81 | - task: import
82 | - task: exportall
83 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/FeatureRequest.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: 💡 Feature Request
3 | description: Request a new feature or an improvement to an existing one.
4 | labels: [question]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | ## Thank You For Your Ideas!
10 |
11 | Thank you in advance for any input you have on how we can improve our open-source product.
12 | It is great to get ideas from other people's well-thought perspectives. Take a minute to
13 | ponder your idea and then feel free to submit your feature/idea for review.
14 |
15 | - type: textarea
16 | id: description
17 | attributes:
18 | label: 💡 Feature/Idea
19 | description: Enter a clear and concise description of the feature request/improvement.
20 | validations:
21 | required: true
22 |
23 | - type: input
24 | id: contributor
25 | attributes:
26 | label: ':thumbsup: Can you contribute?'
27 | description: '**Optional** Add a way we can contact you here if you would like to contribute.'
28 | placeholder: 'Twitter: @MegabyteLabs, E-mail: help@megabyte.space, etc.'
29 | validations:
30 | required: false
31 |
32 | - type: markdown
33 | attributes:
34 | value: |
35 | ## :heart: Love Megabyte Labs?
36 |
37 | If you find **[Megabyte Labs](https://megabyte.space)** projects useful, please consider donating so we sustain our projects:
38 |
39 |
40 |
44 |
45 |
46 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/.config/taskfiles/security/Taskfile-ssh.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | generate:
6 | vars:
7 | SSH_CIPHER: '{{if .SSH_CIPHER}}{{.SSH_CIPHER}}{{else}}ed25519{{end}}'
8 | SSH_EMAIL_COMMENT:
9 | sh: echo "{{if .SSH_EMAIL}}{{.SSH_EMAIL}}{{else}}$(jq -r '.YUBI_EMAIL' .yubi.json){{end}}"
10 | SSH_KEY_CATEGORY: '{{if .SSH_KEY_CATEGORY}}{{.SSH_KEY_CATEGORY}}{{else}}ssh{{end}}'
11 | cmds:
12 | - mkdir -p "$HOME/.ssh"
13 | - ssh-keygen -t {{.SSH_CIPHER}} -C "{{.SSH_EMAIL_COMMENT}} ({{.SSH_CIPHER}} - {{.SSH_KEY_CATEGORY}})"
14 | -f "$HOME/.ssh/id_gpg_{{.SSH_CIPHER}}_{{.SSH_KEY_CATEGORY}}" -q -P ""{{if (eq .SSH_CIPHER "rsa")}} -b 4096{{end}}
15 |
16 | yubikey:
17 | summary: |
18 | Generates default SSH keys that are intended to be made part of
19 | the keys stored in the ~/.gnupg folder using the `gpg-agent`.
20 | cmds:
21 | - task: generate
22 | vars:
23 | SSH_CIPHER: ed25519
24 | SSH_KEY_CATEGORY: alt_auto
25 | - task: generate
26 | vars:
27 | SSH_CIPHER: rsa
28 | SSH_KEY_CATEGORY: alt_auto
29 | - task: generate
30 | vars:
31 | SSH_CIPHER: ed25519
32 | SSH_KEY_CATEGORY: auto
33 | - task: generate
34 | vars:
35 | SSH_CIPHER: rsa
36 | SSH_KEY_CATEGORY: auto
37 | - task: generate
38 | vars:
39 | SSH_CIPHER: ed25519
40 | SSH_KEY_CATEGORY: local
41 | - task: generate
42 | vars:
43 | SSH_CIPHER: rsa
44 | SSH_KEY_CATEGORY: local
45 | - task: generate
46 | vars:
47 | SSH_CIPHER: ed25519
48 | SSH_KEY_CATEGORY: private
49 | - task: generate
50 | vars:
51 | SSH_CIPHER: rsa
52 | SSH_KEY_CATEGORY: private
53 | - task: generate
54 | vars:
55 | SSH_CIPHER: ed25519
56 | SSH_KEY_CATEGORY: web
57 | - task: generate
58 | vars:
59 | SSH_CIPHER: rsa
60 | SSH_KEY_CATEGORY: web
61 | status:
62 | - '[ -n "$YUBIKEY_BACKUP" ]'
63 |
64 | yubikey:resident:
65 | notes:
66 | - https://catbaba.com/ssh-authentication-with-a-yubikey-fido2-hardware-token-easy-portable-touch-free/
67 | - -O no-touch-required for no touch required auth
68 | cmds:
69 | - ssh-keygen -t ed25519 -O resident -O verify-required -C "{{.FILL_ME_IN}}"
70 |
--------------------------------------------------------------------------------
/.config/taskfiles/cloud/Taskfile-s3.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | bucket:create:
6 | deps:
7 | - :install:software:s5cmd
8 | summary: |
9 | # Create S3 Bucket
10 |
11 | This task creates an S3 bucket in the given account
12 |
13 | `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` and `BUCKET_NAME` are passed from the calling task. The first 3
14 | variables are set as environment variables
15 | env:
16 | AWS_ACCESS_KEY_ID: '{{.AWS_ACCESS_KEY_ID}}'
17 | AWS_REGION: '{{.AWS_REGION}}'
18 | AWS_SECRET_ACCESS_KEY: '{{.AWS_SECRET_ACCESS_KEY}}'
19 | cmds:
20 | - s5cmd mb s3://'{{.BUCKET_NAME}}'
21 |
22 | bucket:jumpusb:populate:
23 | deps:
24 | - :install:software:axel
25 | summary: |
26 | # Populate an S3 Bucket with JumpUSB Assets
27 |
28 | This script first downloads the script from the JumpUSB repository:
29 |
30 | https://gitlab.com/megabyte-labs/jumpusb/-/blob/master/local/distros.json
31 |
32 | After that, it downloads all the operating systems and uploads them to an
33 | S3 bucket using the same path that is defined in each object's path key.
34 | For example, the following:
35 |
36 | ```
37 | {
38 | "url": "https://mirrors.edge.kernel.org/zorinos-isos/16/Zorin-OS-16.1-Core-64-bit.iso",
39 | "url_axel": "https://{mirrors.edge.kernel.org/zorinos-isos,mirror2.sandyriver.net/pub/zorinos,mirror.clarkson.edu/zorinos/isos,distro.ibiblio.org/zorinos}/16/Zorin-OS-16.1-Core-64-bit.iso",
40 | "path": "/iso/zorin/zorin-16.1-amd64.iso",
41 | "persistence_base": "persistence_ext4_4GB_casper-rw.dat.7z",
42 | "persistence_file": "zorin.dat",
43 | "live": true
44 | }
45 | ```
46 |
47 | 1. Downloads the ISO with Axel using the `url_axel` URL (and falls back to the `url` if `url_axel` is not present)
48 | 2. Then uploads the file into the `/iso/zorin` directory of the S3 bucket where the file is named `zorin-16.1-amd64.iso
49 | env:
50 | DISTROS_TMP:
51 | sh: mktemp
52 | cmds:
53 | - curl -sSL https://gitlab.com/megabyte-labs/jumpusb/-/raw/master/local/distros.json > "$DISTROS_TMP"
54 | bucket:synchronize:
55 | deps:
56 | - :install:software:s5cmd
57 | summary: |
58 | # Synchronize S3 Buckets
59 |
60 | Synchronize the contents of one S3 bucket with another using s5cmd.
61 | cmds:
62 | - s5cmd sync '{{.SOURCE_BUCKET}}' '{{.DEST_BUCKET}}'
63 |
--------------------------------------------------------------------------------
/.config/taskfiles/lint/Taskfile-markdown.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | markdown:
6 | deps:
7 | - :install:modules:local
8 | - :install:npm:remark
9 | desc: Lint markdown files with `remark`
10 | summary: |
11 | # Lint markdown files
12 |
13 | This task uses `remark-lint` under the hood to provide markdown style recommendations.
14 |
15 | **Example scanning all markdown files:**
16 | `task lint:markdown`
17 |
18 | **Example scanning single markdown file:**
19 | `task lint:markdown -- TEST.md`
20 |
21 | For more information on `remark`, see the [GitHub page](https://github.com/remarkjs/remark).
22 |
23 | For more information on `remark-lint`, see the [GitHub page](https://github.com/remarkjs/remark-lint).
24 | log:
25 | error: Error running `remark`
26 | start: Filtering markdown files with `remark`
27 | success: Successfully filtered markdown files with `remark`
28 | cmds:
29 | - |
30 | {{if .CLI_ARGS}}
31 | remark {{.CLI_ARGS}}
32 | {{else}}
33 | while read PATHH; do
34 | remark --no-stdout "$PATHH" &
35 | done < <(find . -type d \( {{.IGNORE_FOLDERS}} \) -prune -o -type f \( -name '*.md' \))
36 | wait
37 | {{end}}
38 |
39 | markdown:links:
40 | deps:
41 | - :install:npm:markdown-link-check
42 | desc: Scan markdown files for broken links
43 | summary: |
44 | # Report any broken links in the files that end with .md
45 |
46 | This task uses the npm package called `markdown-link-check` to scan all the links
47 | and then report which ones are broken.
48 |
49 | **Example scanning the whole project:**
50 | `task lint:markdown-broken-links`
51 |
52 | **Example scanning single file:**
53 | `task lint:markdown-broken-links -- filename.md`
54 |
55 | For more information on `markdown-link-check`, see their [GitHub page](https://github.com/tcort/markdown-link-check).
56 | log:
57 | error: Errors reported by `markdown-link-check`
58 | start: Checking for broken links in markdown files with `markdown-link-check`
59 | success: Successfully passed `markdown-link-check`
60 | cmds:
61 | - |
62 | {{if .CLI_ARGS}}
63 | markdown-link-check {{.CLI_ARGS}}
64 | {{else}}
65 | find . -type d \( {{.IGNORE_FOLDERS}} \) -prune -o -type f \( -name '*.md' \) -print0 | xargs -0 -r -n1 markdown-link-check
66 | {{end}}
67 |
--------------------------------------------------------------------------------
/.config/taskfiles/lint/Taskfile-prose.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | prose:
6 | deps:
7 | - :install:pipx:proselint
8 | desc: Lint text/markdown for English prose with `proselint`
9 | summary: |
10 | # Lint for English Prose
11 |
12 | This task uses `proselint` to analyze markdown files for prose. It will generate recommendations
13 | based on typography, grammar, and wording.
14 |
15 | **Example scanning all markdown files:**
16 | `task lint:prose`
17 |
18 | **Example scanning specific file (markdown or not):**
19 | `task lint:prose -- myfile.js`
20 |
21 | For more information, see [Proselint's GitHub page](https://github.com/amperser/proselint).
22 | log:
23 | error: Error encountered while validating {{if .CLI_ARGS}}`{{.CLI_ARGS}}`{{else}}the project{{end}} with Proselint
24 | start: Linting {{if .CLI_ARGS}}`{{.CLI_ARGS}}`{{else}}the project{{end}} prose with Proselint
25 | success: Successfully validated {{if .CLI_ARGS}}`{{.CLI_ARGS}}`{{else}}the project{{end}} with Proselint
26 | cmds:
27 | - task: prose:config
28 | - |
29 | PATH="$PATH:$HOME/.local/bin"
30 | {{if .CLI_ARGS}}
31 | {{.PYTHON_HANDLE}}proselint {{.CLI_ARGS}}
32 | {{else}}
33 | find . -type d \( {{.IGNORE_FOLDERS}} \) -prune -o -type f \( -name '*.md' \) -print0 | xargs -0 -r -n1 {{.PYTHON_HANDLE}}proselint
34 | {{end}}
35 | - task: prose:config:restore
36 |
37 | prose:config:
38 | log:
39 | error: Error encountered while ensuring Proselint configuration is in proper location
40 | start: Moving Proselint configuration to proper location
41 | success: Ensured Proselint configuration is in proper location
42 | cmds:
43 | - |
44 | if [ -f ~/.config/proselint/config.json ]; then
45 | .config/log info 'Backing up `proselint` from `~/.config/proselint/config.json` to `~/.config/proselint/config.json.backup`'
46 | mv ~/.config/proselint/config.json ~/.config/proselint/config.json.backup
47 | fi
48 | - mkdir -p ~/.config/proselint
49 | - cp .config/proselint.json ~/.config/proselint/config.json
50 |
51 | prose:config:restore:
52 | log:
53 | error: Error restoring original Proselint configuration
54 | start: Restoring original Proselint configuration
55 | cmds:
56 | - mv ~/.config/proselint/config.json.backup ~/.config/proselint/config
57 | status:
58 | - '[ ! -f ~/.config/proselint/config.json.backup ]'
59 |
--------------------------------------------------------------------------------
/.config/docs/contributing/overview.md:
--------------------------------------------------------------------------------
1 | ## Overview
2 |
3 | Our VM images aim to be minimal, performant, and pretty. They are minimal because they remove unnecessary files and are compressed before uploading them to [VagrantUp](https://www.vagrantup.com/). Our images are performant because we choose the right configurations. We also ensure there is a seamless experience by including the Plymouth boot loader (which makes them _prettier_).
4 |
5 | A popular repository on GitHub called [chef/bento](https://github.com/chef/bento/tree/master/packer_templates) has already done most of the work we are trying to accomplish. They have Packer templates for everything we aim to support except [Archlinux]({{ repository.group.packer }}/base-archlinux-desktop) and [Mac OS X]({{ repository.group.packer }}/base-mac-desktop). Since it has a huge following, updates are likely to be provided. We use chef/bento's source wherever possible. They provide shell scripts that do a lot of the setup needed to initialize boxes. In each of our repositories (except Archlinux and Mac OS X), you can see that we symlink to a chef/bento submodule. By doing this, we are able to receive updates directly from our upstream code provider.
6 |
7 | However, chef/bento's work is not perfect for our use case. There are a few changes we make to each of our repositories. The `template.json` is reformatted to be neater and slightly easier to read. There are also additional scripts we run to convert the distribution into a desktop environment. These scripts that we make and add to the build routine all end with `.custom.sh` and are located in the `scripts/` folder.
8 |
9 | Ideally, five years from now, if you go to [our VagrantUp repositories]({{ profile.vagrant }}) you will be able to browse through all the various releases in any OS distribution. Our goal is to accomplish this through automation by:
10 |
11 | - Including the [vagrant-cloud post-processor](https://www.packer.io/docs/post-processors/vagrant-cloud)
12 | - Leveraging [LatestOS](https://pypi.org/project/latestos/) to automatically detect the latest release of the Linux variants we build boxes for
13 | - Running the builds on a cronjob
14 |
15 | ### Virtualization Platforms
16 |
17 | We aim to support the following virtualization platforms:
18 |
19 | - [Hyper-V]({{ repository.group.ansible_roles }}/hyperv)
20 | - [KVM]({{ repository.group.ansible_roles }}/kvm)
21 | - [Parallels]({{ repository.group.ansible_roles }}/parallels)
22 | - [VirtualBox]({{ repository.group.ansible_roles }}/virtualbox)
23 | - [VMWare]({{ repository.group.ansible_roles }}/vmware)
24 |
--------------------------------------------------------------------------------
/.config/taskfiles/symlink/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | ROLE_NAME: '{{.GALAXY_NAMESPACE}}.{{.GALAXY_ROLE_NAME}}'
6 |
7 | tasks:
8 | playbook:
9 | desc: Symlink all the roles in the roles/ folder to ~/.ansible/roles
10 | summary: |
11 | # Symlink each role to `~/.ansible/roles/{{.GALAXY_NAMESPACE}}.role_name`
12 |
13 | In the playbook, roles are sometimes referred to by their folder name and in other cases
14 | they are referred to with their namespace prepended (e.g. `{{.GALAXY_NAMESPACE}}.role_name`).
15 | This can cause issues so, in order for everything to work, each folder needs to be symlinked
16 | to `~/.ansible/roles` with the namespace prepended.
17 | log:
18 | error: Encountered an error while symlinking the roles
19 | start: Symlinking all roles in the `roles/` folder to `$HOME/.ansible/roles/`
20 | success: Successfully symlinked all the roles
21 | cmds:
22 | - mkdir -p "$HOME/.ansible/roles"
23 | - |
24 | while read ROLE_PATH; do
25 | ROLE_FOLDER="{{.GALAXY_NAMESPACE}}.$(basename "$ROLE_PATH")"
26 | if [ ! -d "$HOME/.ansible/roles/$ROLE_FOLDER" ]; then
27 | rm -rf "$HOME/.ansible/roles/$ROLE_FOLDER"
28 | ln -sf "$PWD/$ROLE_PATH" "$HOME/.ansible/roles/$ROLE_FOLDER"
29 | fi
30 | done < <(find ./roles -mindepth 2 -maxdepth 2 -type d)
31 | wait
32 | preconditions:
33 | - sh: test -d roles
34 | msg: The roles folder is missing. Is the project set up right?
35 |
36 | role:
37 | desc: Symlink the current role to ~/.ansible/roles/{{.ROLE_NAME}}
38 | summary: |
39 | # Symlink this role to `~/.ansible/roles/{{.ROLE_NAME}}`
40 |
41 | Roles are sometimes referred to by their folder name (which ideally is also the role_name in
42 | the `{{.META_PATH}}` file) and they are sometimes referred to by their Ansible Galaxy name which
43 | has the namespace prepended (e.g. `{{.ROLE_NAME}}`). In order to make sure Ansible
44 | can find the role in both cases, a symlink in `~/.ansible/roles` that points to the folder needs
45 | to be created.
46 | log:
47 | error: There was an error symlinking `{{.ROLE_NAME}}` to `$HOME/.ansible/roles/{{.ROLE_NAME}}`
48 | start: Symlinking `{{.ROLE_NAME}}` to `$HOME/.ansible/roles/{{.ROLE_NAME}}`
49 | success: Symlinked `{{.ROLE_NAME}}`
50 | cmds:
51 | - mkdir -p "$HOME/.ansible/roles"
52 | - rm -rf "$HOME/.ansible/roles/{{.ROLE_NAME}}"
53 | - ln -sf "$PWD" "$HOME/.ansible/roles/{{.ROLE_NAME}}"
54 |
--------------------------------------------------------------------------------
/.config/bash/try-catch.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Try / catch in bash
4 | #
5 | # ````
6 | # #!/bin/bash
7 | # export AnException=100
8 | # export AnotherException=101
9 | #
10 | # # start with a try
11 | # try
12 | # ( # open a subshell !!!
13 | # echo "do something"
14 | # [ someErrorCondition ] && throw $AnException
15 | #
16 | # echo "do something more"
17 | # executeCommandThatMightFail || throw $AnotherException
18 | #
19 | # throwErrors # automaticatly end the try block, if command-result is non-null
20 | # echo "now on to something completely different"
21 | # executeCommandThatMightFail
22 | #
23 | # echo "it's a wonder we came so far"
24 | # executeCommandThatFailsForSure || true # ignore a single failing command
25 | #
26 | # ignoreErrors # ignore failures of commands until further notice
27 | # executeCommand1ThatFailsForSure
28 | # local result = $(executeCommand2ThatFailsForSure)
29 | # [ result != "expected error" ] && throw $AnException # ok, if it's not an expected error, we want to bail out!
30 | # executeCommand3ThatFailsForSure
31 | #
32 | # # make sure to clear $ex_code, otherwise catch * will run
33 | # # echo "finished" does the trick for this example
34 | # echo "finished"
35 | # )
36 | # # directly after closing the subshell you need to connect a group to the catch using ||
37 | # catch || {
38 | # # now you can handle
39 | # case $ex_code in
40 | # $AnException)
41 | # echo "AnException was thrown"
42 | # ;;
43 | # $AnotherException)
44 | # echo "AnotherException was thrown"
45 | # ;;
46 | # *)
47 | # echo "An unexpected exception was thrown"
48 | # throw $ex_code # you can rethrow the "exception" causing the script to exit if not caught
49 | # ;;
50 | # esac
51 | # }
52 | # ```
53 | # Source: https://stackoverflow.com/a/25180186`
54 |
55 | # shellcheck disable=SC2034
56 | Logger="${BASH_SOURCE[0]}../log"
57 |
58 | # @description Turn on fail on errors mode
59 | function try() {
60 | [[ $- = *e* ]]; SAVED_OPT_E=$?
61 | set +e
62 | }
63 |
64 | # @description Turn on fail on errors mode
65 | function throw() {
66 | exit "$1"
67 | }
68 |
69 | # @description Turn on fail on errors mode
70 | function catch() {
71 | export ex_code=$?
72 | # shellcheck disable=SC2004
73 | (( $SAVED_OPT_E )) && set +e
74 | return $ex_code
75 | }
76 |
77 | # @description Turn on fail on errors mode
78 | function throwErrors() {
79 | set -e
80 | }
81 |
82 | # @description Do not fail on errors mode
83 | function ignoreErrors() {
84 | set +e
85 | }
86 |
--------------------------------------------------------------------------------
/.config/taskfiles/security/Taskfile-gpg.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | conf:
6 | vars:
7 | GPG_CONFIG: |
8 | # Source: https://raw.githubusercontent.com/drduh/config/master/gpg.conf
9 | personal-cipher-preferences AES256 AES192 AES
10 | personal-digest-preferences SHA512 SHA384 SHA256
11 | personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed
12 | default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed
13 | cert-digest-algo SHA512
14 | s2k-digest-algo SHA512
15 | s2k-cipher-algo AES256
16 | charset utf-8
17 | fixed-list-mode
18 | no-comments
19 | no-emit-version
20 | keyid-format 0xlong
21 | list-options show-uid-validity
22 | verify-options show-uid-validity
23 | with-fingerprint
24 | require-cross-certification
25 | no-symkey-cache
26 | use-agent
27 | throw-keyids
28 | cmds:
29 | - mkdir -p "{{if .CONFIG_DIR_PATH}}{{.CONFIG_DIR_PATH}}{{else}}$HOME/.gnupg{{end}}"
30 | - echo '{{.GPG_CONFIG}}' > "{{if .CONFIG_DIR_PATH}}{{.CONFIG_DIR_PATH}}{{else}}$HOME/.gnupg{{end}}/gpg.conf"
31 | status:
32 | - '[ -n "$YUBIKEY_BACKUP" ]'
33 |
34 | conf:agent:
35 | deps:
36 | - :install:software:pinentry
37 | vars:
38 | GPG_AGENT_CONFIG: |
39 | enable-ssh-support
40 | default-cache-ttl 60
41 | max-cache-ttl 120
42 | pinentry-program {{if (eq OS "linux")}}/usr/bin/pinentry-gnome3{{else}}/usr/local/bin/pinentry-mac{{end}}
43 | PROFILE_STRING: |
44 | ### GPG SSH Settings ###
45 | export GPG_TTY="$(tty)"
46 | export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
47 | gpgconf --launch gpg-agent
48 | cmds:
49 | - mkdir -p "{{if .CONFIG_DIR_PATH}}{{.CONFIG_DIR_PATH}}{{else}}$HOME/.gnupg{{end}}"
50 | - echo '{{.GPG_AGENT_CONFIG}}' > "{{if .CONFIG_DIR_PATH}}{{.CONFIG_DIR_PATH}}{{else}}$HOME/.gnupg{{end}}/gpg-agent.conf"
51 | - task: :install:profile:add
52 | vars:
53 | PROFILE_STRING: '{{.PROFILE_STRING}}'
54 | status:
55 | - '[ -n "$YUBIKEY_BACKUP" ]'
56 |
57 | donothing: 'true'
58 |
59 | public:import:file:
60 | todo: Polish
61 | cmds:
62 | - gpg --import /mnt/gpg-public/gpg-$KEYID*.asc
63 | - echo -e "trust\n5\ny" | gpg --command-fd 0 --edit-key "$KEYID"
64 | status:
65 | - '[ ! -f /mnt/gpg-public ]'
66 |
67 | public:import:server:
68 | todo: Add prompt for KEYID
69 | cmds:
70 | - gpg --recv $KEYID
71 | - echo -e "trust\n5\ny" | gpg --command-fd 0 --edit-key "$KEYID"
72 |
--------------------------------------------------------------------------------
/.config/taskfiles/security/Taskfile-disk.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | CRYPT_LABEL: '{{if .CRYPT_LABEL}}{{.CRYPT_LABEL}}{{else}}secret{{end}}'
6 | DISK_PATH: '{{if .DISK_PATH}}{{.DISK_PATH}}{{else}}{{.CLI_ARGS}}{{end}}'
7 | PARTITION_SIZE: '{{if .PARTITION_SIZE}}{{.PARTITION_SIZE}}{{else}}+25M{{end}}'
8 |
9 | env:
10 | GNUPGHOME:
11 | sh: echo "$HOME/.gnupghome"
12 |
13 | tasks:
14 | encrypt:create:
15 | summary: |
16 | # Encrypt a Disk (USB, etc.)
17 |
18 | This task will encrypt a disk (like a USB drive) as a single partition using
19 | the full disk space.
20 |
21 | **Usage example:**
22 |
23 | ```shell
24 | task security:disk:encrypt -- /dev/mmcblk0
25 | ```
26 |
27 | You can find the path of the USB / storage medium to pass to the CLI command
28 | by running `fdisk -l`.
29 | vars:
30 | DISK_LABEL: '{{if .DISK_LABEL}}{{.DISK_LABEL}}{{else}}gpg{{end}}'
31 | PARTITION_NUMBER: '{{if .PARTITION_NUMBER}}{{.PARTITION_NUMBER}}{{else}}1{{end}}'
32 | cmds:
33 | - sudo dd if=/dev/urandom of={{.DISK_PATH}} bs=4M status=progress
34 | - echo -e "o\nn\np\n{{.PARTITION_NUMBER}}\n{{.PARTITION_SIZE}}\nw" | sudo fdisk {{.DISK_PATH}}
35 | - echo -e "${MASTER_KEY}\n${MASTER_KEY}" | sudo cryptsetup -q luksFormat {{.DISK_PATH}}{{.PARTITION_NUMBER}}
36 | - echo -e "${MASTER_KEY}" | sudo cryptsetup -q luksOpen {{.DISK_PATH}}{{.PARTITION_NUMBER}} {{.CRYPT_LABEL}}
37 | - sudo mkfs.ext2 /dev/mapper/{{.CRYPT_LABEL}} -L {{.DISK_LABEL}}
38 | - sudo cryptsetup luksClose {{.CRYPT_LABEL}}
39 |
40 | encrypt:mount:
41 | vars:
42 | PARTITION_NUMBER: '{{if .PARTITION_NUMBER}}{{.PARTITION_NUMBER}}{{else}}1{{end}}'
43 | cmds:
44 | - echo -e "${MASTER_KEY}" | sudo cryptsetup -q luksOpen {{.DISK_PATH}}{{.PARTITION_NUMBER}} {{.CRYPT_LABEL}}
45 | - sudo mkdir /mnt/gpg-encrypted-storage
46 | - sudo mount /dev/mapper/{{.CRYPT_LABEL}} /mnt/gpg-encrypted-storage
47 |
48 | encrypt:unmount:
49 | cmds:
50 | - sudo umount /mnt/gpg-encrypted-storage
51 | - sudo cryptsetup luksClose {{.CRYPT_LABEL}}
52 |
53 | unencrypted:create:
54 | vars:
55 | PARTITION_NUMBER: '{{if .PARTITION_NUMBER}}{{.PARTITION_NUMBER}}{{else}}2{{end}}'
56 | cmds:
57 | - echo -e "o\nn\np\n{{.PARTITION_NUMBER}}\n{{.PARTITION_SIZE}}\nw" | sudo fdisk {{.DISK_PATH}}
58 | - sudo mkfs.ext2 {{.DISK_PATH}}{{.PARTITION_NUMBER}}
59 |
60 | unencrypted:mount:
61 | vars:
62 | PARTITION_NUMBER: '{{if .PARTITION_NUMBER}}{{.PARTITION_NUMBER}}{{else}}2{{end}}'
63 | cmds:
64 | - sudo mkdir /mnt/gpg-public
65 | - sudo mount {{.DISK_PATH}}{{.PARTITION_NUMBER}} /mnt/gpg-public
66 |
67 | unencrypted:unmount:
68 | cmds:
69 | - sudo umount /mnt/gpg-public
70 |
--------------------------------------------------------------------------------
/.config/taskfiles/vagrant/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | up:
6 | deps:
7 | - :install:software:jq
8 | - :install:software:vagrant
9 | desc: Select which virtualization platform to run the image on using an interactive prompt
10 | vars:
11 | PROMPT_OPTIONS:
12 | sh: |
13 | TMP="$(mktemp)"
14 | if type qemu-system-x86_64 &> /dev/null; then
15 | echo 'KVM' > "$TMP"
16 | fi
17 | if [[ '{{OS}}' == 'darwin' ]] && mdfind -name 'Parallels Desktop.app' &> /dev/null; then
18 | echo 'Parallels' > "$TMP"
19 | fi
20 | if type vboxmanage &> /dev/null; then
21 | echo 'VirtualBox' > "$TMP"
22 | fi
23 | if [[ '{{OS}}' == 'linux' ]] && type vmware &> /dev/null; then
24 | echo 'VMWare Workstation' > "$TMP"
25 | fi
26 | if [[ '{{OS}}' == 'darwin' ]] && type vmrun &> /dev/null; then
27 | echo 'VMWare Fusion' > "$TMP"
28 | fi
29 | LIST_LENGTH="$(jq -R -s -c -r 'split("\n") | length' < "$TMP")"
30 | if [ "$LIST_LENGTH" != '0' ]; then
31 | echo "\""$(jq -R -s -c -r 'split("\n") | join("\" \"")' < "$TMP")"\""
32 | else
33 | echo "None"
34 | fi
35 | cmds:
36 | - |
37 | if [[ '{{.PROMPT_OPTIONS' == 'None' ]]; then
38 | .config/log error 'No virtualization platforms installed. Install a platform (e.g. VirtualBox, VMWare, QEMU) to continue.' && exit 1
39 | else
40 | .config/log prompt 'Which desktop OS would you like to launch?'
41 | .config/log info 'Select "Other" to launch any OS from VagrantUp.com (TODO Implement feature)'
42 | OS_CHOICE="$(.config/log choose 'ArchLinux' 'CentOS' 'Debian' 'Fedora' 'macOS' 'Ubuntu' 'Windows' 'Other')"
43 | .config/log prompt 'Which virtualization platform would you like to use?'
44 | PLATFORM_CHOICE="$(.config/log choose '{{.PROMPT_OPTIONS}}')"
45 | if [[ "$PLATFORM_CHOICE" == 'KVM' ]]; then
46 | VAGRANT_UP_PROVIDER="libvirt"
47 | elif [[ "$PLATFORM_CHOICE" == 'Parallels' ]]; then
48 | VAGRANT_UP_PROVIDER="parallels"
49 | elif [[ "$PLATFORM_CHOICE" == 'VirtualBox' ]]; then
50 | VAGRANT_UP_PROVIDER="virtualbox"
51 | elif [[ "$PLATFORM_CHOICE" == 'VMWare Workstation' ]]; then
52 | VAGRANT_UP_PROVIDER="vmware_workstation"
53 | elif [[ "$PLATFORM_CHOICE" == 'VMWare Fusion' ]]; then
54 | VAGRANT_UP_PROVIDER="vmware_fusion"
55 | else
56 | .config/log error 'Unrecognized platform selection.'
57 | fi
58 | .config/log warn 'TODO Unfinished task - need to add in OS_CHOICE to vagrant up'
59 | vagrant up --provider="$VAGRANT_UP_PROVIDER"
60 | fi
61 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/SupportRequest.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: ⛑️ Support Request
3 | description: Find out how to get answers and/or submit a support request.
4 | labels: [question]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | ## 💬 Join Us on Slack!
10 | If you have general questions or need help implementing this project, you have several options:
11 |
12 | * Ask the question on **[our Slack channel](https://app.slack.com/client/T01ABCG4NK1/C01NN74H0LW/details/)** *Fast*
13 | * Submit a request here *Depends*
14 | * E-mail [help@megabyte.space](mailto:help@megabyte.space) *Slow*
15 | * Submit a request on any of the above for paid support (just mention you are interested in paid support) **Fastest**
16 |
17 | - type: textarea
18 | id: support
19 | attributes:
20 | label: ⛑️ Support Request
21 | description: Add your support request here. Detail exactly what you need help with.
22 | validations:
23 | required: true
24 |
25 | - type: input
26 | id: contributor
27 | attributes:
28 | label: 😀 Are you interested in paid support?
29 | description: '**Optional** For the fastest, most-effective support we offer paid services. If you are interested,
30 | answer *Yes* and we will get in contact with you immediately.'
31 | options:
32 | # yamllint disable-line rule:truthy
33 | - Yes
34 | # yamllint disable-line rule:truthy
35 | - No
36 | validations:
37 | required: false
38 |
39 | - type: input
40 | id: contributor
41 | attributes:
42 | label: 💬 How can we contact you?
43 | description: '**Optional** Add a way we can contact you here (especially if you want us to contact you immediately for paid support).'
44 | placeholder: 'Twitter: @MegabyteLabs, E-mail: help@megabyte.space, etc.'
45 | validations:
46 | required: false
47 |
48 | - type: markdown
49 | attributes:
50 | value: |
51 | ## :heart: Love Megabyte Labs?
52 |
53 | If you find **[Megabyte Labs](https://megabyte.space)** projects useful, please consider donating so we sustain our projects:
54 |
55 |
56 |
60 |
61 |
62 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/.config/docs/readme-cli/subheader.md:
--------------------------------------------------------------------------------
1 |
18 |
19 |
36 |
--------------------------------------------------------------------------------
/.config/taskfiles/python/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | build:
6 | deps:
7 | - :install:python:requirements
8 | desc: Build the project
9 | log:
10 | error: Encountered error while building the project with `poetry build`
11 | start: Building the project with `poetry build`
12 | success: Successfully built the project
13 | cmds:
14 | - task: clean
15 | - poetry build
16 |
17 | build:binary:
18 | deps:
19 | - :install:python:requirements
20 | desc: Build standalone binary
21 | log:
22 | error: Encountered error while building standalone Python binary with `PyInstaller`
23 | start: Building standalone Python binary with `PyInstaller`
24 | success: Successfully build standalone Python binary with `PyInstaller`
25 | cmds:
26 | - task: clean
27 | - |
28 | {{.PYTHON_HANDLE}}python -OO -m PyInstaller -F run.py
29 |
30 | clean:
31 | log:
32 | error: Encountered error while removing `build/` and `dist/`
33 | start: Removing `build/` and `dist/`
34 | success: Ensured `build/` and `dist/` are removed
35 | cmds:
36 | - rm -rf build
37 | - rm -rf dist
38 |
39 | global:reset:
40 | log:
41 | error: Error removing pip packages
42 | start: Removing pip packages
43 | success: Removed pip packages
44 | cmds:
45 | - cmd: if type pip &> /dev/null; then pip uninstall -y -r <(pip freeze); fi
46 | ignore_error: true
47 | - cmd: if type pip3 &> /dev/null; then pip3 uninstall -y -r <(pip3 freeze); fi
48 | ignore_error: true
49 |
50 | prepare:
51 | cmds:
52 | - .config/log info 'TODO Build the project'
53 |
54 | publish:
55 | deps:
56 | - :install:python:requirements
57 | desc: Publish the project to PyPi.org
58 | log:
59 | error: Error running `poetry publish`
60 | start: Running `poetry publish`
61 | success: '`poetry publish` executed successfully'
62 | cmds:
63 | - poetry publish
64 |
65 | requirementstxt:
66 | deps:
67 | - :install:python:requirements
68 | desc: Generate the requirements.txt fallback file
69 | log:
70 | error: Failed to generate `local/requirements.txt`
71 | start: Generating `local/requirements.txt`
72 | success: Generated `local/requirements.txt`
73 | cmds:
74 | - mkdir -p local
75 | - poetry export -f requirements.txt --output local/requirements.txt --without-hashes
76 | status:
77 | - '[ ! -f pyproject.toml ] || ! type poetry > /dev/null'
78 |
79 | run:
80 | deps:
81 | - :install:python:requirements
82 | desc: Runs the project by calling `run.py`
83 | log:
84 | error: Error running `{{.PYTHON_HANDLE}}python run.py`
85 | start: Running `{{.PYTHON_HANDLE}}python run.py`
86 | success: Successfully ran `{{.PYTHON_HANDLE}}python run.py`
87 | cmds:
88 | - |
89 | {{.PYTHON_HANDLE}}python run.py
90 |
91 | test:
92 | deps:
93 | - :install:python:requirements
94 | desc: Runs tests with `pytest` after fixing and linting
95 | log:
96 | start: Fixing, linting, and testing Python code
97 | success: Successfully fixed, linted, and tested Python code
98 | cmds:
99 | - task: :fix:python
100 | - task: :lint:python
101 | - task: :python:test:pytest
102 |
103 | verify:
104 | cmds:
105 | - .config/log info 'TODO Verify API key works with pypi.org'
106 |
--------------------------------------------------------------------------------
/.config/docs/readme-library/subheader.md:
--------------------------------------------------------------------------------
1 |
18 |
19 |
36 |
--------------------------------------------------------------------------------
/.config/taskfiles/common/Taskfile-util.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | MAP_FILE: .cache/task-map/Taskfile.json
6 |
7 | tasks:
8 | task:map:generate:
9 | deps:
10 | - :install:software:jq
11 | - :install:software:yq
12 | vars:
13 | MAP_FILE_QUERY: >-
14 | [.includes | with_entries(select(.value.optional == true)) | to_entries | .[] |
15 | { "key": .key, "value": .value.taskfile }] + (.includes | with_entries(select(.value.optional == null)) |
16 | to_entries) + { "key": "", "value": "Taskfile.yml" }
17 | log:
18 | error: Encountered error while generating Taskfile task map array
19 | start: Generating Taskfile task map array
20 | success: Successfully generated Taskfile task map array at `{{.MAP_FILE}}`
21 | cmds:
22 | - |
23 | COMBINED="$(mktemp)"
24 | echo '[]' > "$COMBINED"
25 | TMP_COMBINED="$(mktemp)"
26 | TMP_JQ="$(mktemp)"
27 | TMP_YQ="$(mktemp)"
28 | mkdir -p "$(dirname '{{.MAP_FILE}}')"
29 | yq e -o=j '{{.MAP_FILE_QUERY}}' Taskfile.yml > "{{.MAP_FILE}}"
30 | jq -c '.[]' "{{.MAP_FILE}}" | while read i; do
31 | PREFIX="$(echo "$i" | jq -r '.key')"
32 | FILE="$(echo "$i" | jq -r '.value')"
33 | if [ -f "$FILE" ]; then
34 | yq e -o=j '.tasks' "$FILE" > "$TMP_YQ"
35 | jq --arg prefix "$PREFIX:" '[to_entries | .[] | .key as $key | .value | ._task? = $prefix + $key]' "$TMP_YQ" > "$TMP_JQ"
36 | jq -s '.[0] + .[1]' "$COMBINED" "$TMP_JQ" > "$TMP_COMBINED"
37 | cp "$TMP_COMBINED" "$COMBINED"
38 | fi
39 | done
40 | mv "$COMBINED" '{{.MAP_FILE}}'
41 | sources:
42 | - .config/taskfiles/**/*.yml
43 | - Taskfile.yml
44 |
45 | task:tag:command:
46 | deps:
47 | - task:map:generate
48 | vars:
49 | TAG: '{{if .TAG}}{{.TAG}}{{else}}{{.CLI_ARGS}}{{end}}'
50 | TEMPLATE: 'task $i && '
51 | log:
52 | error: Encountered error while building Taskfile task list from tag named `{{.TAG}}`
53 | start: Selecting by Taskfile task tag named `{{.TAG}}`
54 | success: Wrote task tag command to `tag-command.txt`
55 | cmds:
56 | - |
57 | RESULT=""
58 | jq -cr '(.. | select(.tags?[]? == "{{.TAG}}")) | ._task' {{.MAP_FILE}} | while read i; do
59 | RESULT="$RESULT{{.TEMPLATE}}"
60 | done
61 | if [ '{{.TEMPLATE}}' == 'task $i && ' ]; then
62 | RESULT="$(echo $RESULT | sed 's/ && $//')"
63 | fi
64 | echo "$RESULT" > tag-command.txt
65 |
66 | task:tag:deps:
67 | deps:
68 | - task:map:generate
69 | vars:
70 | TAG: '{{if .TAG}}{{.TAG}}{{else}}{{.CLI_ARGS}}{{end}}'
71 | TEMPLATE: '- task: $i\n'
72 | log:
73 | error: Encountered error while building Taskfile task deps file from tag named `{{.TAG}}`
74 | start: Selecting by Taskfile task tag named `{{.TAG}}` for deps file
75 | success: Completed `Taskfile.yml` update logic for deps task named `deps:{{.TAG}}`
76 | cmds:
77 | - |
78 | RESULT=""
79 | COUNT="0"
80 | jq -r '(.. | select(.tags?[]? == "{{.TAG}}")) | ._task' {{.MAP_FILE}} | while read i; do
81 | COUNT="$(("$COUNT" + 1))"
82 | RESULT="$RESULT{{.TEMPLATE}}"
83 | done
84 | if [ "$COUNT" -gt 0 ]; then
85 | ARR="$(echo -e "$RESULT")" yq e -i '.tasks["deps:run:parallel"].cmds = env(ARR)' Taskfile.yml
86 | else
87 | .config/log warn 'There were no results so nothing was added to the `Taskfile.yml`'
88 | fi
89 |
--------------------------------------------------------------------------------
/.config/taskfiles/go/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | build:
6 | deps:
7 | - :install:software:jq
8 | vars:
9 | BUILD_COMMAND:
10 | sh: jq -r '.blueprint.build_command' package.json
11 | BUILD_OUTPUT:
12 | sh: jq -r '.blueprint.build_command_output' package.json
13 | cmds:
14 | - task: build:bin
15 | vars:
16 | BUILD_COMMAND: '{{.BUILD_COMMAND}}'
17 | BUILD_OUTPUT: '{{.BUILD_OUTPUT}}'
18 | status:
19 | - '[[ "{{.BUILD_COMMAND}}" == "null" ]] || [[ "{{.BUILD_OUTPUT}}" == "null" ]]'
20 |
21 | build:bin:
22 | deps:
23 | - :install:software:go
24 | log:
25 | error: Failed to build binary
26 | start: Running build command specified in `package.json` (defined under the `build_command` key in the `blueprint` section)
27 | success: Successfully built the binary
28 | cmds:
29 | - go mod tidy
30 | - '{{.BUILD_COMMAND}}'
31 | sources:
32 | - '**/*.go'
33 | generates:
34 | - '{{.BUILD_OUTPUT}}'
35 |
36 | help:
37 | deps:
38 | - build
39 | - :install:software:jq
40 | vars:
41 | BUILD_COMMAND:
42 | sh: jq -r '.blueprint.build_command' package.json
43 | BUILD_OUTPUT:
44 | sh: jq -r '.blueprint.build_command_output' package.json
45 | log:
46 | error: Failed to query binary help menu output
47 | start: Querying binary help menu output
48 | success: Successfully injected binary help menu output into `.variables.json`
49 | cmds:
50 | - |
51 | TMP_HELP="$(mktemp)"
52 | {{.BUILD_OUTPUT}} --help 2> "$TMP_HELP"
53 | TMP_VARS="$(mktemp)"
54 | jq --arg output "$(cat "$TMP_HELP")" '.help_menu_output = $output' .variables.json > "$TMP_VARS"
55 | mv "$TMP_VARS" .variables.json
56 | status:
57 | - '[[ "{{.BUILD_COMMAND}}" == "null" ]] || [[ "{{.BUILD_OUTPUT}}" == "null" ]]'
58 |
59 | prepare:
60 | cmds:
61 | - task: :go:goreleaser:build
62 |
63 | publish:
64 | cmds:
65 | - task: :go:goreleaser:release
66 | - task: publish:after
67 | - rm -rf dist
68 |
69 | publish:after:
70 | deps:
71 | - publish:after:docker
72 | - publish:after:fury
73 |
74 | publish:after:docker:
75 | summary: |
76 | Unsure why this is here and how it is useful.
77 | cmds:
78 | - .config/log warn 'Unused step go:publish:after:docker - pay attention to this only for debugging purposes'
79 | # cmds:
80 | # - |
81 | # for FILE in build/goreleaserdocker*; do
82 | # [ -e "$FILE" ] && task --dir "$FILE" docker:verify docker:build docker:publish
83 | # break
84 | # done
85 | # - rm -rf build/goreleaserdocker*
86 |
87 | publish:after:fury:
88 | deps:
89 | - :install:software:fury
90 | cmds:
91 | - fury push build/*.deb --account=$FURY_ACCOUNT --api-token=$FURY_DEPLOY_TOKEN
92 | - fury push build/*.rpm --account=$FURY_ACCOUNT --api-token=$FURY_DEPLOY_TOKEN
93 | status:
94 | - '[ -z "$FURY_ACCOUNT" ] || [ -z "$FURY_DEPLOY_TOKEN" ]'
95 |
96 | test:
97 | deps:
98 | - :install:software:go
99 | log:
100 | error: Failed to test Go sources
101 | start: Testing Go sources
102 | success: Successfully finished testing Go sources
103 | cmds:
104 | - go test ./...
105 |
106 | verify:
107 | cmds:
108 | - task: :go:goreleaser:check
109 | - task: :publish:snap:register
110 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-go.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | bin:
6 | run: once
7 | cmds:
8 | - task: install:go
9 | vars:
10 | BIN_NAME: bin
11 | PACKAGE: github.com/marcosnils/bin@latest
12 |
13 | bundle:
14 | deps:
15 | - bin
16 | - golangci-lint
17 | - goreleaser
18 | - minio
19 | - nfpm
20 | - ots
21 | - pup
22 |
23 | clean:
24 | cmds:
25 | - rm -rf "$GOPATH/pkg" "$GOPATH/src"
26 | status:
27 | - '[ -z "$GOPATH" ]'
28 |
29 | gitomatic:
30 | run: once
31 | cmds:
32 | - task: install:go
33 | vars:
34 | BIN_NAME: gitomatic
35 | PACKAGE: github.com/muesli/gitomatic@latest
36 |
37 | goconvey:
38 | run: once
39 | cmds:
40 | - task: install:go
41 | vars:
42 | BIN_NAME: goconvey
43 | PACKAGE: github.com/smartystreets/goconvey@latest
44 |
45 | golangci-lint:
46 | run: once
47 | cmds:
48 | - task: install:go
49 | vars:
50 | BIN_NAME: golangci-lint
51 | PACKAGE: github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0
52 |
53 | goofys:
54 | run: once
55 | cmds:
56 | - task: install:go
57 | vars:
58 | BIN_NAME: goofys
59 | PACKAGE: github.com/kahing/goofys@latest
60 |
61 | goreleaser:
62 | run: once
63 | tags:
64 | - semantic
65 | cmds:
66 | - task: install:go
67 | vars:
68 | BIN_NAME: goreleaser
69 | PACKAGE: github.com/goreleaser/goreleaser@latest
70 |
71 | gotestsum:
72 | run: once
73 | cmds:
74 | - task: install:go
75 | vars:
76 | BIN_NAME: gotestsum
77 | PACKAGE: gotest.tools/gotestsum@latest
78 |
79 | gum:
80 | run: once
81 | cmds:
82 | - task: install:go
83 | vars:
84 | BIN_NAME: gum
85 | PACKAGE: github.com/charmbracelet/gum@latest
86 |
87 | install:go:
88 | vars:
89 | BIN: '{{.BIN_NAME}}'
90 | run: when_changed
91 | log:
92 | error: Failed to install `{{.PACKAGE}}` with Go
93 | start: Installing Go package named `{{.PACKAGE}}`
94 | success: Successfully installed `{{.PACKAGE}}`
95 | cmds:
96 | - task: :install:software:go
97 | - go install {{.PACKAGE}}
98 | status:
99 | - type {{.BIN}} > /dev/null
100 |
101 | minio:
102 | run: once
103 | cmds:
104 | - task: install:go
105 | vars:
106 | BIN_NAME: mc
107 | PACKAGE: github.com/minio/mc@latest
108 |
109 | misspell:
110 | run: once
111 | cmds:
112 | - task: install:go
113 | vars:
114 | BIN_NAME: misspell
115 | PACKAGE: github.com/client9/misspell/cmd/misspell@latest
116 |
117 | nfpm:
118 | run: once
119 | tags:
120 | - semantic
121 | cmds:
122 | - task: install:go
123 | vars:
124 | BIN_NAME: nfpm
125 | PACKAGE: github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
126 |
127 | node-prune:
128 | run: once
129 | tags:
130 | - semantic
131 | cmds:
132 | - task: install:go
133 | vars:
134 | BIN_NAME: node-prune
135 | PACKAGE: github.com/tj/node-prune@latest
136 |
137 | ots:
138 | run: once
139 | cmds:
140 | - task: install:go
141 | vars:
142 | BIN_NAME: ots
143 | PACKAGE: github.com/sniptt-official/ots@latest
144 |
145 | pup:
146 | run: once
147 | cmds:
148 | - task: install:go
149 | vars:
150 | BIN_NAME: pup
151 | PACKAGE: github.com/ericchiang/pup@latest
152 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/BugReport.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🐛 Bug Report
3 | description: Stumbled upon an error? Submit a bug report.
4 | labels: [question]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | ## Yikes! That Was Not Supposed to Happen
10 |
11 | Sorry you had to find out the hard way that even the best software does not always work
12 | perfectly in every type of environment, 24/7. Your bug report is appreciated. After
13 | you have taken the time to gather the information needed to reproduce the issue, please
14 | fill out the bug report form below.
15 |
16 | - type: dropdown
17 | id: type
18 | attributes:
19 | label: ❔ What are you experiencing an issue with?
20 | options:
21 | - Latest Release
22 | - Prior Release
23 | - Development Issue
24 | - Documentation
25 | - Other
26 | validations:
27 | required: true
28 |
29 | - type: input
30 | id: version
31 | attributes:
32 | label: ❔ Version
33 | description: Enter the version number, the commit ID, or a link to the release that has the issue.
34 | placeholder: Version 2.4.0
35 | validations:
36 | required: true
37 |
38 | - type: textarea
39 | id: description
40 | attributes:
41 | label: 🐞 Description
42 | description: Enter a clear and concise description of the problem.
43 | validations:
44 | required: true
45 |
46 | - type: textarea
47 | id: steps
48 | attributes:
49 | label: ⏺️ Steps To Reproduce
50 | description: '**Optional** Enter the steps required to reproduce the behavior. Be sure to include environment
51 | information, as appropriate.'
52 | placeholder: |
53 | 1. In this environment...
54 | 2. With this config...
55 | 3. Run '...'
56 | 4. See error...
57 | validations:
58 | required: false
59 |
60 | - type: textarea
61 | id: logs
62 | attributes:
63 | label: 📒 Relevant Log Output
64 | description: '**Optional** Please copy and paste any relevant log output. This will be automatically formatted into
65 | code, so no need for backticks.'
66 | render: shell
67 | validations:
68 | required: false
69 |
70 | - type: textarea
71 | id: solution
72 | attributes:
73 | label: 💡 Possible Solution
74 | description: '**Optional** Enter suggestions on a fix/reason for the bug if you have any.'
75 | validations:
76 | required: false
77 |
78 | - type: markdown
79 | attributes:
80 | value: |
81 | ## :heart: Love Megabyte Labs?
82 |
83 | If you find **[Megabyte Labs](https://megabyte.space)** projects useful, please consider donating so we sustain our projects:
84 |
85 |
86 |
90 |
91 |
92 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Vagrantfile.template:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.require_version ">= 1.6.2"
5 |
6 | Vagrant.configure("2") do |config|
7 | config.vm.define "Windows-10-Desktop"
8 | config.vm.box = "Megabyte/Windows-Desktop"
9 | config.vm.communicator = "winrm"
10 |
11 | # Admin user name and password
12 | config.winrm.username = "vagrant"
13 | config.winrm.password = "vagrant"
14 |
15 | config.vm.guest = :windows
16 | config.windows.halt_timeout = 15
17 |
18 | config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true
19 | config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true
20 |
21 | config.vm.provider :virtualbox do |v, override|
22 | #v.gui = true
23 | v.customize ["modifyvm", :id, "--memory", 4096]
24 | v.customize ["modifyvm", :id, "--cpus", 2]
25 | v.customize ["modifyvm", :id, "--vram", 128]
26 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
27 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
28 | end
29 |
30 | config.vm.provider :vmware_fusion do |v, override|
31 | v.vmx["memsize"] = "4096"
32 | v.vmx["numvcpus"] = "2"
33 | v.vmx["ethernet0.virtualDev"] = "vmxnet3"
34 | v.vmx["RemoteDisplay.vnc.enabled"] = "false"
35 | v.vmx["RemoteDisplay.vnc.port"] = "5900"
36 | v.vmx["scsi0.virtualDev"] = "lsisas1068"
37 | v.vmx["gui.fitguestusingnativedisplayresolution"] = "TRUE"
38 | v.vmx["mks.enable3d"] = "TRUE"
39 | v.vmx["mks.forceDiscreteGPU"] = "TRUE"
40 | v.vmx["gui.fullscreenatpoweron"] = "TRUE"
41 | v.vmx["gui.viewmodeatpoweron"] = "fullscreen"
42 | v.vmx["gui.lastPoweredViewMode"] = "fullscreen"
43 | v.vmx["sound.startconnected"] = "FALSE"
44 | v.vmx["sound.present"] = "FALSE"
45 | v.vmx["sound.autodetect"] = "TRUE"
46 | v.enable_vmrun_ip_lookup = false
47 | v.whitelist_verified = true
48 | v.vmx["hgfs.linkRootShare"] = "FALSE"
49 | end
50 |
51 | config.vm.provider :vmware_workstation do |v, override|
52 | v.gui = true
53 | v.vmx["memsize"] = "4096"
54 | v.vmx["numvcpus"] = "2"
55 | v.vmx["ethernet0.virtualDev"] = "vmxnet3"
56 | v.vmx["RemoteDisplay.vnc.enabled"] = "false"
57 | v.vmx["RemoteDisplay.vnc.port"] = "5900"
58 | v.vmx["scsi0.virtualDev"] = "lsisas1068"
59 | v.enable_vmrun_ip_lookup = false
60 | v.whitelist_verified = true
61 | v.vmx["hgfs.linkRootShare"] = "FALSE"
62 | end
63 |
64 | config.vm.provider "hyperv" do |v|
65 | v.cpus = 2
66 | v.maxmemory = 4096
67 | v.linked_clone = true
68 | end
69 |
70 | config.vm.provider :libvirt do |libvirt, override|
71 | libvirt.memory = 4096
72 | libvirt.cpus = 2
73 |
74 | # Use WinRM for the default synced folder; or disable it if
75 | # WinRM is not available. Linux hosts don't support SMB,
76 | # and Windows guests don't support NFS/9P/rsync
77 | # See https://github.com/Cimpress-MCP/vagrant-winrm-syncedfolders
78 | if Vagrant.has_plugin?("vagrant-winrm-syncedfolders")
79 | override.vm.synced_folder ".", "/vagrant", type: "winrm"
80 | else
81 | override.vm.synced_folder ".", "/vagrant", disabled: true
82 | end
83 |
84 | # Enable Hyper-V enlightments, see
85 | # https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html
86 | libvirt.hyperv_feature :name => 'stimer', :state => 'on'
87 | libvirt.hyperv_feature :name => 'relaxed', :state => 'on'
88 | libvirt.hyperv_feature :name => 'vapic', :state => 'on'
89 | libvirt.hyperv_feature :name => 'synic', :state => 'on'
90 | end
91 | end
92 |
--------------------------------------------------------------------------------
/.config/taskfiles/publish/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | tasks:
5 | app:beta:
6 | deps:
7 | - :publish:android:beta
8 | - :publish:chrome:private
9 | - :publish:firefox:private
10 | - :publish:ios:beta
11 | - :publish:opera:private
12 | desc: Publish a beta release of all the release targets
13 | hide: '{{ne (print .REPOSITORY_TYPE "-" .REPOSITORY_SUBTYPE) "angular-app"}}'
14 | log:
15 | error: Error publishing beta release
16 | start: Publishing beta release
17 | success: Finished publishing beta release
18 |
19 | app:release:
20 | deps:
21 | - :publish:android:release
22 | - :publish:brew:cask
23 | - :publish:chrome:release
24 | - :publish:firefox:release
25 | - :publish:ios:release
26 | - :publish:opera:release
27 | - :publish:menubar:release
28 | desc: Publish a production release of all the targets
29 | hide: '{{ne (print .REPOSITORY_TYPE "-" .REPOSITORY_SUBTYPE) "angular-app"}}'
30 | summary: |
31 | This task is used to release Angular applications.
32 | log:
33 | error: Error publishing `production` release
34 | start: Publishing `production` release
35 | success: Successfully published `production` release
36 |
37 | semantic-release:
38 | deps:
39 | - task: :install:modules:local
40 | vars:
41 | SEMANTIC_RELEASE:
42 | sh: echo true
43 | - :install:npm:semantic-release
44 | - :install:software:git
45 | vars:
46 | RELEASE_PREFIX:
47 | sh: if [ -f setup.cfg ]; then echo 'poetry run '; else echo ''; fi
48 | RUN_OPTIONS: '{{if .CLI_ARGS}} {{.CLI_ARGS}}{{else}} --ci false --debug --dry-run false{{end}}'
49 | env:
50 | GIT_CREDENTIALS:
51 | sh: |
52 | if [ -n "$CI" ]; then
53 | echo "gitlab-ci-token:$CI_BUILD_TOKEN"
54 | fi
55 | HUSKY: '0'
56 | PUBLISHING: 'true'
57 | SEMANTIC_RELEASE: 'true'
58 | log:
59 | error: Error while running `semantic-release`
60 | start: Releasing with `semantic-release`..
61 | success: Finished running `semantic-release`
62 | cmds:
63 | - git fetch --tags -f
64 | - task: semantic-release:prepare
65 | - |
66 | {{.RELEASE_PREFIX}}semantic-release -r "$(git remote get-url origin)"{{.RUN_OPTIONS}}
67 | - git push all master || git push origin master
68 |
69 | semantic-release:build:
70 | cmds:
71 | - rm -rf artifacts build dist
72 | - task: :release:build
73 |
74 | semantic-release:poetry:
75 | deps:
76 | - :install:software:poetry
77 | cmds:
78 | - poetry install -E semantic
79 | status:
80 | - '[ ! -f setup.cfg ]'
81 |
82 | semantic-release:prepare:
83 | deps:
84 | - task: :install:modules:local:sync
85 | vars:
86 | NPM_KEEP_UPDATED: '{{.SEMANTIC_CONFIG}}'
87 | - :common:update:variables
88 | - :npm:config
89 | - semantic-release:build
90 | - semantic-release:poetry
91 | - version:tag
92 |
93 | version:tag:
94 | deps:
95 | - :ci:commit:config
96 | - :install:software:jq
97 | summary: |
98 | This command is intended to be used before the `semantic-release` task to ensure
99 | that the latest git tag is up-to-date with the latest `package.json` version.
100 | cmds:
101 | - git fetch --all --tags -f
102 | - git tag "v$(jq -r '.version' package.json)"
103 | status:
104 | - git tag | grep "v$(jq -r '.version' package.json)"
105 | preconditions:
106 | - sh: '[ -f package.json ]'
107 | msg: A package.json file must be present!
108 | - sh: '[ "$(jq -r \".version\" package.json)" != "null" ]'
109 | msg: Version must be defined in package.json
110 |
--------------------------------------------------------------------------------
/.config/taskfiles/upstream/Taskfile-docs.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | COMMON_FILES_URL: https://gitlab.com/megabyte-labs/common/shared.git
6 | COMMON_FOLDER: .common
7 | SHARED_DOCS_URL: https://gitlab.com/megabyte-labs/documentation/shared.git
8 | SHARED_FOLDER: .shared
9 |
10 | tasks:
11 | clean:
12 | deps:
13 | - clean:common
14 | - clean:shared
15 |
16 | clean:common:
17 | log:
18 | error: Error running `rm -rf {{.COMMON_FOLDER}}`
19 | start: Running `rm -rf {{.COMMON_FOLDER}}`
20 | success: Successfully ran `rm -rf {{.COMMON_FOLDER}}`
21 | cmds:
22 | - rm -rf {{.COMMON_FOLDER}}
23 |
24 | clean:shared:
25 | log:
26 | error: Error running `rm -rf {{.SHARED_FOLDER}}`
27 | start: Running `rm -rf {{.SHARED_FOLDER}}`
28 | success: Successfully ran `rm -rf {{.SHARED_FOLDER}}`
29 | cmds:
30 | - rm -rf {{.SHARED_FOLDER}}
31 |
32 | clone:
33 | deps:
34 | - clone:common
35 | - clone:shared
36 |
37 | clone:common:
38 | log:
39 | error: Error encountered in clone logic for {{.COMMON_FILES_URL}}
40 | start: Cloning {{.COMMON_FILES_URL}}
41 | success: Successfully cloned {{.COMMON_FILES_URL}}
42 | cmds:
43 | - rm -rf {{.COMMON_FOLDER}}
44 | - git clone --depth=1 {{.COMMON_FILES_URL}} {{.COMMON_FOLDER}}
45 | - rm -rf {{.COMMON_FOLDER}}/.git
46 |
47 | clone:shared:
48 | log:
49 | error: Error encountered in clone logic for {{.SHARED_DOCS_URL}}
50 | start: Cloning {{.SHARED_DOCS_URL}}
51 | success: Successfully cloned {{.SHARED_DOCS_URL}}
52 | cmds:
53 | - rm -rf {{.SHARED_FOLDER}}
54 | - git clone --depth=1 {{.SHARED_DOCS_URL}} {{.SHARED_FOLDER}}
55 | - rm -rf {{.SHARED_FOLDER}}/.git
56 |
57 | copy:
58 | deps:
59 | - :install:software:yq
60 | log:
61 | error: Error encountered in copy sequence
62 | start: Beginning copy sequence
63 | success: Completed copy sequence
64 | cmds:
65 | - mv .gitlab-ci.yml old.gitlab-ci.yml
66 | - task: copy:before
67 | - |
68 | yq eval-all -i 'select(fileIndex == 0) * select(fileIndex == 1)' old.gitlab-ci.yml .gitlab-ci.yml
69 | mv old.gitlab-ci.yml .gitlab-ci.yml
70 | - cp {{.SHARED_FOLDER}}/.gitlab-ci.yml .gitlab-ci.yml
71 |
72 | copy:before:
73 | deps:
74 | - copy:common
75 | - copy:shared
76 |
77 | copy:common:
78 | deps:
79 | - :install:software:coreutils
80 | log:
81 | error: Error copying common files
82 | start: Copying common files
83 | success: Copied common files
84 | cmds:
85 | - |
86 | {{if (eq OS "darwin")}}PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"{{end}}
87 | cp -rT ./{{.COMMON_FOLDER}}/common/ .
88 | - task: :common:husky:permissions
89 |
90 | copy:shared:
91 | log:
92 | error: Error encountered while copying shared files
93 | start: Copying shared files
94 | success: Copied shared files
95 | cmds:
96 | - rm -rf common
97 | - mv {{.SHARED_FOLDER}}/common common
98 | - mv {{.SHARED_FOLDER}}/README.md README.md
99 | - mkdir -p docs
100 | - mv {{.SHARED_FOLDER}}/docs/CONTRIBUTING.md docs/CONTRIBUTING.md
101 |
102 | merge:
103 | deps:
104 | - :install:software:jq
105 | log:
106 | error: Error combining common.json files
107 | start: Combining common.json files
108 | success: Combined common.json files
109 | cmds:
110 | - jq -s -S '.[0] * .[1]' {{.SHARED_FOLDER}}/common.json common.json > variables.json
111 |
112 | template:
113 | cmds:
114 | - task: :upstream:variables
115 | vars:
116 | INPUT_FILE: variables.json
117 | OUTPUT_FILE: ./.variables.json
118 | - task: :upstream:template
119 |
--------------------------------------------------------------------------------
/.config/docs/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "build": {
3 | "args": {
4 | "DOCKER_VERSION": "latest",
5 | "ENABLE_NONROOT_DOCKER": "true",
6 | "INSTALL_ZSH": "true",
7 | "UPGRADE_PACKAGES": "true",
8 | "USERNAME": "megabyte",
9 | "USE_MOBY": "true"
10 | }
11 | },
12 | "dockerFile": "Dockerfile",
13 | "extensions": [
14 | "Angular.ng-template",
15 | "attilabuti.vscode-mjml",
16 | "bierner.markdown-emoji",
17 | "ChakrounAnas.turbo-console-log",
18 | "ChFlick.firecode",
19 | "chrmarti.regex",
20 | "CoenraadS.bracket-pair-colorizer",
21 | "cweijan.vscode-mysql-client2",
22 | "DavidAnson.vscode-markdownlint",
23 | "dbaeumer.vscode-eslint",
24 | "denoland.vscode-deno",
25 | "dracula-theme.theme-dracula",
26 | "drewbourne.vscode-remark-lint",
27 | "eamodio.gitlens",
28 | "EditorConfig.EditorConfig",
29 | "esbenp.prettier-vscode",
30 | "ericadamski.carbon-now-sh",
31 | "firefox-devtools.vscode-firefox-debug",
32 | "firsttris.vscode-jest-runner",
33 | "formulahendry.auto-rename-tag",
34 | "formulahendry.code-runner",
35 | "foxundermoon.shell-format",
36 | "GitHub.vscode-pull-request-github",
37 | "GitLab.gitlab-workflow",
38 | "GoogleCloudTools.cloudcode",
39 | "golang.Go",
40 | "HashiCorp.terraform",
41 | "hediet.vscode-drawio",
42 | "IBM.output-colorizer",
43 | "johnpapa.vscode-peacock",
44 | "Kelvin.vscode-sshfs",
45 | "KnisterPeter.vscode-commitizen",
46 | "kruemelkatze.vscode-dashboard",
47 | "mads-hartmann.bash-ide-vscode",
48 | "mechatroner.rainbow-csv",
49 | "msjsdiag.debugger-for-chrome",
50 | "msjsdiag.debugger-for-edge",
51 | "ms-azuretools.vscode-docker",
52 | "ms-kubernetes-tools.vscode-kubernetes-tools",
53 | "ms-vscode-remote.remote-containers",
54 | "ms-vscode-remote.remote-ssh",
55 | "ms-vscode-remote.remote-wsl",
56 | "ms-python.python",
57 | "ms-vscode.PowerShell",
58 | "ms-vscode.vscode-typescript-tslint-plugin",
59 | "MS-vsliveshare.vsliveshare",
60 | "MS-vsliveshare.vsliveshare-audio",
61 | "njpwerner.autodocstring",
62 | "nrwl.angular-console",
63 | "paulvarache.vscode-taskfile",
64 | "philnash.ngrok-for-vscode",
65 | "PKief.material-icon-theme",
66 | "pnp.polacode",
67 | "pranaygp.vscode-css-peek",
68 | "quicktype.quicktype",
69 | "RandomFractalsInc.vscode-data-preview",
70 | "rbbit.typescript-hero",
71 | "redhat.ansible",
72 | "redhat.vscode-yaml",
73 | "richie5um2.vscode-sort-json",
74 | "Rubymaniac.vscode-paste-and-indent",
75 | "salbert.comment-ts",
76 | "shd101wyy.markdown-preview-enhanced",
77 | "snipsnapdev.snipsnap-vscode",
78 | "softwaredotcom.swdc-vscode",
79 | "steoates.autoimport",
80 | "stylelint.vscode-stylelint",
81 | "TabNine.tabnine-vscode",
82 | "timonwong.shellcheck",
83 | "toba.vsfire",
84 | "tyriar.sort-lines",
85 | "usernamehw.errorlens",
86 | "valentjn.vscode-ltex",
87 | "VisualStudioExptTeam.vscodeintellicode",
88 | "vsciot-vscode.vscode-arduino",
89 | "vsls-contrib.codetour",
90 | "vsls-contrib.gistfs",
91 | "WallabyJs.quokka-vscode",
92 | "wayou.vscode-todo-highlight",
93 | "wix.vscode-import-cost",
94 | "yatki.vscode-surround"
95 | ],
96 | "forwardPorts": [2222, 5901, 6080, 8001, 8014],
97 | "hostRequirements": {
98 | "cpus": 2,
99 | "memory": "8gb",
100 | "storage": "16gb"
101 | },
102 | "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
103 | "name": "Megabyte Labs DevContainer Code Rocket Pack",
104 | "overrideCommand": false,
105 | "postCreateCommand": "task start",
106 | "remoteUser": "megabyte",
107 | "runArgs": ["--init", "--privileged", "--shm-size=4g"],
108 | "settings": {}
109 | }
110 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "[html]": {
3 | "editor.defaultFormatter": "esbenp.prettier-vscode"
4 | },
5 | "[javascript]": {
6 | "editor.defaultFormatter": "esbenp.prettier-vscode"
7 | },
8 | "[javascriptreact]": {
9 | "editor.defaultFormatter": "esbenp.prettier-vscode"
10 | },
11 | "[json5]": {
12 | "editor.defaultFormatter": "esbenp.prettier-vscode"
13 | },
14 | "[json]": {
15 | "editor.defaultFormatter": "esbenp.prettier-vscode"
16 | },
17 | "[jsonc]": {
18 | "editor.defaultFormatter": "esbenp.prettier-vscode"
19 | },
20 | "[markdown]": {
21 | "editor.defaultFormatter": "esbenp.prettier-vscode"
22 | },
23 | "[toml]": {
24 | "editor.defaultFormatter": "esbenp.prettier-vscode"
25 | },
26 | "[typescript]": {
27 | "editor.defaultFormatter": "esbenp.prettier-vscode"
28 | },
29 | "[typescriptreact]": {
30 | "editor.defaultFormatter": "esbenp.prettier-vscode"
31 | },
32 | "[vue]": {
33 | "editor.defaultFormatter": "esbenp.prettier-vscode"
34 | },
35 | "[yaml]": {
36 | "editor.defaultFormatter": "esbenp.prettier-vscode"
37 | },
38 | "codetour.customTourDirectory": ".config/codetour.yml",
39 | "editor.defaultFormatter": "esbenp.prettier-vscode",
40 | "editor.formatOnPaste": false,
41 | "editor.formatOnSave": true,
42 | "eslint.alwaysShowStatus": true,
43 | "eslint.format.enable": true,
44 | "eslint.lintTask.enable": true,
45 | "eslint.lintTask.options": "-c package.json --no-eslintrc --cache --cache-location .cache/eslintcache .",
46 | "eslint.packageManager": "pnpm",
47 | "eslint.validate": [
48 | "html",
49 | "javascript",
50 | "javascriptreact",
51 | "json",
52 | "jsonc",
53 | "json5",
54 | "markdown",
55 | "toml",
56 | "typescript",
57 | "typescriptreact",
58 | "vue",
59 | "yaml"
60 | ],
61 | "git.autoStash": true,
62 | "git.autofetch": true,
63 | "github.codespaces.showPerformanceExplorer": true,
64 | "gitlab.showPipelineUpdateNotifications": true,
65 | "gitlens.showWelcomeOnInstall": false,
66 | "gitlens.showWhatsNewAfterUpgrades": false,
67 | "go.lintFlags": ["--fast"],
68 | "go.lintTool": "golangci-lint",
69 | "html.format.endWithNewline": true,
70 | "html.format.indentHandlebars": true,
71 | "html.format.indentInnerHtml": true,
72 | "html.format.templating": true,
73 | "javascript.format.semicolons": "remove",
74 | "javascript.suggest.completeFunctionCalls": true,
75 | "ltex.additionalRules.enablePickyRules": true,
76 | "ltex.completionEnabled": true,
77 | "markdown-preview-enhanced.previewTheme": "solarized-light.css",
78 | "material-icon-theme.showWelcomeMessage": false,
79 | "merge-conflict.autoNavigateNextConflict.enabled": true,
80 | "npm.enableRunFromFolder": true,
81 | "npm.packageManager": "pnpm",
82 | "prettier.printWidth": 120,
83 | "prettier.singleQuote": true,
84 | "python.languageServer": "Pylance",
85 | "security.workspace.trust.banner": "never",
86 | "security.workspace.trust.enabled": false,
87 | "telemetry.telemetryLevel": "crash",
88 | "typescript.enablePromptUseWorkspaceTsdk": true,
89 | "typescript.format.semicolons": "remove",
90 | "typescript.implementationsCodeLens.enabled": true,
91 | "typescript.inlayHints.enumMemberValues.enabled": true,
92 | "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
93 | "typescript.inlayHints.parameterTypes.enabled": true,
94 | "typescript.inlayHints.variableTypes.enabled": true,
95 | "typescript.preferences.quoteStyle": "single",
96 | "typescript.referencesCodeLens.enabled": true,
97 | "typescript.referencesCodeLens.showOnAllFunctions": true,
98 | "typescript.suggest.completeFunctionCalls": true,
99 | "typescript.tsdk": "node_modules/typescript/lib",
100 | "workbench.startupEditor": "readme",
101 | "workbench.welcomePage.walkthroughs.openOnInstall": false,
102 | "yaml.format.printWidth": 160,
103 | "yaml.format.singleQuote": true
104 | }
105 |
--------------------------------------------------------------------------------
/.config/taskfiles/git/Taskfile-hook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | GIT_NOTIFY_COLOR: '#0450ec'
6 |
7 | tasks:
8 | commit-msg:
9 | deps:
10 | - :lint:commit
11 | log:
12 | error: '`commit-msg` hook encountered an error!'
13 | start: '`commit-msg` hook running..'
14 |
15 | post-checkout:
16 | deps:
17 | - :install:npm:git-notify
18 | - :install:npm:yarnhook
19 | log:
20 | error: '`post-checkout` hook encountered an error!'
21 | start: '`post-checkout` hook running..'
22 | cmds:
23 | - git-notify checkout --prefix "@notify" --color "{{.GIT_NOTIFY_COLOR}}" "$GIT_PARAMS"
24 | - yarnhook
25 |
26 | post-commit:
27 | log:
28 | error: '`post-commit` hook encountered an error!'
29 | start: '`post-commit` hook running..'
30 | cmds:
31 | - 'true'
32 |
33 | post-merge:
34 | deps:
35 | - :install:npm:git-notify
36 | - :install:npm:yarnhook
37 | log:
38 | error: '`post-merge` hook encountered an error!'
39 | start: '`post-merge` hook running..'
40 | cmds:
41 | - git-notify merge --prefix "@notify" --color "{{.GIT_NOTIFY_COLOR}}" "$GIT_PARAMS"
42 | - yarnhook
43 |
44 | post-rewrite:
45 | deps:
46 | - :install:npm:git-notify
47 | - :install:npm:yarnhook
48 | log:
49 | error: '`post-rewrite` hook encountered an error!'
50 | start: '`post-rewrite` hook running..'
51 | cmds:
52 | - git-notify rewrite --prefix "@notify" --color "{{.GIT_NOTIFY_COLOR}}" "$GIT_PARAMS"
53 | - yarnhook
54 |
55 | pre-commit:
56 | deps:
57 | - :fix:json
58 | - :fix:misc
59 | - :security:gitleaks
60 | - :security:private-keys
61 | log:
62 | error: '`pre-commit` hook encountered an error!'
63 | start: '`pre-commit` hook running..'
64 |
65 | pre-push:
66 | vars:
67 | GITHUB_TOKEN:
68 | sh: echo "$GITHUB_TOKEN"
69 | GITLAB_TOKEN:
70 | sh: echo "$GITLAB_TOKEN"
71 | log:
72 | error: '`pre-push` hook encountered an error!'
73 | start: '`pre-push` hook running..'
74 | cmds:
75 | - |
76 | REMOTE={{index (split " " (trimAll "'" .CLI_ARGS)) "_0"}}
77 | URL={{index (split " " (trimAll "'" .CLI_ARGS)) "_1" | replace .GITLAB_TOKEN "" | replace .GITHUB_TOKEN ""}}
78 | if [[ $URL == http* ]]; then
79 | URL="$(echo $URL | sed 's/^[^@]*@/git@/')"
80 | fi
81 | HOST="$(echo $URL | sed 's/^.*@//' | sed 's/:.*$//')"
82 | ORG="$(echo $URL | sed 's/^.*://' | sed 's/\/.*$//')"
83 | PROJECT="$(echo $URL | sed 's/^[^\/]*\///' | sed 's/.[^\.]*$//')"
84 | IFS=' '
85 | while read local_ref local_sha remote_ref remote_sha; do
86 | # local_ref -> refs/heads/master
87 | # local_sha -> b14959a077c9b6ced19c29d5ba9c75ddbad5d3ea
88 | # remote_ref -> refs/heads/master
89 | # remote_sha -> 9901a2eb2f34d5744276a80c4b339a88a92a7b53
90 | REMOTE_BRANCH="$(echo $remote_ref | sed 's/^[^\/]*\/[^\/]*\///')"
91 | if [ "$(echo "$HOST" | cut -c1-8)" == 'https://' ]; then
92 | HOST="$(echo "$HOST" | cut -c8)"
93 | fi
94 | .config/log star "Repository -----> https://$HOST/$ORG/$PROJECT"
95 | if [ "$HOST" == 'gitlab.com' ]; then
96 | if [ "$REMOTE_BRANCH" != 'master' ]; then
97 | .config/log star "Open PR --------> https://$HOST/$ORG/$PROJECT/-/merge_requests/new"
98 | fi
99 | .config/log star "View commit ----> https://$HOST/$ORG/$PROJECT/-/commit/$local_sha"
100 | elif [ "$HOST" == 'github.com' ]; then
101 | if [ "$REMOTE_BRANCH" != 'master' ]; then
102 | .config/log star "Open PR --------> https://$HOST/$ORG/$PROJECT/pull/new/$REMOTE_BRANCH"
103 | fi
104 | .config/log star "View commit ----> https://$HOST/$ORG/$PROJECT/commit/$local_sha"
105 | fi
106 | done
107 |
--------------------------------------------------------------------------------
/.config/taskfiles/ansible/Taskfile-ansibler.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | MAIN_TASKS_PATH: tasks/main.yml
6 | META_PATH: meta/main.yml
7 | MOLECULE_RESULTS_PATH: molecule/.results/logs
8 | REQUIREMENTS_PATH: requirements.yml
9 | VARIABLES_PATH: .variables.json
10 |
11 | tasks:
12 | ansibler:
13 | deps:
14 | - :install:pipx:ansibler
15 | cmds:
16 | - task: compatibility-chart
17 | - task: populate-platforms
18 | - task: tasks:{{.REPOSITORY_SUBTYPE}}
19 |
20 | compatibility-chart:
21 | deps:
22 | - :install:software:jq
23 | log:
24 | error: Failed to generate operating system compatibility chart
25 | start: Generating operating system compatibility chart
26 | success: Successfully generated operating system compatibility chart
27 | cmds:
28 | - mkdir -p .cache
29 | - if [ ! -f .cache/compatibility-chart.json ]; then echo "{}" > .cache/compatibility-chart.json; fi
30 | - task: compatibility-chart:generate
31 | - |
32 | TMP="$(mktemp)"
33 | jq -s -S '.[0] + .[1]' '{{.VARIABLES_PATH}}' .cache/compatibility-chart.json > "$TMP"
34 | mv "$TMP" '{{.VARIABLES_PATH}}'
35 |
36 | compatibility-chart:ansifilter:
37 | deps:
38 | - :install:software:ansifilter
39 | cmds:
40 | - |
41 | for LOG in {{.MOLECULE_RESULTS_PATH}}; do
42 | if [ "$LOG" != '{{.MOLECULE_RESULTS_PATH}}' ]; then
43 | TMP="$(mktemp)" && cat "$LOG" | ansifilter > "$TMP" && mv "$TMP" "$LOG"
44 | fi
45 | done
46 | sources:
47 | - '{{.MOLECULE_RESULTS_PATH}}/*'
48 |
49 | compatibility-chart:generate:
50 | deps:
51 | - :install:pipx:ansibler
52 | cmds:
53 | - task: compatibility-chart:ansifilter
54 | - >
55 | PATH="$PATH:$HOME/.local/bin"
56 |
57 | {{.PYTHON_HANDLE}}ansibler --generate-compatibility-chart --molecule-results-dir '{{.MOLECULE_RESULTS_PATH}}'
58 | --json-file .cache/compatibility-chart.json
59 | sources:
60 | - '{{.MOLECULE_RESULTS_PATH}}/*'
61 | generates:
62 | - .cache/compatibility-chart.json
63 |
64 | populate-platforms:
65 | deps:
66 | - :install:pipx:ansibler
67 | log:
68 | error: Failed to populate platforms in `meta/main.yml
69 | start: Populating the supported platforms listed in `meta/main.yml` based on the compatibility chart data
70 | success: Successfully populated `meta/main.yml` platforms
71 | cmds:
72 | - cmd: |
73 | PATH="$PATH:$HOME/.local/bin"
74 | {{.PYTHON_HANDLE}}ansibler --populate-platforms --json-file .cache/compatibility-chart.json
75 | ignore_error: true
76 | sources:
77 | - .cache/compatibility-chart.json
78 | - meta/main.yml
79 |
80 | role-dependencies:
81 | deps:
82 | - :install:software:jq
83 | log:
84 | error: Failed to acquire role dependency information
85 | start: Gathering information about role dependencies
86 | success: Acquired role dependency information
87 | cmds:
88 | - mkdir -p .cache
89 | - if [ ! -f .cache/role-dependencies.json ]; then echo "{}" > .cache/role-dependencies.json; fi
90 | - task: role-dependencies:generate
91 | - if [ -f role-dependencies.json ]; then mv role-dependencies.json .cache/role-dependencies.json; fi
92 | - |
93 | TMP="$(mktemp)"
94 | jq -s -S '.[0] + .[1]' '{{.VARIABLES_PATH}}' .cache/role-dependencies.json > "$TMP"
95 | mv "$TMP" '{{.VARIABLES_PATH}}'
96 |
97 | role-dependencies:generate:
98 | deps:
99 | - :install:pipx:ansibler
100 | cmds:
101 | - cmd: |
102 | PATH="$PATH:$HOME/.local/bin"
103 | {{.PYTHON_HANDLE}}ansibler --role-dependencies --json-file .cache/role-dependencies.json
104 | ignore_error: true
105 | sources:
106 | - '{{.REQUIREMENTS_PATH}}'
107 | generates:
108 | - .cache/role-dependencies.json
109 |
110 | tasks:playbook:
111 | deps:
112 | - :ansible:collection-dependencies
113 | - role-dependencies
114 |
115 | tasks:role:
116 | deps:
117 | - :ansible:collection-dependencies
118 | - populate-platforms
119 | - role-dependencies
120 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-ventoy.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | VENTOY_DOWNLOAD_CONFIG_URL: https://gitlab.com/megabyte-labs/jumpusb/-/raw/master/local/distros.json
6 | VENTOY_USB_PATH:
7 | sh: |
8 | if [ -d /run/media/user/Ventoy ]; then
9 | echo "/run/media/user/Ventoy"
10 | else
11 | echo "./jumpusb-fs"
12 | fi
13 |
14 | tasks:
15 | clone:
16 | cmds:
17 | - |
18 | mkdir -p {{.VENTOY_USB_PATH}}
19 | cd {{.VENTOY_USB_PATH}}
20 | git init
21 | git remote add origin https://gitlab.com/megabyte-labs/jumpusb.git
22 | git fetch
23 | git pull origin master
24 |
25 | download:
26 | deps:
27 | - :install:software:axel
28 | - :install:software:p7zip
29 | todo: Add validation of md5/sha256 and add update functionality to VENTOY_DOWNLOAD_CONFIG_URL
30 | cmds:
31 | - task: setup:persistence
32 | - curl -sSL '{{.VENTOY_DOWNLOAD_CONFIG_URL}}' > .ventoy.json
33 | - |
34 | jq -c '.distros[]' .ventoy.json | while read VENTOY_OS; do
35 | MIRROR_COUNT="$(jq -r -n --argjson in "$VENTOY_OS" '$in.mirrors | length')"
36 | VENTOY_URL="$(jq -r -n --argjson in "$VENTOY_OS" '$in.mirrors[]')"
37 | if [ "$MIRROR_COUNT" == '1' ]; then
38 | VENTOY_URL_AXEL="$VENTOY_URL"
39 | else
40 | VENTOY_URL_AXEL="$(jq -r -n --argjson in "$VENTOY_OS" '$in.mirrors | join(" ")')"
41 | fi
42 | VENTOY_MD5="$(jq -r -n --argjson in "$VENTOY_OS" '$in.md5')"
43 | VENTOY_PATH="$(jq -r -n --argjson in "$VENTOY_OS" '$in.path')"
44 | VENTOY_PER_BASE="$(jq -r -n --argjson in "$VENTOY_OS" '$in.persistence_base')"
45 | VENTOY_PER_FILE="$(jq -r -n --argjson in "$VENTOY_OS" '$in.persistence_file')"
46 | mkdir -p "$(dirname ./jumpusb-fs/$VENTOY_PATH)"
47 | if [ ! -f "./jumpusb-fs/$VENTOY_PATH" ] || [ -f "./jumpusb-fs/${VENTOY_PATH}.st" ]; then
48 | mkdir -p "$(dirname ./jumpusb-fs/${VENTOY_PATH})"
49 | axel -o "./jumpusb-fs/${VENTOY_PATH}" -n 14 $VENTOY_URL_AXEL
50 | if [[ "$VENTOY_URL" == *.gz ]]; then
51 | mv "./jumpusb-fs/${VENTOY_PATH}" "./jumpusb-fs/${VENTOY_PATH}.gz"
52 | gzip -d "./jumpusb-fs/${VENTOY_PATH}.gz"
53 | elif [[ "$VENTOY_URL" == *.bz2 ]]; then
54 | mv "./jumpusb-fs/${VENTOY_PATH}" "./jumpusb-fs/${VENTOY_PATH}.bz2"
55 | bzip2 -d "./jumpusb-fs/${VENTOY_PATH}.bz2"
56 | fi
57 | fi
58 | if [ "$VENTOY_PER_FILE" != 'null' ] && [ ! -f "./jumpusb-fs/persistence/$VENTOY_PER_FILE" ]; then
59 | 7z -y x "./jumpusb-fs/persistence/$VENTOY_PER_BASE"
60 | UNCOMPRESSED_FILE="$(echo $VENTOY_PER_BASE | sed 's/.7z$//')"
61 | mv "$UNCOMPRESSED_FILE" "./jumpusb-fs/persistence/$VENTOY_PER_FILE"
62 | fi
63 | done
64 |
65 | install:
66 | cmds:
67 | - task: install:disk
68 |
69 | install:detect:usb:
70 | summary: |
71 | # Detects the Drive Path of USB Last Inserted
72 |
73 | This task detects the drive path of the last USB that was inserted. After
74 | it detects the drive path, it writes the path to the file that is passed in
75 | as the ANSWER_FILE Go template variable.
76 | cmds:
77 | - |
78 | # TODO: Add bash script / darwin script that detects the drive path of
79 |
80 | install:disk:
81 | vars:
82 | TARGET_DRIVE: '{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.TARGET_DRIVE}}{{end}}'
83 | cmds:
84 | - curl -sSL https://github.com/ventoy/Ventoy/releases/download/v1.0.74/ventoy-1.0.74-linux.tar.gz > ventoy.tar.gz
85 | - tar -xzvf ventoy.tar.gz
86 | - .config/log info 'Running sudo command `sudo sh ventoy/Ventoy2Disk.sh -ui {{.TARGET_DRIVE}}`'
87 | - sudo sh ventoy/Ventoy2Disk.sh -ui {{.TARGET_DRIVE}}
88 | - rm -rf ventoy
89 | status:
90 | - '[ -z "{{.TARGET_DRIVE}}" ]'
91 |
92 | setup:persistence:
93 | cmds:
94 | - curl -sSL https://github.com/ventoy/backend/releases/download/v5.0/images.zip > images.zip
95 | - unzip images.zip
96 | - rm images.zip
97 | - mkdir -p {{.VENTOY_USB_PATH}}/persistence
98 | - mv images/* {{.VENTOY_USB_PATH}}/persistence
99 | - rm -rf images
100 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.require_version ">= 1.6.2"
5 |
6 | cpus = 2
7 | description = "Windows 10 Enterprise (Insider's Preview)"
8 | memory = 4096
9 |
10 | Vagrant.configure("2") do |config|
11 |
12 | config.ssh.password = "vagrant"
13 | config.ssh.username = "vagrant"
14 |
15 | config.vm.define "" do |os|
16 | os.vm.box="Megabyte/Windows-Desktop"
17 | os.vm.hostname = "vagrant-windows"
18 |
19 | os.vm.network "forwarded_port", guest: 22, host: 58022, id: "ssh", auto_correct: true
20 | os.vm.network "forwarded_port", guest: 80, host: 58080, id: "http", auto_correct: true
21 | os.vm.network "forwarded_port", guest: 443, host: 58443, id: "https", auto_correct: true
22 | os.vm.network "forwarded_port", guest: 3389, host: 53389, id: "rdp", auto_correct: true
23 |
24 | os.vm.provider "hyperv" do |v|
25 | v.cpus = cpus
26 | v.maxmemory = memory
27 | v.vmname = description
28 | end
29 |
30 | os.vm.provider "parallels" do |v|
31 | v.cpus = cpus
32 | v.memory = memory
33 | v.name = description
34 | v.update_guest_tools = true
35 | end
36 |
37 | os.vm.provider "libvirt" do |v, override|
38 | v.cpus = cpus
39 | v.memory = memory
40 | # Use WinRM for the default synced folder; or disable it if
41 | # WinRM is not available. Linux hosts don't support SMB,
42 | # and Windows guests don't support NFS/9P/rsync
43 | # Source: https://github.com/Cimpress-MCP/vagrant-winrm-syncedfolders
44 | if Vagrant.has_plugin?("vagrant-winrm-syncedfolders")
45 | override.vm.synced_folder ".", "/vagrant", type: "winrm"
46 | else
47 | override.vm.synced_folder ".", "/vagrant", disabled: true
48 | end
49 | # Enable Hyper-V enlightments - Source: https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html
50 | v.hyperv_feature :name => 'stimer', :state => 'on'
51 | v.hyperv_feature :name => 'relaxed', :state => 'on'
52 | v.hyperv_feature :name => 'vapic', :state => 'on'
53 | v.hyperv_feature :name => 'synic', :state => 'on'
54 | end
55 |
56 | os.vm.provider "virtualbox" do |v|
57 | v.check_guest_additions = true
58 | v.cpus = cpus
59 | v.customize ["modifyvm", :id, "--accelerate3d", "on"]
60 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
61 | v.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]
62 | v.customize ["modifyvm", :id, "--hwvirtex", "on"]
63 | v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
64 | v.customize ["modifyvm", :id, "--vram", "256"]
65 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all"]
66 | v.gui = true
67 | v.memory = memory
68 | v.name = description
69 | end
70 |
71 | os.vm.provider "vmware_fusion" do |v|
72 | v.gui = true
73 | v.vmx["ethernet0.virtualDev"] = "vmxnet3"
74 | v.vmx["gui.fitGuestUsingNativeDisplayResolution"] = "TRUE"
75 | v.vmx["gui.fullScreenAtPowerOn"] = "TRUE"
76 | v.vmx["gui.lastPoweredViewMode"] = "fullscreen"
77 | v.vmx["gui.viewModeAtPowerOn"] = "fullscreen"
78 | v.vmx["memsize"] = memory.to_s
79 | v.vmx["mks.enable3d"] = "TRUE"
80 | v.vmx["mks.forceDiscreteGPU"] = "TRUE"
81 | v.vmx["numvcpus"] = cpus.to_s
82 | v.vmx["RemoteDisplay.vnc.enabled"] = "TRUE"
83 | v.vmx["RemoteDisplay.vnc.port"] = "5900"
84 | v.vmx["sound.autodetect"] = "TRUE"
85 | v.vmx["sound.present"] = "TRUE"
86 | v.vmx["sound.startConnected"] = "TRUE"
87 | end
88 |
89 | os.vm.provider "vmware_workstation" do |v|
90 | v.gui = true
91 | v.vmx["ethernet0.virtualDev"] = "vmxnet3"
92 | v.vmx["gui.fitGuestUsingNativeDisplayResolution"] = "TRUE"
93 | v.vmx["gui.fullScreenAtPowerOn"] = "TRUE"
94 | v.vmx["gui.lastPoweredViewMode"] = "fullscreen"
95 | v.vmx["gui.viewModeAtPowerOn"] = "fullscreen"
96 | v.vmx["memsize"] = memory.to_s
97 | v.vmx["mks.enable3d"] = "TRUE"
98 | v.vmx["mks.forceDiscreteGPU"] = "TRUE"
99 | v.vmx["numvcpus"] = cpus.to_s
100 | v.vmx["RemoteDisplay.vnc.enabled"] = "TRUE"
101 | v.vmx["RemoteDisplay.vnc.port"] = "5900"
102 | v.vmx["sound.autodetect"] = "TRUE"
103 | v.vmx["sound.present"] = "TRUE"
104 | v.vmx["sound.startConnected"] = "TRUE"
105 | end
106 | end
107 | end
108 |
--------------------------------------------------------------------------------
/.config/taskfiles/install/Taskfile-requirements.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: '3'
3 |
4 | vars:
5 | INSTALL_GROUP:
6 | sh: |
7 | if type apk &> /dev/null; then
8 | echo 'apk'
9 | elif type apt-get &> /dev/null; then
10 | echo 'apt-get'
11 | elif type dnf &> /dev/null; then
12 | echo 'dnf'
13 | elif type pacman &> /dev/null; then
14 | echo 'pacman'
15 | elif type yum &> /dev/null; then
16 | echo 'yum'
17 | elif [ '{{OS}}' == 'darwin' ]; then
18 | echo 'brew'
19 | fi
20 | REQUIREMENTS_TASKFILE: .config/taskfiles/install/Taskfile-requirements.yml
21 |
22 | gpg:
23 | apt-get:
24 | - gnupg-agent
25 | - gnupg-curl
26 | - gnupg2
27 | - pcscd
28 | - scdaemon
29 | brew:
30 | - gnupg
31 | - pinentry-mac
32 | dnf:
33 | - gnupg2
34 | - pinentry-curses
35 | pacman:
36 | - gnupg
37 | yum:
38 | - gnupg2
39 | - pinentry-curses
40 |
41 | yubikey:
42 | apt-get:
43 | - cryptsetup
44 | - dirmngr
45 | - gnupg2
46 | - gnupg-agent
47 | - hopenpgp-tools
48 | - libpcsclite-dev
49 | - libssl-dev
50 | - openssl
51 | - pcscd
52 | - python3-gnupg
53 | - python3-pip
54 | - python3-pyscard
55 | - rng-tools
56 | - scdaemon
57 | - secure-delete
58 | - swig
59 | - wget
60 | - yubikey-personalization
61 | brew:
62 | - gnupg
63 | - hopenpgp-tools
64 | - pinentry-mac
65 | - swig
66 | - wget
67 | - ykman
68 | - yubikey-personalization
69 | dnf:
70 | - gnupg2
71 | - gnupg2-smime
72 | - pcsc-lite
73 | - pcsc-lite-libs
74 | - pinentry-curses
75 | pacman:
76 | - ccid
77 | - gnupg
78 | - hopenpgp-tools
79 | - pcsclite
80 | - yubikey-personalization
81 | python:
82 | - PyOpenSSL
83 | - yubikey-manager
84 | yum:
85 | - gnupg2
86 | - gnupg2-smime
87 | - pcsc-lite
88 | - pcsc-lite-libs
89 | - pinentry-curses
90 |
91 | tasks:
92 | gpg:
93 | cmds:
94 | - task: install
95 | vars:
96 | REQUIREMENTS_KEY: gpg
97 |
98 | install:
99 | deps:
100 | - install:deps:{{OS}}
101 | vars:
102 | INSTALL_GROUP: '{{if .REQUIREMENTS_GROUP}}{{.REQUIREMENTS_GROUP}}{{else}}{{.INSTALL_GROUP}}{{end}}'
103 | REQUIREMENTS_KEY: '{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.REQUIREMENTS_KEY}}{{end}}'
104 | cmds:
105 | - task: :{{if .REQUIREMENTS_GROUP_TASK}}{{.REQUIREMENTS_GROUP_TASK}}{{else}}install:software:system{{end}}
106 | vars:
107 | PACKAGE:
108 | sh: yq e '.["{{.REQUIREMENTS_KEY}}"]["{{.INSTALL_GROUP}}"]' {{.REQUIREMENTS_TASKFILE}} | sed 's/- / /' | tr -d '\n' | sed 's/^ //'
109 |
110 | install:deps:darwin:
111 | cmds:
112 | - task: :install:software:brew
113 | - task: :install:software:yq
114 |
115 | install:deps:linux:
116 | cmds:
117 | - task: :install:software:yq
118 |
119 | onlykey:
120 | summary: |
121 | # Preload OnlyKey Installer Files
122 |
123 | Windows
124 | OnlyKey_5.3.6.exe
125 | SHA256 - 22fc0b80d0b11fa5b0f9a566ae11edb8aee41e53905259e2a8a948c71e45e1fe
126 |
127 | MacOS
128 | OnlyKey.App.5.3.6.dmg
129 | SHA256 - 1f7756227af0752bf2d1071bf6f04e5a3282df54ac0125fdfb4abfab7edb115a
130 |
131 | Linux
132 | OnlyKey_5.3.6_amd64.deb
133 | SHA256 - d5e223581b459c869a2f2d4c84cd77f52b851dced5c87dea5f8d93ec1cecc7c4
134 | GPG Signature verify with debsig-verify
135 | A1D6 4A3B 496C B0F3 6E12 B46F 9A9F 520D 44EA 53D1
136 | cmds:
137 | - mkdir -p ~/Downloads
138 | - curl -sSL https://github.com/trustcrypto/OnlyKey-App/releases/download/v5.3.6/OnlyKey.App.5.3.6.dmg > ~/Downloads/OnlyKey.App.5.3.6.dmg
139 | - curl -sSL https://github.com/trustcrypto/OnlyKey-App/releases/download/v5.3.6/OnlyKey_5.3.6.exe > ~/Downloads/OnlyKey_5.3.6.exe
140 | - curl -sSL https://github.com/trustcrypto/OnlyKey-App/releases/download/v5.3.6/OnlyKey_5.3.6_amd64.deb > ~/Downloads/OnlyKey_5.3.6_amd64.deb
141 | - |
142 | if type apt &> /dev/null; then
143 | sudo apt install debsig-verify
144 | fi
145 |
146 | yubikey:
147 | cmds:
148 | - task: :install:software:yubikey-agent
149 | - task: install
150 | vars:
151 | REQUIREMENTS_KEY: yubikey
152 | - task: install
153 | vars:
154 | REQUIREMENTS_GROUP: python
155 | REQUIREMENTS_GROUP_TASK: install:python:pip
156 | REQUIREMENTS_KEY: yubikey
157 |
--------------------------------------------------------------------------------