Help renewing LetsEncrypt certificate.

Status
Not open for further replies.

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

rodofrn

Contributor
Joined
Apr 13, 2016
Messages
180
What exactly fixed it for you in case someone else runs across this thread?

This is how i got the renewal process to work after installing certbot:

You can create it in the root of your jail and call it from cron.

To create the script from the shell (preferably not the one in the GUI) log into your jail and run the following

Code:
ee /renew.sh


Paste the following and save and exit.

Code:
#!/bin/sh
/usr/local/bin/certbot renew --quiet


Then create a cron entry (under tasks in the FreeNAS GUI) to the following.

Code:
jexec nameofyourjail csh /renew.sh


and last thing:

From the owncloud jails root:
Code:
chmod +x renew.sh
 
Last edited:

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
My OC also has letsencrypt expired ...

My OC is up to date and is working like a charm. By searching this page and try to use the solutions suggested by you guys, something caught my attention
Code:
root@MyCloud:/ # letsencrypt.sh -c																								 
letsencrypt.sh: Command not found. 


I have letsencrypt installed. Why it's not finding the script?
 
Joined
Dec 2, 2015
Messages
730
How did you install letsencrypt? More to the point, what is the path to the letsencrypt program? And, when logged in to the jail as root, what is the output of printenv PATH ?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I have letsencrypt installed. Why it's not finding the script?
certbot is the program used for certifcate retrieval.

In your case the command to run it from the jail root is sh letsencrypt.sh
 

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
@Kevin Horton

Sorry for the delay in replying.

