capistrano-atlas 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/capistrano/atlas/version.rb +1 -1
 - data/lib/capistrano/tasks/ssl.rake +8 -5
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a6b213b0d83a08807c027bb88948a74b5784c55d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a601ee1208dbc0543692b6de3a9a54d0dfb5ceef
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 61468a9fb92634ba91f511774f8ea9e8d11006b3d6c909b60c1a1a255c0942638280ac2dff99c24f1d0031faf4c378b2a754be9536962827fdc038d08ffa3556
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 25196c2b900893d0ffa4442d1c4654f497a6d0405f8842ef102ab45aeaf0cf1cb63ed256fe6c2dc8c7c9bb7014cf6134e0ddd40a7946027d8dcab456cf4b9d2d
         
     | 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            atlas_recipe :ssl do
         
     | 
| 
       2 
     | 
    
         
            -
               
     | 
| 
       3 
     | 
    
         
            -
               
     | 
| 
      
 2 
     | 
    
         
            +
              after :provision, "generate_dh"
         
     | 
| 
      
 3 
     | 
    
         
            +
              after :provision, "configure_lets_encrypt"
         
     | 
| 
       4 
4 
     | 
    
         
             
            end
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            namespace :atlas do
         
     | 
| 
         @@ -8,13 +8,16 @@ namespace :atlas do 
     | 
|
| 
       8 
8 
     | 
    
         
             
                desc "Setup Let's Encrypt and get a free certificate"
         
     | 
| 
       9 
9 
     | 
    
         
             
                task :configure_lets_encrypt do
         
     | 
| 
       10 
10 
     | 
    
         
             
                  privileged_on roles(:web) do
         
     | 
| 
       11 
     | 
    
         
            -
                    unless test("sudo [ -f /etc/ssl/#{ 
     | 
| 
      
 11 
     | 
    
         
            +
                    unless test("sudo [ -f /etc/ssl/#{capistrano_app_name}.crt ]")
         
     | 
| 
       12 
12 
     | 
    
         
             
                      execute :sudo, "mkdir -p /opt/certbot"
         
     | 
| 
       13 
13 
     | 
    
         
             
                      execute :sudo, "wget https://dl.eff.org/certbot-auto -O /opt/certbot/certbot-auto && chmod a+x /opt/certbot/certbot-auto"
         
     | 
| 
       14 
14 
     | 
    
         
             
                      execute :sudo, "/opt/certbot/certbot-auto certonly --agree-tos "\
         
     | 
| 
       15 
     | 
    
         
            -
                                     "--email #{fetch(:atlas_lets_encrypt_email)}  
     | 
| 
       16 
     | 
    
         
            -
                                     "-w #{current_path}/public "\
         
     | 
| 
      
 15 
     | 
    
         
            +
                                     "--email #{fetch(:atlas_lets_encrypt_email)} "\
         
     | 
| 
      
 16 
     | 
    
         
            +
                                     "--webroot -w #{current_path}/public "\
         
     | 
| 
       17 
17 
     | 
    
         
             
                                     "-d #{fetch(:atlas_lets_encrypt_domain_name)}"
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                      execute :sudo, "ln -s /etc/letsencrypt/live/#{production_hostname}/fullchain.pem /etc/ssl/#{capistrano_app_name}.crt"
         
     | 
| 
      
 20 
     | 
    
         
            +
                      execute :sudo, "ln -s /etc/letsencrypt/live/#{production_hostname}/privkey.pem /etc/ssl/#{capistrano_app_name}.key"                         
         
     | 
| 
       18 
21 
     | 
    
         
             
                    end
         
     | 
| 
       19 
22 
     | 
    
         
             
                  end
         
     | 
| 
       20 
23 
     | 
    
         
             
                end
         
     |