Skip to content

Commit f71efcd

Browse files
committed
Aktualisiere Labeler-Konfiguration und verbessere Installationsskript für bessere Lesbarkeit und Sicherheit
1 parent 9a072f3 commit f71efcd

4 files changed

Lines changed: 25 additions & 18 deletions

File tree

.github/labeler.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@
7373

7474
'type:feature':
7575
- head-branch:
76-
- '^(?:[Ff][Ee][Aa][Tt][Uu][Rr][Ee]|[Ff][Ee][Aa][Tt])[-/].+'
76+
- '^(?:[Ff][Ee][Aa][Tt][Uu][Rr][Ee]|[Ff][Ee][Aa][Tt])[-/].+'
7777

7878
'type:task':
7979
- head-branch:
8080
- '^(?:[Tt][Aa][Ss][Kk]|[Cc][Hh][Oo][Rr][Ee])[-/].+'
8181

8282
'type:release':
8383
- head-branch:
84-
- '^[Rr][Ee][Ll][Ee][Aa][Ss][Ee][-/].+'
84+
- '^[Rr][Ee][Ll][Ee][Aa][Ss][Ee][-/].+'
8585

8686
'type:bugfix':
8787
- head-branch:
88-
- '^(?:[Bb][Uu][Gg][Ff][Ii][Xx]|[Ff][Ii][Xx])[-/].+'
88+
- '^(?:[Bb][Uu][Gg][Ff][Ii][Xx]|[Ff][Ii][Xx])[-/].+'
8989

9090
'type:hotfix':
9191
- head-branch:
92-
- '^[Hh][Oo][Tt][Ff][Ii][Xx][-/].+'
92+
- '^[Hh][Oo][Tt][Ff][Ii][Xx][-/].+'

.github/workflows/rust-build-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
if [ "${{ runner.os }}" == "Windows" ]; then
6767
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} dist/${{ matrix.asset_name }}
6868
cp install.sh dist/install.sh
69-
chmod +x dist/install.sh || true
69+
# Skipping chmod on Windows; not required
7070
cd dist
7171
7z a ../${{ matrix.asset_name }}.zip ${{ matrix.asset_name }} install.sh
7272
else

hypnoscript-cli/src/main.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,10 @@ fn build_agent() -> Agent {
320320
.build()
321321
}
322322

323-
fn github_get(agent: &Agent, url: &str) -> Request {
323+
fn github_get(agent: &Agent, url: &str) -> ureq::Request {
324324
let mut request = agent
325325
.get(url)
326-
.set("Accept", "application/vnd.github+json")
327-
.set(
328-
"User-Agent",
329-
&format!("hypnoscript-cli/{}", env!("CARGO_PKG_VERSION")),
330-
);
326+
.set("Accept", "application/vnd.github+json");
331327

332328
if let Ok(token) = env::var("GITHUB_TOKEN") {
333329
request = request

install.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env bash
22
# HypnoScript runtime installer / updater
3+
#
4+
# SECURITY NOTICE:
5+
# This installer script may be executed via a command like:
6+
# curl -fsSL <URL> | bash
7+
# Downloading and executing remote code via a pipe to bash can be dangerous.
8+
# You should always review the script before running it, and consider downloading
9+
# and inspecting it first:
10+
# curl -fsSL <URL> -o install.sh
11+
# less install.sh
12+
# bash install.sh
13+
#
314

415
set -euo pipefail
516

@@ -387,21 +398,21 @@ fi
387398

388399
info "Installing to $DEST_DIR"
389400
if [[ ! -w "$DEST_DIR" ]]; then
390-
$SUDO_PREFIX mkdir -p "$DEST_DIR"
401+
${SUDO_PREFIX}mkdir -p "$DEST_DIR"
391402
fi
392-
$SUDO_PREFIX install -m 0755 "$UNPACK_DIR/hypnoscript" "$DEST_DIR/hypnoscript"
403+
${SUDO_PREFIX}install -m 0755 "$UNPACK_DIR/hypnoscript" "$DEST_DIR/hypnoscript"
393404

394405
META_DIR="$DEST_DIR/../share/hypnoscript"
395-
$SUDO_PREFIX mkdir -p "$META_DIR"
406+
${SUDO_PREFIX}mkdir -p "$META_DIR"
396407

397408
if [[ -f "$UNPACK_DIR/VERSION.txt" ]]; then
398-
$SUDO_PREFIX install -m 0644 "$UNPACK_DIR/VERSION.txt" "$META_DIR/VERSION.txt"
409+
${SUDO_PREFIX}install -m 0644 "$UNPACK_DIR/VERSION.txt" "$META_DIR/VERSION.txt"
399410
fi
400411

401412
if [[ -f "$UNPACK_DIR/install.sh" ]]; then
402-
$SUDO_PREFIX install -m 0755 "$UNPACK_DIR/install.sh" "$META_DIR/install.sh"
413+
${SUDO_PREFIX}install -m 0755 "$UNPACK_DIR/install.sh" "$META_DIR/install.sh"
403414
elif [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/install.sh" ]]; then
404-
$SUDO_PREFIX install -m 0755 "$SCRIPT_DIR/install.sh" "$META_DIR/install.sh"
415+
${SUDO_PREFIX}install -m 0755 "$SCRIPT_DIR/install.sh" "$META_DIR/install.sh"
405416
fi
406417

407418
info_tmp=$(mktemp 2>/dev/null) || info_tmp="/tmp/hyp-install-info-$$"
@@ -415,7 +426,7 @@ cat >"$info_tmp" <<EOF
415426
"source": "installer"
416427
}
417428
EOF
418-
$SUDO_PREFIX install -m 0644 "$info_tmp" "$META_DIR/installation.json"
429+
${SUDO_PREFIX}install -m 0644 "$info_tmp" "$META_DIR/installation.json"
419430
rm -f "$info_tmp"
420431

421432
trap - EXIT

0 commit comments

Comments
 (0)