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

0.11.1 #1187

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

0.11.1 #1187

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
574495e
ref #1155 - Python version requirement (3.8+)
farirat Nov 15, 2023
52962a5
version bump
farirat Nov 15, 2023
9808b84
Proposing different packaging - switching to venv
Kisuke-CZE Nov 15, 2023
275ca51
Added noreplace option for some files which user might want to perser…
Kisuke-CZE Nov 15, 2023
2e3eb52
Fixing postremove script order for RPM
Kisuke-CZE Nov 15, 2023
e10716e
Tweaked dependecies and postinstall script for Debian and Ubuntu.
Kisuke-CZE Nov 16, 2023
2f0071e
Fixed permissions on jasmind.environment - file must not be world rea…
Kisuke-CZE Nov 17, 2023
6eb0f0c
create DLR with last pdu smpp_msgid instead of the first
Herneto Nov 19, 2023
bb1c6ac
Moved setting DLR mas from HTTP request before interception is done.
Kisuke-CZE Nov 21, 2023
50c6f03
Merge branch '0.11.1' into master
farirat Nov 23, 2023
8be6917
Merge pull request #1156 from Kisuke-CZE/master
farirat Nov 23, 2023
911eab4
Removing digitalocean sponsorship
farirat Nov 23, 2023
67844b9
RestAPI configuration file: rest-api.cfg
BlackOrder Jan 3, 2024
fa4ee78
Edit cfg file name in Docs
BlackOrder Jan 3, 2024
383d393
Update AMQP and Redis configuration. use name convention
BlackOrder Jan 4, 2024
5a884a1
clean RestAPI Dockerfiles
BlackOrder Jan 4, 2024
50a0cf9
Update pip in Dockerfile
BlackOrder Jan 4, 2024
5d055f4
Remove unnecessary dependencies from Dockerfile
BlackOrder Jan 4, 2024
598be16
Clean build directory in Dockerfile for RestAPI
BlackOrder Jan 4, 2024
9dae416
Fix Celery worker mode condition
BlackOrder Jan 4, 2024
5646a1a
Refactor RestAPI startup and add Celery worker support
BlackOrder Jan 4, 2024
16365b3
udh segment_seqnum from the current part. was always 1
BlackOrder Jan 20, 2024
b58af11
Merge pull request #1170 from BlackOrder/RestApiConfig-0.11.0
farirat Jan 20, 2024
4e13240
Add logging to stdout for HTTP server and REST API
BlackOrder Jan 22, 2024
22469fa
Add DeliverSmDaemon class to handle the Deliver-Sm thrower functionality
BlackOrder Jan 24, 2024
28ec80e
fix 1142
BlackOrder Jan 29, 2024
7c1f406
Merge pull request #1157 from Herneto/master
farirat Mar 27, 2024
6a29aeb
Merge pull request #1159 from Kisuke-CZE/fix-dlr-interception
farirat Mar 27, 2024
4ec623c
Merge pull request #1174 from BlackOrder/logging-to-stdout-for-HTTP-s…
farirat Mar 27, 2024
bb35e40
Merge pull request #1175 from BlackOrder/udh-segment_seqnum
farirat Mar 27, 2024
dd0562b
Merge pull request #1176 from BlackOrder/deliversmd
farirat Mar 27, 2024
c45c688
Merge pull request #1178 from BlackOrder/fix-1142-timer
farirat Mar 27, 2024
eb75667
Merge branch '0.11.1' of github.com:jookies/jasmin into 0.11.1
xfourat Mar 27, 2024
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
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ Jasmin is a very complete open source SMS Gateway with many enterprise-class fea
Jasmin relies heavily on message queuing through message brokers (Using AMQP), it is designed for performance,
high traffic loads and full in-memory execution.

.. figure:: https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg
:alt: Powered by DigitalOcean
:align: Center
:figwidth: 210px
:target: https://www.digitalocean.com/

Architecture
************

Expand Down
50 changes: 24 additions & 26 deletions docker/Dockerfile.restapi
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ MAINTAINER Jookies LTD <[email protected]>
RUN groupadd -r jasmin && useradd -r -g jasmin jasmin

# Install requirements
RUN apt-get update && apt-get install -y \
libffi-dev \
libssl-dev \
# Run python with jemalloc
# More on this:
# - https://zapier.com/engineering/celery-python-jemalloc/
# - https://paste.pics/581cc286226407ab0be400b94951a7d9
libjemalloc2

RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update; \
apt-get install -y --no-install-recommends \
libffi-dev \
libssl-dev \
# Run python with jemalloc
# More on this:
# - https://zapier.com/engineering/celery-python-jemalloc/
# - https://paste.pics/581cc286226407ab0be400b94951a7d9
libjemalloc2 \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Run python with jemalloc
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
Expand All @@ -26,15 +28,20 @@ ENV RESOURCE_PATH ${CONFIG_PATH}/resource
ENV STORE_PATH ${CONFIG_PATH}/store
ENV LOG_PATH /var/log/jasmin

