Skip to content

Commit 1f64f6c

Browse files
committed
Initial commit
0 parents  commit 1f64f6c

13 files changed

Lines changed: 14694 additions & 0 deletions
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Update install SHA
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- install.ps1
9+
- tailscale-control.ps1
10+
- assets/icons/tailscale-control.ico
11+
- assets/icons/tailscale.ico
12+
- assets/icons/tailscale-mtu.ico
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: write
17+
18+
concurrency:
19+
group: update-install-sha
20+
cancel-in-progress: true
21+
22+
jobs:
23+
update-sha:
24+
if: github.actor != 'github-actions[bot]'
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Compute app version and SHA-256 hashes
34+
id: metadata
35+
shell: python
36+
run: |
37+
import hashlib
38+
import os
39+
import pathlib
40+
import re
41+
42+
files = {
43+
"script_hash": pathlib.Path("tailscale-control.ps1"),
44+
"tailscale_control_icon_hash": pathlib.Path("assets/icons/tailscale-control.ico"),
45+
"tailscale_icon_hash": pathlib.Path("assets/icons/tailscale.ico"),
46+
"tailscale_mtu_icon_hash": pathlib.Path("assets/icons/tailscale-mtu.ico"),
47+
}
48+
49+
script_text = files["script_hash"].read_text(encoding="utf-8")
50+
version_match = re.search(r"\$script:AppVersion\s*=\s*['\"]([^'\"]+)['\"]", script_text)
51+
if not version_match:
52+
raise SystemExit("Could not find $script:AppVersion in tailscale-control.ps1")
53+
54+
def sha256_hex(path: pathlib.Path) -> str:
55+
if not path.is_file():
56+
raise SystemExit(f"Missing required file: {path}")
57+
return hashlib.sha256(path.read_bytes()).hexdigest()
58+
59+
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as f:
60+
f.write(f"app_version={version_match.group(1)}\n")
61+
for key, path in files.items():
62+
f.write(f"{key}={sha256_hex(path)}\n")
63+
64+
- name: Update install.ps1
65+
shell: python
66+
env:
67+
APP_VERSION: ${{ steps.metadata.outputs.app_version }}
68+
SCRIPT_HASH: ${{ steps.metadata.outputs.script_hash }}
69+
TAILSCALE_CONTROL_ICON_HASH: ${{ steps.metadata.outputs.tailscale_control_icon_hash }}
70+
TAILSCALE_ICON_HASH: ${{ steps.metadata.outputs.tailscale_icon_hash }}
71+
TAILSCALE_MTU_ICON_HASH: ${{ steps.metadata.outputs.tailscale_mtu_icon_hash }}
72+
run: |
73+
import os
74+
import re
75+
from pathlib import Path
76+
77+
path = Path("install.ps1")
78+
text = path.read_text(encoding="utf-8")
79+
80+
replacements = [
81+
(
82+
r"\$script:AppVersion\s*=\s*['\"][^'\"]*['\"]",
83+
f"$script:AppVersion = '{os.environ['APP_VERSION']}'",
84+
"$script:AppVersion",
85+
),
86+
(
87+
r"\$script:ExpectedScriptSha256\s*=\s*['\"][^'\"]*['\"]",
88+
f"$script:ExpectedScriptSha256 = '{os.environ['SCRIPT_HASH']}'",
89+
"$script:ExpectedScriptSha256",
90+
),
91+
]
92+
93+
for pattern, replacement, label in replacements:
94+
text, count = re.subn(pattern, replacement, text, count=1)
95+
if count != 1:
96+
raise SystemExit(f"Could not update {label} in install.ps1")
97+
98+
icon_hashes = {
99+
"tailscale-control.ico": os.environ["TAILSCALE_CONTROL_ICON_HASH"],
100+
"tailscale.ico": os.environ["TAILSCALE_ICON_HASH"],
101+
"tailscale-mtu.ico": os.environ["TAILSCALE_MTU_ICON_HASH"],
102+
}
103+
104+
for file_name, digest in icon_hashes.items():
105+
pattern = (
106+
r"(FileName\s*=\s*'" + re.escape(file_name) +
107+
r"'[\s\S]*?ExpectedSha256\s*=\s*)['\"][^'\"]*['\"]"
108+
)
109+
text, count = re.subn(pattern, rf"\1'{digest}'", text, count=1)
110+
if count != 1:
111+
raise SystemExit(f"Could not update hash for {file_name} in install.ps1")
112+
113+
path.write_text(text, encoding="utf-8")
114+
115+
- name: Commit and push if changed
116+
shell: bash
117+
run: |
118+
if git diff --quiet -- install.ps1; then
119+
echo "install.ps1 already up to date"
120+
exit 0
121+
fi
122+
git config user.name "github-actions[bot]"
123+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
124+
git add install.ps1
125+
git commit -m "chore(install): update app version and sha"
126+
git push

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
contact@luizbizzio.com.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

