Quellcode durchsuchen

More fun with dupes

Grant Limberg vor 5 Jahren
Ursprung
Commit
f6026f94a5
2 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen
  1. 6 1
      controller/PostgreSQL.cpp
  2. 4 4
      ext/central-controller-docker/Dockerfile

+ 6 - 1
controller/PostgreSQL.cpp

@@ -530,7 +530,12 @@ void PostgreSQL::initializeMembers(PGconn *conn)
 
 			int n = PQntuples(r2);
 			for (int j = 0; j < n; ++j) {
-				config["ipAssignments"].push_back(PQgetvalue(r2, j, 0));
+				std::string ipaddr = PQgetvalue(r2, j, 0);
+				std::size_t pos = ipaddr.find('/');
+				if (pos != std::string::npos) {
+					ipaddr = ipaddr.substr(0, pos);
+				}
+				config["ipAssignments"].push_back(ipaddr);
 			}
 
 			_memberChanged(empty, config, false);

+ 4 - 4
ext/central-controller-docker/Dockerfile

@@ -10,10 +10,10 @@ RUN yum -y install epel-release && yum -y update && yum clean all
 RUN yum groupinstall -y "Development Tools"
 RUN yum install -y bash postgresql10 postgresql10-devel libpqxx-devel glibc-static libstdc++-static clang jemalloc jemalloc-devel
 
-RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git
-RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi
-RUN ldconfig
-RUN cd ZeroTierOne && make central-controller
+# RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git
+# RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi
+ADD . /ZeroTierOne
+RUN cd ZeroTierOne && make clean && make central-controller
 
 FROM centos:7
 RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm && yum -y install epel-release && yum -y update && yum clean all