Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazily check if onion or i2p sites exist in instances.json #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sahal
Copy link

@sahal sahal commented Jul 26, 2024

A silly attempt to fix #53

no onion test

$ cat instances-noonion.txt
https://example.com/redlib,US,false,""
https://example.org/redlib,US,false,""
$ cat instances-noonion.json 
{
  "updated": "2024-07-15",
  "instances": [
    {
      "url": "https://example.com/redlib",
      "country": "US",
      "version": "v0.0.0"
    },
    {
      "url": "https://example.org/redlib",
      "country": "US",
      "version": "v0.0.0"
    }
  ]
}
$ ./generate-instances-json.sh -e -i ./instances-noonion.txt -I ./instances-noonion.json -o ./instances-noonion.json
https://example.com/redlib: FAILED
https://example.org/redlib: FAILED
The following instances could not be reached:
        https://example.com/redlib
        https://example.org/redlib

with onion test

$ cat instances-withonion.txt 
https://example.onion/redlib,US,false,""
https://example.i2p/redlib,US,false,""
$ cat instances-withonion.json 
{
  "updated": "2024-07-26",
  "instances": [
    {
      "onion": "https://example.onion/redlib",
      "country": "US",
      "version": "v0.0.0"
    },
    {
      "onion": "https://example.i2p/redlib",
      "country": "US",
      "version": "v0.0.0"
    }
  ]
}
$ ./generate-instances-json.sh -e -i ./instances-withonion.txt -I ./instances-withonion.json -o ./instances-withonion.json 
https://example.onion/redlib: SKIPPED
https://example.i2p/redlib: SKIPPED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If no onion or i2p sites exist in json file, the github action will always fail
1 participant