Quellcode durchsuchen

Temp commit for verifier, apache with new graphene.

Miti Mazmudar vor 4 Jahren
Ursprung
Commit
0821f461c6
1 geänderte Dateien mit 21 neuen und 14 gelöschten Zeilen
  1. 21 14
      docker/Dockerfile

+ 21 - 14
docker/Dockerfile

@@ -37,11 +37,11 @@ RUN git clone https://git-crysp.uwaterloo.ca/miti/verifier.git && \
 	export SGX_SDK_TRTS_MODIFIED=/root/source/linux-sgx-trts-modified/build/linux && make && \
 	cp verifier /root/graphene/LibOS/shim/test/native && \
 	git checkout master && \
-	cp verifier.manifest.template /root/graphene/LibOS/shim/test/native && \
-	cp grapheneMakefile /root/graphene/LibOS/shim/test/native/Makefile
+	cp verifier.manifest.template /root/graphene/LibOS/shim/test/native 
 
 #Build the verifier
 WORKDIR /root/graphene/LibOS/shim/test/native
+RUN sed -i s/ls.manifest/'ls.manifest verifier.manifest'/g Makefile
 RUN make SGX=1
 
 RUN apt update && apt install -y php7.0-dev tmux libxml2-dev 
@@ -56,28 +56,35 @@ RUN git clone https://git-crysp.uwaterloo.ca/miti/Apache_PHP_extension.git && \
 	make
 
 WORKDIR /root/graphene/LibOS/shim/test/apps/apache
-RUN cp /root/source/Apache_PHP_extension/apacheMakefile ./Makefile 
+#Modifying the Makefile to generate the php module.
+RUN sed -i s/'LISTEN_HOST ?= 127.0.0.1'/'LISTEN_HOST ?= 0.0.0.0'/g Makefile
+RUN sed -i s/'testdata ssldata'/'$(INSTALL_DIR)/modules/libphp7.so  #testdata ssldata'/g Makefile 
+RUN sed -i s/"'-'"/"'-' | tr '+' 'p'"/g Makefile #Fix for stdc++ to be named as a key sgx.trusted_files.stdcpp in the autogenerated manifest. 
+RUN printf '\nPHP_DIR = php-7.0.7 \n$(PHP_DIR): $(PHP_DIR).tar.gz\n\ttar -xmzf $<\n' >> Makefile 
+RUN printf '\n$(INSTALL_DIR)/modules/libphp7.so: $(PHP_DIR) $(INSTALL_DIR)/bin/apxs\n' >> Makefile
+RUN printf '\tcd $< && ./configure --prefix=$(abspath $(INSTALL_DIR)) --with-apxs2=$(abspath $(INSTALL_DIR)/bin/apxs) \ \n' >> Makefile
+RUN printf '\t--disable-cgi --disable-cli --disable-soap\n\tcd $< && $(MAKE) \n\tcd $< && $(MAKE) install\n' >> Makefile
+RUN printf '\nbuild-apache-with-php: $(INSTALL_DIR)/bin/httpd $(INSTALL_DIR)/modules/libphp7.so\n' >> Makefile 
 RUN cp /root/source/Apache_PHP_extension/*.tar.gz ./
 #Don't make the manifest yet - make the apache/php build first and then the manifest.
-RUN make SGX=1 build-apache 
+RUN make SGX=1 build-apache-with-php
 
-#Add the updated httpd.manifest.template
+#Add the updated httpd.manifest.template #Todo update manifest. 
 RUN cp /root/source/Apache_PHP_extension/httpd.manifest.template ./
-#Add the PHP .ini file from the PHP folder to /obj/lib 
-RUN cp ./php-7.0.7/php.ini-development ./obj/lib/php.ini 
 #Add the extension to the obj/modules folder. 
-RUN cp /root/source/Apache_PHP_extension/localattestation_decryption.so ./obj/modules/
+RUN cp /root/source/Apache_PHP_extension/localattestation_decryption.so install/modules/
+#Add the PHP .ini file from the PHP folder to the location accessed by the PHP setup at runtime
+RUN cp ./php-7.0.7/php.ini-development install/lib/php.ini
 #Add the extension directory and the extension name to the php.ini 
-RUN echo "extension_dir=/root/graphene/LibOS/shim/test/apps/apache/obj/modules" >> obj/lib/php.ini && \ 
-	echo "extension=localattestation_decryption.so" >> obj/lib/php.ini
+RUN echo "extension_dir=/root/graphene/LibOS/shim/test/apps/apache/install/modules" >> install/lib/php.ini && \ 
+	echo "extension=localattestation_decryption.so" >> install/lib/php.ini
 #Add all php source code files to the right place. 
-RUN cp /root/source/Apache_PHP_extension/*.php ./obj/htdocs
+RUN cp /root/source/Apache_PHP_extension/*.php install/htdocs
 #Fix the configuration file for Apache
-RUN sed -i s/User/#User/g obj/conf/httpd.conf
-RUN sed -i s/Group/#Group/g obj/conf/httpd.conf
-RUN cat /root/source/Apache_PHP_extension/httpd.conf >> obj/conf/httpd.conf
+RUN printf '\nAcceptFilter http none\n<IfModule mime_module>\n    AddType application/x-httpd-php .php\n</IfModule>\n' > install/conf/httpd.conf
 RUN make SGX=1 
 
 WORKDIR /root 
 COPY deploy_enclaves.sh ./
 RUN chmod 755 ./deploy_enclaves.sh
+