refactor some more & prepare for the sussy forgejo mirror

This commit is contained in:
CeciliaKelley33Mm 2024-10-18 13:15:54 +07:00
parent 87e4518eb8
commit f3736cc222
3 changed files with 16 additions and 50 deletions

View file

@ -24,11 +24,11 @@ jobs:
custom: custom:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- name: Setup Python (for use with Pool Kit) - name: Setup Python (for use with Page flying on a Kite)
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.11' python-version: '3.11'
- name: Setup Java 21 (Eclipse Temurin) - name: Setup Java 21 (Eclipse Temurin) // !!! broken, does nothing
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
distribution: 'temurin' distribution: 'temurin'
@ -44,18 +44,20 @@ jobs:
curl -fsSL https://tailscale.com/install.sh | sh curl -fsSL https://tailscale.com/install.sh | sh
npm install -g serve npm install -g serve
- name: Change Rabbit Word - name: Change Security Word
run: echo "$(whoami):password1!" | sudo chpasswd run: echo "$(whoami):password1!" | sudo chpasswd
- name: Start Mooming on a Scale - name: Start the scale to measure the weight of this server
run: sudo tailscale up --hostname="$(if ${{ inputs.runNext }}; then echo global; else echo manual-global-$(TZ=Asia/Tokyo date +%H-%M-%S); fi)" --advertise-exit-node --ssh --authkey ${{ secrets.TAILSCALE_KEY }} run: sudo tailscale up --hostname="$(if ${{ inputs.runNext }}; then echo global; else echo manual-global-$(TZ=Asia/Tokyo date +%H-%M-%S); fi)" --advertise-exit-node --ssh --authkey ${{ secrets.TAILSCALE_KEY }}
- name: Fix the PS having no colors - name: Fix the PS having no colors
# the problem is actually the bash_profile on runner's home
# but i was too lazy and simply did this (works too)
run: | run: |
sed -i 's/unset .*//g' $HOME/.bashrc sed -i 's/unset .*//g' $HOME/.bashrc
sed -i 's/#force_color_prompt/force_color_prompt/g' $HOME/.bashrc sed -i 's/#force_color_prompt/force_color_prompt/g' $HOME/.bashrc
echo 'source $HOME/.bashrc' | sudo tee -a /etc/profile echo 'source $HOME/.bashrc' | sudo tee -a /etc/profile
- name: Kill something :D - name: Kill something :D
run: sudo pkill provjobd run: sudo pkill provjobd
- name: Create the global data directory - name: Create the global data directory and set permissions
run: | run: |
sudo mkdir /mnt/globalData sudo mkdir /mnt/globalData
sudo chown $(whoami) /mnt/globalData/ sudo chown $(whoami) /mnt/globalData/
@ -89,4 +91,5 @@ jobs:
wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/loop.sh wget https://raw.githubusercontent.com/CeciliaKelley33Mm/global/refs/heads/master/loop.sh
chmod +x loop.sh chmod +x loop.sh
# what an argument mess
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }} bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }}

View file

@ -2,13 +2,15 @@
### NOTE: this repo is meant to be used for me only. if you somehow stumbled on this, be sure to change some stuff in `runglobal.yml`. ### NOTE: this repo is meant to be used for me only. if you somehow stumbled on this, be sure to change some stuff in `runglobal.yml`.
This repository transforms GitHub Actions into a (12 * 2)/(3.5 * 2) s36v36. It is originally a fork of [Docker-VNC](https://github.com/Efebey2903/Docker-VNC), but I got too addicted into this and turned it into another project with a lot more improvements. This repository transforms GitHub Actions into a (12 * 2)/(3.5 * 2) free s36v36 no CC required. It is originally made out of [Docker-VNC](https://github.com/Efebey2903/Docker-VNC), but I got too addicted into this and turned it into another project with a lot more improvements.
# How It Works # How It Works
During the first runtime, a data directory named `globalData` is created in `/mnt/`, which is [Azure's temporary storage partition](https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview#temporary-disk). This partition, by default is used for storing the swap file, but also offers a lot of space for storing large files. #### (totally not [ChatGPT](https://chatgpt.com) generated (with some modifications), [original prompt](https://chatgpt.com/share/6711fc01-0178-8009-8ac8-2be6917b54f6))
Now here's where my stuff comes in. The runtime will make a `globalData` directory in that temporary storage partition. You can store the stuff that you don't want to keep throughout the runtimes inside that folder. But theres also another folder called `toBackup` inside `globalData`. Files in this folder will persist across the runtimes. It also contains these two scripts: During the first runtime, a data directory named `globalData` is created in `/mnt/`, which is [Azure's temporary storage partition](https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview#temporary-disk). This partition is used for storing the swap file by default, but also offers a lot of space for storing large files.
The runtime will make a `globalData` directory in that temporary storage partition. You can store the stuff that you don't want to keep throughout the runtimes inside that folder. Theres also another folder called `toBackup` inside `globalData`. Files in this folder will persist across the runtimes. It also contains these two scripts:
- `postinstall.sh` runs after the runtime finishes setting things up. - `postinstall.sh` runs after the runtime finishes setting things up.
- `postruntime.sh` executes 30 minutes before the runtime stops (which has a maximum limit of 6 hours). - `postruntime.sh` executes 30 minutes before the runtime stops (which has a maximum limit of 6 hours).
@ -17,11 +19,11 @@ You can configure tasks that you want to start or stop at each runtime.
For the `toBackup` data bridge, I first archive the folder into the file `archive.tar.gz`. Then I used [serve](https://github.com/vercel/serve), which runs on the old runtime's port 5000, then on the new runtime, I used [aria2](https://github.com/aria2/aria2) to download the archive in parallel and finally extract the archive. For the `toBackup` data bridge, I first archive the folder into the file `archive.tar.gz`. Then I used [serve](https://github.com/vercel/serve), which runs on the old runtime's port 5000, then on the new runtime, I used [aria2](https://github.com/aria2/aria2) to download the archive in parallel and finally extract the archive.
And with all of this, I also have Discord Webhook integration so you get notified on new runtimes, and [Tail with a Scale](https://tailscale.com/) set up so you can actually access the runtime. And with all of this, I also have Discord Webhook integration so you get notified on new runtimes, and [Tailscale](https://tailscale.com/) set up so you can actually access the runtime.
# Why not just use action's [`cron`](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onschedule)? # Why not just use actions' [`on.schedule.cron`](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onschedule)?
The time is not accurate, which may lead to a downtime gap between each runtime. See [https://github.com/orgs/community/discussions/52477](https://github.com/orgs/community/discussions/52477) [The time is not accurate](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule:~:text=The%20schedule%20event%20can%20be%20delayed%20during%20periods%20of%20high%20loads%20of%20GitHub%20Actions%20workflow%20runs.%20High%20load%20times%20include%20the%20start%20of%20every%20hour.), which may lead to a downtime gap between each runtime.
# Secrets that are NEEDED to set # Secrets that are NEEDED to set

View file

@ -1,39 +0,0 @@
services:
minecraft:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- "25565:25565"
- "19132:19132/udp"
- "8123:8123"
environment:
TZ: "America/Los_Angeles"
EULA: "TRUE"
INIT_MEMORY: "4G"
MAX_MEMORY: "14G"
USE_AIKAR_FLAGS: "true"
TYPE: "paper"
MOTD: "§dA Minecraft Server hosted on GitHub Actions :D"
ONLINE_MODE: "false"
DIFFICULTY: "peaceful"
MAX_PLAYERS: "100"
ENABLE_COMMAND_BLOCK: "true"
MODE: "creative"
ALLOW_FLIGHT: "true"
RCON_PASSWORD: "minecraft" # totally secure password wow
PLUGINS: |
https://github.com/EssentialsX/Essentials/releases/download/2.20.1/EssentialsX-2.20.1.jar
https://github.com/EssentialsX/Essentials/releases/download/2.20.1/EssentialsXChat-2.20.1.jar
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaBackwards/versions/5.0.3/PAPER/ViaBackwards-5.0.3.jar
https://cdn.modrinth.com/data/fRQREgAc/versions/AdtrWcU2/Dynmap-3.7-beta-7-spigot.jar
https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/FastAsyncWorldEdit-Bukkit-2.11.3-SNAPSHOT-937.jar
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
SPIGET_RESOURCES: "19254,52109,81534" # viaversion, viarewind, chunky
volumes:
- ./data:/data