LICENSE

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# PolyForm Internal Use License 1.0.0
2+
3+
<https://polyformproject.org/licenses/internal-use/1.0.0>
4+
5+
## Acceptance
6+
7+
In order to get any license under these terms, you must agree
8+
to them as both strict obligations and conditions to all
9+
your licenses.
10+
11+
## Copyright License
12+
13+
The licensor grants you a copyright license for the software
14+
to do everything you might do with the software that would
15+
otherwise infringe the licensor's copyright in it for any
16+
permitted purpose. However, you may only make changes or
17+
new works based on the software according to [Changes and New
18+
Works License](#changes-and-new-works-license), and you may
19+
not distribute the software.
20+
21+
## Changes and New Works License
22+
23+
The licensor grants you an additional copyright license to
24+
make changes and new works based on the software for any
25+
permitted purpose.
26+
27+
## Patent License
28+
29+
The licensor grants you a patent license for the software that
30+
covers patent claims the licensor can license, or becomes able
31+
to license, that you would infringe by using the software.
32+
33+
## Fair Use
34+
35+
You may have "fair use" rights for the software under the
36+
law. These terms do not limit them.
37+
38+
## Internal Business Use
39+
40+
Use of the software for the internal business operations of
41+
you and your company is use for a permitted purpose.
42+
43+
## No Other Rights
44+
45+
These terms do not allow you to sublicense or transfer any of
46+
your licenses to anyone else, or prevent the licensor from
47+
granting licenses to anyone else. These terms do not imply
48+
any other licenses.
49+
50+
## Patent Defense
51+
52+
If you make any written claim that the software infringes or
53+
contributes to infringement of any patent, your patent license
54+
for the software granted under these terms ends immediately. If
55+
your company makes such a claim, your patent license ends
56+
immediately for work on behalf of your company.
57+
58+
## Violations
59+
60+
The first time you are notified in writing that you have
61+
violated any of these terms, or done anything with the software
62+
not covered by your licenses, your licenses can nonetheless
63+
continue if you come into full compliance with these terms,
64+
and take practical steps to correct past violations, within
65+
32 days of receiving notice. Otherwise, all your licenses
66+
end immediately.
67+
68+
## No Liability
69+
70+
***As far as the law allows, the software comes as is, without
71+
any warranty or condition, and the licensor will not be liable
72+
to you for any damages arising out of these terms or the use
73+
or nature of the software, under any kind of legal claim.***
74+
75+
## Definitions
76+
77+
The **licensor** is the individual or entity offering these
78+
terms, and the **software** is the software the licensor makes
79+
available under these terms.
80+
81+
**You** refers to the individual or entity agreeing to these
82+
terms.
83+
84+
**Your company** is any legal entity, sole proprietorship,
85+
or other kind of organization that you work for, plus all
86+
organizations that have control over, are under the control of,
87+
or are under common control with that organization. **Control**
88+
means ownership of substantially all the assets of an entity,
89+
or the power to direct its management and policies by vote,
90+
contract, or otherwise. Control can be direct or indirect.
91+
92+
**Your licenses** are all the licenses granted to you for the
93+
software under these terms.
94+
95+
**Use** means anything you do with the software requiring one
96+
of your licenses.

0 commit comments

Comments
 (0)