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

Add pip instructions #698

Merged
merged 23 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6777d34
Add pip instructions (barring DNS instructions fixes)
ohemorange Feb 25, 2021
e18fde4
fix typo
ohemorange Feb 25, 2021
e133999
use new id since pip is already in use
ohemorange Feb 25, 2021
61ee800
Fix non-DNS instructions
ohemorange Feb 25, 2021
b9d27ab
streamline instructions and start on DNS instructions
ohemorange Feb 25, 2021
48705aa
add symlink so DNS instructions work
ohemorange Feb 25, 2021
15f8bf5
Clean up instructions even more, including using terms from context
ohemorange Feb 25, 2021
7ea8434
Use python instead of python3
ohemorange Mar 1, 2021
1489304
Update _scripts/instruction-widget/templates/install/pip.html
ohemorange Mar 1, 2021
d8b2b32
Update _scripts/instruction-widget/templates/install/pip.html
ohemorange Mar 1, 2021
fea8794
Update _scripts/instruction-widget/templates/install/pip.html
ohemorange Mar 1, 2021
9166b43
Remove third-party plugin instructions
ohemorange Mar 1, 2021
d9bacf2
move upgrade instructions to after confirming certbot worked
ohemorange Mar 1, 2021
1f57af6
Remove other mentions of dev/devel
ohemorange Mar 1, 2021
3170bab
encourage people to uninstall and certbot os packages
ohemorange Mar 1, 2021
a6205f5
more strongly suggest people keep cb up to date
ohemorange Mar 1, 2021
f753f9f
improve readability of system dep installation instructions
ohemorange Mar 1, 2021
2d6f6ce
tt is deprecated. I'm not fixing the whole site right now but new cod…
ohemorange Mar 1, 2021
bb002f2
remove unnecessary redhat-rpm-config
ohemorange Mar 1, 2021
3b891c3
remove automatic updates line
ohemorange Mar 3, 2021
f53d1d1
put RHEL notes in full sentences
ohemorange Mar 3, 2021
1b8f049
add dns plugin and sudo to installation instructions
ohemorange Mar 3, 2021
c7a13e8
streamline and rename dropdowns and uris
ohemorange Mar 3, 2021
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
18 changes: 15 additions & 3 deletions _data/inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
"distro": "snap",
"version": "0"
},
{
"name": "pip",
"id": "pip",
"distro": "pip",
"version": "0"
},
{
"name": "Debian 9 (stretch)",
"id": "debianstretch",
Expand Down Expand Up @@ -159,9 +165,15 @@
"version": "15.0"
},
{
"name": "Other Linux",
"id": "pip",
"distro": "linux",
"name": "Other Linux (snapd)",
"id": "othersnap",
"distro": "snap",
"version": "0"
},
{
"name": "Other Linux (pip)",
"id": "otherpip",
"distro": "pip",
"version": "0"
},
{
Expand Down
23 changes: 22 additions & 1 deletion _scripts/instruction-widget/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ module.exports = function(context) {
macos_install();
} else if (context.distro == "devuan" && context.version > 1) {
debian_install();
} else if (context.distro == "pip") {
pip_install();
} else {
snap_install();
}

partials.auto = require(TEMPLATE_PATH + "commonauto.html");
partials.header = require(TEMPLATE_PATH + "header.html");
partials.installcertbot = require(TEMPLATE_PATH + "installcertbot.html");
partials.preparecertbotsnapcommand = require(TEMPLATE_PATH + "preparecertbotsnapcommand.html");
partials.preparecertbotsymlinkcommand = require(TEMPLATE_PATH + "preparecertbotsymlinkcommand.html");
partials.dnsplugins = require(TEMPLATE_PATH + "dnsplugins.html");
partials.dnspluginssetup = require(TEMPLATE_PATH + "dnspluginssetup.html");

Expand Down Expand Up @@ -259,6 +261,25 @@ module.exports = function(context) {
context.package = "--classic certbot";
context.dns_plugins = true;
context.dns_package_prefix = "certbot-dns";
context.original_certbot_location = "/snap/bin";
}

pip_install = function () {
template = "pip";
context.base_command = "certbot";
context.cron_included = false;
context.install_command = "sudo /opt/certbot/bin/pip install";
context.package = "certbot";
if (context.webserver == "apache") {
context.package += " certbot-apache";
} else if (context.webserver == "nginx") {
context.package += " certbot-nginx";
}
context.dns_plugins = true;
context.dns_package_prefix = "certbot-dns";
context.python_name = "/opt/certbot/bin/python";
context.original_certbot_location = "/opt/certbot/bin";
context.upgrade_instructions = true;
}

// This function is currently unused, but we keep it around to make it easy
Expand Down
15 changes: 15 additions & 0 deletions _scripts/instruction-widget/templates/getting-started/renewal.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,18 @@
look for the lock icon in the URL bar.
</p>
</li>

{{#upgrade_instructions}}
<li>
[Monthly] Upgrade certbot
<p>It's important to occasionally update Certbot to keep it up-to-date. To do this, run the
following command on the command line on the machine.
<pre class="no-before"><ol>
<li>{{install_command}} --upgrade {{package}}{{#advanced}} certbot-dns-&lt;PLUGIN&gt;{{/advanced}}</li></ol></pre>
</p>

{{#advanced}}<p>As above, replace <code>&lt;PLUGIN&gt;</code> with the name of your DNS provider.</p>{{/advanced}}

<p>If this step leads to errors, run <code>sudo rm -rf /opt/certbot</code> and repeat all installation instructions.</p>
</li>
{{/upgrade_instructions}}
84 changes: 84 additions & 0 deletions _scripts/instruction-widget/templates/install/pip.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<aside class="note">
<div class="note-header">
<h3>Partial support</h3>
</div>
<p>
The Certbot team supports this installation method on a best effort basis. If you are on
a more obscure or heavily customized system, these instructions may not work and the
Certbot team may be unable to help you resolve the problem.
</p>
</aside>

{{> header}}
<li>
Install system dependencies

<p>System dependencies may include Python 3.6+, including venv (this might be called <code>python3</code>,
<code>python3</code>, or <code>python3-venv</code>) and Augeas for the Apache
plugin (<code>libaugeas0</code> or <code>augeaslibs</code>).</p>

<p>If you're having trouble installing cryptography, you may need to install additional
dependencies. See
<a href="https://cryptography.io/en/latest/installation.html#building-cryptography-on-linux">
the cryptography project's site</a> for more infoformation.</p>

<p>Commands to install system dependencies may look like the following, run on the command
line on the machine.</p>
<p>For APT-based distributions (e.g. Debian, Ubuntu ...):
<pre class="no-before"><ol>
<li>sudo apt update</li>
<li>sudo apt install python3 python3-venv libaugeas0</li>
</ol></pre>
</p>
<p>For RPM-based distributions (e.g. Fedora, CentOS ...):
<pre class="no-before"><ol>
<li>sudo dnf install python3 augeas-libs</li></ol></pre></p>
<p>
* Note that old distributions use <code>yum</code> instead of <code>dnf</code>, and that
RHEL-based distributions use <code>python3X</code> instead of <code>python3</code>
(e.g. <code>python36</code>).
</p>

<p>These packages may have slightly different names on other distributions; a search such as
"augeas on &lt;your_system_name&gt;" will probably yield helpful results.</p>
</li>
<li>
Remove certbot-auto and any Certbot OS packages
<p>
If you have any Certbot packages installed using an OS package manager like
<code>apt</code>, <code>dnf</code>, or <code>yum</code>, you should remove them before
installing the Certbot snap to ensure that when you run the command
<code>certbot</code> the snap is used rather than the installation from your OS
package manager. The exact command to do this depends on your OS, but
common examples are <code>sudo apt-get remove certbot</code>, <code>sudo dnf
remove certbot</code>, or <code>sudo yum remove certbot</code>.
</p>
<p>
If you previously used Certbot through the certbot-auto script, you should
also remove its installation by following the instructions <a
href="/docs/uninstall.html">here</a>.
</p>
</li>
<li>
Set up a Python virtual environment
<p>
Execute the following instructions on the command line on the machine to set up a virtual
environment.
<pre class="no-before"><ol>
<li>sudo python3 -m venv /opt/certbot/</li>
<li>{{install_command}} --upgrade pip</li>
</ol></pre>
</p>
</li>

{{> installcertbot}}
ohemorange marked this conversation as resolved.
Show resolved Hide resolved
{{>preparecertbotsymlinkcommand}}


{{#advanced}}
{{#dns_plugins}}
{{/dns_plugins}}
{{/advanced}}

{{> dnspluginssetup}}

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Execute the following instruction on the command line on the machine to ensure
that the <tt>certbot</tt> command can be run.
</p>
<pre>sudo ln -s /snap/bin/certbot /usr/bin/certbot</pre>
<pre>sudo ln -s {{original_certbot_location}}/certbot /usr/bin/certbot</pre>
</li>
2 changes: 1 addition & 1 deletion _scripts/instruction-widget/templates/install/snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h3>Snap Support</h3>
</li>

{{>installcertbot}}
{{>preparecertbotsnapcommand}}
{{>preparecertbotsymlinkcommand}}

{{#advanced}}
{{#dns_plugins}}
Expand Down