├── agent ├── __init__.py ├── netflow │ ├── __init__.py │ ├── djing_flow.tar.gz │ ├── start_netflow.sh │ ├── netflow_handler.sh │ └── netflow_collect.sh └── downloader.py ├── devapp ├── __init__.py ├── migrations │ └── __init__.py ├── apps.py ├── admin.py ├── expect_scripts │ ├── __init__.py │ └── dlink_DGS1100_reboot.exp ├── templates │ └── devapp │ │ ├── device_confirm_delete.html │ │ ├── manage_ports │ │ ├── modal_show_subscriber_on_port.html │ │ ├── modal_del_port.html │ │ ├── modal_add_edit_port.html │ │ └── fix_abon_device.html │ │ ├── modal_device_reboot.html │ │ ├── modal_device_extra_edit.html │ │ ├── ext.htm │ │ └── group_list.html ├── tasks.py └── tests.py ├── finapp ├── __init__.py ├── migrations │ └── __init__.py ├── apps.py ├── admin.py ├── forms.py ├── templates │ └── finapp │ │ ├── ext.htm │ │ ├── fin_report.html │ │ └── payHistory.html └── urls.py ├── mapapp ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_auto_20180808_1236.py │ └── 0001_initial.py ├── admin.py ├── apps.py ├── forms.py ├── templates │ └── maps │ │ ├── preload_devices_tmpl.html │ │ ├── modal_add_device.html │ │ ├── map_tooltip.html │ │ └── modal_add_dot.html ├── models.py └── urls.py ├── abonapp ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0009_auto_20181123_1556.py ├── apps.py ├── templates │ └── abonapp │ │ ├── abon_confirm_delete.html │ │ ├── modal_confirm_ip_free.html │ │ ├── modal_passport_view.html │ │ ├── modal_export.html │ │ ├── modal_current_networks.html │ │ ├── modal_abonamount.html │ │ ├── modal_addstreet.html │ │ ├── modal_phonebook.html │ │ ├── modal_add_phone.html │ │ ├── modal_periodic_pay.html │ │ ├── modal_attach_nas.html │ │ ├── modal_ip_form.html │ │ ├── modal_user_markers.html │ │ ├── modal_additional_telephones.html │ │ ├── modal_dev.html │ │ ├── group_tariffs.html │ │ └── modal_editstreet.html ├── admin.py └── tasks.py ├── docsapp ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── apps.py ├── forms.py ├── templates │ └── docsapp │ │ ├── documenttemplatemodel_confirm_delete.html │ │ ├── simple_list.html │ │ └── documenttemplatemodel_form.html ├── urls.py └── models.py ├── group_app ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0003_auto_20180808_1236.py │ ├── 0002_group_code.py │ └── 0001_initial.py ├── tests.py ├── admin.py ├── apps.py ├── forms.py ├── urls.py ├── templates │ └── group_app │ │ ├── group_confirm_delete.html │ │ ├── ext.html │ │ ├── add_group.html │ │ └── edit_group.html └── models.py ├── ip_pool ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0001_squashed_0004_auto_20190305_1243.py ├── templatetags │ ├── __init__.py │ └── ip_pool_tags.py ├── apps.py ├── admin.py ├── templates │ └── ip_pool │ │ ├── networkmodel_confirm_delete.html │ │ ├── ext.html │ │ ├── network_groups_available.html │ │ └── net_add.html ├── forms.py └── urls.py ├── msg_app ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0002_auto_20180808_1236.py ├── tests.py ├── apps.py ├── admin.py ├── context_processors.py ├── urls.py └── templates │ └── msg_app │ └── modal_new_conversation.html ├── searchapp ├── __init__.py ├── migrations │ └── __init__.py ├── admin.py ├── models.py ├── apps.py ├── urls.py ├── locale │ └── ru │ │ └── LC_MESSAGES │ │ └── django.po └── views.py ├── tariff_app ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0003_auto_20181115_1206.py │ └── 0002_auto_20180807_1548.py ├── admin.py ├── forms.py ├── templates │ └── tariff_app │ │ ├── tariff_confirm_delete.html │ │ └── ext.html └── urls.py ├── taskapp ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0002_auto_20180808_1236.py ├── apps.py ├── admin.py ├── context_proc.py ├── templates │ └── taskapp │ │ ├── notification.html │ │ ├── comments │ │ ├── extracomment_confirm_delete.html │ │ └── task_comments.html │ │ ├── footer_btns.html │ │ └── details.html ├── templatetags │ └── tasktags.py ├── urls.py └── handle.py ├── traf_stat ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── admin.py ├── tests.py ├── apps.py ├── urls.py ├── views.py ├── templates │ └── statistics │ │ └── index.html └── fields.py ├── accounts_app ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0004_userprofile_flags.py │ └── 0002_auto_20180807_1548.py ├── templatetags │ ├── __init__.py │ └── acc_tags.py ├── apps.py ├── admin.py ├── templates │ └── accounts │ │ ├── settings │ │ └── userprofile_form.html │ │ ├── perms │ │ ├── change_global_perms.html │ │ ├── object │ │ │ ├── objects_of_type.html │ │ │ └── objects_types.html │ │ └── ext.html │ │ ├── action_log.html │ │ ├── set_abon_groups_permission.html │ │ ├── manage_responsibility_groups.html │ │ └── index.html └── urls.py ├── clientsideapp ├── __init__.py ├── migrations │ └── __init__.py ├── admin.py ├── models.py ├── apps.py ├── urls.py └── templates │ └── clientsideapp │ ├── pays.html │ ├── index.html │ ├── modal_service_buy.html │ └── tasklist.html ├── new_customers ├── __init__.py ├── migrations │ └── __init__.py ├── apps.py ├── admin.py ├── forms.py ├── urls.py ├── templates │ └── new_customers │ │ └── potentialsubscriber_form.html ├── views.py └── models.py ├── djing ├── templatetags │ ├── __init__.py │ ├── globaltags.py │ └── dpagination.py ├── lib │ ├── messaging │ │ ├── __init__.py │ │ └── sms │ │ │ ├── pdu.py │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── consts.py │ │ │ └── wap.py │ └── mixins.py ├── views.py ├── celery.py ├── wsgi.py ├── formfields.py ├── locale │ └── ru │ │ └── LC_MESSAGES │ │ └── django.po ├── urls.py └── local_settings.py.example ├── gw_app ├── migrations │ ├── __init__.py │ ├── 0003_nasmodel_enabled.py │ ├── 0002_auto_20181101_1545.py │ └── 0001_initial.py ├── __init__.py ├── admin.py ├── apps.py ├── nas_managers │ └── __init__.py ├── urls.py ├── templates │ └── gw_app │ │ ├── nasmodel_confirm_delete.html │ │ ├── nasmodel_add.html │ │ └── nasmodel_update.html └── forms.py ├── messenger ├── migrations │ └── __init__.py ├── __init__.py ├── tests.py ├── apps.py ├── admin.py ├── templates │ └── messenger │ │ ├── add_messenger.html │ │ ├── vibersubscriber_list.html │ │ └── vibermessenger_form.html ├── forms.py └── urls.py ├── _config.yml ├── templates ├── bajax.html ├── nullcont.htm ├── site_base.html ├── custom_pages │ ├── footer.htm │ ├── main_page.htm │ ├── service_bottom.htm │ └── service.htm ├── base_no_lmenu.html ├── 403_for_modal.html ├── base_delete_modal.html ├── pagination.html ├── 403.html └── 500.html ├── docs ├── img │ ├── login.png │ └── pagination.png ├── bot.md ├── extra_func.md ├── tarifs.md ├── notifications.md └── user_page.md ├── install ├── robots.txt ├── djing.ini └── nginx_server.conf ├── static ├── img │ ├── bcgr.png │ ├── noticon.png │ ├── user_ava.gif │ ├── favicon_m.ico │ ├── user_ava_min.gif │ ├── user_markers.png │ └── icon-port-64x64-grey.png ├── clientside │ ├── bc.png │ ├── rj45.png │ ├── TL-WR840N-v2.jpg │ └── custom.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── bad_ie.html ├── .gitmodules ├── .dockerignore ├── systemd_units ├── djing.timer ├── djing_backup.timer ├── djing_backup.service ├── djing_rotate.timer ├── djing.service ├── djing_rotate.service ├── djing_celery.service ├── do_backup.sh └── webdav_backup.py ├── .gitignore ├── manage.py ├── update_release.sh ├── docker-compose.yml ├── Doc.txt ├── README.md ├── requirements.txt ├── LICENSE └── Dockerfile /agent/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /devapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /finapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mapapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /abonapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docsapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /group_app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ip_pool/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /msg_app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /searchapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tariff_app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /taskapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /traf_stat/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts_app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /agent/netflow/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /clientsideapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /new_customers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /abonapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /devapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /djing/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docsapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /finapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /group_app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gw_app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ip_pool/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ip_pool/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mapapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /messenger/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /msg_app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /searchapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tariff_app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /taskapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /traf_stat/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts_app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /clientsideapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /new_customers/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-time-machine -------------------------------------------------------------------------------- /searchapp/admin.py: -------------------------------------------------------------------------------- 1 | # Register your models here. 2 | -------------------------------------------------------------------------------- /searchapp/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /templates/bajax.html: -------------------------------------------------------------------------------- 1 | {% block main %}{% endblock %} -------------------------------------------------------------------------------- /clientsideapp/admin.py: -------------------------------------------------------------------------------- 1 | # Register your models here. 2 | -------------------------------------------------------------------------------- /clientsideapp/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /templates/nullcont.htm: -------------------------------------------------------------------------------- 1 | {% block content %}{% endblock %} -------------------------------------------------------------------------------- /templates/site_base.html: -------------------------------------------------------------------------------- 1 | {% include 'all_base.html' %} 2 | -------------------------------------------------------------------------------- /accounts_app/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'bashmak' 2 | -------------------------------------------------------------------------------- /gw_app/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'gw_app.apps.GatewaysAppConfig' 2 | -------------------------------------------------------------------------------- /messenger/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'messenger.apps.messengerConfig' -------------------------------------------------------------------------------- /templates/custom_pages/footer.htm: -------------------------------------------------------------------------------- 1 | {# Your custom content here. #} 2 | -------------------------------------------------------------------------------- /djing/lib/messaging/__init__.py: -------------------------------------------------------------------------------- 1 | # see LICENSE 2 | 3 | VERSION = (0, 5, 12) 4 | -------------------------------------------------------------------------------- /templates/custom_pages/main_page.htm: -------------------------------------------------------------------------------- 1 | {#
You have service variable {{ active_service }}
#} 3 | -------------------------------------------------------------------------------- /new_customers/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class NewCustomersConfig(AppConfig): 5 | name = 'new_customers' 6 | -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nerosketch/djing/HEAD/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nerosketch/djing/HEAD/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nerosketch/djing/HEAD/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nerosketch/djing/HEAD/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /abonapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AbonappConfig(AppConfig): 5 | name = 'abonapp' 6 | verbose_name = 'Abonent app' 7 | -------------------------------------------------------------------------------- /devapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from . import models 4 | 5 | admin.site.register(models.Device) 6 | admin.site.register(models.Port) 7 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.db 3 | media/* 4 | media/min/* 5 | .idea/ 6 | .git/ 7 | gmap/fixtures 8 | *.sqlite3 9 | *.json 10 | *.bak 11 | *.mo 12 | venv/ 13 | -------------------------------------------------------------------------------- /msg_app/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | 4 | admin.site.register(models.Message) 5 | admin.site.register(models.Conversation) 6 | -------------------------------------------------------------------------------- /taskapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from . import models 4 | 5 | admin.site.register(models.Task) 6 | admin.site.register(models.ChangeLog) 7 | -------------------------------------------------------------------------------- /new_customers/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from new_customers.models import PotentialSubscriber 3 | 4 | 5 | admin.site.register(PotentialSubscriber) 6 | -------------------------------------------------------------------------------- /finapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from finapp import models 3 | 4 | admin.site.register(models.AllTimePayLog) 5 | admin.site.register(models.PayAllTimeGateway) 6 | -------------------------------------------------------------------------------- /clientsideapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ClientsideappConfig(AppConfig): 5 | name = 'clientsideapp' 6 | verbose_name = 'Client side application' 7 | -------------------------------------------------------------------------------- /accounts_app/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import UserProfile, UserProfileLog 4 | 5 | admin.site.register(UserProfile) 6 | admin.site.register(UserProfileLog) 7 | -------------------------------------------------------------------------------- /searchapp/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | app_name = 'searchapp' 6 | 7 | urlpatterns = [ 8 | path(r'', views.home, name='home'), 9 | 10 | ] 11 | -------------------------------------------------------------------------------- /traf_stat/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from traf_stat.views import home 4 | 5 | app_name = 'traf_stat' 6 | 7 | urlpatterns = [ 8 | path('', home, name='home'), 9 | ] 10 | -------------------------------------------------------------------------------- /group_app/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from . import models 3 | 4 | 5 | class GroupForm(forms.ModelForm): 6 | class Meta: 7 | model = models.Group 8 | fields = '__all__' 9 | -------------------------------------------------------------------------------- /systemd_units/djing.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run every night a job for djing 3 | 4 | [Timer] 5 | OnCalendar=*-*-* 01:59:00 6 | Unit=djing.service 7 | 8 | [Install] 9 | WantedBy=timers.target 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.db 3 | media/* 4 | media/min/* 5 | ~*/migrations/00*.py 6 | .idea/ 7 | djing/local_settings.py 8 | gmap/fixtures 9 | *.sqlite3 10 | *.json 11 | *.bak 12 | *.mo 13 | agent/netflow/djing_flow 14 | venv/ 15 | -------------------------------------------------------------------------------- /systemd_units/djing_backup.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run backup periodically 3 | 4 | [Timer] 5 | OnCalendar=*-*-* 8,12,14,16,19,23:15:0 6 | Unit=djing_backup.service 7 | 8 | [Install] 9 | WantedBy=timers.target 10 | 11 | -------------------------------------------------------------------------------- /docsapp/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from docsapp.models import DocumentTemplateModel 3 | 4 | 5 | class DocumentTemplateModelForm(forms.ModelForm): 6 | class Meta: 7 | model = DocumentTemplateModel 8 | fields = '__all__' 9 | -------------------------------------------------------------------------------- /messenger/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from messenger import models 3 | 4 | admin.site.register(models.Messenger) 5 | admin.site.register(models.ViberMessenger) 6 | admin.site.register(models.ViberSubscriber) 7 | admin.site.register(models.ViberMessage) 8 | -------------------------------------------------------------------------------- /systemd_units/djing_backup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup for djing 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/var/backups/do_backup.sh 7 | WorkingDirectory=/var/backups 8 | User=root 9 | Group=root 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /systemd_units/djing_rotate.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run every one minute rotate flows for djing 3 | 4 | [Timer] 5 | OnCalendar=*-*-* *:*:59 6 | Persistent=true 7 | RandomizedDelaySec=5 8 | Unit=djing_rotate.service 9 | 10 | [Install] 11 | WantedBy=timers.target 12 | -------------------------------------------------------------------------------- /djing/lib/messaging/sms/pdu.py: -------------------------------------------------------------------------------- 1 | # see LICENSE 2 | 3 | 4 | class Pdu(object): 5 | def __init__(self, pdu, len_smsc, cnt=1, seq=1): 6 | self.pdu = pdu.upper() 7 | self.length = len(pdu) / 2 - len_smsc 8 | self.cnt = cnt 9 | self.seq = seq 10 | -------------------------------------------------------------------------------- /devapp/expect_scripts/__init__.py: -------------------------------------------------------------------------------- 1 | from .f601 import register_onu as register_f601_onu 2 | from .f660 import register_onu as register_f660_onu 3 | from .base import ( 4 | ZteOltConsoleError, OnuZteRegisterError, 5 | ZTEFiberIsFull, ZteOltLoginFailed, ExpectValidationError 6 | ) 7 | -------------------------------------------------------------------------------- /djing/lib/messaging/sms/__init__.py: -------------------------------------------------------------------------------- 1 | # See LICENSE 2 | 3 | from djing.lib.messaging.sms.deliver import SmsDeliver 4 | from djing.lib.messaging.sms.submit import SmsSubmit 5 | from djing.lib.messaging.sms.gsm0338 import is_gsm_text 6 | 7 | __all__ = ("SmsSubmit", "SmsDeliver", "is_gsm_text") 8 | -------------------------------------------------------------------------------- /systemd_units/djing.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=A job for djing 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/var/www/djing/venv/bin/python periodic.py 7 | WorkingDirectory=/var/www/djing 8 | User=www-data 9 | Group=www-data 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /traf_stat/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.contrib.auth.decorators import login_required 3 | from djing.lib.decorators import only_admins 4 | 5 | 6 | @login_required 7 | @only_admins 8 | def home(request): 9 | return render(request, 'statistics/index.html') 10 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djing.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /djing/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.shortcuts import redirect 3 | 4 | 5 | @login_required 6 | def home(request): 7 | if request.user.is_staff: 8 | return redirect('acc_app:setup_info') 9 | else: 10 | return redirect('client_side:home') 11 | -------------------------------------------------------------------------------- /msg_app/context_processors.py: -------------------------------------------------------------------------------- 1 | from .models import Conversation 2 | 3 | 4 | def get_new_messages_count(request): 5 | if request.user.is_anonymous: 6 | count = 0 7 | else: 8 | count = Conversation.objects.get_new_messages_count(request.user) 9 | return {'new_messages_count': count} 10 | -------------------------------------------------------------------------------- /install/djing.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | chdir=/var/www/djing 3 | module=djing.wsgi 4 | master=True 5 | processes=8 6 | socket=/run/uwsgi/app/djing/socket 7 | ;http-socket=:8000 8 | chmod-socket=644 9 | ;pidfile=/run/uwsgi/django-master.pid 10 | vacuum=True 11 | plugin=python3 12 | ;disable-logging=True 13 | venv=/var/www/djing/venv -------------------------------------------------------------------------------- /mapapp/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Dot 3 | 4 | 5 | class DotForm(forms.ModelForm): 6 | class Meta: 7 | model = Dot 8 | exclude = ('devices',) 9 | 10 | widgets = { 11 | 'title': forms.TextInput(attrs={'required': '', 'autofocus': ''}), 12 | } 13 | -------------------------------------------------------------------------------- /abonapp/templates/abonapp/abon_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_delete_modal.html' %} 2 | {% load i18n %} 3 | 4 | {% block modal_form_url %} 5 | {% url 'abonapp:del_abon' abon.group.pk abon.username %} 6 | {% endblock %} 7 | 8 | {% block modal_form_title %} 9 | {% trans 'Remove subscriber' %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /systemd_units/djing_rotate.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=A job for rotate djing netflow data 3 | 4 | [Service] 5 | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" 6 | Type=oneshot 7 | ExecStart=/var/www/djing/agent/netflow/netflow_collect.sh 8 | User=root 9 | Group=root 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /djing/lib/messaging/sms/base.py: -------------------------------------------------------------------------------- 1 | # see LICENSE 2 | 3 | 4 | class SmsBase(object): 5 | def __init__(self): 6 | self.udh = None 7 | self.number = None 8 | self.text = None 9 | self.fmt = None 10 | self.dcs = None 11 | self.pid = None 12 | self.csca = None 13 | self.type = None 14 | -------------------------------------------------------------------------------- /mapapp/templates/maps/preload_devices_tmpl.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% for dev in all_devices %}7 | 8 |
9 | 10 | {% block main %}{% endblock %} 11 | 12 |{% blocktrans %}after delete the tariff, subscribers who use that tariff will be disconnected from it.{% endblocktrans %}
15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /agent/netflow/start_netflow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/bin 4 | 5 | if ! [[ -n "$1" ]]; then 6 | echo 'Missing port parameter' 7 | exit 8 | fi 9 | 10 | port=$1 11 | DIRECTORY=`dirname $(readlink -e "$0")` 12 | 13 | tdir="/tmp/djing_flow/${port}" 14 | if [[ -d "${tdir}" ]]; then 15 | echo "Warning: directory '${tdir}' exists, clean all" 16 | rm -f ${tdir}/ft* 17 | else 18 | mkdir -p "${tdir}" 19 | fi 20 | 21 | 22 | flow-capture -R ${DIRECTORY}/netflow_handler.sh -p /run/flow.pid -w ${tdir} -n1 -N0 0/0/${port} 23 | -------------------------------------------------------------------------------- /docs/extra_func.md: -------------------------------------------------------------------------------- 1 | ## Дополнительный фунционал 2 | В процессе реализации проекта понадобился функционал, который отсутствует в базовой поставке **Django**. 3 | Его совсем не много, но без внимания оставить нельзя. 4 | 5 | Все вспомогательные модули можно найти в пакете **djing.lib**. 6 | 7 | ### messaging 8 | Этот модуль помогает работать с форматами СМС сообщений. 9 | 10 | ### init 11 | Содержит всякие мелкие примочки, код прост и с комментариями, зайдите посмотрите. 12 | 13 | ## auth_decorators 14 | Бэкенд авторизации 15 | 16 | ## decorators 17 | Дополнительные декораторы. 18 | -------------------------------------------------------------------------------- /gw_app/templates/gw_app/nasmodel_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_delete_modal.html' %} 2 | {% load i18n %} 3 | 4 | {% block modal_form_url %} 5 | {% url 'gw_app:del' object.pk %} 6 | {% endblock %} 7 | 8 | {% block modal_form_title %} 9 | {% trans 'Remove NAS' %} 10 | {% endblock %} 11 | 12 | {% block modal_form_text %} 13 |{% trans 'You have no permissions for that page' %}
{% blocktrans trimmed %} 17 | Attention! All leases in that network will be removed and services finished. 18 | {% endblocktrans %}
19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /abonapp/templates/abonapp/modal_passport_view.html: -------------------------------------------------------------------------------- 1 | {% load i18n bootstrap3 %} 2 | 14 | -------------------------------------------------------------------------------- /accounts_app/migrations/0004_userprofile_flags.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.3 on 2018-12-24 15:52 2 | 3 | import bitfield.models 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('accounts_app', '0003_new_user_profile_log'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='userprofile', 16 | name='flags', 17 | field=bitfield.models.BitField((('notify_task', 'Notification about tasks'), ('notify_msg', 'Notification about messages'), ('notify_mon', 'Notification from monitoring')), default=0, verbose_name='Flags'), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /agent/downloader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from urllib import request 3 | from hashlib import sha256 4 | 5 | API_AUTH_SECRET = 'your api key' 6 | FILE_LINK = 'http://localhost:8000/dev/nagios/hosts/' 7 | 8 | """ 9 | Example script that downloads config 10 | file from web via api hash. 11 | """ 12 | 13 | 14 | def calc_hash(data): 15 | if type(data) is str: 16 | result_data = data.encode('utf-8') 17 | else: 18 | result_data = bytes(data) 19 | return sha256(result_data).hexdigest() 20 | 21 | 22 | if __name__ == '__main__': 23 | sign = calc_hash(API_AUTH_SECRET) 24 | request.urlretrieve("%s?sign=%s" % (FILE_LINK, sign), 'nagios_objects.cfg') 25 | 26 | -------------------------------------------------------------------------------- /finapp/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from finapp import views 3 | 4 | 5 | app_name = 'finapp' 6 | 7 | urlpatterns = [ 8 | path('', views.AllTimeGatewaysListView.as_view(), name='alltime_gateways_list'), 9 | 10 | path('fin_report/', views.BasicFinReport.as_view(), name='fin_report'), 11 | 12 | path('add/', views.AddAllTimeGateway.as_view(), name='add_alltime_gateway'), 13 | 14 | path('Можете воспользоваться ссылками ниже:
11 || {% trans 'Network' %} | 11 |{% trans 'Scope' %} | 12 |
|---|---|
| {{ net_item }} | 18 |{{ net_item.get_scope }} | 19 |
| {% trans 'Available networks not found' %} | 23 ||
| {% trans 'Transaction Amount (rubles)' %} | 12 |{% trans 'Date of transaction' %} | 13 |{% trans 'Comment' %} | 14 |
|---|---|---|
| {{ pay.amount }} | 20 |{{ pay.date|date:'d b H:i' }} | 21 |{{ pay.comment }} | 22 |
| {% trans 'You have not spent payments' %} | 26 |||
| {% trans 'Telephone' %} | 11 |{% trans 'Telephone owner' %} | 12 |
|---|---|
| {{ t.0 }} | 18 |{{ t.1 }} | 19 |
| {% trans 'Telephone numbers not found' %} | 23 ||
| {% trans 'Date' %} | 10 |{% trans 'Additional' %} | 11 |{% trans 'Description' %} | 12 |{% trans 'Meta information' %} | 13 |
|---|---|---|---|
| {{ log.action_date|date:'D d E Y H:i:s' }} | 19 |{{ log.additional_text|default_if_none:'-' }} | 20 |{{ log.get_do_type_display }} | 21 |{{ log.meta_info }} | 22 |
| {% trans 'That admin has no logs' %} | |||
| obj | 26 |
|---|
| 30 | {{ obj }} 31 | |
| {% trans 'Telephone owner' %} | 13 |{% trans 'Telephone' %} | 14 |15 | |
|---|---|---|
| {{ t.owner_name }} | 21 |{{ t.telephone }} | 22 |23 | 24 | 25 | 26 | | 27 |
| {% trans 'Additional telephones not found' %} | 31 |||
| {% trans 'Group' %} | 24 |
|---|
| 30 | <{{ klass }}> {% klass_name klass %} 31 | | 32 |
| {% trans 'uid' %} | 22 |{% trans 'Name' %} | 23 |{% trans 'Account' %} | 24 |
|---|---|---|
| {{ subscriber.uid }} | 30 |{{ subscriber.name }} | 31 |{{ subscriber.account.get_full_name }} | 32 |
| {% trans 'Subscribers was not found' %} | 36 |||
| {% trans 'Telephone' %} | 10 |{{ userprofile.telephone }} | 11 |
| {% trans 'User name' %} | 14 |{{ userprofile.username }} | 15 |
| {% trans 'Name and surname' %} | 18 |{{ userprofile.fio }} | 19 |
| {% trans 'Is enable' %} | 22 |23 | |
| {% trans 'Last login' %} | 26 |{{ userprofile.last_login|date:"l d E Y H:i" }} | 27 |
| {% trans 'Is superuser' %} | 31 |32 | |
{% blocktrans %}You may choose the subscriber who correctly attached to device port. When you have found right subscriber, remove the port from the other person{% endblocktrans %}
26 || {% trans 'Cost' %} | 23 |{% trans 'Date' %} | 24 |
|---|---|
| {{ l.summ }} | 30 |{{ l.pay_date|date:"d E Y" }} | 31 |
| {% trans 'Pays not found' %} | 35 ||
| 42 | 43 | {% trans 'Export to csv' %} 44 | 45 | | 46 ||
{% trans 'You have no permissions for that page' %}
{% trans 'A server has error occurred. Please contact the administrator.' %}
| {{ gr.title }} | 27 |
| {% trans 'Groups was not found' %} | 31 |
| 37 | 38 | {% trans 'Devices without group' %} 39 | 40 | 41 | {% trans 'Export to nagios objects' %} 42 | 43 | | 44 |
| {% trans 'State' %} | 14 |{% trans 'Date of create' %} | 15 |{% trans 'The nature of the damage' %} | 16 |{% trans 'Expected or real completion date' %} | 17 |
|---|---|---|---|
| {{ task.get_state_display }} | 23 |24 | {% if task.time_of_create|is_current_year %} 25 | {{ task.time_of_create|date:'d b H:i' }} 26 | {% else %} 27 | {{ task.time_of_create|date:'d b H:i. Y' }} 28 | {% endif %} 29 | | 30 |{{ task.get_mode_display }} | 31 |32 | {% if task.out_date|is_current_year %} 33 | {{ task.out_date|date:'d E, l' }} 34 | {% else %} 35 | {{ task.out_date|date:'d E, l Y' }} 36 | {% endif %} 37 | | 38 |
| 42 | {% trans "You didn't leave any requests for breakdowns." %} 43 | 44 | | 45 ||||
| {% trans 'User' %} | 23 |{% trans 'Pay id' %} | 24 |{% trans 'Date' %} | 25 |{% trans 'Cost' %} | 26 |{% trans 'Trade point' %} | 27 |{% trans 'Receipt num' %} | 28 |
|---|---|---|---|---|---|
| 34 | {% if pay.abon %} 35 | {{ pay.abon }} 36 | {% else %} 37 | {% trans 'Deleted' %} 38 | {% endif %} 39 | | 40 |{{ pay.pay_id }} | 41 |{{ pay.date_add|date:'D d E Y H:i:s' }} | 42 |{{ pay.summ }} | 43 |{{ pay.trade_point|default_if_none:'—' }} | 44 |{{ pay.receipt_num }} | 45 |
| {% trans 'Payment history is empty' %} | 49 ||||||
{% trans 'Description' %}: {{ task.descr|default:'' }}
9 | 10 | {% trans 'Task author' %}: 11 | {% if task and task.author %} 12 | {{ task.author.username }} 13 | {% else %} 14 | {% trans 'Not assigned' %} 15 | {% endif %}{{ comment.text }}
20 |{% trans 'Comment history is empty' %}
25 |