RUN mkdir -p ${RESOURCE_PATH} ${STORE_PATH} ${LOG_PATH}
RUN mkdir -p ${CONFIG_PATH} ${RESOURCE_PATH} ${STORE_PATH} ${LOG_PATH}
RUN chown jasmin:jasmin ${CONFIG_PATH} ${RESOURCE_PATH} ${STORE_PATH} ${LOG_PATH}

WORKDIR /build

RUN pip install --upgrade pip

COPY . .

RUN pip install .

# Clean build dir
RUN rm -rf /build

# For RestAPI MODE
RUN pip install gunicorn

Expand All @@ -45,26 +52,17 @@ COPY misc/config/resource ${RESOURCE_PATH}

WORKDIR /etc/jasmin

# Default Redis and RabbitMQ connections
# Default Jasmin, Redis, and RabbitMQ connections
ENV JCLI_BIND '0.0.0.0'
ENV AMQP_BROKER_HOST 'rabbitmq'
ENV AMQP_BROKER_PORT 5672
ENV REDIS_CLIENT_HOST 'redis'
ENV REDIS_CLIENT_PORT 6379

# For RestAPI MODE
ENV RESTAPI_MODE 0
ENV RESTAPI_OLD_HTTP_HOST '127.0.0.1'

ENV ENABLE_PUBLISH_SUBMIT_SM_RESP 0

# Change binding host for jcli
RUN sed -i '/\[jcli\]/a bind=0.0.0.0' ${CONFIG_PATH}/jasmin.cfg
# Change binding port for redis, and amqp
RUN sed -i "/\[redis-client\]/a port=$REDIS_CLIENT_PORT" ${CONFIG_PATH}/jasmin.cfg
RUN sed -i "/\[amqp-broker\]/a port=$AMQP_BROKER_PORT" ${CONFIG_PATH}/jasmin.cfg
# Change binding host for redis, and amqp
RUN sed -i "/\[redis-client\]/a host=$REDIS_CLIENT_HOST" ${CONFIG_PATH}/jasmin.cfg
RUN sed -i "/\[amqp-broker\]/a host=$AMQP_BROKER_HOST" ${CONFIG_PATH}/jasmin.cfg
# For RestAPI http mode
ENV RESTAPI_HTTP_MODE 0
# For RestAPI Celery worker mode
ENV RESTAPI_WORKER_MODE 0

EXPOSE 2775 8990 1401 8080
VOLUME ["/var/log/jasmin", "/etc/jasmin", "/etc/jasmin/store"]
Expand Down
54 changes: 24 additions & 30 deletions docker/Dockerfile.restapi.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,54 @@ MAINTAINER Jookies LTD <[email protected]>
RUN addgroup -S jasmin && adduser -S -g jasmin jasmin

# Install requirements
RUN apk --update add \
gcc \
musl-dev \
libffi-dev \
openssl-dev \
python3-dev \
py3-pip \
git \
bash

# For RestAPI MODE
ENV RESTAPI_MODE 0
ENV RESTAPI_OLD_HTTP_HOST '127.0.0.1'

ENV ENABLE_PUBLISH_SUBMIT_SM_RESP 0
RUN apk --no-cache add \
libffi-dev \
openssl-dev \
bash \
; \
rm -vrf /var/cache/apk/*

ENV ROOT_PATH /
ENV CONFIG_PATH /etc/jasmin
ENV RESOURCE_PATH /etc/jasmin/resource
ENV STORE_PATH /etc/jasmin/store
ENV RESOURCE_PATH ${CONFIG_PATH}/resource
ENV STORE_PATH ${CONFIG_PATH}/store
ENV LOG_PATH /var/log/jasmin

RUN mkdir -p ${CONFIG_PATH} ${RESOURCE_PATH} ${STORE_PATH} ${LOG_PATH}
RUN chown jasmin:jasmin ${CONFIG_PATH} ${RESOURCE_PATH} ${STORE_PATH} ${LOG_PATH}

WORKDIR /build

RUN pip install -e git+https://github.com/jookies/txamqp.git@master#egg=txamqp3
RUN pip install -e git+https://github.com/jookies/python-messaging.git@master#egg=python-messaging
RUN pip install -e git+https://github.com/jookies/smpp.pdu.git@master#egg=smpp.pdu3
RUN pip install -e git+https://github.com/jookies/smpp.twisted.git@master#egg=smpp.twisted3
RUN pip install --upgrade pip

COPY . .

RUN pip install .

# Clean build dir
RUN rm -rf /build

# For RestAPI MODE
RUN pip install gunicorn

ENV UNICODEMAP_JP unicode-ascii

COPY misc/config/*.cfg ${CONFIG_PATH}/
COPY misc/config/resource/*.xml ${RESOURCE_PATH}/
COPY misc/config/resource ${RESOURCE_PATH}

WORKDIR /etc/jasmin

# Change binding host for jcli
RUN sed -i '/\[jcli\]/a bind=0.0.0.0' ${CONFIG_PATH}/jasmin.cfg
# Change binding port for redis, and amqp
RUN sed -i "/\[redis-client\]/a port=$REDIS_CLIENT_PORT" ${CONFIG_PATH}/jasmin.cfg
RUN sed -i "/\[amqp-broker\]/a port=$AMQP_BROKER_PORT" ${CONFIG_PATH}/jasmin.cfg
# Change binding host for redis, and amqp
RUN sed -i "/\[redis-client\]/a host=$REDIS_CLIENT_HOST" ${CONFIG_PATH}/jasmin.cfg
RUN sed -i "/\[amqp-broker\]/a host=$AMQP_BROKER_HOST" ${CONFIG_PATH}/jasmin.cfg
# Default Jasmin, Redis, and RabbitMQ connections
ENV JCLI_BIND '0.0.0.0'
ENV AMQP_BROKER_HOST 'rabbitmq'
ENV AMQP_BROKER_PORT 5672
ENV REDIS_CLIENT_HOST 'redis'
ENV REDIS_CLIENT_PORT 6379

# For RestAPI http mode
ENV RESTAPI_HTTP_MODE 0
# For RestAPI Celery worker mode
ENV RESTAPI_WORKER_MODE 0

EXPOSE 2775 8990 1401 8080
VOLUME ["/var/log/jasmin", "/etc/jasmin", "/etc/jasmin/store"]
Expand Down
36 changes: 11 additions & 25 deletions docker/restapi-docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
#!/bin/bash
set -e

# Change binding host:port for redis, and amqp
sed -i "/\[redis-client\]/,/host=/ s/host=.*/host=$REDIS_CLIENT_HOST/" ${CONFIG_PATH}/jasmin.cfg
sed -i "/\[redis-client\]/,/port=/ s/port=.*/port=$REDIS_CLIENT_PORT/" ${CONFIG_PATH}/jasmin.cfg
sed -i "/\[amqp-broker\]/,/host=/ s/host=.*/host=$AMQP_BROKER_HOST/" ${CONFIG_PATH}/jasmin.cfg
sed -i "/\[amqp-broker\]/,/port=/ s/port=.*/port=$AMQP_BROKER_PORT/" ${CONFIG_PATH}/jasmin.cfg

# Clean lock files
echo 'Cleaning lock files'
rm -f /tmp/*.lock

# RestAPI
if [ "$RESTAPI_MODE" = 1 ]; then
# find jasmin installation directory
jasminRoot=$(python -c "import jasmin as _; print(_.__path__[0])")
# update jasmin-restAPI config
sed -i "/# RESTAPI/,/old_api_uri/ s/old_api_uri.*/old_api_uri = 'http:\/\/$RESTAPI_OLD_HTTP_HOST:1401'/" ${jasminRoot}/protocols/rest/config.py
sed -i "/# CELERY/,/broker_url/ s/broker_url.*/broker_url = 'amqp:\/\/guest:guest@$AMQP_BROKER_HOST:$AMQP_BROKER_PORT\/\/'/" ${jasminRoot}/protocols/rest/config.py
sed -i "/# CELERY/,/result_backend/ s/result_backend.*/result_backend = 'redis:\/\/:@$REDIS_CLIENT_HOST:$REDIS_CLIENT_PORT\/1'/" ${jasminRoot}/protocols/rest/config.py
# If RestAPI http Mode, start Guicorn
if [ "$RESTAPI_HTTP_MODE" = 1 ]; then
# start restapi
exec gunicorn -b 0.0.0.0:8080 jasmin.protocols.rest:api --access-logfile /var/log/jasmin/rest-api.access.log --disable-redirect-access-to-syslog
else
if [ "$ENABLE_PUBLISH_SUBMIT_SM_RESP" = 1 ]; then
# Enable publish_submit_sm_resp
echo 'Enabling publish_submit_sm_resp'
sed -i "s/.*publish_submit_sm_resp\s*=.*/publish_submit_sm_resp=True/g" ${CONFIG_PATH}/jasmin.cfg
else
# Disable publish_submit_sm_resp
echo 'Disabling publish_submit_sm_resp'
sed -i "s/.*publish_submit_sm_resp\s*=.*/publish_submit_sm_resp=False/g" ${CONFIG_PATH}/jasmin.cfg
fi

# If Celery Worker is enabled, start Celery worker
elif [ "$RESTAPI_WORKER_MODE" = 1 ]; then
echo 'Starting Celery worker'
exec celery -A jasmin.protocols.rest.tasks worker -l INFO -c 4 --autoscale=10,3

# Else start jasmind
else
if [ "$2" = "--enable-interceptor-client" ]; then
echo 'Starting interceptord'
interceptord.py &
fi

echo 'Starting jasmind'
exec "$@"
fi
2 changes: 1 addition & 1 deletion jasmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

MAJOR = 0
MINOR = 11
PATCH = 0
PATCH = 1
META = ''


Expand Down
Loading
Loading