Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #10 from lca1/dev
Browse files Browse the repository at this point in the history
MedCo v0.2.0
  • Loading branch information
mickmis authored May 2, 2019
2 parents e12359a + e37ed47 commit c3ad2a9
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test_fmt:
test_lint:
@echo Checking linting of files
@{ \
go get -u golang.org/x/lint/golint; \
go install golang.org/x/lint/golint; \
el=$(EXCLUDE_LINT); \
lintfiles=$$( golint ./... | egrep -v "$$el" ); \
if [ -n "$$lintfiles" ]; then \
Expand Down
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@
MedCo documentation is centralized on the following website:
[MedCo Unlynx](https://medco.epfl.ch/documentation/developer/components/medco-unlynx.html).

## Version

We have a development and a stable version. The `master`-branch in `github.com/lca1/medco-unlynx` is the development version that works but can have incompatible changes.

Use one of the latest tags `v0.1.1d` that are stable and have no incompatible changes.

**Very Important!!**

Due to the current changes being made to [onet](https://github.com/dedis/onet) and [kyber](https://github.com/dedis/kyber) (release of v3) you must revert back to previous commits for these two libraries if you want medco-unlynx to work. This will change in the near future.

```bash
cd $GOPATH/src/dedis/onet/
git checkout 5796104343ef247e2eed58e573f68c566db2136f

cd $GOPATH/src/dedis/kyber/
git checkout f55fec5463cda138dfc7ff15e4091d12c4ddcbfe
```

## License
*medco-unlynx* is licensed under a End User Software License Agreement ('EULA') for non-commercial use.
If you need more information, please contact us.
30 changes: 15 additions & 15 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
FROM medco/unlynx:v1.2b-alpha as build
FROM golang:1.11 as build

# build time environment variables
ENV MEDCO_UNLYNX_REPO="github.com/lca1/medco-unlynx"
COPY ./ /src
WORKDIR /src

ENV GO111MODULE=on
# get dependencies
RUN go get -v -d ./...

# adjust timeout values
RUN sed -i 's/conn.SetReadDeadline(time.Now().Add(5 \* time.Minute))/conn.SetReadDeadline(time.Now().Add(5 \* time.Hour))/' /go/src/github.com/dedis/onet/websocket.go && \
sed -i 's/const expirationTime = 1 \* time.Minute/const expirationTime = 1 \* time.Hour/' /go/src/github.com/dedis/onet/overlay.go
# hack to adjust timeout values in onet
RUN cd /go/pkg/mod/go.dedis.ch/onet && \
chmod u+w -R . && \
find . -maxdepth 2 -name overlay.go | xargs sed -i \
's/const expirationTime = 1 \* time.Minute/const expirationTime = 1 \* time.Hour/' && \
find . -maxdepth 2 -name websocket.go | xargs sed -i \
's/conn.SetReadDeadline(time.Now().Add(5 \* time.Minute))/conn.SetReadDeadline(time.Now().Add(5 \* time.Hour))/'

COPY ./ /go/src/$MEDCO_UNLYNX_REPO

# get remaining dependencies, compile and install medco-unlynx binary
# compile and install medco-unlynx binary
# CGO_ENABLED=0 in order to be able to run from alpine
WORKDIR /go/src/$MEDCO_UNLYNX_REPO
RUN go get -v -d ./... && \
CGO_ENABLED=0 go build -v ./... && \
RUN CGO_ENABLED=0 go build -v ./... && \
CGO_ENABLED=0 go install -v ./... && \
mv /go/bin/app /go/bin/medco-unlynx

Expand All @@ -26,12 +27,11 @@ FROM golang:1.11-alpine as release
ENV NODE_IDX="0" \
UNLYNX_DEBUG_LEVEL="1" \
MEDCO_CONF_DIR="/medco-configuration"
ENV UNLYNX_BIN_EXPORT_PATH="$MEDCO_CONF_DIR/medco-unlynx"

COPY --from=build /go/bin/medco-unlynx /go/bin/
COPY deployment/docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
apk add --no-cache bash outils-md5
apk add --no-cache bash

VOLUME "$MEDCO_CONF_DIR"
ENTRYPOINT ["docker-entrypoint.sh"]
10 changes: 0 additions & 10 deletions deployment/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ set -Eeuo pipefail
export UNLYNX_KEY_FILE_PATH="$MEDCO_CONF_DIR/srv$NODE_IDX-private.toml" \
UNLYNX_DDT_SECRETS_FILE_PATH="$MEDCO_CONF_DIR/srv$NODE_IDX-ddtsecrets.toml"

# copy unlynx binary in the configuration folder
if [[ (-f "$UNLYNX_BIN_EXPORT_PATH" && $(md5 /go/bin/medco-unlynx) != $(md5 $UNLYNX_BIN_EXPORT_PATH) ) ]]; then
rm -f $UNLYNX_BIN_EXPORT_PATH
fi

if [[ ! -f "$UNLYNX_BIN_EXPORT_PATH" ]]; then
cp /go/bin/medco-unlynx $UNLYNX_BIN_EXPORT_PATH
chmod 777 $UNLYNX_BIN_EXPORT_PATH
fi

# run unlynx
if [[ $# -eq 0 ]]; then
ARGS="-d $UNLYNX_DEBUG_LEVEL server -c $UNLYNX_KEY_FILE_PATH"
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/lca1/unlynx v0.0.0-20190312131415-2e3533f65afe
github.com/lib/pq v1.0.0
github.com/satori/go.uuid v1.2.0
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
github.com/stretchr/testify v1.3.0
go.dedis.ch/kyber/v3 v3.0.0
go.dedis.ch/onet/v3 v3.0.0
Expand Down
21 changes: 19 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
Expand All @@ -11,16 +12,23 @@ github.com/daviddengcn/go-colortext v0.0.0-20180409174941-186a3d44e920 h1:d/cVoZ
github.com/daviddengcn/go-colortext v0.0.0-20180409174941-186a3d44e920/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE=
github.com/fanliao/go-concurrentMap v0.0.0-20141114143905-7d2d7a5ea67b h1:aHrWACMJZJ160Pl0qlH6s0/+5Kb1KYG/kEUTaZCW7QY=
github.com/fanliao/go-concurrentMap v0.0.0-20141114143905-7d2d7a5ea67b/go.mod h1:DRc7ieGsJItxOsZ2lnqemj92zsSsBjBepuritZaumSE=
github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450 h1:7xqw01UYS+KCI25bMrPxwNYkSns2Db1ziQPpVq99FpE=
github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho=
github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995 h1:f5gsjBiF9tRRVomCvrkGMMWI8W1f2OBFar2c5oakAP0=
github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8=
github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e h1:KhcknUwkWHKZPbFy2P7jH5LKJ3La+0ZeknkkmrSgqb0=
github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lca1/unlynx v0.0.0-20190213120802-5cef42d6b22c h1:PnK0cljJWiYFEg8Hb241BKo4f9gCO44BIAi+Kb2vEAk=
github.com/lca1/unlynx v0.0.0-20190213120802-5cef42d6b22c/go.mod h1:QlvYsckeeV0ZKVx0Ryh2wI2VyXMlKvn4uq5rX4Op2U0=
github.com/lca1/unlynx v0.0.0-20190312131415-2e3533f65afe h1:WHc+KZi5aiGJJyNcADipOkaB+d1TWE7nVEwzDzFfi8A=
github.com/lca1/unlynx v0.0.0-20190312131415-2e3533f65afe/go.mod h1:iVlai2WR/UbMOeozxL2uOuLK2AQ+pcEl0Hkepk1ub3g=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
Expand All @@ -34,6 +42,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/r0fls/gostats v0.0.0-20180711082619-e793b1fda35c/go.mod h1:2mJY7Hx2k1GaMAmiAoyy090oY3RTSk3kkaaTieLq7wc=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
Expand All @@ -57,15 +69,20 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f h1:hX65Cu3JDlGH3uEdK7I99Ii+
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e h1:3GIlrlVLfkoipSReOMNAgApI0ajnalyLa/EZHHca/XI=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5 h1:ZcPpqKMdoZeNQ/4GHlyY4COf8n8SmpPv6mcqF1+VPSM=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/satori/go.uuid.v1 v1.2.0 h1:AH9uksa7bGe9rluapecRKBCpZvxaBEyu0RepitcD0Hw=
gopkg.in/satori/go.uuid.v1 v1.2.0/go.mod h1:kjjdhYBBaa5W5DYP+OcVG3fRM6VWu14hqDYST4Zvw+E=
Expand Down

0 comments on commit c3ad2a9

Please sign in to comment.