From 5984f62f2ef24ab665f9367746cade0921044cc3 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Sat, 24 Jun 2023 03:35:14 +0000 Subject: [PATCH] Add tasks to build script --- .codesandbox/Dockerfile | 3 +++ .codesandbox/tailscaled | 28 ++++++++++++++++++++++++++++ .gitpod/Dockerfile | 1 + package.json | 6 +++++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 .codesandbox/tailscaled diff --git a/.codesandbox/Dockerfile b/.codesandbox/Dockerfile index 383bc13..b18848e 100644 --- a/.codesandbox/Dockerfile +++ b/.codesandbox/Dockerfile @@ -5,6 +5,7 @@ USER root RUN dnf install -y \ docker \ cockpit \ + passwd \ make \ npm \ rpm-build \ @@ -13,6 +14,8 @@ RUN dnf install -y \ RUN npm install -g yarn +COPY .codesandbox/tailscaled /etc/init.d/taiscaled + USER gbraad RUN git clone https://github.com/gbraad/dotfiles ~/.dotfiles \ diff --git a/.codesandbox/tailscaled b/.codesandbox/tailscaled new file mode 100755 index 0000000..54d57a9 --- /dev/null +++ b/.codesandbox/tailscaled @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e +test -x /usr/sbin/tailscaled || exit 0 +umask 022 + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" + +case "$1" in + start) + echo "Starting Tailscale VPN" + tailscaled --tun=userspace-networking \ + --socks5-server=localhost:3215 \ + --outbound-http-proxy-listen=localhost:3214 \ + --state=/var/lib/tailscale/tailscaled.state \ + --socket=/run/tailscale/tailscaled.sock \ + --port 41641 \ + 2>/dev/null & + tailscale up --authkey=${TAILSCALE_AUTHKEY} \ + --netfilter-mode=off \ + --ssh + ;; + *) + echo "Usage: /etc/init.d/tailscaled {start}" + exit 1 +esac + +exit 0 \ No newline at end of file diff --git a/.gitpod/Dockerfile b/.gitpod/Dockerfile index dc133aa..adfa901 100644 --- a/.gitpod/Dockerfile +++ b/.gitpod/Dockerfile @@ -8,6 +8,7 @@ RUN useradd -l -u 33333 -G wheel -md /home/gitpod -s /usr/bin/zsh -p gitpod gitp RUN dnf install -y \ docker \ cockpit \ + passwd \ make \ npm \ rpm-build \ diff --git a/package.json b/package.json index 7f1f518..cf7caa3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,11 @@ "license": "LGPL-2.1", "scripts": { "build": "webpack --mode production", - "watch": "" + "rpm": "make rpm", + "watch": "", + "link": "mkdir -p ~/.local/share/cockpit && ln -s $PWD/dist ~/.localshare/share/cockpit/tailscale", + "unlink": "rm ~/.local/share/cockpit/tailscale", + "cockpit": "sudo runuser -u cockpit-wsinstance -- /usr/libexec/cockpit-ws --port=9090 --for-tls-proxy" }, "devDependencies": { "@types/react": "^18.2.12",