- Shell 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| icons | ||
| README.md | ||
| slk-ci.sh | ||
| UNLICENSE | ||
| watch.txt | ||
This is a workflow template.
Use "Use this template" to create your own copy. Do not open PRs upstream.
=====
sbo-ntfy
This is a TEMPLATE for how you can have the opportunity to receive a notification on your mobile when someone goes through https://slackbuilds.org/submit/ one of the packages that you are the maintainer.
This application is useful since there are some technical problems from time to time with the email notification and this results in someone being able to pretend to be you and update one of your packages (in the best case scenario) or something worse...(bad case scenario).
It is a very secure application, no personal data is needed such as phone number or email, etc. The opportunity to run it for free and properly is given to us by installing ntfy app on our mobile phone and run a .forgejo/workflows from a private repo.
I thank those who gave us this forge opportunity :)
HOWTO
mobile-setup
- Download app:
Android: https://play.google.com/store/apps/details?id=io.heckel.ntfy
- Open the app, press "+" and write any channel name.
example: slackbuilds-my-watch-93842
- Remember the name because same topic name we will use in workflow:
https://ntfy.sh/slackbuilds-my-watch-93842
Use a difficult/random topic so no one can guess in case you want to hide your notifications.
Why don't we want a topic with an easy name?
There is no security issue but if you use a simple topic like alerts, test, slackbuilds
someone might find it (accidentally or from a leak)
and maybe will start spamming notifications.
So create a very random/particular name slackbuilds-watch-7f3k9q2x1m etc...
forge.slackware.nl
The best and correct way is Use This Template
Hit that button continue it is very simple.
Next add like these:
Then hit Create Repository
Your repo is almost ready, just few edits needed:
- Open watch.txt and place in your SBo packages exaclty like the
Example:
academic/foo
audio/voo
development/foo2
etc...
-
Open
.forgejo/workflows/watcher.ymland replace: -
YOUR_TOPIC_NAME_HERE --> were needed (1 time) with the name of topic you created in mobile ntfy app (the exaclty channel name)
-
YOUR_USER_NAME --> were needed (2 times) with the nickname you use for
https://forge.slackware.nl -
OPEN
https://forge.slackware.nl/user/settings/applicationsand create a New access token -
Name give any name you like
-
Pick up
All (public private and limmited) -
In Select permissions pick up
read+writeto all avaliable places -
Ones token created and appears copy it because you will need it and you cant find it again.
-
Open
https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frk/settings/actions/secrets -
Hit Add secret
-
Name it:
API_TOKEN -
Paste in the token you copied earlier
-
Confirm
To use as TEMPLATE from cli this repo: (is not suggested)
- Use your browser and create an empty repository, assume you name it
sbo-ntfy-frk - open terminal and command:
git clone https://forge.slackware.nl/rizitis/sbo-ntfy.git
cd sbo-ntfy
rm -rf .git
Use a text edditor for watch.txt and place in your SBo packages exaclty like the
Example:
academic/foo
audio/voo
development/foo2
etc...
Save file, exit editor
Now open .forgejo/workflows/watcher.yml
and replace:
- YOUR_TOPIC_NAME_HERE --> were needed (1 time) with the name of topic you created in mobile ntfy app (the exaclty channel name)
- YOUR_USER_NAME --> were needed (2 times) with the nickname you use for
https://forge.slackware.nl
Save file, exit editor and command:
git init
# --- Add your forge.slackware YOUR_USER_NAME ---
git remote add origin https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frk.git
git add .
git commit -m "init from template"
git branch -M main
git push -u origin main
You should now reload web page to access your
https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frkwith all files in.
SET-UP
-
Edit watcher.txt with your
-
Open
https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frk/settingsand make it private
- OPEN
https://forge.slackware.nl/user/settings/applicationsand create a New access token
- Name give any name you like
- Pick up
All (public private and limmited) - In Select permissions pick up
read+writeto all avaliable places - Ones token created and appears copy it because you will need it and you cant find it again.
- Open
https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frk/settings/actions/secrets
- Hit Add secret
- Name it:
API_TOKEN - Paste in the token you copied earlier
- Confirm
Your system is now live.
It will:
- run every 1 hour
- read SlackBuilds PRs
- filter by
submission-formlabel
- match against watch.txt
- avoid duplicates
- send notifications via ntfy
TEST
To test if everything works fine:
Made a valid foo.tar.gz from your packages and upload it to SBo using https://slackbuilds.org/submit/
When the package appear to https://github.com/SlackBuildsOrg/slackbuilds/pulls
wait for workflow to run in the next one hour and you will have a notify in your mobile.
Alternative you can manuall run workflow and see if working:
To do it open https://forge.slackware.nl/YOUR_USER_NAME/sbo-ntfy-frk/actions
click on the left side on watcher.yml
And then click on Run workflow
TIP
If you manage a lot of packages and you are bored of writing the watch.txt list one by one, you can install repology-cli from SBo and simply run: (replace example@email.com with your email )
repology --maintainer example@email.com | awk '{print $1}' | sort -u > watch.txt
A basic requirement for repology to work is that you have the same valid email address in all .info files.
rizitis[AT]yah00[DOT]com --- as email address in your .info files is not a valid email for repology and will not work