Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace letsencrypt git repo with certbot #11

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 2 additions & 14 deletions scripts/generate-ssl-cert.sh
@@ -1,13 +1,6 @@
#!/bin/bash

[ -f '/opt/letsencrypt/settings' ] && source '/opt/letsencrypt/settings' || echo "No settings available"

#To be sure that r/w access
mkdir -p /etc/letsencrypt/
#chown -R jelastic:jelastic /etc/letsencrypt/

cd /opt/letsencrypt
git pull origin master
[ -f '/root/letsencrypt_settings' ] && source '/root/letsencrypt_settings' || echo "No settings available"

iptables -I INPUT -p tcp -m tcp --dport 9999 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 9999
Expand All @@ -17,7 +10,7 @@ test_params='';
[ "$test" == "true" ] && { test_params='--test-cert --break-my-certs '; }

#Request for certificates
/opt/letsencrypt/letsencrypt-auto certonly --standalone $test_params --domain $domain --preferred-challenges tls-sni-01 --tls-sni-01-port 9999 --renew-by-default --email $email --agree-tos
certbot certonly --standalone $test_params --domain $domain --preferred-challenges tls-sni-01 --tls-sni-01-port 9999 --renew-by-default --email $email --agree-tos

iptables -t nat -D PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 9999
iptables -D INPUT -p tcp -m tcp --dport 9999 -j ACCEPT
Expand All @@ -41,8 +34,3 @@ echo $uploadresult | awk -F '{"file":"' '{print $3}' | awk -F ":\"" '{print $1}'
echo $uploadresult | awk -F '{"file":"' '{print $4}' | awk -F ":\"" '{print $1}' | sed 's/","name"//g' > /tmp/cert.url

sed -i '/^\s*$/d' /tmp/*.url

#installing ssl cert via JEM
#sed -i '/function doDownloadKeys/a return 0;#letsenctemp' /usr/lib/jelastic/modules/keystore.module
#jem ssl install
#sed -i '/letsenctemp/d' /usr/lib/jelastic/modules/keystore.module
14 changes: 6 additions & 8 deletions scripts/install-le.sh
@@ -1,14 +1,12 @@
#!/bin/bash

echo Install opel-release
yum -y install epel-release git bc;

rpm -ivh https://downloads.hpdd.intel.com/public/e2fsprogs/1.42.12.wc1/el7/RPMS/x86_64/libcom_err-devel-1.42.12.wc1-4.el7.centos.x86_64.rpm;

git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt;

/opt/letsencrypt/letsencrypt-auto --os-packages-only

if ! rpm -qa | grep -qw epel-release; then
yum -y install epel-release;
fi
if ! rpm -qa | grep -qw certbot; then
yum install -y certbot
fi

JEM_SSL_MODULE_LATEST_URL="https://raw.githubusercontent.com/jelastic/jem/master/usr/lib/jelastic/modules/ssl.module"
JEM_SSL_MODULE_PATH="/usr/lib/jelastic/modules/ssl.module"
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-ssl.js
Expand Up @@ -69,7 +69,7 @@ debug.push(resp);

//write configs for ssl generation
var primaryDomain = window.location.host;
execParams = '\"domain=\'' + (customDomain || envDomain) + '\'\nemail=\''+email+'\'\nappid=\''+envAppid+'\'\nappdomain=\''+envDomain+'\'\ntest=\''+ (customDomain ? false : true)+ '\'\nprimarydomain=\''+primaryDomain + '\'\n\" > /opt/letsencrypt/settings'
execParams = '\"domain=\'' + (customDomain || envDomain) + '\'\nemail=\''+email+'\'\nappid=\''+envAppid+'\'\nappdomain=\''+envDomain+'\'\ntest=\''+ (customDomain ? false : true)+ '\'\nprimarydomain=\''+primaryDomain + '\'\n\" > /root/letsencrypt_settings'
resp = ExecCmdById("printf", execParams);
debug.push(resp);

Expand Down