simplex-chat / simplex-chat/simplexmq
smp-server-download.Dockerfile does not verify smp-server binary
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 847
- Forks
- 111
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 9
Description
I just recently rebuilt the docker container running my smp-server, and encountered a failure mode when building the -download docker image. If github throttles you or there's some other network error when you attempt to download, the result is that your smp-server binary might just be a bad server response in a text file 😄
# cat /usr/bin/smp-server
<?xml version="1.0" encoding="utf-8"?><Error><Code>ServerBusy</Code><Message>Egress is over the account limit.
RequestId:f4b4d993-b01e-006c-0778-d3c9f2000000
Time:2022-09-28T20:26:34.2999215Z</Message></Error>
The result is the rather obtuse log message when the entrypoint tries to execute the bad text file:
/usr/bin/smp-server: 1: Syntax error: redirection unexpected
One solution to this might be publishing a shasum of the smp-server binary as an asset on your github releases, and then comparing that hash with the downloaded binary in the -download.Dockerfile build to ensure that your downloaded binary matches what you expect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with smp-server-download.Dockerfile and the step that downloads /usr/bin/smp-server. Check how a failed or non-binary response is handled and whether the downloaded artifact can be compared with a release checksum. Done means the image build rejects an invalid download instead of producing an executable text file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, dockerfile
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100