From 260a066b9de1ef911bc077d76a129bbc199d34dd Mon Sep 17 00:00:00 2001 From: Sean Whalen <44679+seanthegeek@users.noreply.github.com> Date: Sun, 9 Jan 2022 14:46:14 -0500 Subject: [PATCH] Better install instructions Avoid polluting the system Python installation --- _sources/index.rst.txt | 23 +++++++++++++---------- index.html | 16 +++++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt index cb8ff00..26b4705 100644 --- a/_sources/index.rst.txt +++ b/_sources/index.rst.txt @@ -607,15 +607,25 @@ On CentOS or RHEL systems, run: Python 3 installers for Windows and macOS can be found at https://www.python.org/downloads/ + +Create a system user + .. code-block:: bash - sudo -H pip3 install -U parsedmarc + sudo mkdir -f /opt + sudo useradd parsedmarc -r -s /bin/false -b /opt + + +.. code-block:: bash + + sudo -u parsedmarc -H pip3 install --user -U pip + sudo -u parsedmarc -H pip3 install --user -U parsedmarc Or, install the latest development release directly from GitHub: .. code-block:: bash - sudo -H pip3 install -U git+https://github.com/domainaware/parsedmarc.git + sudo -u parsedmarc -H pip3 install --user -U git+https://github.com/domainaware/parsedmarc.git .. note:: @@ -1153,13 +1163,6 @@ Running parsedmarc as a systemd service Use systemd to run ``parsedmarc`` as a service and process reports as they arrive. - -Create a system user - -.. code-block:: bash - - sudo useradd parsedmarc -r -s /bin/false - Protect the ``parsedmarc`` configuration file from prying eyes .. code-block:: bash @@ -1182,7 +1185,7 @@ Create the service configuration file After=network.target network-online.target elasticsearch.service [Service] - ExecStart=/usr/local/bin/parsedmarc -c /etc/parsedmarc.ini + ExecStart=/opt/parsedmarc/.local/bin/parsedmarc -c /etc/parsedmarc.ini User=parsedmarc Group=parsedmarc Restart=always diff --git a/index.html b/index.html index 3eea1d0..55d2df5 100644 --- a/index.html +++ b/index.html @@ -716,11 +716,17 @@ sudo easy_install-3.4 pip

Python 3 installers for Windows and macOS can be found at https://www.python.org/downloads/

-
sudo -H pip3 install -U parsedmarc
+

Create a system user

+
sudo mkdir -f /opt
+sudo useradd parsedmarc -r -s /bin/false -b /opt
+
+
+
sudo -u parsedmarc -H pip3 install --user -U pip
+sudo -u parsedmarc -H pip3 install --user -U parsedmarc
 

Or, install the latest development release directly from GitHub:

-
sudo -H pip3 install -U git+https://github.com/domainaware/parsedmarc.git
+
sudo -u parsedmarc -H pip3 install --user -U git+https://github.com/domainaware/parsedmarc.git
 
@@ -1149,10 +1155,6 @@ flexible filtering options.

Running parsedmarc as a systemd service

Use systemd to run parsedmarc as a service and process reports as they arrive.

-

Create a system user

-
sudo useradd parsedmarc -r -s /bin/false
-
-

Protect the parsedmarc configuration file from prying eyes

sudo chown root:parsedmarc /etc/parsedmarc.ini
 sudo chmod u=rw,g=r,o= /etc/parsedmarc.ini
@@ -1169,7 +1171,7 @@ sudo chmod u=rw,g
 After=network.target network-online.target elasticsearch.service
 
 [Service]
-ExecStart=/usr/local/bin/parsedmarc -c /etc/parsedmarc.ini
+ExecStart=/opt/parsedmarc/.local/bin/parsedmarc -c /etc/parsedmarc.ini
 User=parsedmarc
 Group=parsedmarc
 Restart=always