From 85224da0e59e50c76e880dbe05dff3f33daf2083 Mon Sep 17 00:00:00 2001 From: The Z <1020111+farirat@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:00:36 +0100 Subject: [PATCH 1/8] Update ci.yml Added the new 0.11 branch Added py3.12 to the matrix --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c184d368..8961b599 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,10 @@ on: pull_request: branches: - 'master' - - '0.9' - - '0.10' + - '0.10-develop' - '0.10.*' + - '0.11-develop' + - '0.11.*' env: GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} @@ -28,7 +29,7 @@ jobs: - 6379:6379 strategy: matrix: - python: [3.7, 3.8, 3.9, '3.10', 3.11] + python: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12] steps: - uses: actions/checkout@v2 - name: Install os dependencies From 9810625d627412b8ed0bcb27f81efee9293bc736 Mon Sep 17 00:00:00 2001 From: The Z <1020111+farirat@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:24:46 +0100 Subject: [PATCH 2/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8961b599..701ae789 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - 6379:6379 strategy: matrix: - python: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12] + python: [3.7, 3.8, 3.9, '3.10', 3.11] steps: - uses: actions/checkout@v2 - name: Install os dependencies From 4c0249af60d0de12102ced6b805831fedf4451eb Mon Sep 17 00:00:00 2001 From: The Z <1020111+farirat@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:30:03 +0100 Subject: [PATCH 3/8] Update ci.yml --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a837042c..2fb6ab0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,7 @@ on: branches: - 'master' - '0.10-develop' - - '0.10.*' - '0.11-develop' - - '0.11.*' env: GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} From 9808b84a58f37d1a0bddae1e45e47d0cf1e3e99e Mon Sep 17 00:00:00 2001 From: Kisuke-CZE Date: Wed, 15 Nov 2023 22:03:36 +0100 Subject: [PATCH 4/8] Proposing different packaging - switching to venv --- misc/config/jasmind.environment | 2 + misc/config/systemd/jasmin-celery.service | 2 +- misc/config/systemd/jasmin-dlrd.service | 2 +- misc/config/systemd/jasmin-dlrlookupd.service | 2 +- .../systemd/jasmin-interceptord.service | 2 +- misc/config/systemd/jasmin-restapi.service | 2 +- misc/config/systemd/jasmind.service | 3 +- misc/packaging/scripts/common-postinstall.sh | 63 ++++++++++------- misc/packaging/scripts/common-preremove.sh | 10 +-- nfpm.yaml | 68 +++---------------- 10 files changed, 62 insertions(+), 94 deletions(-) create mode 100644 misc/config/jasmind.environment diff --git a/misc/config/jasmind.environment b/misc/config/jasmind.environment new file mode 100644 index 00000000..be324ae8 --- /dev/null +++ b/misc/config/jasmind.environment @@ -0,0 +1,2 @@ +JCLI_USERNAME='jcliadmin' +JCLI_PASSWORD='jclipwd' diff --git a/misc/config/systemd/jasmin-celery.service b/misc/config/systemd/jasmin-celery.service index 4cca55aa..94ba6ba8 100644 --- a/misc/config/systemd/jasmin-celery.service +++ b/misc/config/systemd/jasmin-celery.service @@ -9,7 +9,7 @@ SyslogIdentifier=jasmin-celery PIDFile=/run/jasmin-celery.pid User=jasmin Group=jasmin -ExecStart=/bin/sh -c "celery -A jasmin.protocols.rest.tasks worker -l INFO -c 4 --autoscale=10,3" +ExecStart=/bin/sh -c "/opt/jasmin-sms-gateway/venv/bin/celery -A jasmin.protocols.rest.tasks worker -l INFO -c 4 --autoscale=10,3" [Install] WantedBy=multi-user.target diff --git a/misc/config/systemd/jasmin-dlrd.service b/misc/config/systemd/jasmin-dlrd.service index c0e6f0e4..ab68f19c 100644 --- a/misc/config/systemd/jasmin-dlrd.service +++ b/misc/config/systemd/jasmin-dlrd.service @@ -8,7 +8,7 @@ SyslogIdentifier=jasmin-dlrd PIDFile=/run/jasmin-dlrd.pid User=jasmin Group=jasmin -ExecStart=/usr/local/bin/dlrd.py +ExecStart=/opt/jasmin-sms-gateway/venv/bin/dlrd.py [Install] WantedBy=multi-user.target diff --git a/misc/config/systemd/jasmin-dlrlookupd.service b/misc/config/systemd/jasmin-dlrlookupd.service index 6e58dbf3..d7e8c70d 100644 --- a/misc/config/systemd/jasmin-dlrlookupd.service +++ b/misc/config/systemd/jasmin-dlrlookupd.service @@ -8,7 +8,7 @@ SyslogIdentifier=jasmin-dlrlookupd PIDFile=/run/jasmin-dlrlookupd.pid User=jasmin Group=jasmin -ExecStart=/usr/local/bin/dlrlookupd.py +ExecStart=/opt/jasmin-sms-gateway/venv/bin/dlrlookupd.py [Install] WantedBy=multi-user.target diff --git a/misc/config/systemd/jasmin-interceptord.service b/misc/config/systemd/jasmin-interceptord.service index e9162bfa..86314f0f 100644 --- a/misc/config/systemd/jasmin-interceptord.service +++ b/misc/config/systemd/jasmin-interceptord.service @@ -9,7 +9,7 @@ SyslogIdentifier=interceptord PIDFile=/run/interceptord.pid User=jasmin Group=jasmin -ExecStart=/usr/local/bin/interceptord.py +ExecStart=/opt/jasmin-sms-gateway/venv/bin/interceptord.py [Install] WantedBy=multi-user.target diff --git a/misc/config/systemd/jasmin-restapi.service b/misc/config/systemd/jasmin-restapi.service index c209c747..ae1fbe24 100644 --- a/misc/config/systemd/jasmin-restapi.service +++ b/misc/config/systemd/jasmin-restapi.service @@ -8,7 +8,7 @@ SyslogIdentifier=jasmin-restapi PIDFile=/run/jasmin-restapi.pid User=jasmin Group=jasmin -ExecStart=/bin/sh -c "twistd3 -n --pidfile=/tmp/twistd-web-restapi.pid web --wsgi=jasmin.protocols.rest.api" +ExecStart=/bin/sh -c "/opt/jasmin-sms-gateway/venv/bin/twistd -n --pidfile=/tmp/twistd-web-restapi.pid web --wsgi=jasmin.protocols.rest.api --listen=tcp:1402" [Install] WantedBy=multi-user.target diff --git a/misc/config/systemd/jasmind.service b/misc/config/systemd/jasmind.service index 21cbd73e..e87d6ac2 100644 --- a/misc/config/systemd/jasmind.service +++ b/misc/config/systemd/jasmind.service @@ -8,7 +8,8 @@ SyslogIdentifier=jasmind PIDFile=/run/jasmind.pid User=jasmin Group=jasmin -ExecStart=/usr/local/bin/jasmind.py --username jcliadmin --password jclipwd +ExecStart=/opt/jasmin-sms-gateway/venv/bin/jasmind.py --enable-interceptor-client +EnvironmentFile=/etc/jasmin/jasmind.environment [Install] WantedBy=multi-user.target diff --git a/misc/packaging/scripts/common-postinstall.sh b/misc/packaging/scripts/common-postinstall.sh index 4f37e217..f4470ae3 100755 --- a/misc/packaging/scripts/common-postinstall.sh +++ b/misc/packaging/scripts/common-postinstall.sh @@ -3,35 +3,57 @@ set -e JASMIN_USER="jasmin" JASMIN_GROUP="jasmin" +JASMIN_VENV_DIR="/opt/jasmin-sms-gateway" +JASMIN_CFG_STORAGE="/var/log/jasmin" +JASMIN_LOG_DIR="/etc/jasmin/store" PACKAGE_NAME="jasmin-sms-gateway" PYPI_NAME="jasmin" +function create_dir { + if [ ! -d ${1} ] + then + mkdir ${1} + chown -R "${JASMIN_USER}:${JASMIN_GROUP}" ${1} + fi +} + +# Provision user/group +getent group ${JASMIN_GROUP} || groupadd -r "${JASMIN_GROUP}" +grep -q "^${JASMIN_USER}:" /etc/passwd || useradd -r -g ${JASMIN_GROUP} \ + -d ${JASMIN_VENV_DIR} -s /sbin/nologin \ + -c "Jasmin SMS Gateway user" ${JASMIN_USER} + +# If there is any VENV from previous version, just remove it (configs are safe in /etc ) - we do not want any conflicts +if [ -d ${JASMIN_VENV_DIR} ] +then + rm -rf ${JASMIN_VENV_DIR} +fi + +# Create empty directories +create_dir ${JASMIN_CFG_STORAGE} +create_dir ${JASMIN_LOG_DIR} +create_dir ${JASMIN_VENV_DIR} + +# Find latest installed python version +LATEST_PYTHON="$(find /usr/bin/ -maxdepth 1 -regex '.*python3\.[0-9]+' | sort --version-sor | tail -n 1)" +# LATEST_PYTHON="$(basename ${LATEST_PYTHON})" # Not needed + # Get installed package version and install the related pypi package(s) if [ "$(grep -Ei 'debian|buntu' /etc/*release)" ]; then - PACKAGE_VERSION=$(dpkg -s "$PACKAGE_NAME"|grep ^Version:|awk '{print $2}') - pip3 install "$PYPI_NAME"=="$PACKAGE_VERSION" -elif [ "$(grep -Ei 'centos|rhel|fedora' /etc/*release)" ]; then - PACKAGE_VERSION=$(rpm -qi "$PACKAGE_NAME"|grep ^Version|awk {'print $3'}) - pip3 install "$PYPI_NAME"=="$PACKAGE_VERSION" + PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk '{print $2}') +elif [ "$(grep -Ei 'centos|rhel|fedora|almalinux' /etc/*release)" ]; then + PACKAGE_VERSION=$(rpm -qi "${PACKAGE_NAME}"|grep ^Version|awk {'print $3'}) else echo "ERROR: Unsupported OS for this package." exit 1 fi -# Provision user/group -getent group $JASMIN_GROUP || groupadd -r "$JASMIN_GROUP" -grep -q "^${JASMIN_USER}:" /etc/passwd || useradd -r -g $JASMIN_GROUP \ - -d /usr/share/jasmin -s /sbin/nologin \ - -c "Jasmin SMS Gateway user" $JASMIN_USER - -# Create empty directories -mkdir /etc/jasmin/store -mkdir /var/log/jasmin - -# Change owner of required folders -chown -R "$JASMIN_USER:$JASMIN_GROUP" /etc/jasmin/store/ -chown -R "$JASMIN_USER:$JASMIN_GROUP" /var/log/jasmin +# Create VENV and install jasmin and all dependencies from pipy into that VENV +# sudo -u jasmin virtualenv -p ${LATEST_PYTHON} ${JASMIN_VENV_DIR}/venv +sudo -u jasmin ${LATEST_PYTHON} -m venv ${JASMIN_VENV_DIR}/venv +source ${JASMIN_VENV_DIR}/venv/bin/activate +sudo -u "${JASMIN_USER}" ${JASMIN_VENV_DIR}/venv/bin/pip install "${PYPI_NAME}"=="${PACKAGE_VERSION}" if [ "$1" = configure ]; then # Enable jasmind service @@ -39,8 +61,3 @@ if [ "$1" = configure ]; then /bin/systemctl enable jasmind fi -# python3-falcon package is not available in centos/rhel 8 -# this is a workaround -if [ "$(grep -Ei 'centos|rhel|fedora' /etc/*release)" ]; then - pip3 install falcon==2.0.0 -fi diff --git a/misc/packaging/scripts/common-preremove.sh b/misc/packaging/scripts/common-preremove.sh index 295dee0d..8b1fdee0 100755 --- a/misc/packaging/scripts/common-preremove.sh +++ b/misc/packaging/scripts/common-preremove.sh @@ -2,16 +2,12 @@ set -e PYPI_NAME="jasmin" - -pip3 uninstall -y "$PYPI_NAME" +JASMIN_VENV_DIR="/opt/jasmin-sms-gateway/" # Stop and disable jasmind service /bin/systemctl stop jasmind /bin/systemctl disable jasmind /bin/systemctl daemon-reload -# python3-falcon package is not available in centos/rhel 8 -# this is a workaround -if [ "$(grep -Ei 'centos|rhel|fedora' /etc/*release)" ]; then - pip3 uninstall -y falcon==2.0.0 -fi +# Remove whole VENV whe jasmin lives +rm -rf "${JASMIN_VENV_DIR}" diff --git a/nfpm.yaml b/nfpm.yaml index c2678089..4f379f7c 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -1,7 +1,8 @@ name: "jasmin-sms-gateway" -arch: "amd64" +arch: "all" platform: "linux" -version: "v0.11.0" +version: "0.11.0" +release: "2" section: "default" priority: "extra" maintainer: "Jookies LTD " @@ -42,6 +43,9 @@ contents: - src: ./misc/config/dlr.cfg dst: "/etc/jasmin/dlr.cfg" type: config + - src: ./misc/config/jasmind.environment + dst: "/etc/jasmin/jasmind.environment" + type: config - src: ./misc/config/dlrlookupd.cfg dst: "/etc/jasmin/dlrlookupd.cfg" type: config @@ -53,30 +57,16 @@ contents: type: config - src: ./misc/config/systemd/jasmind.service dst: "/usr/lib/systemd/system/jasmind.service" - type: config - src: ./misc/config/systemd/jasmin-celery.service dst: "/usr/lib/systemd/system/jasmin-celery.service" - type: config - src: ./misc/config/systemd/jasmin-dlrd.service dst: "/usr/lib/systemd/system/jasmin-dlrd.service" - type: config - src: ./misc/config/systemd/jasmin-dlrlookupd.service dst: "/usr/lib/systemd/system/jasmin-dlrlookupd.service" - type: config - src: ./misc/config/systemd/jasmin-interceptord.service dst: "/usr/lib/systemd/system/jasmin-interceptord.service" - type: config - src: ./misc/config/systemd/jasmin-restapi.service dst: "/usr/lib/systemd/system/jasmin-restapi.service" - type: config - - src: ./jasmin/bin/jasmind.py - dst: "/usr/local/bin/jasmind.py" - - src: ./jasmin/bin/interceptord.py - dst: "/usr/local/bin/interceptord.py" - - src: ./jasmin/bin/dlrd.py - dst: "/usr/local/bin/dlrd.py" - - src: ./jasmin/bin/dlrlookupd.py - dst: "/usr/local/bin/dlrlookupd.py" scripts: postinstall: ./misc/packaging/scripts/common-postinstall.sh preremove: ./misc/packaging/scripts/common-preremove.sh @@ -85,48 +75,10 @@ overrides: depends: - python3 (>= 3.8) - adduser - - python3-twisted - - python3-dateutil - - python3-pyparsing - - python3-lockfile - - python3-requests - - python3-setuptools - - python3-mimeparse - - python3-celery - - python-celery-common - - python3-falcon - - python3-redis - - python3-amqp - - python3-tabulate - - python3-treq - # These dependencies come from Jookies package repository - - python3-jookies-messaging - - python3-txredisapi - - python3-txamqp3 - - python3-smpp-pdu3 - - python3-smpp-twisted3 + - python3-virtualenv + # All dependecies all installed to VENV via pip rpm: depends: - epel-release - - python3 (>= 3.8) - - python3-twisted - - python3-dateutil - - python3-pyparsing - - python3-lockfile - - python3-requests - - python3-setuptools - - python3-mimeparse - - python3-celery - - python3-redis - - python3-amqp - - python3-tabulate - - python3-treq - # These dependencies come from Jookies package repository - - python3-jookies-messaging - - python3-txredisapi - - python3-txamqp3 - - python3-smpp-pdu3 - - python3-smpp-twisted3 - # There's no python3-falcon package for CentOS/RHEL 8 - # It will be handled by the pre/post scripts - #- python3-falcon + - python(abi) >= 3.8 + # All dependecies all installed to VENV via pip From 275ca5197d2aa8d1c6554673afea7bb39c938d44 Mon Sep 17 00:00:00 2001 From: Kisuke-CZE Date: Wed, 15 Nov 2023 22:31:10 +0100 Subject: [PATCH 5/8] Added noreplace option for some files which user might want to perserve. Fixed PACKAGE_VERSION in postinstall script for multiline version output - might happen on reinstalling package --- misc/packaging/scripts/common-postinstall.sh | 4 ++-- nfpm.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/misc/packaging/scripts/common-postinstall.sh b/misc/packaging/scripts/common-postinstall.sh index f4470ae3..64201723 100755 --- a/misc/packaging/scripts/common-postinstall.sh +++ b/misc/packaging/scripts/common-postinstall.sh @@ -36,14 +36,14 @@ create_dir ${JASMIN_LOG_DIR} create_dir ${JASMIN_VENV_DIR} # Find latest installed python version -LATEST_PYTHON="$(find /usr/bin/ -maxdepth 1 -regex '.*python3\.[0-9]+' | sort --version-sor | tail -n 1)" +LATEST_PYTHON="$(find /usr/bin/ -maxdepth 1 -regex '.*python3\.[0-9]+' | sort --version-sort | tail -n 1)" # LATEST_PYTHON="$(basename ${LATEST_PYTHON})" # Not needed # Get installed package version and install the related pypi package(s) if [ "$(grep -Ei 'debian|buntu' /etc/*release)" ]; then PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk '{print $2}') elif [ "$(grep -Ei 'centos|rhel|fedora|almalinux' /etc/*release)" ]; then - PACKAGE_VERSION=$(rpm -qi "${PACKAGE_NAME}"|grep ^Version|awk {'print $3'}) + PACKAGE_VERSION=$(rpm -qi "${PACKAGE_NAME}"|grep ^Version|awk {'print $3'} | sort --version-sort | tail -n 1) else echo "ERROR: Unsupported OS for this package." exit 1 diff --git a/nfpm.yaml b/nfpm.yaml index 4f379f7c..3a839813 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -36,19 +36,19 @@ provides: contents: - src: ./misc/config/jasmin.cfg dst: "/etc/jasmin/jasmin.cfg" - type: config + type: config|noreplace - src: ./misc/config/interceptor.cfg dst: "/etc/jasmin/interceptor.cfg" - type: config + type: config|noreplace - src: ./misc/config/dlr.cfg dst: "/etc/jasmin/dlr.cfg" - type: config + type: config|noreplace - src: ./misc/config/jasmind.environment dst: "/etc/jasmin/jasmind.environment" - type: config + type: config|noreplace - src: ./misc/config/dlrlookupd.cfg dst: "/etc/jasmin/dlrlookupd.cfg" - type: config + type: config|noreplace - src: ./misc/config/resource/amqp0-9-1.xml dst: "/etc/jasmin/resource/amqp0-9-1.xml" type: config From 2e3eb52e9ec8f9c650189832f6b27c34ed676090 Mon Sep 17 00:00:00 2001 From: Kisuke-CZE Date: Wed, 15 Nov 2023 23:34:13 +0100 Subject: [PATCH 6/8] Fixing postremove script order for RPM --- misc/packaging/scripts/common-postinstall.sh | 2 +- nfpm.yaml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/packaging/scripts/common-postinstall.sh b/misc/packaging/scripts/common-postinstall.sh index 64201723..ffdbb520 100755 --- a/misc/packaging/scripts/common-postinstall.sh +++ b/misc/packaging/scripts/common-postinstall.sh @@ -41,7 +41,7 @@ LATEST_PYTHON="$(find /usr/bin/ -maxdepth 1 -regex '.*python3\.[0-9]+' | sort -- # Get installed package version and install the related pypi package(s) if [ "$(grep -Ei 'debian|buntu' /etc/*release)" ]; then - PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk '{print $2}') + PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk '{print $2}' | sort --version-sort | tail -n 1) elif [ "$(grep -Ei 'centos|rhel|fedora|almalinux' /etc/*release)" ]; then PACKAGE_VERSION=$(rpm -qi "${PACKAGE_NAME}"|grep ^Version|awk {'print $3'} | sort --version-sort | tail -n 1) else diff --git a/nfpm.yaml b/nfpm.yaml index 3a839813..b668207b 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -68,10 +68,14 @@ contents: - src: ./misc/config/systemd/jasmin-restapi.service dst: "/usr/lib/systemd/system/jasmin-restapi.service" scripts: - postinstall: ./misc/packaging/scripts/common-postinstall.sh preremove: ./misc/packaging/scripts/common-preremove.sh +rpm: + scripts: + posttrans: ./misc/packaging/scripts/common-postinstall.sh overrides: deb: + scripts: + postinstall: ./misc/packaging/scripts/common-postinstall.sh depends: - python3 (>= 3.8) - adduser From e10716e846e1f6fc969c004c6dd94f8b891e2d60 Mon Sep 17 00:00:00 2001 From: Kisuke-CZE Date: Thu, 16 Nov 2023 22:12:01 +0100 Subject: [PATCH 7/8] Tweaked dependecies and postinstall script for Debian and Ubuntu. --- misc/packaging/scripts/common-postinstall.sh | 6 +++--- nfpm.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/misc/packaging/scripts/common-postinstall.sh b/misc/packaging/scripts/common-postinstall.sh index ffdbb520..3ad11f9e 100755 --- a/misc/packaging/scripts/common-postinstall.sh +++ b/misc/packaging/scripts/common-postinstall.sh @@ -35,13 +35,13 @@ create_dir ${JASMIN_CFG_STORAGE} create_dir ${JASMIN_LOG_DIR} create_dir ${JASMIN_VENV_DIR} -# Find latest installed python version +# Find latest installed python version available on system LATEST_PYTHON="$(find /usr/bin/ -maxdepth 1 -regex '.*python3\.[0-9]+' | sort --version-sort | tail -n 1)" # LATEST_PYTHON="$(basename ${LATEST_PYTHON})" # Not needed # Get installed package version and install the related pypi package(s) if [ "$(grep -Ei 'debian|buntu' /etc/*release)" ]; then - PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk '{print $2}' | sort --version-sort | tail -n 1) + PACKAGE_VERSION=$(dpkg -s "${PACKAGE_NAME}"|grep ^Version:|awk -F '[- ]' '{print $2}' | sort --version-sort | tail -n 1) elif [ "$(grep -Ei 'centos|rhel|fedora|almalinux' /etc/*release)" ]; then PACKAGE_VERSION=$(rpm -qi "${PACKAGE_NAME}"|grep ^Version|awk {'print $3'} | sort --version-sort | tail -n 1) else @@ -51,7 +51,7 @@ fi # Create VENV and install jasmin and all dependencies from pipy into that VENV # sudo -u jasmin virtualenv -p ${LATEST_PYTHON} ${JASMIN_VENV_DIR}/venv -sudo -u jasmin ${LATEST_PYTHON} -m venv ${JASMIN_VENV_DIR}/venv +sudo -u "${JASMIN_USER}" ${LATEST_PYTHON} -m venv ${JASMIN_VENV_DIR}/venv source ${JASMIN_VENV_DIR}/venv/bin/activate sudo -u "${JASMIN_USER}" ${JASMIN_VENV_DIR}/venv/bin/pip install "${PYPI_NAME}"=="${PACKAGE_VERSION}" diff --git a/nfpm.yaml b/nfpm.yaml index b668207b..b094d1a8 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -79,10 +79,12 @@ overrides: depends: - python3 (>= 3.8) - adduser - - python3-virtualenv + - python3-venv + - sudo # All dependecies all installed to VENV via pip rpm: depends: - - epel-release - python(abi) >= 3.8 + - sudo # All dependecies all installed to VENV via pip + # Dependecy on epel-release removed - it's not needed on most RHEL version and you might have your own EPEL clone or another source for packages From 2f0071edf5e66bfbe4e2801d16cb3b3cb78d7639 Mon Sep 17 00:00:00 2001 From: Kisuke-CZE Date: Fri, 17 Nov 2023 08:41:31 +0100 Subject: [PATCH 8/8] Fixed permissions on jasmind.environment - file must not be world readable --- nfpm.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nfpm.yaml b/nfpm.yaml index b094d1a8..c6faa78d 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -46,6 +46,8 @@ contents: - src: ./misc/config/jasmind.environment dst: "/etc/jasmin/jasmind.environment" type: config|noreplace + file_info: + mode: 0660 - src: ./misc/config/dlrlookupd.cfg dst: "/etc/jasmin/dlrlookupd.cfg" type: config|noreplace