Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# expanded using subsequent `include` items.
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
python-version: ["3.12"]
bare: [false]

defaults:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ target/
#PyCharm
.idea

# Dockerfile
docker-compose.yml

# Apprise Gateway Variable/Test Configuration
apprise_gw/var/*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim AS base
FROM python:3.12-slim AS base

# set version label
ARG BUILD_DATE
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.py310 → Dockerfile.py312
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# POSSIBILITY OF SUCH DAMAGE.

# Base
FROM python:3.10-buster
FROM python:3.12
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential musl-dev bash && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -38,7 +38,7 @@ WORKDIR /apprise-api
COPY requirements.txt /
COPY dev-requirements.txt /
ENV PYTHONPATH /apprise-api
ENV PYTHONPYCACHEPREFIX /apprise-api/__pycache__/py310
ENV PYTHONPYCACHEPREFIX /apprise-api/__pycache__/py312

RUN pip install --no-cache-dir -r /requirements.txt -r /dev-requirements.txt

Expand Down
64 changes: 37 additions & 27 deletions apprise_api/supervisord-startup
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,51 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

if [ $(id -u) -ne 0 ]; then
echo "You must be root to run this script."
echo "Caution: This should only be ran in a dockerized instance!"
exit 1
fi
if [ $(id -u) -eq 0 ]; then
#
# Root User
#
echo "Apprise API Super User Startup"

# Default values
PUID=${PUID:=1000}
PGID=${PGID:=1000}
# Default values
PUID=${PUID:=1000}
PGID=${PGID:=1000}

# lookup our identifier
GROUP=$(getent group $PGID 2>/dev/null | cut -d: -f1)
[ -z "$GROUP" ] && groupadd --force -g $PGID apprise &>/dev/null && \
GROUP=apprise
# lookup our identifier
GROUP=$(getent group $PGID 2>/dev/null | cut -d: -f1)
[ -z "$GROUP" ] && groupadd --force -g $PGID apprise &>/dev/null && \
GROUP=apprise

USER=$(id -un $PUID 2>/dev/null)
[ $? -ne 0 ] && useradd -M -N \
-o -u $PUID -G $GROUP -c "Apprise API User" -d /opt/apprise apprise && \
USER=apprise
USER=$(id -un $PUID 2>/dev/null)
[ $? -ne 0 ] && useradd -M -N \
-o -u $PUID -G $GROUP -c "Apprise API User" -d /opt/apprise apprise && \
USER=apprise

if [ -z "$USER" ]; then
echo "The specified User ID (PUID) of $PUID is invalid; Aborting operation."
exit 1
if [ -z "$USER" ]; then
echo "The specified User ID (PUID) of $PUID is invalid; Aborting operation."
exit 1

elif [ -z "$GROUP" ]; then
echo "The specified Group ID (PGID) of $PGID is invalid; Aborting operation."
exit 1
fi
elif [ -z "$GROUP" ]; then
echo "The specified Group ID (PGID) of $PGID is invalid; Aborting operation."
exit 1
fi

# Ensure our group has been correctly assigned
usermod -a -G $GROUP $USER &>/dev/null
chmod o+w /dev/stdout /dev/stderr
# Ensure our group has been correctly assigned
usermod -a -G $GROUP $USER &>/dev/null
chmod o+w /dev/stdout /dev/stderr

else
#
# Non-Root User
#
echo "Apprise API Non-Super User Startup"
USER=$(id -un 2>/dev/null)
GROUP=$(id -gn 2>/dev/null)
fi

[ ! -d /attach ] && mkdir -p /attach
chown -R $USER:$GROUP /attach
[ ! -d /config ] && mkdir -p /config /config/store
[ ! -d /config/store ] && mkdir -p /config/store
chown $USER:$GROUP /config
chown -R $USER:$GROUP /config/store
[ ! -d /plugin ] && mkdir -p /plugin
Expand Down Expand Up @@ -91,5 +100,6 @@ cd /opt/apprise

# Launch our SupervisorD
/usr/local/bin/supervisord -c /opt/apprise/webapp/etc/supervisord.conf

# Always return our SupervisorD return code
exit $?
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ services:
##
## > Host service (visit http://localhost on host pc to access):
## ./manage.py runserver 0.0.0.0:8000
test.py310:
ports:
- 8000:8000
build:
context: .
dockerfile: Dockerfile.py310
volumes:
- ./:/apprise-api
# test.py312:
# ports:
# - 8000:8000
# build:
# context: .
# dockerfile: Dockerfile.py312
# volumes:
# - ./:/apprise-api
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py311,coverage-report
envlist = py312,coverage-report
skipsdist = true

[testenv]
Expand All @@ -14,7 +14,7 @@ commands =
coverage run --parallel -m pytest {posargs} apprise_api
flake8 apprise_api --count --show-source --statistics

[testenv:py311]
[testenv:py312]
deps=
-r{toxinidir}/requirements.txt
-r{toxinidir}/dev-requirements.txt
Expand Down