deploy key for fetching occlum and detee-sgx
This commit is contained in:
		
							parent
							
								
									5ea4751e02
								
							
						
					
					
						commit
						75c94324dd
					
				| @ -37,7 +37,7 @@ hyper-rustls = { version = "0.27", features = ["http2"] } | |||||||
| base64 = "0.22" | base64 = "0.22" | ||||||
| lazy_static = "1.5" | lazy_static = "1.5" | ||||||
| # TODO: create a feature for testing, make occlum feature optional and added only if not compiling for testing | # TODO: create a feature for testing, make occlum feature optional and added only if not compiling for testing | ||||||
| occlum-ratls = { git = "ssh://git@gitea.detee.cloud/vfaychuk/occlum-ratls", features = ["tonic", "occlum"] } | detee-sgx = { git = "ssh://git@gitea.detee.cloud/sgx/detee-sgx", features = ["tonic", "occlum"] } | ||||||
| env_logger = "0.11" | env_logger = "0.11" | ||||||
| 
 | 
 | ||||||
| [build-dependencies] | [build-dependencies] | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								rewrite/deploy_ed25519
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										7
									
								
								rewrite/deploy_ed25519
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | -----BEGIN OPENSSH PRIVATE KEY----- | ||||||
|  | b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW | ||||||
|  | QyNTUxOQAAACBYdHXQVf+0oYwA5YcRlpgqWCuIWgnNmXHi1LpFlI00+wAAAJAEKIh7BCiI | ||||||
|  | ewAAAAtzc2gtZWQyNTUxOQAAACBYdHXQVf+0oYwA5YcRlpgqWCuIWgnNmXHi1LpFlI00+w | ||||||
|  | AAAEAO6GnjVnvVtki2igy1aGZ6Jibtas0M7gU2RH1wzNWlaFh0ddBV/7ShjADlhxGWmCpY | ||||||
|  | K4haCc2ZceLUukWUjTT7AAAADXZmYXljaHVrQHNneDE= | ||||||
|  | -----END OPENSSH PRIVATE KEY----- | ||||||
| @ -15,22 +15,27 @@ if [ "$prerequisites" == "--prep" ]; then | |||||||
|     mkdir -p /root/.ssh |     mkdir -p /root/.ssh | ||||||
| 
 | 
 | ||||||
|     echo |     echo | ||||||
|     echo "docker cp ~/.ssh/config packager:/root/.ssh/config" |     #echo "docker cp ~/.ssh/config packager:/root/.ssh/config" | ||||||
|     echo "docker cp ~/.ssh/gitea_ed25519 packager:/root/.ssh/gitea_ed25519" |     echo "docker cp deploy_ed25519 packager:/root/.ssh/id_ed25519" | ||||||
|     echo |     echo | ||||||
|     echo "Run above commands in another terminal" |     echo "Run above commands in another terminal" | ||||||
|     while true; do |     while true; do | ||||||
|         echo -n "." && sleep 1 |         echo -n "." && sleep 1 | ||||||
|         if [ -e ~/.ssh/config ] && [ -e ~/.ssh/gitea_ed25519 ]; then |         if [ -e ~/.ssh/id_ed25519 ]; then | ||||||
|           echo && break |           echo && break | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
| 
 | 
 | ||||||
|     chown -R root:root /root/.ssh |     chown -R root:root /root/.ssh | ||||||
|     chmod 600 /root/.ssh/gitea_ed25519 |     chmod 600 /root/.ssh/id_ed25519 | ||||||
|     ssh-keyscan -H gitea.detee.cloud > ~/.ssh/known_hosts |     ssh-keyscan -H gitea.detee.cloud > ~/.ssh/known_hosts | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | echo "Building the occlum fork" | ||||||
|  | git clone git@gitea.detee.cloud:SGX/occlum.git | ||||||
|  | (cd occlum && make submodule) | ||||||
|  | (cd tools/toolchains/utils_lib && ./build.sh) | ||||||
|  | 
 | ||||||
| echo "Building the hacker-challenge signed bundle" | echo "Building the hacker-challenge signed bundle" | ||||||
| occlum-cargo build --release | occlum-cargo build --release | ||||||
| strip target/x86_64-unknown-linux-musl/release/hacker-challenge | strip target/x86_64-unknown-linux-musl/release/hacker-challenge | ||||||
| @ -47,6 +52,7 @@ targets: | |||||||
|     copy: |     copy: | ||||||
|       - files: |       - files: | ||||||
|         - /opt/occlum/toolchains/dcap_lib/musl/libocclum_dcap.so.0.1.0 |         - /opt/occlum/toolchains/dcap_lib/musl/libocclum_dcap.so.0.1.0 | ||||||
|  |         - /opt/occlum/toolchains/utils_lib/musl/libutils_dcap.so.0.1.0 | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
| rm -rf challenge_instance && mkdir challenge_instance && cd challenge_instance | rm -rf challenge_instance && mkdir challenge_instance && cd challenge_instance | ||||||
|  | |||||||
| @ -50,7 +50,7 @@ impl ConnManager { | |||||||
|     async fn connect(&self, node_ip: String) -> Result<(), Box<dyn std::error::Error>> { |     async fn connect(&self, node_ip: String) -> Result<(), Box<dyn std::error::Error>> { | ||||||
|         use hyper::Uri; |         use hyper::Uri; | ||||||
|         use hyper_util::{client::legacy::connect::HttpConnector, rt::TokioExecutor}; |         use hyper_util::{client::legacy::connect::HttpConnector, rt::TokioExecutor}; | ||||||
|         use occlum_ratls::{prelude::*, RaTlsConfigBuilder}; |         use detee_sgx::{prelude::*, RaTlsConfigBuilder}; | ||||||
|         use tokio_rustls::rustls::ClientConfig; |         use tokio_rustls::rustls::ClientConfig; | ||||||
| 
 | 
 | ||||||
|         println!("Connecting to {node_ip}..."); |         println!("Connecting to {node_ip}..."); | ||||||
| @ -122,7 +122,7 @@ impl ConnManager { | |||||||
| pub async fn key_grabber(node_ip: String) -> Result<(Keypair, Pubkey), Box<dyn std::error::Error>> { | pub async fn key_grabber(node_ip: String) -> Result<(Keypair, Pubkey), Box<dyn std::error::Error>> { | ||||||
|     use hyper::Uri; |     use hyper::Uri; | ||||||
|     use hyper_util::{client::legacy::connect::HttpConnector, rt::TokioExecutor}; |     use hyper_util::{client::legacy::connect::HttpConnector, rt::TokioExecutor}; | ||||||
|     use occlum_ratls::{prelude::*, RaTlsConfigBuilder}; |     use detee_sgx::{prelude::*, RaTlsConfigBuilder}; | ||||||
|     use tokio_rustls::rustls::ClientConfig; |     use tokio_rustls::rustls::ClientConfig; | ||||||
| 
 | 
 | ||||||
|     println!("Getting key from {node_ip}..."); |     println!("Getting key from {node_ip}..."); | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ impl MyServer { | |||||||
|         use tonic::{body::boxed, service::Routes}; |         use tonic::{body::boxed, service::Routes}; | ||||||
|         use tower::{ServiceBuilder, ServiceExt}; |         use tower::{ServiceBuilder, ServiceExt}; | ||||||
| 
 | 
 | ||||||
|         use occlum_ratls::{prelude::*, RaTlsConfigBuilder}; |         use detee_sgx::{prelude::*, RaTlsConfigBuilder}; | ||||||
| 
 | 
 | ||||||
|         // TODO: ratls config should be global
 |         // TODO: ratls config should be global
 | ||||||
|         // TODO: error handling, shouldn't have expects
 |         // TODO: error handling, shouldn't have expects
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user