Skip to content

Add app-text/tree to builders #153

Add app-text/tree to builders

Add app-text/tree to builders #153

Workflow file for this run

name: Azure
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
permissions:
id-token: write
contents: read
packages: read
jobs:
azure:
name: Azure
runs-on: ubuntu-latest
steps:
- name: Inspect Azure
run: |
set -eux
type jq || true
type curl || true
curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq . || true
- name: 🐋 Docker Login
if: ${{ false }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker pull agent
if: ${{ false }}
run: |
docker pull ghcr.io/berney/aether-tunnel/agent || echo "Failed to pull image"
- name: Extract Agent
if: ${{ false }}
env:
LIGOLO_PROXY: ${{ secrets.LIGOLO_PROXY }}
run: |
docker create --name agent ghcr.io/berney/aether-tunnel/agent
pwd
mkdir etc
docker cp agent:/etc/s6_finish_default etc/
docker cp agent:/etc/service/ etc/
docker cp agent:/service/ .
docker cp agent:/usr/bin/ .
docker cp agent:/usr/local/bin/ .
docker rm agent
touch service/web-shell/down
touch service/nginx/down
export PATH="$(pwd)/bin:$PATH"
mkdir ~/log
s6-svscan service &
- name: Inspect
if: ${{ false }}
run: |
set -eux
sleep 10
ps -ef
pstree
docker ps
docker ps -a
ss -nlt
ss -nlu
ip link
ip addr
ip -6 addr
ls -l ~/log/mosh-server/current || true
cat ~/log/mosh-server/current || true
- name: Azure login
id: azure-login
#continue-on-error: true
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Sleep if azure-login error
#if: ${{ steps.azure-login.outcome == 'failure' }}
if: ${{ false }}
run: |
set -eux
LOOPS=12
for x in $(seq $LOOPS); do
echo "== $x/$LOOPS"
ps -ef
pstree
docker ps
docker ps -a
ss -nlt
ss -nlu
ip link
ip addr
ip -6 addr
ls -l ~/log/mosh-server/current || true
cat ~/log/mosh-server/current || true
ls -l ~/log/ligolo-ng/current || true
cat ~/log/ligolo-ng/current || true
sleep 5m
done
- name: Azure CLI script
id: azure-cli
#continue-on-error: true
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
set -eux
id || true
hostname || true
date || true
az account show
az ad signed-in-user show || true
az group list
az storage account list
az storage container list --account-name berneygithub || true
az storage container-rm list --storage-account berneygithub || true
az storage blob list --account-name berneygithub --container-name packages --auth-mode login --output table
- name: Sleep if azure-cli error
#if: ${{ steps.azure-cli.outcome == 'failure' }}
if: ${{ false }}
run: |
set -eux
LOOPS=12
for x in $(seq $LOOPS); do
echo "== $x/$LOOPS"
ps -ef
pstree
docker ps
docker ps -a
ss -nlt
ss -nlu
ip link
ip addr
ip -6 addr
ls -l ~/log/mosh-server/current || true
cat ~/log/mosh-server/current || true
ls -l ~/log/ligolo-ng/current || true
cat ~/log/ligolo-ng/current || true
sleep 5m
done
- name: az direct
id: az-direct
#continue-on-error: true
run: |
set -eux
id
hostname
date
az account show
az ad signed-in-user show || true
az group list
az storage account list
az storage container list --account-name berneygithub || true
az storage container-rm list --storage-account berneygithub || true
az storage blob list --account-name berneygithub --container-name packages --auth-mode login --output table
- name: Sleep if azure-direct error
#if: ${{ steps.azure-direct.outcome == 'failure' }}
if: ${{ false }}
run: |
set -eux
LOOPS=12
for x in $(seq $LOOPS); do
echo "== $x/$LOOPS"
ps -ef
pstree
docker ps
docker ps -a
ss -nlt
ss -nlu
ip link
ip addr
ip -6 addr
ls -l ~/log/mosh-server/current || true
cat ~/log/mosh-server/current || true
ls -l ~/log/ligolo-ng/current || true
cat ~/log/ligolo-ng/current || true
sleep 5m
done
- name: Blob FUSE
#continue-on-error: true
run: |
set -eux
sudo apt update
sudo apt-get install -y blobfuse2
ls -la /mnt
cat /mnt/DATALOSS_WARNING_README.txt
free -h || true
free -m
lsblk
nproc
mount
cat /proc/mounts
type blobfuse2 || true
df -h /tmp
curl -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" -s | jq .
az account show
az storage account list
az --version
az version
az storage container list --account-name berneygithub || true
az storage container-rm list --storage-account berneygithub || true
# Gets an OAUTH2 Access Token to the whole Storage Account
# Alternatively could get a SAS to the storage container
ACCESS_TOKEN=$(az account get-access-token --resource https://storage.azure.com/ --query accessToken --output tsv)
# account-key: ${ACCESS_TOKEN}
# Get GitHub OAuth Token for OIDC
curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r .value | sudo tee /root/token.txt
cat <<-EOF > config.yaml
# This allows all users access to the mount
allow-other: true
logging:
level: log_debug
file-path: "blobfuse2-logs.txt"
type: base
azstorage:
account-name: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
container: ${{ secrets.AZURE_STORAGE_CONTAINER }}
# Doesn't work https://github.com/Azure/azure-storage-fuse/discussions/1449
#mode: azcli
mode: spn
clientid: ${{ secrets.AZURE_CLIENT_ID }}
tenantid: ${{ secrets.AZURE_TENANT_ID }}
oauth-token-path: /root/token.txt
EOF
cat config.yaml
sudo mkdir -p /mnt/blobfuse2
sudo mkdir -p /mnt/blobfuse2tmp
if sudo blobfuse2 mount /mnt/blobfuse2 --config-file=config.yaml --tmp-path=/mnt/blobfuse2tmp; then
echo "DBG Blobfuse2 mount worked $?"
ls -lad /mnt/blobfuse2
ls -la /mnt/blobfuse2
echo "Hello World" > /mnt/blobfuse2/hello.txt
cat /mnt/blobfuse2/hello.txt
else
echo "ERR Blobfuse2 mount failed $?"
ls -l blobfuse2-logs.txt
cat blobfuse2-logs.txt
exit 1
fi
- name: Sleep
if: ${{ false }}
run: |
set -eux
LOOPS=12
for x in $(seq $LOOPS); do
echo "== $x/$LOOPS"
ps -ef
pstree
docker ps
docker ps -a
ss -nlt
ss -nlu
ip link
ip addr
ip -6 addr
ls -l ~/log/mosh-server/current || true
cat ~/log/mosh-server/current || true
ls -l ~/log/ligolo-ng/current || true
cat ~/log/ligolo-ng/current || true
sleep 5m
done