From 591db8d5415caaf001c57cfa58fc4d4cb6d72f3b Mon Sep 17 00:00:00 2001 From: sneak Date: Wed, 2 Feb 2022 00:36:49 -0800 Subject: [PATCH] bump protoc version in build, use newer syntax in .proto --- Dockerfile | 9 +++++++-- src/mf.proto | 16 ++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 15b969b..6e12a45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,12 @@ FROM golang@sha256:52a48e0239f4d645b20ac268a60361703afe7feb2df5697fa89f72052cb87 #FROM golang:1.16-buster AS builder ENV DEBIAN_FRONTEND noninteractive -RUN apt update && apt install -y make bzip2 protobuf-compiler +RUN apt update && apt install -y make bzip2 curl unzip + +# install newer protoc than what comes with buster +ENV PB_REL https://github.com/protocolbuffers/protobuf/releases +RUN curl -LO $PB_REL/download/v3.19.0/protoc-3.19.0-linux-x86_64.zip && \ + unzip protoc-3.19.0-linux-x86_64.zip -d /usr/local RUN mkdir -p /build WORKDIR /build @@ -26,7 +31,7 @@ COPY ./ ./ # image and we already did it in a previous stage #RUN make lint RUN make mfer -RUN go mod vendor +#RUN go mod vendor RUN tar -c . | bzip2 > /src.tbz2 diff --git a/src/mf.proto b/src/mf.proto index 73ac1ab..90e4e5c 100644 --- a/src/mf.proto +++ b/src/mf.proto @@ -26,11 +26,11 @@ message MFFile { // github.com/frankbraun/gosignify //detached signature, ascii or binary - bytes signature = 201; + optional bytes signature = 201; //full GPG key id - bytes signer = 202; + optional bytes signer = 202; //full GPG signing public key, ascii or binary - bytes signingPubKey = 203; + optional bytes signingPubKey = 203; } message MFFilePath { @@ -42,10 +42,10 @@ message MFFilePath { repeated MFFileChecksum hashes = 201; // optional per-file metadata - string mimeType = 301; - Timestamp mtime = 302; - Timestamp ctime = 303; - Timestamp atime = 304; + optional string mimeType = 301; + optional Timestamp mtime = 302; + optional Timestamp ctime = 303; + optional Timestamp atime = 304; } @@ -67,6 +67,6 @@ message MFFileInner { repeated MFFilePath files = 103; // optional manifest attributes 2xx: - Timestamp createdAt = 201; + optional Timestamp createdAt = 201; }