Skip to content

0xf (Self-Hosted) ➼ Debugger (aarch64) #43

0xf (Self-Hosted) ➼ Debugger (aarch64)

0xf (Self-Hosted) ➼ Debugger (aarch64) #43

name: 0xf (Self-Hosted) ➼ Debugger (aarch64)
#Runner: https://github.com/Azathothas/Toolpacks/settings/actions/runners
on:
workflow_dispatch:
env:
DEBIAN_FRONTEND: "noninteractive"
GITHUB_TOKEN: "${{ secrets.TOOLPACKS }}"
RCLONE_CF_R2_PUB: "${{ secrets.RCLONE_CF_R2_PUB }}"
THOST: "gh-runner-self-arm64"
TUSER: "runner"
jobs:
connect:
runs-on: arm64x-gcp-4x-16GB-120GB
#Default Timeout= 6 Hr (360 Mins) : https://nesin.io/blog/github-action-timeout
#Docs: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
#It's best to cause this timeout from your own side (Low to No chance of GH Disabling your repo) rather than gh (High Chance of them disabling your repo)
timeout-minutes: 6900
permissions:
contents: write
steps:
- name: Setup Tailscale
run: |
# Presets
set +x ; set +e
export USER="${{ env.TUSER }}"
#--------------#
sudo curl -qfSL "https://bin.ajam.dev/aarch64_arm64_Linux/tailscale" -o "/usr/local/bin/tailscale"
sudo curl -qfSL "https://bin.ajam.dev/aarch64_arm64_Linux/tailscaled" -o "/usr/local/bin/tailscaled"
sudo chmod +xwr /usr/local/bin/tailscale*
sudo tailscaled --tun=userspace-networking --socks5-server=localhost:9025 --outbound-http-proxy-listen=localhost:9025 >/dev/null 2>&1 &
sudo tailscale up --ssh --hostname="${{ env.THOST }}" --authkey="${{ secrets.TSKEY }}"
sudo tailscale status --peers=false
SSH_IP="$(sudo tailscale ip -4 | tr -d '\n')" && export SSH_IP="$SSH_IP"
TS_DNS="$(sudo tailscale status --json | jq -r '.Self.DNSName' | sed 's/\.$//')" && export TS_DNS="$TS_DNS"
export GREEN='\033[32m' ; export BLUE='\033[34m' ; export YELLOW='\033[33m' ; export PURPLE='\033[35m' ; export VIOLET='\033[0;35m' ; export NC='\033[0m'
echo -e "${GREEN}SSH: ${YELLOW}ssh "$USER@$SSH_IP" -o "StrictHostKeyChecking=no${NC}"\n ${YELLOW}ssh "$USER@$TS_DNS" -o "StrictHostKeyChecking=no${NC}""
echo -e "\n [+] ${GREEN}openvscode-server: ${BLUE}http://$TS_DNS:8080${NC}\n"
continue-on-error: true
- name: Set TZ to (Asia/Kathmandu)
run: |
# Presets
set +x ; set +e
#--------------#
sudo apt-get update -y && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y dos2unix tzdata
sudo ln -fs "/usr/share/zoneinfo/Asia/Kathmandu" "/etc/localtime"
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo apt-get install apt-utils software-properties-common -y
sudo apt-get update -y
continue-on-error: true
- name: Get latest Python
uses: deadsnakes/[email protected]
with:
python-version: "3.13"
continue-on-error: true
- name: Test latest Python
run: |
# Presets
set +x ; set +e
#--------------#
python --version ; pip --version
continue-on-error: true
- name: Init
run: |
# Presets
set +x ; set +e
#--------------#
#PATH
export PATH="$HOME/bin:$HOME/.cargo/bin:$HOME/.cargo/env:$HOME/.go/bin:$HOME/go/bin:$HOME/.local/bin:$HOME/miniconda3/bin:$HOME/miniconda3/condabin:/usr/local/zig:/usr/local/zig/lib:/usr/local/zig/lib/include:/usr/local/musl/bin:/usr/local/musl/lib:/usr/local/musl/include:$PATH"
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="$SYSTMP"
#TMPDIRS
#For build-cache
TMPDIRS="mktemp -d --tmpdir=$SYSTMP/toolpacks XXXXXXX_linux_aarch64" && export TMPDIRS="$TMPDIRS"
rm -rf "$SYSTMP/toolpacks" 2>/dev/null ; mkdir -p "$SYSTMP/toolpacks"
#For Bins
BINDIR="$SYSTMP/toolpack_aarch64" && export BINDIR="$BINDIR"
rm -rf "$BINDIR" 2>/dev/null ; rm -rf "$BINDIR.7z" 2>/dev/null ; mkdir -p "$BINDIR"
##Sane Configs
#In case of removed/privated GH repos
# https://git-scm.com/docs/git#Documentation/git.txt-codeGITTERMINALPROMPTcode
export GIT_TERMINAL_PROMPT="0"
#https://git-scm.com/docs/git#Documentation/git.txt-codeGITASKPASScode
export GIT_ASKPASS="/bin/echo"
##RUN
#bash <(curl -qfsSL "https://pub.ajam.dev/repos/Azathothas/Toolpacks/.github/scripts/aarch64_Linux/init_debian.sh")
curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/.github/scripts/aarch64_Linux/init_debian.sh" -o "/tmp/init_debian.sh"
dos2unix "/tmp/init_debian.sh" && chmod +xwr "/tmp/init_debian.sh" && bash "/tmp/init_debian.sh"
#This keeps GH Actions hypnotized until timeout
- name: Breakpoint || Sleep ∞
run: |
while :; do sleep 1; done
#sleep 340m
continue-on-error: true