From 95516356c6d0f0de591c11c399f6f623903823b3 Mon Sep 17 00:00:00 2001
From: Tobias Pfandzelter <pfandzelter@campus.tu-berlin.de>
Date: Wed, 30 Dec 2020 14:34:51 +0100
Subject: [PATCH 1/2] update git urls

---
 .gitlab-ci.yml                               |  6 +-
 .idea/runConfigurations/ci_Dockerfile.xml    |  2 +-
 .idea/runConfigurations/fred_Dockerfile.xml  |  2 +-
 Makefile                                     |  2 +-
 README.md                                    | 10 +--
 ci/Dockerfile                                | 91 ++++++++++----------
 terraform/small-test/fred-node/setup_node.sh |  6 +-
 7 files changed, 60 insertions(+), 59 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 181f7f2..031a502 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/ci:latest
+image: git.tu-berlin.de:5000/mcc-fred/fred/ci:latest
 
 cache:
   paths:
@@ -68,8 +68,8 @@ container:
     - if [ "$CI_COMMIT_REF_NAME" == "master" ]; then CONTAINER_TAG=latest; fi;
     - echo $CONTAINER_TAG
     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-    - docker tag gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred:$CONTAINER_TAG
-    - docker push gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred:$CONTAINER_TAG
+    - docker tag git.tu-berlin.de:5000/mcc-fred/fred/fred git.tu-berlin.de:5000/mcc-fred/fred/fred:$CONTAINER_TAG
+    - docker push git.tu-berlin.de:5000/mcc-fred/fred/fred:$CONTAINER_TAG
 
 # this adds a new stage to the CI process that tests the terraform files
 #terraform:
diff --git a/.idea/runConfigurations/ci_Dockerfile.xml b/.idea/runConfigurations/ci_Dockerfile.xml
index 479c263..77cf3da 100644
--- a/.idea/runConfigurations/ci_Dockerfile.xml
+++ b/.idea/runConfigurations/ci_Dockerfile.xml
@@ -7,7 +7,7 @@
         <option name="command" value="" />
         <option name="containerName" value="ci" />
         <option name="entrypoint" value="" />
-        <option name="imageTag" value="gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/ci" />
+        <option name="imageTag" value="git.tu-berlin.de:5000/mcc-fred/fred/ci" />
         <option name="commandLineOptions" value="" />
         <option name="sourceFilePath" value="ci/Dockerfile" />
       </settings>
diff --git a/.idea/runConfigurations/fred_Dockerfile.xml b/.idea/runConfigurations/fred_Dockerfile.xml
index 6dff2be..b28d86d 100644
--- a/.idea/runConfigurations/fred_Dockerfile.xml
+++ b/.idea/runConfigurations/fred_Dockerfile.xml
@@ -7,7 +7,7 @@
         <option name="command" value="" />
         <option name="containerName" value="fred" />
         <option name="entrypoint" value="" />
-        <option name="imageTag" value="gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred" />
+        <option name="imageTag" value="git.tu-berlin.de:5000/mcc-fred/fred/fred" />
         <option name="commandLineOptions" value="" />
         <option name="sourceFilePath" value="Dockerfile" />
       </settings>
diff --git a/Makefile b/Makefile
index 28769b1..e66efdf 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ clean: ## Remove previous build
 	@rm -f $(PROJECT_NAME)
 
 container: ## Create a Docker container
-	@docker build . -t gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred
+	@docker build . -t git.tu-berlin.de:5000/mcc-fred/fred/fred
 
 staticcheck: ## Do a static code check
 	@GO111MODULE=off go get -u honnef.co/go/tools/cmd/staticcheck
diff --git a/README.md b/README.md
index ef9a828..f35d0d9 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
-# FReD 
+# FReD
 
