Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
654ca169
Commit
654ca169
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
ipfs on mesh
parent
3ea1b034
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-app-ipfs
+36
-38
36 additions, 38 deletions
src/freedombone-app-ipfs
src/freedombone-image-customise
+1
-1
1 addition, 1 deletion
src/freedombone-image-customise
src/freedombone-image-mesh
+15
-4
15 additions, 4 deletions
src/freedombone-image-mesh
with
52 additions
and
43 deletions
src/freedombone-app-ipfs
+
36
−
38
View file @
654ca169
...
...
@@ -39,6 +39,7 @@ IPFS_N_VERSION='2.1.4'
IPFS_JS_VERSION
=
'0.14.3'
IPFS_JS_RONIN_VERSION
=
'0.3.11'
IPFS_KEY_LENGTH
=
2048
IPFS_GO_VERSION
=
0.4.2
function
reconfigure_ipfs
{
echo
-n
''
...
...
@@ -378,50 +379,47 @@ function install_ipfs_js {
}
function
mesh_install_ipfs_go
{
chroot
${
rootdir
}
apt-get
-y
install
golang
libpam0g-dev fuse
chroot
${
rootdir
}
apt-get
-y
install
libpam0g-dev fuse
wget
mesh_upgrade_golang
GOPATH
=
/home/go/go
${
GO_VERSION
}
IPFS_ARCH
=
IPFS_PATH
=
/usr/bin
cat
<<
EOF
>
${
rootdir
}
/root/install_ipfs_go.sh
export GOPATH=
$GOPATH
export GOROOT=/home/go
IPFS_PATH=
$IPFS_PATH
echo "go get -u
${
IPFS_GO_REPO_BASE
}
/cmd/ipfs"
go get -u
${
IPFS_GO_REPO_BASE
}
/cmd/ipfs
if [ ! "
$?
" = "0" ]; then
exit 8242
fi
if [ ! -d
$GOPATH
/src/
$IPFS_GO_REPO_BASE
]; then
echo
$'
go get failed to get ipfs'
exit 63923
fi
cd
\$
GOPATH/src/
${
IPFS_GO_REPO_BASE
}
git checkout
$IPFS_COMMIT
-b
$IPFS_COMMIT
if [ ! "
$?
" = "0" ]; then
exit 735639
fi
if
[
!
-d
$rootdir$INSTALL_DIR
/ipfs
]
;
then
mkdir
-p
$rootdir$INSTALL_DIR
/ipfs
fi
cd
$rootdir$INSTALL_DIR
/ipfs
make install
if [ ! "
$?
" = "0" ]; then
exit 6743895
fi
if
[[
$ARCHITECTURE
==
*
"386"
]]
;
then
IPFS_ARCH
=
386
fi
if
[[
$ARCHITECTURE
==
*
"amd64"
]]
;
then
IPFS_ARCH
=
amd64
fi
if
[[
$ARCHITECTURE
==
*
"arm"
*
]]
;
then
IPFS_ARCH
=
arm
fi
if
[
!
$IPFS_ARCH
]
;
then
return
fi
exit 0
EOF
chroot
${
rootdir
}
chmod
+x /root/install_ipfs_go.sh
chroot
${
rootdir
}
bash /root/install_ipfs_go.sh
if
[
!
-f
${
rootdir
}
$IPFS_PATH
/ipfs
]
;
then
echo
'IPFS was not installed'
exit
73529
IPFS_FILE
=
go-ipfs_v
${
IPFS_GO_VERSION
}
_linux-
${
IPFS_ARCH
}
.tar.gz
wget https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v
${
IPFS_GO_VERSION
}
/
${
IPFS_FILE
}
if
[
!
-f
$rootdir$INSTALL_DIR
/ipfs/
${
IPFS_FILE
}
]
;
then
echo
$'IPFS package could not be downloaded'
exit
63725
fi
tar
-xzvf
${
IPFS_FILE
}
if
[
!
-f
$rootdir$INSTALL_DIR
/ipfs/go-ipfs/ipfs
]
;
then
echo
$"ipfs was not found in downloaded package"
exit
638235
fi
chroot
"
$rootdir
"
cp
$INSTALL_DIR
/ipfs/go-ipfs/ipfs
$IPFS_PATH
if
[
!
-f
$rootdir$IPFS_PATH
/ipfs
]
;
then
echo
$'IPFS was not installed'
exit
63722
fi
chroot
${
rootdir
}
rm
-f
/root/install_ipfs_go.sh
echo
'[Unit]'
>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
'Description=IPFS go daemon'
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
...
...
@@ -433,9 +431,9 @@ EOF
echo
"User=
$MY_USERNAME
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"Group=
$MY_USERNAME
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"WorkingDirectory=/home/
$MY_USERNAME
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"ExecStart=
$IPFS_PATH
/ipfs daemon
--mount
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"ExecStart=
$IPFS_PATH
/ipfs daemon"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
'Restart=on-failure'
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"Environment=
\"
USER=
$MY_USERNAME
\"
\"
HOME=/home/
$MY_USERNAME
\"
\"
GOPATH=
$GOPATH
\"
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
"Environment=
\"
USER=
$MY_USERNAME
\"
\"
HOME=/home/
$MY_USERNAME
\"
\"
GOPATH=
/home/go/go
${
GO_VERSION
}
\"
"
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
''
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
'[Install]'
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
echo
'WantedBy=multi-user.target'
>>
${
rootdir
}
/etc/systemd/system/ipfs.service
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-image-customise
+
1
−
1
View file @
654ca169
...
...
@@ -557,7 +557,7 @@ initialise_mesh() {
install_tomb
#install_tahoelafs
#install_librevault
#
install_ipfs
install_ipfs
install_tox
install_web_server
if
[
$ENABLE_ZERONET
]
;
then
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-image-mesh
+
15
−
4
View file @
654ca169
...
...
@@ -730,10 +730,6 @@ function setup_ipfs {
rm
-rf
/home/
$MY_USERNAME
/.ipfs
fi
if
[
-f
/home/git/gvm/bin/gvm
]
;
then
/home/git/gvm/bin/gvm use go
${
GO_VERSION
}
--default
fi
su
-c
"
$IPFS_COMMAND
init -b
$IPFS_KEY_LENGTH
"
-
$MY_USERNAME
if
[
!
-d
/home/
$MY_USERNAME
/.ipfs
]
;
then
echo
"IPFS could not be initialised for user
$MY_USERNAME
"
>>
$INSTALL_LOG
...
...
@@ -754,6 +750,21 @@ function setup_ipfs {
return
fi
# directories to mount to
if
[
!
-d
/ipfs
]
;
then
mkdir
/ipfs
mkdir
/ipns
chown
$MY_USERNAME
:
$MY_USERNAME
/ipfs
chown
$MY_USERNAME
:
$MY_USERNAME
/ipns
fi
if
[
-f
/etc/fuse.conf
]
;
then
chown
$MY_USERNAME
:
$MY_USERNAME
/etc/fuse.conf
fi
if
[
-f
/dev/fuse
]
;
then
chown
$MY_USERNAME
:
$MY_USERNAME
/dev/fuse
fi
# TODO in avahi service for ipfs replace IPFS_PEER_ID
echo
'IPFS installed with ID $IPFS_PEER_ID'
>>
$INSTALL_LOG
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment