<commit_before>#!/bin/sh

name=$1
file_prefix=/opt/engines/etc/ssl/certs/${name}
chmod og-rw ${file_prefix}.key
chmod og-w ${file_prefix}.crt

	file $file_prefix.cert | grep PEM
	   if test $? -ne 0
 	then
		echo $name not a PEM certificate
		exit
	fi
	
	#AS DOMAIN CERT for NGINX
		cp -p $file_prefix.crt   /opt/engines/etc/nginx/ssl/certs/$name.crt 
		chown 22005 /opt/engines/etc/nginx/ssl/certs/$name.crt 
		cp -p $file_prefix.key   /opt/engines/etc/nginx/ssl/keys/$name.key
		chown 22005 /opt/engines/etc/nginx/ssl/keys/$name.key
		
#Below here install default cert FIXME to only do so if asked and extend so individual certs can be installed per service ie imap. smtp.
		cp -p $file_prefix.crt /opt/engines/etc/ssl/certs/engines.crt
		chown 21000 /opt/engines/etc/ssl/certs/engines.crt
		cp -p $file_prefix.key /opt/engines/etc/ssl/keys/engines.key 
		chown 21000 /opt/engines/etc/ssl/engines.key 

		cp -p $file_prefix.crt /opt/engines/etc/ftp/ssl/engines.crt 
		chown 22003 /opt/engines/etc/ftp/ssl/engines.crt 
		cp -p $file_prefix.key /opt/engines/etc/ftp/ssl/keys/engines.key
		chown 22003 /opt/engines/etc/ftp/ssl/keys/engines.key

		cp -p $file_prefix.crt /opt/engines/etc/smtp/ssl/engines.crt 
		chown 22003 /opt/engines/etc/smtp/ssl/engines.crt 
		cp -p $file_prefix.key /opt/engines/etc/smtp/ssl/keys/engines.key
		chown 22003 /opt/engines/etc/smtp/ssl/keys/engines.key

	
		cp -p $file_prefix.crt  /opt/engines/etc/imap/ssl/certs/engines.crt 
		chown 22013 /opt/engines/etc/imap/ssl/certs/engines.crt 
		cp -p $file_prefix.key /opt/engines/etc/imap/ssl/keys/engines.key 
		chown 22013 /opt/engines/etc/imap/ssl/keys/engines.key 

		cp -p $file_prefix.crt /opt/engines/etc/pgsql/ssl/certs/engines.crt
		chown 22002 /opt/engines/etc/pgsql/ssl/certs/engines.crt
		cp -p $file_prefix.key /opt/engines/etc/pgsql/ssl/private/engines.key
		chown 22002 /opt/engines/etc/pgsql/ssl/private/engines.key
  
#AS Default Cert Nginx
		cp -p $file_prefix.crt   /opt/engines/etc/nginx/ssl/certs/engines.crt
		chown 22005 /opt/engines/etc/nginx/ssl/certs/engines.crt
		cp -p $file_prefix.key   /opt/engines/etc/nginx/ssl/keys/engines.key	
		chown 22005 /opt/engines/etc/nginx/ssl/keys/engines.key			

		


<commit_msg>handle keys and certs in sep dirs<commit_after>#!/bin/sh

name=$1
cert=/opt/engines/etc/ssl/certs/${name}
key=/opt/engines/etc/ssl/keys/${name}
chmod og-rw ${key}.key
chmod og-w ${cert}.crt

	file $cert.cert | grep PEM
	   if test $? -ne 0
 	then
		echo $name not a PEM certificate
		exit
	fi
	
	#AS DOMAIN CERT for NGINX
		cp -p $cert.crt   /opt/engines/etc/nginx/ssl/certs/$name.crt 
		chown 22005 /opt/engines/etc/nginx/ssl/certs/$name.crt 
		cp -p $key.key   /opt/engines/etc/nginx/ssl/keys/$name.key
		chown 22005 /opt/engines/etc/nginx/ssl/keys/$name.key
		
#Below here install default cert FIXME to only do so if asked and extend so individual certs can be installed per service ie imap. smtp.
		cp -p $cert.crt /opt/engines/etc/ssl/certs/engines.crt
		chown 21000 /opt/engines/etc/ssl/certs/engines.crt
		cp -p $key.key /opt/engines/etc/ssl/keys/engines.key 
		chown 21000 /opt/engines/etc/ssl/engines.key 

		cp -p $cert.crt /opt/engines/etc/ftp/ssl/engines.crt 
		chown 22003 /opt/engines/etc/ftp/ssl/engines.crt 
		cp -p $key.key /opt/engines/etc/ftp/ssl/keys/engines.key
		chown 22003 /opt/engines/etc/ftp/ssl/keys/engines.key

		cp -p $cert.crt /opt/engines/etc/smtp/ssl/engines.crt 
		chown 22003 /opt/engines/etc/smtp/ssl/engines.crt 
		cp -p $key.key /opt/engines/etc/smtp/ssl/keys/engines.key
		chown 22003 /opt/engines/etc/smtp/ssl/keys/engines.key

	
		cp -p $cert.crt  /opt/engines/etc/imap/ssl/certs/engines.crt 
		chown 22013 /opt/engines/etc/imap/ssl/certs/engines.crt 
		cp -p $key.key /opt/engines/etc/imap/ssl/keys/engines.key 
		chown 22013 /opt/engines/etc/imap/ssl/keys/engines.key 

		cp -p $cert.crt /opt/engines/etc/pgsql/ssl/certs/engines.crt
		chown 22002 /opt/engines/etc/pgsql/ssl/certs/engines.crt
		cp -p $key.key /opt/engines/etc/pgsql/ssl/private/engines.key
		chown 22002 /opt/engines/etc/pgsql/ssl/private/engines.key
  
#AS Default Cert Nginx
		cp -p $cert.crt   /opt/engines/etc/nginx/ssl/certs/engines.crt
		chown 22005 /opt/engines/etc/nginx/ssl/certs/engines.crt
		cp -p $key.key   /opt/engines/etc/nginx/ssl/keys/engines.key	
		chown 22005 /opt/engines/etc/nginx/ssl/keys/engines.key			

		



{'fraction_non_alphanumeric': 0.1408903166590179, 'fraction_numerical': 0.03304268012849931, 'mean_word_length': 3.0212177121771218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2193671', 'n_tokens_mistral': 2136, 'n_tokens_neox': 1882, 'n_words': 323}