Skip to content

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

Closed
@sahal

Description

@sahal

Since #51 was merged in Actions have been failing: https://github.com/redlib-org/redlib-instances/actions

Screenshot_20240725_205735

It seems that maybe the last PR generated an instances.json without any .i2p or .onion links. I'm assuming (big assumption) that the instances.json file was generated with the -T flag.

The logic in the bash script is set to fail when jq exits non-zero.

    731         IFS=$'\n' imported_nonwww=($(jq -Mcer '.instances[] | select(.onion or .i2p)' "${import_nonwww_from_file}"))
    732         rc=$?
    733 
    734         if [[ ${rc} -ne 0 ]]
    735         then
    736             echo >&2 "Failed to read onion instances from existing JSON file."
    737             return 1
    738         fi
    739     fi

In my opinion, it should be logical to sometimes have a list of redlib instances without .onion or .i2p sites.

A lazy way to do this would be to set rc to 0 when you do not find .onion or .i2p in the json (via grep for example). I've proposed this in a linked PR.

Other options

  1. (schema fix) If you always expect an onion or i2p site to be running redlib then you'll have to check to see if people accidentally (or otherwise) generated the instances.json file without having Tor or I2p enabled. Maybe add a note to the json with the bash script flags or something.

  2. (process fix) Personally, I don't think its reasonable for people adding their own (or others) instances to have to run Tor to generate the instances.json. You might be able to solve this by always having the maintainers generate instances.json (assuming maintainers use Tor and i2p).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions