Commit 84c23a57 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: disable checking for magic CID if IPFS is used

parent ecfd1eca
...@@ -475,7 +475,7 @@ get_ipfs_brave() ...@@ -475,7 +475,7 @@ get_ipfs_brave()
echo "$ipfs_brave" echo "$ipfs_brave"
} }
ipfs_access() ipfs_api_access()
{ {
[ -n "$IPFS_CMD" ] || fatal "IPFS is disabled" [ -n "$IPFS_CMD" ] || fatal "IPFS is disabled"
verdocmd $IPFS_CMD --api $IPFS_API $ipfs_diag_timeout diag sys >/dev/null verdocmd $IPFS_CMD --api $IPFS_API $ipfs_diag_timeout diag sys >/dev/null
...@@ -495,24 +495,26 @@ select_ipfs_mode() ...@@ -495,24 +495,26 @@ select_ipfs_mode()
# if no EGET_IPFS_API, check brave # if no EGET_IPFS_API, check brave
if [ -z "$EGET_IPFS_API" ] && [ -n "$IPFS_CMD" ] ; then if [ -z "$EGET_IPFS_API" ] && [ -n "$IPFS_CMD" ] ; then
IPFS_API="$ipfs_api_brave" IPFS_API="$ipfs_api_brave"
if ipfs_access ; then if ipfs_api_access ; then
if ipfs_check "$ipfs_checkQm" ; then ipfs_mode="brave" && return
ipfs_mode="brave" && return #if ipfs_check "$ipfs_checkQm" ; then
else # ipfs_mode="brave" && return
info "Skipped Brave: it is accessible via $IPFS_CMD --api $IPFS_API, but can't return shared $ipfs_checkQm" #else
fi # info "Skipped Brave: it is accessible via $IPFS_CMD --api $IPFS_API, but can't return shared $ipfs_checkQm"
#fi
fi fi
fi fi
IPFS_CMD="$(print_command_path ipfs)" IPFS_CMD="$(print_command_path ipfs)"
if [ -n "$IPFS_CMD" ] ; then if [ -n "$IPFS_CMD" ] ; then
IPFS_API="$ipfs_api_local" IPFS_API="$ipfs_api_local"
if ipfs_access ; then if ipfs_api_access ; then
if ipfs_check "$ipfs_checkQm" ; then ipfs_mode="local" && return
ipfs_mode="local" && return #if ipfs_check "$ipfs_checkQm" ; then
else # ipfs_mode="local" && return
info "Skipped local: it is accessible via $IPFS_CMD --api $IPFS_API, but can't return shared $ipfs_checkQm" #else
fi # info "Skipped local: it is accessible via $IPFS_CMD --api $IPFS_API, but can't return shared $ipfs_checkQm"
#fi
fi fi
fi fi
...@@ -596,7 +598,7 @@ fi ...@@ -596,7 +598,7 @@ fi
# detect if we run with ipfs:// or with auto # detect if we run with ipfs:// or with auto
if is_ipfsurl "$1" && [ -z "$ipfs_mode" ] || [ "$ipfs_mode" = "auto" ] ; then if is_ipfsurl "$1" && [ -z "$ipfs_mode" ] || [ "$ipfs_mode" = "auto" ] ; then
info "Autodetecting for available IPFS relay..." info "Autodetecting available IPFS relay..."
select_ipfs_mode select_ipfs_mode
info "Auto selected IPFS mode: $ipfs_mode" info "Auto selected IPFS mode: $ipfs_mode"
else else
...@@ -627,14 +629,14 @@ elif [ "$ipfs_mode" = "brave" ] ; then ...@@ -627,14 +629,14 @@ elif [ "$ipfs_mode" = "brave" ] ; then
IPFS_CMD="$(get_ipfs_brave)" || fatal "Can't find ipfs command in Brave" IPFS_CMD="$(get_ipfs_brave)" || fatal "Can't find ipfs command in Brave"
IPFS_PRETTY_CMD="~Brave-Browser/$(basename $IPFS_CMD)" IPFS_PRETTY_CMD="~Brave-Browser/$(basename $IPFS_CMD)"
IPFS_API="$ipfs_api_brave" IPFS_API="$ipfs_api_brave"
ipfs_access || fatal "Can't access to Brave IPFS API (Brave browser is not running and IPFS is not activated?)" ipfs_api_access || fatal "Can't access to Brave IPFS API (Brave browser is not running and IPFS is not activated?)"
info "Will use $IPFS_PRETTY_CMD --api $IPFS_API" info "Will use $IPFS_PRETTY_CMD --api $IPFS_API"
elif [ "$ipfs_mode" = "local" ] ; then elif [ "$ipfs_mode" = "local" ] ; then
IPFS_CMD="$(print_command_path ipfs)" || fatal "Can't find ipfs command" IPFS_CMD="$(print_command_path ipfs)" || fatal "Can't find ipfs command"
IPFS_PRETTY_CMD="$IPFS_CMD" IPFS_PRETTY_CMD="$IPFS_CMD"
IPFS_API="$ipfs_api_local" IPFS_API="$ipfs_api_local"
ipfs_access || fatal "Can't access to IPFS API (ipfs daemon is not running?)" ipfs_api_access || fatal "Can't access to IPFS API (ipfs daemon is not running?)"
info "Will use $IPFS_PRETTY_CMD --api $IPFS_API" info "Will use $IPFS_PRETTY_CMD --api $IPFS_API"
elif [ "$ipfs_mode" = "gateway" ] ; then elif [ "$ipfs_mode" = "gateway" ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment