pradt2 / always-online-stun

A list of publicly available STUN servers, refreshed every hour.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How about realizing this as a self-triggering GitHub Action?

kyr0 opened this issue · comments

Hey :)

this project is truly amazing! The only thing I think that could make it even better is a self-triggering GitHub action.
It seems like that the Rust scripts being triggered "externally". But this would "stop" if the "central" infra that triggers this update script stops working for some reason. But if implemented as a GitHub Action, this would run forever, and be much more resilient?

Self-triggering can be approached when you build a GitHub Action that registers an action on push that runs the rust, and then waits a while (NOP) before it pushes to the very same repo -> recursion.

Thanks a lot for your work here!

Hey hey, thanks for the suggestion. I don't mind using my VM for the checks, but if there is a chance to offload this task to a M$-owned machine then we should at least investigate it.

I have to admit that I've not worked with Github Actions before. Do any other projects do something similar? Is there an example I could take a look at?

@tarwich and I looked into it recently, and the only thing stopping us from doing it now is the lack of support for IPv6 connectivity in GHA runners actions/runner-images#668

I will keep this issue open as a reminder to keep checking when GHA start supporting IPv6

@pradt2 I tried it with the dockerized GitHub runner solution (https://github.com/myoung34/docker-github-actions-runner) but get some failed jobs.
But the standard self-hosted runner can reach IPv6 (https://github.com/actions/runner).
https://github.com/agoraxyz/ipv6-test/runs/7031276610?check_suite_focus=true

Hi @D3vl0per , thanks for the suggestion. I'm not sure how my tiny VPS will handle the Github runner runtime, but it's definitely worth a try

I have an even better idea. My VPS already has Wireguard installed, so it should be possible to execute the GHA on Microsoft runners and connect from within the runner to to my VPS for IPv6 connectivity.

I think this is the best way forward.

I'm in. Just not understanding all the words being said 😆 . When you say execute the action on Microsoft runners... is that a setting we setup in GitHub actions? I don't think that's in the .yml file, right? It's in the repo settings, so I wouldn't have access to it IIRC.

I'm watching this thread to see if there's anything I can do to help. If there is, please let me know 😁.

@tarwich I created a Github Action that does all that we want. Excpt running, it doesm't want to run... It was running well when the 'on' trigger was for branch push, but it doesn't run on schedule. Could you take a look?

https://github.com/pradt2/always-online-stun/actions/runs/2573284964

image

I looked at your .yml and it looks fine. What's more, it says the schedule triggered and ran successfully. The schedule is set to run on minute zero of every hour, and the last run took ~6 minutes, so I'll check again in 30 minutes and see if we got another run. Looking good!

Ah right, I did check it 2 hours after pushing, and it still hadn't ran, I guess the scheduler takes a while to pick up the job.

I think we can close this now.

Thanks to @kyr0 and @D3vl0per for your suggestions.

Special thanks to @tarwich for contributing a baseline Github Action snippet that enabled this.