status-go icon indicating copy to clipboard operation
status-go copied to clipboard

Raspberry Pi Mailserver

Open jfarid27 opened this issue 6 years ago • 2 comments
trafficstars

Problem

Go 1.12.4 is able to run on Arm platforms, so I wanted to try and take a crack at getting status-go to run on a Raspberry Pi 3 B+ (ARMv8). It appears that this should be doable, but there's a few issues I ran into I wanted to share.

Implementation

  1. Install Go 1.12.4 using the Armv6L binary. This appears to work on both. I use the ARMv8 version of a PI to install and it worked fine.
  2. go get github.com/status-im/status-go. This worked fine obviously.
  3. Run Make Setup. This is where things got weird. I had to circumvent a few necessary packages for development to get it running. I had to remove the go linter and the go deps checker specifically calls in the Makefile.
  4. I had to remove the install_deps.sh call. Something during the running would not release the dpkg lock so I just installed the dependencies manually.
  5. After this all ran, I realized there a docker mailserver image RIGHT THERE. I installed a docker setup but realized there is a current bug with how it works with systemctl and it simply doesn't work at all when trying to run the image. I ended up saying screw it and trying to build the statusd from source.
  6. Building statusd from source was a bit hard, but not difficult. I just used the build instruction in the Makefile to do this. There were a few packages I ran into that it couldn't find, like x/unix. Each time I hit a could not find error, I just went and ran go get for the missing package. I want sure if there was an issue here with go's installations and how it manages dependencies or me not having the deps library. deps doesn't even work on ARM so I'm not sure why these weren't in. Eventually I got through it by manually installing and got statusd built.

Current implementation problems

  • Let's update the docs to do a shallow git install. It's kind of weird but for a Pi I don't want to install using git clone alone without a shallow clone with an exact tar. Let's also make sure there's instructions to link this correctly in the GOPATH. Luckily when I ran make setup, it explicitly said where it wanted the folder, so I just used mkdir to add the appropriate folder in the GOPATH/src -docker didn't work. Raspis apparently don't work well with docker images since it seems the binaries for dependencies must be built for the ARM architecture. I just built and ran the code from source, but didn't look too deeply into whether I could get this working. You just have to make setup and build statusd.
  • golangci-lint is a lint dependency that isn't really necessary for building. When running make setup, the architecture is checked but since they haven't updated their architecture to accept ARMv7 it fails on install. To circumvent this, I removed golangci-lint from the Makefile.
  • dep ensure -update github.com/golang/mock times out due to a lock file issue when doing the mock-install step. Had to remove it completely.
  • _assets/scripts/install_deps.sh in install-os-dependencies didn't work. I just manually installed them with sudo apt get and removed this step.
  • There was a few packages like x/unix and x/crypto package that couldn't be found during the build of statusd. I'm not sure if this was a installation error since it seemed like a lot of people had problems with this ok Stack overflow. When building, I just had to go get every package I hit that wasn't installed.

Current Status

~~I was able to get through the setup, and should update on running the mailserver soon. I'm currently working on installing docker. Docker is able to run using the get.docker website script, but docker-compose must be installed through pip.~~

I was able to get through the setup and built statusd on the Raspberry Pi 3 B+. Mailserver seems to work fine and have connected to the Status mobile app.

Acceptance Criteria

We're able to run a Mailserver on a Raspberry Pi ARMv8 architecture without these headaches. Maybe a separate bash script and some separate make commands to install these things would be nice. At the very least, docs would be nice.

Notes

It's possible this wont work stand up long since it may take up far too much compute power. It's mostly a POC to support ARM architectures, but given that it seems most people have Pi's just laying around, it might be good to add support for it. I could imagine people who have working PiHoles to be interested in hosting a Mailserver at home.

Future Steps

  • [ ] Add some documentation that gives instructions to installing a Raspi version of the mailserver.
  • [ ] Possibly make separate Makefile commands +bash to build and run targeting Raspis.

jfarid27 avatar Apr 15 '19 19:04 jfarid27

Updated this with a cleaned version. Was able to get it running!

jfarid27 avatar Apr 16 '19 13:04 jfarid27

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

status-github-bot[bot] avatar Aug 05 '21 16:08 status-github-bot[bot]