Actually I don't remember how I installed letsencrypt, but I believe I followed thoses git's guides (https://github.com/certbot/certbot) and (https://github.com/lukas2511/dehydrated).

The letsencrypt folder is at the root of my jail, and within that folder it contains the other folders like certbot, acme, letsenccrypt-niginx, and so on... But in none of them does the letsencrypt.sh script

@Jailer
I believe that .sh is missing

Note that even in the jail root and inside the letsencrypt folder was founded...

Code:
root@MyCloud:/ # sh letsencrypt.sh																								 
cannot open letsencrypt.sh: No such file or directory																			   
root@MyCloud:/ # cd letsencrypt																									 
root@MyCloud:/letsencrypt # sh letsencrypt.sh																					   
cannot open letsencrypt.sh: No such file or directory


Where did I get lost?

Both of you, thank you for your help!!!
 
Joined
Dec 2, 2015
Messages
730
There is a FreeBSD package for letsencrypt in the standard package system now (it probably didn't exist yet when those guides were written). It may be simpler to install it that way, as it puts everything in standard places and ensures that the certbot client is in your PATH.

pkg update; pkg upgrade; pkg install py27-certbot should install it for you.

Once it is installed, use the certbot client. certbot -h will display the help, but the online docs are probably more useful.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Thank you Kevin and Jailer, but see how strange ... there is no package py27-certbot?

Code:
root@MyCloud:/ # pkg update && pkg upgrade && pkg install py27-certbot												  
Updating FreeBSD repository catalogue...																							
FreeBSD repository is up-to-date.																								   
All repositories are up-to-date.																									
Updating FreeBSD repository catalogue...																							
FreeBSD repository is up-to-date.																								   
All repositories are up-to-date.																									
Checking for upgrades (0 candidates): 100%																						 
Processing candidates (0 candidates): 100%																						 
Checking integrity... done (0 conflicting)																						 
Your packages are up to date.																									   
Updating FreeBSD repository catalogue...																							
FreeBSD repository is up-to-date.																								   
All repositories are up-to-date.																									
pkg: No packages available to install matching 'py27-certbot' have been found in the repositories								   
root@MyCloud:/ #	
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Well that is odd since I just installed it a couple days ago and got my certs with it.......
 
Joined
Dec 2, 2015
Messages
730
What do you get from pkg --version ?
 

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Any ideas?

Code:
root@MyCloud:/ # pkg --version																									 
1.9.4																															   
root@MyCloud:/ # pkg install py27-certbot																						   
Updating FreeBSD repository catalogue...																							
FreeBSD repository is up-to-date.																								   
All repositories are up-to-date.																									
pkg: No packages available to install matching 'py27-certbot' have been found in the repositories								   
root@MyCloud:/ #
 
Joined
Dec 2, 2015
Messages
730
I'm certainly no expert on FreeBSD package management.

What do you get if you run pkg -d upgrade ?

If that actually does something, then try pkg install py27-certbot .

If it does nothing useful, what is the output of pkg stats ?
 

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Thank you very much for taking the time to help me solve this problem. I really do not know what's happening.

Is it because I'm using FN 9.3 instead of 9.10? I do not think so, right?

These are the answers to what you suggested to me.

What do you get if you run pkg -d upgrade ?

Code:
root@MyCloud:/ # pkg -d upgrade																									
DBG(1)[74702]> pkg initialized																									
Updating FreeBSD repository catalogue...																							
DBG(1)[74702]> PkgRepo: verifying update for FreeBSD																				
DBG(1)[74702]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite'														  
DBG(1)[74702]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/freebsd:9:x86:64/latest/meta.txz with opts "i"				  
DBG(1)[74702]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/freebsd:9:x86:64/latest/packagesite.txz with opts "i"			
FreeBSD repository is up-to-date.																								  
All repositories are up-to-date.																									
DBG(1)[74702]> want to get an advisory lock on a database																		  
Checking for upgrades (0 candidates): 100%																						
Processing candidates (0 candidates): 100%																						
DBG(1)[74702]> problem has no requests																							
Checking integrity...DBG(1)[74702]> check integrity for 0 items added															  
done (0 conflicting)																											  
Your packages are up to date.																									  
DBG(1)[74702]> release an advisory lock on a database


If that actually does something, then try pkg install py27-certbot .

Code:
root@MyCloud:/ # pkg install py27-certbot																						  
Updating FreeBSD repository catalogue...																							
FreeBSD repository is up-to-date.																								  
All repositories are up-to-date.																									
pkg: No packages available to install matching 'py27-certbot' have been found in the repositories  


If it does nothing useful, what is the output of pkg stats ?

Code:
root@MyCloud:/ # pkg stats																										
Local package database:																											
		Installed packages: 168																									
		Disk space occupied: 1 GiB																								
																																	
Remote package database(s):																										
		Number of repositories: 1																								  
		Packages available: 25079																								  
		Unique packages: 25079																									
		Total size of packages: 64 GiB


With this new information, did any idea come up?

Thank you again
 
Joined
Dec 2, 2015
Messages
730
The plot thickens. It turns out that one of my jails has the same issue as your jail - it cannot install py27-certbot either. That jail has the same number of packages available as your problematic jail: 25079. The jails that do have py27-certbot have 26002 packages available. I'll carefully compare the jails to attempt to find a clue to this mystery. I'll be travelling for the rest of day, and have a busy few days ahead, so I have no prediction about when I might have some more ideas here.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Is it because I'm using FN 9.3 instead of 9.10? I do not think so, right?

Hmmm, I wonder if since your running a 9.3 jail that it pulls from a different repository. Try pkg install py27-letsencrypt and report the output.
 
Joined
Dec 2, 2015
Messages
730
My flight was delayed, so I took a quick look.

I'm on FreeNAS 9.10, which is based on FreeBSD 10. For some reason, the problematic jail is still pointed at the FreeBSD 9 package repositories, as seen in /usr/local/etc/pkg/repos/FreeBSD.conf inside the jail. That jail is actually running FreeBSD 10, as seen by the output of uname -a.

Code:
# uname -a
FreeBSD misc 10.3-STABLE FreeBSD 10.3-STABLE #0 r295946+1805185(9.10.2-STABLE): Wed Jan 11 17:12:42 UTC 2017	 root@gauntlet:/freenas-9.10-releng/_BE/objs/freenas-9.10-releng/_BE/os/sys/FreeNAS.amd64  amd64

My conclusion is that your problem is due to your system being on FreeNAS 9.3. It looks like py27-certbot is not available in the package repositories for that old system. Perhaps it is time to update.

In the interest of science, once I have some free time I'll snapshot the jail, so I can roll back if everything blows up. Then I'll edit /usr/local/etc/pkg/repos/FreeBSD.conf and try updating and upgrading the packages.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Then I'll edit /usr/local/etc/pkg/repos/FreeBSD.conf and try updating and upgrading the packages.
Will that mess with dependencies pulling packages from the 10.3 repository for a 9.3 jail?
 
Joined
Dec 2, 2015
Messages
730
Will that mess with dependencies pulling packages from the 10.3 repository for a 9.3 jail?
My initial experiments suggest that the jail is not happy to run pkg update after editing /usr/local/etc/pkg/repos/FreeBSD.conf.
Code:
# pkg update
Updating FreeBSD repository catalogue...
Repository FreeBSD has a wrong packagesite, need to re-create database
[misc] Fetching meta.txz: 100%	944 B   0.9kB/s	00:01
[misc] Fetching packagesite.txz: 100%	6 MiB 658.1kB/s	00:09
Processing entries:   0%
pkg: wrong architecture: freebsd:10:x86:64 instead of FreeBSD:9:amd64
pkg: repository FreeBSD contains packages with wrong ABI: freebsd:10:x86:64
Processing entries: 100%
Unable to update repository FreeBSD

I suspect I'll have to delete this jail and make a new one. But, before that, I'll try deleting all the packages in the repository and making it start over. But, I need to leave for my flight now, so this will have to wait.
 

jag131990

Explorer
Joined
Dec 2, 2016
Messages
68
This is how i got the renewal process to work after installing certbot:

You can create it in the root of your jail and call it from cron.

To create the script from the shell (preferably not the one in the GUI) log into your jail and run the following

Code:
ee /renew.sh


Paste the following and save and exit.

Code:
#!/bin/sh
/usr/local/bin/certbot renew --quiet


Then create a cron entry (under tasks in the FreeNAS GUI) to the following.

Code:
jexec nameofyourjail csh /renew.sh


and last thing:

From the owncloud jails root:
Code:
chmod +x renew.sh


How do you test to check it works?

What user did you run the Cron task as in freenas GUI.. I just put www
 
Status
Not open for further replies.
Top