-[![pipeline status](https://gitlab.tubit.tu-berlin.de/mcc-fred/fred/badges/master/pipeline.svg)](https://gitlab.tubit.tu-berlin.de/mcc-fred/fred/commits/master)
-[![coverage report](https://gitlab.tubit.tu-berlin.de/mcc-fred/fred/badges/master/coverage.svg)](https://gitlab.tubit.tu-berlin.de/mcc-fred/fred/commits/master)
+[![pipeline status](https://git.tu-berlin.de/mcc-fred/fred/badges/master/pipeline.svg)](https://git.tu-berlin.de/mcc-fred/fred/-/commits/master)
+[![coverage report](https://git.tu-berlin.de/mcc-fred/fred/badges/master/coverage.svg)](https://git.tu-berlin.de/mcc-fred/fred/-/commits/master)
 [![License MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://img.shields.io/badge/License-MIT-brightgreen.svg)
 
 ## Setup
 
-For development, it is recommended to install [Goland](https://www.jetbrains.com/go/).
+For development, it is recommended to install [GoLand](https://www.jetbrains.com/go/).
 
 It is probably easiest to use the dockerfiles to run Fred. An example setup can be found in `tests/3NodeTest`
 
@@ -62,7 +62,7 @@ AWS_PAGER="" aws dynamodb delete-table --table-name fred
 
 - To write a new client a language binding from the proto file (`proto/client/client.proto`) needs to be created. The two tests (in `tests/`) use Go and Python and can be used as inspiration.
 - FReD requires the use of certificates to check whether a node has access to a specific keygroup or not.
-If access control is not necessary every node can just use the same certificate => they all have access to all the data. (The nodes in the 3NodeTest all use the same certificates, for example)
+  If access control is not necessary every node can just use the same certificate => they all have access to all the data. (The nodes in the 3NodeTest all use the same certificates, for example)
 
 # Caching in Nameservice
 
diff --git a/ci/Dockerfile b/ci/Dockerfile
index cf66531..c408497 100644
--- a/ci/Dockerfile
+++ b/ci/Dockerfile
@@ -1,69 +1,70 @@
 # Base image: https://hub.docker.com/_/golang/
-FROM golang:1.15
+FROM golang:1.15-alpine
 
 # Install golint
 ENV GOPATH /go
 ENV PATH ${GOPATH}/bin:$PATH
+RUN apk update && apk add git curl
 RUN go get -u golang.org/x/lint/golint
 RUN go get -u honnef.co/go/tools/cmd/staticcheck
 
-# Add apt key for LLVM repository
-RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+# # Add apt key for LLVM repository
+# RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
 
-# Add LLVM apt repository
-RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | tee -a /etc/apt/sources.list
+# # Add LLVM apt repository
+# RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | tee -a /etc/apt/sources.list
 
-# Install clang from LLVM repository
-RUN apt-get update && apt-get install -y --no-install-recommends \
-    clang \
-    && apt-get clean \
-    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+# # Install clang from LLVM repository
+# RUN apt-get update && apt-get install -y --no-install-recommends \
+#     clang \
+#     && apt-get clean \
+#     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
-# Set Clang as default CC
-ENV set_clang /etc/profile.d/set-clang-cc.sh
-RUN echo "export CC=clang-7.0" | tee -a ${set_clang} && chmod a+x ${set_clang}
+# # Set Clang as default CC
+# ENV set_clang /etc/profile.d/set-clang-cc.sh
+# RUN echo "export CC=clang-7.0" | tee -a ${set_clang} && chmod a+x ${set_clang}
 
 # Install Docker (to build images)
 ENV DOCKER_CHANNEL stable
 ENV DOCKER_VERSION 19.03.5
 
 RUN set -eux; \
-	\
-	apkArch="$(arch)"; \
-	case "$apkArch" in \
-# amd64
-		x86_64) dockerArch='x86_64' ;; \
-# arm32v6
-		armhf) dockerArch='armel' ;; \
-# arm32v7
-		armv7) dockerArch='armhf' ;; \
-# arm64v8
-		aarch64) dockerArch='aarch64' ;; \
-		*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
-	esac; \
-	\
-	if ! wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
-		echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
-		exit 1; \
-	fi; \
-	\
-	tar xzvf docker.tgz --strip=1 -C /usr/local/bin docker/docker; \
-	rm docker.tgz; \
-	\
-	docker --version
+    \
+    apkArch="$(arch)"; \
+    case "$apkArch" in \
+    # amd64
+    x86_64) dockerArch='x86_64' ;; \
+    # arm32v6
+    armhf) dockerArch='armel' ;; \
+    # arm32v7
+    armv7) dockerArch='armhf' ;; \
+    # arm64v8
+    aarch64) dockerArch='aarch64' ;; \
+    *) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
+    esac; \
+    \
+    if ! wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
+    echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
+    exit 1; \
+    fi; \
+    \
+    tar xzvf docker.tgz --strip=1 -C /usr/local/bin docker/docker; \
+    rm docker.tgz; \
+    \
+    docker --version
 
-# Install terraform
-ENV TERRAFORM_VER 0.12.9
+# # Install terraform
+# ENV TERRAFORM_VER 0.12.9
 
-RUN wget -O terraform.zip "https://releases.hashicorp.com/terraform/${TERRAFORM_VER}/terraform_${TERRAFORM_VER}_linux_amd64.zip"
+# RUN wget -O terraform.zip "https://releases.hashicorp.com/terraform/${TERRAFORM_VER}/terraform_${TERRAFORM_VER}_linux_amd64.zip"
 
-RUN apt-get update && apt-get install -y --no-install-recommends \
-    unzip \
-     && apt-get clean \
-    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+# RUN apt-get update && apt-get install -y --no-install-recommends \
+#     unzip \
+#     && apt-get clean \
+#     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
-RUN unzip terraform.zip
-RUN mv terraform /usr/local/bin/
+# RUN unzip terraform.zip
+# RUN mv terraform /usr/local/bin/
 
 # Install Docker Compose
 RUN curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
diff --git a/terraform/small-test/fred-node/setup_node.sh b/terraform/small-test/fred-node/setup_node.sh
index b2f2865..bda5427 100644
--- a/terraform/small-test/fred-node/setup_node.sh
+++ b/terraform/small-test/fred-node/setup_node.sh
@@ -7,11 +7,11 @@ echo "$2" > ./gitlabtoken
 
 sudo systemctl start docker
 
-sudo cat ./gitlabtoken | sudo docker login -u="$1" --password-stdin gitlab-registry.tubit.tu-berlin.de
+sudo cat ./gitlabtoken | sudo docker login -u="$1" --password-stdin git.tu-berlin.de:5000
 
 sudo rm gitlabtoken
 
-sudo docker pull gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred:"$3"
+sudo docker pull git.tu-berlin.de:5000/mcc-fred/fred/fred:"$3"
 
 sudo docker run -it \
       --name=fred \
@@ -21,4 +21,4 @@ sudo docker run -it \
       -p 80:80 \
       -p 5555:5555 \
       -v /tmp/config.toml:/config.toml \
-      gitlab-registry.tubit.tu-berlin.de/mcc-fred/fred/fred:"$3" --config config.toml --ws-host "$4" "$5"
\ No newline at end of file
+      git.tu-berlin.de:5000/mcc-fred/fred/fred:"$3" --config config.toml --ws-host "$4" "$5"
\ No newline at end of file
-- 
GitLab


From 21fdb88b91358602e238b2bad3a994e79fb1e21c Mon Sep 17 00:00:00 2001
From: Tobias Pfandzelter <pfandzelter@campus.tu-berlin.de>
Date: Wed, 30 Dec 2020 16:15:51 +0100
Subject: [PATCH 2/2] update git urls

---
 ci/Dockerfile | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/ci/Dockerfile b/ci/Dockerfile
index c408497..4faf38f 100644
--- a/ci/Dockerfile
+++ b/ci/Dockerfile
@@ -1,28 +1,27 @@
 # Base image: https://hub.docker.com/_/golang/
-FROM golang:1.15-alpine
+FROM golang:1.15
 
 # Install golint
 ENV GOPATH /go
 ENV PATH ${GOPATH}/bin:$PATH
-RUN apk update && apk add git curl
 RUN go get -u golang.org/x/lint/golint
 RUN go get -u honnef.co/go/tools/cmd/staticcheck
 
-# # Add apt key for LLVM repository
-# RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+# Add apt key for LLVM repository
+RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
 
-# # Add LLVM apt repository
-# RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | tee -a /etc/apt/sources.list
+# Add LLVM apt repository
+RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | tee -a /etc/apt/sources.list
 
-# # Install clang from LLVM repository
-# RUN apt-get update && apt-get install -y --no-install-recommends \
-#     clang \
-#     && apt-get clean \
-#     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+# Install clang from LLVM repository
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    clang \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
-# # Set Clang as default CC
-# ENV set_clang /etc/profile.d/set-clang-cc.sh
-# RUN echo "export CC=clang-7.0" | tee -a ${set_clang} && chmod a+x ${set_clang}
+# Set Clang as default CC
+ENV set_clang /etc/profile.d/set-clang-cc.sh
+RUN echo "export CC=clang-7.0" | tee -a ${set_clang} && chmod a+x ${set_clang}
 
 # Install Docker (to build images)
 ENV DOCKER_CHANNEL stable
-- 
GitLab