Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
ee3ea80b
Commit
ee3ea80b
authored
Apr 12, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add ipfs_get_real_url and use it for gateway mode
parent
cbf3f0f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
tools_eget
bin/tools_eget
+16
-4
No files found.
bin/tools_eget
View file @
ee3ea80b
...
...
@@ -626,14 +626,19 @@ elif [ "$ipfs_mode" = "local" ] ; then
elif
[
"
$ipfs_mode
"
=
"gateway"
]
;
then
info
"Will use eget
$IPFS_GATEWAY
/HASH"
ipfs_get
()
ipfs_get_real_url
()
{
[
-n
"
$IPFS_GATEWAY
"
]
||
fatal
"ipfs http gateway is not set"
# FIXME:
echo
"
$IPFS_GATEWAY
/
$1
"
}
ipfs_get
()
{
if
[
-n
"
$2
"
]
;
then
docmd eget
-O
"
$2
"
"
$
IPFS_GATEWAY
/
$1
"
docmd eget
-O
"
$2
"
"
$
(
ipfs_get_real_url
"
$1
"
)
"
else
docmd eget
"
$
IPFS_GATEWAY
/
$1
"
docmd eget
"
$
(
ipfs_get_real_url
"
$1
"
)
"
fi
}
...
...
@@ -655,6 +660,11 @@ fi
if
[
-n
"
$IPFS_CMD
"
]
;
then
ipfs_get_real_url
()
{
return
1
}
ipfs_get
()
{
[
-n
"
$IPFS_CMD
"
]
||
fatal
"ipfs api is not usable"
...
...
@@ -826,6 +836,8 @@ url_get_real_url()
{
local
URL
=
"
$1
"
local
CID
=
"
$(
cid_from_url
"
$URL
"
)
"
# if we use gateway, return URL with gateway
ipfs_get_real_url
"
$URL
"
&&
return
get_url_by_cid
"
$CID
"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment