-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from 101t/3.0.0
3.0.0
- Loading branch information
Showing
117 changed files
with
6,364 additions
and
1,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,9 @@ Dockerfile | |
.cache | ||
*.md | ||
!README*.md | ||
env/ | ||
venv/ | ||
|
||
logs/ | ||
public/ | ||
docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ staticfiles | |
# virtual environments | ||
.env | ||
env/ | ||
venv/ | ||
db.sqlite3 | ||
|
||
# Hitch directory | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,19 +8,19 @@ TIME_ZONE=Etc/GMT-3 | |
LANGUAGE_CODE=en | ||
SITE_ID=1 | ||
|
||
MYSQLDB_URL=mysql://root:[email protected]/jasmin_web_db | ||
SQLITE3_URL=sqlite:///db.sqlite3 | ||
POSTGRE_URL=postgres://postgres:123@127.0.0.1:5432/jasmin_web_db | ||
# mysql://root:[email protected]/jasmin_web_db | ||
# sqlite:///db.sqlite3 | ||
# postgres://jasmin:jasmin@127.0.0.1:5432/jasmin | ||
|
||
DEVDB_URL=sqlite:///db.sqlite3 | ||
PRODB_URL=postgres://postgres:123@127.0.0.1:5432/jasmin_web_db | ||
PRODB_URL=postgres://jasmin:jasmin@127.0.0.1:5432/jasmin | ||
|
||
# REDIS_HOST=localhost | ||
# REDIS_PORT=6379 | ||
# REDIS_DB=0 | ||
|
||
ACTIVE_APP=web | ||
ALLOWED_HOSTS=* | ||
CSRF_TRUSTED_ORIGINS= | ||
|
||
TELNET_HOST=127.0.0.1 | ||
TELNET_PORT=8990 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
from django.conf import settings | ||
from celery import Celery | ||
from celery.utils.log import get_task_logger | ||
|
||
from django.utils import timezone | ||
|
||
logger = get_task_logger(__name__) | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.dev") | ||
|
||
app = Celery('config') | ||
|
||
app.config_from_object("django.conf:settings", namespace="CELERY") | ||
app.conf.broker_url = settings.CELERY_BROKER_URL | ||
app.conf.result_backend = settings.CELERY_RESULT_BACKEND | ||
app.conf.broker_connection_max_retries = 0 | ||
app.conf.broker_connection_retry_on_startup = True | ||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS, related_name='tasks') | ||
|
||
BROKER_CONNECTION_TIMEOUT = 120 | ||
|
||
CELERY_DEFAULT_UP_TIME = timezone.now() | ||
|
||
|
||
@app.task(bind=True) | ||
def debug_task(self): | ||
print("Request: {0!r}".format(self.Request)) | ||
|
||
|
||
def revoke_task(task_id): | ||
app.control.revoke(task_id) | ||
|
||
|
||
def clear_tasks(): | ||
return app.control.purge() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM alpine:3.11 | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV JASMIN_HOME=/jasmin | ||
ENV PATH="${PATH}:/jasmin" | ||
|
||
# RUN mkdir /jasmin | ||
RUN addgroup -S jasmin && adduser -S jasmin -G jasmin -h $JASMIN_HOME | ||
|
||
#RUN apk del busybox-extras | ||
RUN apk --update --no-cache upgrade | ||
RUN apk add python3 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main && ln -sf python3 /usr/bin/python | ||
# RUN apk search busybox-extras | ||
RUN apk add busybox-extras | ||
# RUN busybox --list | ||
# RUN apk add --no-cache bash curl nmap apache2-utils bind-tools tcpdump mtr iperf3 strace tree busybox-extras netcat-openbsd | ||
RUN echo alias telnet='busybox-extras telnet' >> .bashrc | ||
RUN telnet google.com 80 | ||
|
||
RUN apk add --update build-base git gcc cmake py3-setuptools py3-pip python3-dev bash | ||
|
||
# RUN apk add --no-cache bash | ||
|
||
WORKDIR $JASMIN_HOME | ||
|
||
USER jasmin | ||
|
||
RUN mkdir -p $JASMIN_HOME/public/media | ||
RUN mkdir -p $JASMIN_HOME/public/static | ||
|
||
# RUN chown -R jasmin:jasmin $JASMIN_HOME/ | ||
|
||
COPY --chown=jasmin:jasmin ./requirements.txt $JASMIN_HOME/requirements.txt | ||
|
||
ENV PATH="${PATH}:/jasmin/.local/bin" | ||
|
||
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt | ||
|
||
COPY --chown=jasmin:jasmin . $JASMIN_HOME | ||
|
||
COPY --chown=jasmin:jasmin ./docker-entrypoint.sh docker-entrypoint.sh | ||
|
||
# RUN chown -R jasmin:jasmin $JASMIN_HOME/ | ||
|
||
# USER root | ||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: '3.7' | ||
|
||
services: | ||
jasmin_web: | ||
image: tarekaec/jasmin_web_panel:1.0-alpine | ||
ports: | ||
- "8000:8000" | ||
deploy: | ||
replicas: 1 | ||
env_file: | ||
- .env | ||
environment: | ||
JASMIN_PORT: 8000 | ||
healthcheck: | ||
disable: true | ||
volumes: | ||
- ./public:/web/public | ||
# entrypoint: /jasmin/docker-entrypoint.sh | ||
jasmin_celery: | ||
image: tarekaec/jasmin_web_panel:1.0-alpine | ||
deploy: | ||
replicas: 1 | ||
env_file: | ||
- .env | ||
environment: | ||
DEBUG: 0 | ||
healthcheck: | ||
disable: true | ||
depends_on: | ||
- jasmin_redis | ||
entrypoint: /jasmin/celery_run.sh | ||
jasmin_redis: | ||
image: redis:alpine | ||
tty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Jasmin SMS Gateway | ||
This is the docker version of jasmin sms gateway | ||
|
||
```shell | ||
docker stack deploy -c config/docker/jasmin/docker-compose.yml jasmin | ||
``` |
Oops, something went wrong.