From 95521b1e8da860ce4c25df27960e38b6473950d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 11:35:26 +0300 Subject: [PATCH 01/12] Remove debian directory from master branch --- debian/ahenk.install | 4 ---- debian/changelog | 5 ----- debian/compat | 1 - debian/control | 12 ------------ debian/files | 1 - debian/postinst | 44 -------------------------------------------- debian/prerm | 5 ----- debian/rules | 28 ---------------------------- 8 files changed, 100 deletions(-) delete mode 100644 debian/ahenk.install delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/files delete mode 100644 debian/postinst delete mode 100644 debian/prerm delete mode 100755 debian/rules diff --git a/debian/ahenk.install b/debian/ahenk.install deleted file mode 100644 index 4e26f3e..0000000 --- a/debian/ahenk.install +++ /dev/null @@ -1,4 +0,0 @@ -opt/ / -etc/ / -lib/ / -usr/ / diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 6d37e7a..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ahenk (1.0) unstable; urgency=low - - * Ahenk core app - - -- volkansahin Thu, 10 Dec 2015 22:21:04 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 48845c9..0000000 --- a/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: ahenk -Section: unknown -Priority: optional -Maintainer: TUBITAK ULAKBIM -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.5 -Homepage: http://www.liderahenk.org.tr - -Package: ahenk -Architecture: any -Depends: bash, python3 (>= 3), cython, libidn11, libidn11-dev, python3-dev, python3-pip, python3-watchdog, libffi-dev, libssl-dev, python3-paramiko, python3-cpuinfo, python3-psutil (>= 4), libpam-script, python3-sleekxmpp, dmidecode, python3-easygui, notify-osd, read-edid -Description: Lider Ahenk is an open source project which provides solutions to manage, monitor and audit unlimited number of different systems and users on a network. diff --git a/debian/files b/debian/files deleted file mode 100644 index 8bc2437..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -ahenk_1.0_amd64.deb unknown optional diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index f8d9145..0000000 --- a/debian/postinst +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# postinst script for ahenk -# -# see: dh_installdeb(1) - -set -e - - -case "$1" in - configure) - -while true; do - read -p "Eğer makinada var olan bir pam konfigurasyonu varsa geçersiz hale gelecektir.Devam etmek istiyor musunuz? [e/H]" eH - case $eH in - [e] ) - if [ -d /usr/share/pam-configs ] - then - echo -e "Name: Support for authentication by external scripts\nDefault: yes\nPriority: 257\nSession-Type: Additional\nSession:\n\toptional\tpam_script.so" > /usr/share/pam-configs/pam_script - DEBIAN_FRONTEND=noninteractive pam-auth-update - fi - break;; - [H] ) exit;; - * ) echo "Lütfen e ya da H karakterleri ile yanıtlayın!";; - esac -done - - systemctl --system daemon-reload - systemctl enable ahenk.service - - update-rc.d ahenk defaults - /etc/init.d/ahenk start - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/debian/prerm b/debian/prerm deleted file mode 100644 index 297f69e..0000000 --- a/debian/prerm +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# prerm script for ahenk -# -/usr/bin/python3 /opt/ahenk/ahenkd.py clean -find /opt/ahenk | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf diff --git a/debian/rules b/debian/rules deleted file mode 100755 index cfe67d3..0000000 --- a/debian/rules +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#DH_VERBOSE = 1 - -# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - - -# main packaging script based on dh7 syntax -%: - dh $@ - -# debmake generated override targets -# This is example for Cmake (See http://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- \ -# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) From 76d563dd9eadac4b705c9daf996b493d910f63be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 11:36:11 +0300 Subject: [PATCH 02/12] Change commands calling ahenkd from /opt to /usr/share --- etc/ahenk/ahenk.conf | 2 +- lib/systemd/system/ahenk.service | 4 ++-- opt/ahenk/base/agreement/agreement.py | 2 +- opt/ahenk/base/util/util.py | 2 +- usr/share/libpam-script/pam_script_ses_close | 2 +- usr/share/libpam-script/pam_script_ses_open | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/ahenk/ahenk.conf b/etc/ahenk/ahenk.conf index 6281122..449a65b 100644 --- a/etc/ahenk/ahenk.conf +++ b/etc/ahenk/ahenk.conf @@ -3,7 +3,7 @@ logconfigurationfilepath = /etc/ahenk/log.conf dbpath = /etc/ahenk/ahenk.db [PLUGIN] -pluginfolderpath = /opt/ahenk/plugins/ +pluginfolderpath = /usr/share/ahenk/plugins/ mainmodulename = main [CONNECTION] diff --git a/lib/systemd/system/ahenk.service b/lib/systemd/system/ahenk.service index a6083de..420dc39 100644 --- a/lib/systemd/system/ahenk.service +++ b/lib/systemd/system/ahenk.service @@ -4,8 +4,8 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/python3 /opt/ahenk/ahenkd.py start -ExecStop=/usr/bin/python3 /opt/ahenk/ahenkd.py stop +ExecStart=/usr/bin/python3 /usr/share/ahenk/ahenkd.py start +ExecStop=/usr/bin/python3 /usr/share/ahenk/ahenkd.py stop PIDFile=/var/run/ahenkd.pid Restart=always diff --git a/opt/ahenk/base/agreement/agreement.py b/opt/ahenk/base/agreement/agreement.py index a27faa2..97c54f0 100644 --- a/opt/ahenk/base/agreement/agreement.py +++ b/opt/ahenk/base/agreement/agreement.py @@ -14,7 +14,7 @@ class Agreement: self.message_manager = scope.get_message_manager() self.messenger = scope.get_messenger() self.db_service = scope.get_db_service() - self.ask_path = '/opt/ahenk/base/agreement/ask.py' + self.ask_path = '/usr/share/ahenk/base/agreement/ask.py' self.logger.debug('Instance initialized.') def agreement_contract_update(self): diff --git a/opt/ahenk/base/util/util.py b/opt/ahenk/base/util/util.py index cbbc706..738dbb5 100644 --- a/opt/ahenk/base/util/util.py +++ b/opt/ahenk/base/util/util.py @@ -316,7 +316,7 @@ class Util: @staticmethod def ask_permission(display, username, message, title): - ask_path = '/opt/ahenk/base/agreement/confirm.py' + ask_path = '/usr/share/ahenk/base/agreement/confirm.py' try: if username is not None: diff --git a/usr/share/libpam-script/pam_script_ses_close b/usr/share/libpam-script/pam_script_ses_close index 344d77f..f5bab47 100755 --- a/usr/share/libpam-script/pam_script_ses_close +++ b/usr/share/libpam-script/pam_script_ses_close @@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then TTY_DISPLAY="$PAM_TTY" fi log "logout: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY" - sudo python3 /opt/ahenk/ahenkd.py logout $PAM_USER + sudo python3 /usr/share/ahenk/ahenkd.py logout $PAM_USER fi fi diff --git a/usr/share/libpam-script/pam_script_ses_open b/usr/share/libpam-script/pam_script_ses_open index 00b5450..3512806 100755 --- a/usr/share/libpam-script/pam_script_ses_open +++ b/usr/share/libpam-script/pam_script_ses_open @@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then TTY_DISPLAY="$PAM_TTY" fi log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY" - sudo python3 /opt/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY + sudo python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY fi fi From 34f88fda554ee1735b0fb0d33f6e87a42b6b8f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 11:41:40 +0300 Subject: [PATCH 03/12] Remove executable permitions prom python files --- opt/ahenk/ahenkd.py | 0 opt/ahenk/base/agreement/ask.py | 0 opt/ahenk/base/agreement/confirm.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 opt/ahenk/ahenkd.py mode change 100755 => 100644 opt/ahenk/base/agreement/ask.py mode change 100755 => 100644 opt/ahenk/base/agreement/confirm.py diff --git a/opt/ahenk/ahenkd.py b/opt/ahenk/ahenkd.py old mode 100755 new mode 100644 diff --git a/opt/ahenk/base/agreement/ask.py b/opt/ahenk/base/agreement/ask.py old mode 100755 new mode 100644 diff --git a/opt/ahenk/base/agreement/confirm.py b/opt/ahenk/base/agreement/confirm.py old mode 100755 new mode 100644 From b23016097483346055cbb7db01cb55bb12cbd822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 11:43:43 +0300 Subject: [PATCH 04/12] Move source under src --- {opt/ahenk => src}/__init__.py | 0 {opt/ahenk => src}/ahenkd.py | 0 {opt/ahenk => src}/api/service/ps_util.py | 0 {opt/ahenk => src}/base/__init__.py | 0 {opt/ahenk => src}/base/agreement/agreement.py | 0 {opt/ahenk => src}/base/agreement/ask.py | 0 {opt/ahenk => src}/base/agreement/confirm.py | 0 {opt/ahenk => src}/base/command/command_manager.py | 0 {opt/ahenk => src}/base/command/command_runner.py | 0 {opt/ahenk => src}/base/command/fifo.py | 0 {opt/ahenk => src}/base/config/__init__.py | 0 {opt/ahenk => src}/base/config/config_manager.py | 0 {opt/ahenk => src}/base/database/ahenk_db_service.py | 0 {opt/ahenk => src}/base/deamon/__init__.py | 0 {opt/ahenk => src}/base/deamon/base_daemon.py | 0 {opt/ahenk => src}/base/event/event_base.py | 0 {opt/ahenk => src}/base/event/event_manager.py | 0 {opt/ahenk => src}/base/execution/__init__.py | 0 {opt/ahenk => src}/base/execution/execution_manager.py | 0 {opt/ahenk => src}/base/file/file_transfer_manager.py | 0 {opt/ahenk => src}/base/file/http_file_transfer.py | 0 {opt/ahenk => src}/base/file/ssh_file_transfer.py | 0 {opt/ahenk => src}/base/logger/__init__.py | 0 {opt/ahenk => src}/base/logger/ahenk_logger.py | 0 {opt/ahenk => src}/base/mail/mail_manager.py | 0 {opt/ahenk => src}/base/messaging/__init__.py | 0 {opt/ahenk => src}/base/messaging/anonymous_messenger.py | 0 {opt/ahenk => src}/base/messaging/message_response_queue.py | 0 {opt/ahenk => src}/base/messaging/messaging.py | 0 {opt/ahenk => src}/base/messaging/messenger.py | 0 {opt/ahenk => src}/base/model/__init__.py | 0 {opt/ahenk => src}/base/model/enum/__init__.py | 0 {opt/ahenk => src}/base/model/enum/content_type.py | 0 {opt/ahenk => src}/base/model/enum/message_code.py | 0 {opt/ahenk => src}/base/model/enum/message_type.py | 0 {opt/ahenk => src}/base/model/message_factory.py | 0 {opt/ahenk => src}/base/model/modes/__init__.py | 0 {opt/ahenk => src}/base/model/modes/init_mode.py | 0 {opt/ahenk => src}/base/model/modes/login_mode.py | 0 {opt/ahenk => src}/base/model/modes/logout_mode.py | 0 {opt/ahenk => src}/base/model/modes/safe_mode.py | 0 {opt/ahenk => src}/base/model/modes/shutdown_mode.py | 0 {opt/ahenk => src}/base/model/plugin.py | 0 {opt/ahenk => src}/base/model/plugin_bean.py | 0 {opt/ahenk => src}/base/model/policy.py | 0 {opt/ahenk => src}/base/model/policy_bean.py | 0 {opt/ahenk => src}/base/model/profile.py | 0 {opt/ahenk => src}/base/model/profile_bean.py | 0 {opt/ahenk => src}/base/model/response.py | 0 {opt/ahenk => src}/base/model/task.py | 0 {opt/ahenk => src}/base/model/task_bean.py | 0 {opt/ahenk => src}/base/plugin/__init__.py | 0 {opt/ahenk => src}/base/plugin/abstract_plugin.py | 0 {opt/ahenk => src}/base/plugin/file_handler.py | 0 {opt/ahenk => src}/base/plugin/plugin.py | 0 {opt/ahenk => src}/base/plugin/plugin_install_listener.py | 0 {opt/ahenk => src}/base/plugin/plugin_manager.py | 0 {opt/ahenk => src}/base/plugin/plugin_manager_factory.py | 0 {opt/ahenk => src}/base/plugin/plugin_queue.py | 0 {opt/ahenk => src}/base/registration/__init__.py | 0 {opt/ahenk => src}/base/registration/registration.py | 0 {opt/ahenk => src}/base/scheduler/__init__.py | 0 {opt/ahenk => src}/base/scheduler/base_scheduler.py | 0 {opt/ahenk => src}/base/scheduler/custom/__init__.py | 0 {opt/ahenk => src}/base/scheduler/custom/all_match.py | 0 {opt/ahenk => src}/base/scheduler/custom/custom_scheduler.py | 0 {opt/ahenk => src}/base/scheduler/custom/schedule_job.py | 0 {opt/ahenk => src}/base/scheduler/custom/scheduledb.py | 0 {opt/ahenk => src}/base/scheduler/scheduler_factory.py | 0 {opt/ahenk => src}/base/scope.py | 0 {opt/ahenk => src}/base/system/system.py | 0 {opt/ahenk => src}/base/task/__init__.py | 0 {opt/ahenk => src}/base/task/task_in_queue.py | 0 {opt/ahenk => src}/base/task/task_job.py | 0 {opt/ahenk => src}/base/task/task_manager.py | 0 {opt/ahenk => src}/base/timer/setup_timer.py | 0 {opt/ahenk => src}/base/timer/timer.py | 0 {opt/ahenk => src}/base/util/util.py | 0 {opt/ahenk => src}/helper/__init__.py | 0 79 files changed, 0 insertions(+), 0 deletions(-) rename {opt/ahenk => src}/__init__.py (100%) rename {opt/ahenk => src}/ahenkd.py (100%) rename {opt/ahenk => src}/api/service/ps_util.py (100%) rename {opt/ahenk => src}/base/__init__.py (100%) rename {opt/ahenk => src}/base/agreement/agreement.py (100%) rename {opt/ahenk => src}/base/agreement/ask.py (100%) rename {opt/ahenk => src}/base/agreement/confirm.py (100%) rename {opt/ahenk => src}/base/command/command_manager.py (100%) rename {opt/ahenk => src}/base/command/command_runner.py (100%) rename {opt/ahenk => src}/base/command/fifo.py (100%) rename {opt/ahenk => src}/base/config/__init__.py (100%) rename {opt/ahenk => src}/base/config/config_manager.py (100%) rename {opt/ahenk => src}/base/database/ahenk_db_service.py (100%) rename {opt/ahenk => src}/base/deamon/__init__.py (100%) rename {opt/ahenk => src}/base/deamon/base_daemon.py (100%) rename {opt/ahenk => src}/base/event/event_base.py (100%) rename {opt/ahenk => src}/base/event/event_manager.py (100%) rename {opt/ahenk => src}/base/execution/__init__.py (100%) rename {opt/ahenk => src}/base/execution/execution_manager.py (100%) rename {opt/ahenk => src}/base/file/file_transfer_manager.py (100%) rename {opt/ahenk => src}/base/file/http_file_transfer.py (100%) rename {opt/ahenk => src}/base/file/ssh_file_transfer.py (100%) rename {opt/ahenk => src}/base/logger/__init__.py (100%) rename {opt/ahenk => src}/base/logger/ahenk_logger.py (100%) rename {opt/ahenk => src}/base/mail/mail_manager.py (100%) rename {opt/ahenk => src}/base/messaging/__init__.py (100%) rename {opt/ahenk => src}/base/messaging/anonymous_messenger.py (100%) rename {opt/ahenk => src}/base/messaging/message_response_queue.py (100%) rename {opt/ahenk => src}/base/messaging/messaging.py (100%) rename {opt/ahenk => src}/base/messaging/messenger.py (100%) rename {opt/ahenk => src}/base/model/__init__.py (100%) rename {opt/ahenk => src}/base/model/enum/__init__.py (100%) rename {opt/ahenk => src}/base/model/enum/content_type.py (100%) rename {opt/ahenk => src}/base/model/enum/message_code.py (100%) rename {opt/ahenk => src}/base/model/enum/message_type.py (100%) rename {opt/ahenk => src}/base/model/message_factory.py (100%) rename {opt/ahenk => src}/base/model/modes/__init__.py (100%) rename {opt/ahenk => src}/base/model/modes/init_mode.py (100%) rename {opt/ahenk => src}/base/model/modes/login_mode.py (100%) rename {opt/ahenk => src}/base/model/modes/logout_mode.py (100%) rename {opt/ahenk => src}/base/model/modes/safe_mode.py (100%) rename {opt/ahenk => src}/base/model/modes/shutdown_mode.py (100%) rename {opt/ahenk => src}/base/model/plugin.py (100%) rename {opt/ahenk => src}/base/model/plugin_bean.py (100%) rename {opt/ahenk => src}/base/model/policy.py (100%) rename {opt/ahenk => src}/base/model/policy_bean.py (100%) rename {opt/ahenk => src}/base/model/profile.py (100%) rename {opt/ahenk => src}/base/model/profile_bean.py (100%) rename {opt/ahenk => src}/base/model/response.py (100%) rename {opt/ahenk => src}/base/model/task.py (100%) rename {opt/ahenk => src}/base/model/task_bean.py (100%) rename {opt/ahenk => src}/base/plugin/__init__.py (100%) rename {opt/ahenk => src}/base/plugin/abstract_plugin.py (100%) rename {opt/ahenk => src}/base/plugin/file_handler.py (100%) rename {opt/ahenk => src}/base/plugin/plugin.py (100%) rename {opt/ahenk => src}/base/plugin/plugin_install_listener.py (100%) rename {opt/ahenk => src}/base/plugin/plugin_manager.py (100%) rename {opt/ahenk => src}/base/plugin/plugin_manager_factory.py (100%) rename {opt/ahenk => src}/base/plugin/plugin_queue.py (100%) rename {opt/ahenk => src}/base/registration/__init__.py (100%) rename {opt/ahenk => src}/base/registration/registration.py (100%) rename {opt/ahenk => src}/base/scheduler/__init__.py (100%) rename {opt/ahenk => src}/base/scheduler/base_scheduler.py (100%) rename {opt/ahenk => src}/base/scheduler/custom/__init__.py (100%) rename {opt/ahenk => src}/base/scheduler/custom/all_match.py (100%) rename {opt/ahenk => src}/base/scheduler/custom/custom_scheduler.py (100%) rename {opt/ahenk => src}/base/scheduler/custom/schedule_job.py (100%) rename {opt/ahenk => src}/base/scheduler/custom/scheduledb.py (100%) rename {opt/ahenk => src}/base/scheduler/scheduler_factory.py (100%) rename {opt/ahenk => src}/base/scope.py (100%) rename {opt/ahenk => src}/base/system/system.py (100%) rename {opt/ahenk => src}/base/task/__init__.py (100%) rename {opt/ahenk => src}/base/task/task_in_queue.py (100%) rename {opt/ahenk => src}/base/task/task_job.py (100%) rename {opt/ahenk => src}/base/task/task_manager.py (100%) rename {opt/ahenk => src}/base/timer/setup_timer.py (100%) rename {opt/ahenk => src}/base/timer/timer.py (100%) rename {opt/ahenk => src}/base/util/util.py (100%) rename {opt/ahenk => src}/helper/__init__.py (100%) diff --git a/opt/ahenk/__init__.py b/src/__init__.py similarity index 100% rename from opt/ahenk/__init__.py rename to src/__init__.py diff --git a/opt/ahenk/ahenkd.py b/src/ahenkd.py similarity index 100% rename from opt/ahenk/ahenkd.py rename to src/ahenkd.py diff --git a/opt/ahenk/api/service/ps_util.py b/src/api/service/ps_util.py similarity index 100% rename from opt/ahenk/api/service/ps_util.py rename to src/api/service/ps_util.py diff --git a/opt/ahenk/base/__init__.py b/src/base/__init__.py similarity index 100% rename from opt/ahenk/base/__init__.py rename to src/base/__init__.py diff --git a/opt/ahenk/base/agreement/agreement.py b/src/base/agreement/agreement.py similarity index 100% rename from opt/ahenk/base/agreement/agreement.py rename to src/base/agreement/agreement.py diff --git a/opt/ahenk/base/agreement/ask.py b/src/base/agreement/ask.py similarity index 100% rename from opt/ahenk/base/agreement/ask.py rename to src/base/agreement/ask.py diff --git a/opt/ahenk/base/agreement/confirm.py b/src/base/agreement/confirm.py similarity index 100% rename from opt/ahenk/base/agreement/confirm.py rename to src/base/agreement/confirm.py diff --git a/opt/ahenk/base/command/command_manager.py b/src/base/command/command_manager.py similarity index 100% rename from opt/ahenk/base/command/command_manager.py rename to src/base/command/command_manager.py diff --git a/opt/ahenk/base/command/command_runner.py b/src/base/command/command_runner.py similarity index 100% rename from opt/ahenk/base/command/command_runner.py rename to src/base/command/command_runner.py diff --git a/opt/ahenk/base/command/fifo.py b/src/base/command/fifo.py similarity index 100% rename from opt/ahenk/base/command/fifo.py rename to src/base/command/fifo.py diff --git a/opt/ahenk/base/config/__init__.py b/src/base/config/__init__.py similarity index 100% rename from opt/ahenk/base/config/__init__.py rename to src/base/config/__init__.py diff --git a/opt/ahenk/base/config/config_manager.py b/src/base/config/config_manager.py similarity index 100% rename from opt/ahenk/base/config/config_manager.py rename to src/base/config/config_manager.py diff --git a/opt/ahenk/base/database/ahenk_db_service.py b/src/base/database/ahenk_db_service.py similarity index 100% rename from opt/ahenk/base/database/ahenk_db_service.py rename to src/base/database/ahenk_db_service.py diff --git a/opt/ahenk/base/deamon/__init__.py b/src/base/deamon/__init__.py similarity index 100% rename from opt/ahenk/base/deamon/__init__.py rename to src/base/deamon/__init__.py diff --git a/opt/ahenk/base/deamon/base_daemon.py b/src/base/deamon/base_daemon.py similarity index 100% rename from opt/ahenk/base/deamon/base_daemon.py rename to src/base/deamon/base_daemon.py diff --git a/opt/ahenk/base/event/event_base.py b/src/base/event/event_base.py similarity index 100% rename from opt/ahenk/base/event/event_base.py rename to src/base/event/event_base.py diff --git a/opt/ahenk/base/event/event_manager.py b/src/base/event/event_manager.py similarity index 100% rename from opt/ahenk/base/event/event_manager.py rename to src/base/event/event_manager.py diff --git a/opt/ahenk/base/execution/__init__.py b/src/base/execution/__init__.py similarity index 100% rename from opt/ahenk/base/execution/__init__.py rename to src/base/execution/__init__.py diff --git a/opt/ahenk/base/execution/execution_manager.py b/src/base/execution/execution_manager.py similarity index 100% rename from opt/ahenk/base/execution/execution_manager.py rename to src/base/execution/execution_manager.py diff --git a/opt/ahenk/base/file/file_transfer_manager.py b/src/base/file/file_transfer_manager.py similarity index 100% rename from opt/ahenk/base/file/file_transfer_manager.py rename to src/base/file/file_transfer_manager.py diff --git a/opt/ahenk/base/file/http_file_transfer.py b/src/base/file/http_file_transfer.py similarity index 100% rename from opt/ahenk/base/file/http_file_transfer.py rename to src/base/file/http_file_transfer.py diff --git a/opt/ahenk/base/file/ssh_file_transfer.py b/src/base/file/ssh_file_transfer.py similarity index 100% rename from opt/ahenk/base/file/ssh_file_transfer.py rename to src/base/file/ssh_file_transfer.py diff --git a/opt/ahenk/base/logger/__init__.py b/src/base/logger/__init__.py similarity index 100% rename from opt/ahenk/base/logger/__init__.py rename to src/base/logger/__init__.py diff --git a/opt/ahenk/base/logger/ahenk_logger.py b/src/base/logger/ahenk_logger.py similarity index 100% rename from opt/ahenk/base/logger/ahenk_logger.py rename to src/base/logger/ahenk_logger.py diff --git a/opt/ahenk/base/mail/mail_manager.py b/src/base/mail/mail_manager.py similarity index 100% rename from opt/ahenk/base/mail/mail_manager.py rename to src/base/mail/mail_manager.py diff --git a/opt/ahenk/base/messaging/__init__.py b/src/base/messaging/__init__.py similarity index 100% rename from opt/ahenk/base/messaging/__init__.py rename to src/base/messaging/__init__.py diff --git a/opt/ahenk/base/messaging/anonymous_messenger.py b/src/base/messaging/anonymous_messenger.py similarity index 100% rename from opt/ahenk/base/messaging/anonymous_messenger.py rename to src/base/messaging/anonymous_messenger.py diff --git a/opt/ahenk/base/messaging/message_response_queue.py b/src/base/messaging/message_response_queue.py similarity index 100% rename from opt/ahenk/base/messaging/message_response_queue.py rename to src/base/messaging/message_response_queue.py diff --git a/opt/ahenk/base/messaging/messaging.py b/src/base/messaging/messaging.py similarity index 100% rename from opt/ahenk/base/messaging/messaging.py rename to src/base/messaging/messaging.py diff --git a/opt/ahenk/base/messaging/messenger.py b/src/base/messaging/messenger.py similarity index 100% rename from opt/ahenk/base/messaging/messenger.py rename to src/base/messaging/messenger.py diff --git a/opt/ahenk/base/model/__init__.py b/src/base/model/__init__.py similarity index 100% rename from opt/ahenk/base/model/__init__.py rename to src/base/model/__init__.py diff --git a/opt/ahenk/base/model/enum/__init__.py b/src/base/model/enum/__init__.py similarity index 100% rename from opt/ahenk/base/model/enum/__init__.py rename to src/base/model/enum/__init__.py diff --git a/opt/ahenk/base/model/enum/content_type.py b/src/base/model/enum/content_type.py similarity index 100% rename from opt/ahenk/base/model/enum/content_type.py rename to src/base/model/enum/content_type.py diff --git a/opt/ahenk/base/model/enum/message_code.py b/src/base/model/enum/message_code.py similarity index 100% rename from opt/ahenk/base/model/enum/message_code.py rename to src/base/model/enum/message_code.py diff --git a/opt/ahenk/base/model/enum/message_type.py b/src/base/model/enum/message_type.py similarity index 100% rename from opt/ahenk/base/model/enum/message_type.py rename to src/base/model/enum/message_type.py diff --git a/opt/ahenk/base/model/message_factory.py b/src/base/model/message_factory.py similarity index 100% rename from opt/ahenk/base/model/message_factory.py rename to src/base/model/message_factory.py diff --git a/opt/ahenk/base/model/modes/__init__.py b/src/base/model/modes/__init__.py similarity index 100% rename from opt/ahenk/base/model/modes/__init__.py rename to src/base/model/modes/__init__.py diff --git a/opt/ahenk/base/model/modes/init_mode.py b/src/base/model/modes/init_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/init_mode.py rename to src/base/model/modes/init_mode.py diff --git a/opt/ahenk/base/model/modes/login_mode.py b/src/base/model/modes/login_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/login_mode.py rename to src/base/model/modes/login_mode.py diff --git a/opt/ahenk/base/model/modes/logout_mode.py b/src/base/model/modes/logout_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/logout_mode.py rename to src/base/model/modes/logout_mode.py diff --git a/opt/ahenk/base/model/modes/safe_mode.py b/src/base/model/modes/safe_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/safe_mode.py rename to src/base/model/modes/safe_mode.py diff --git a/opt/ahenk/base/model/modes/shutdown_mode.py b/src/base/model/modes/shutdown_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/shutdown_mode.py rename to src/base/model/modes/shutdown_mode.py diff --git a/opt/ahenk/base/model/plugin.py b/src/base/model/plugin.py similarity index 100% rename from opt/ahenk/base/model/plugin.py rename to src/base/model/plugin.py diff --git a/opt/ahenk/base/model/plugin_bean.py b/src/base/model/plugin_bean.py similarity index 100% rename from opt/ahenk/base/model/plugin_bean.py rename to src/base/model/plugin_bean.py diff --git a/opt/ahenk/base/model/policy.py b/src/base/model/policy.py similarity index 100% rename from opt/ahenk/base/model/policy.py rename to src/base/model/policy.py diff --git a/opt/ahenk/base/model/policy_bean.py b/src/base/model/policy_bean.py similarity index 100% rename from opt/ahenk/base/model/policy_bean.py rename to src/base/model/policy_bean.py diff --git a/opt/ahenk/base/model/profile.py b/src/base/model/profile.py similarity index 100% rename from opt/ahenk/base/model/profile.py rename to src/base/model/profile.py diff --git a/opt/ahenk/base/model/profile_bean.py b/src/base/model/profile_bean.py similarity index 100% rename from opt/ahenk/base/model/profile_bean.py rename to src/base/model/profile_bean.py diff --git a/opt/ahenk/base/model/response.py b/src/base/model/response.py similarity index 100% rename from opt/ahenk/base/model/response.py rename to src/base/model/response.py diff --git a/opt/ahenk/base/model/task.py b/src/base/model/task.py similarity index 100% rename from opt/ahenk/base/model/task.py rename to src/base/model/task.py diff --git a/opt/ahenk/base/model/task_bean.py b/src/base/model/task_bean.py similarity index 100% rename from opt/ahenk/base/model/task_bean.py rename to src/base/model/task_bean.py diff --git a/opt/ahenk/base/plugin/__init__.py b/src/base/plugin/__init__.py similarity index 100% rename from opt/ahenk/base/plugin/__init__.py rename to src/base/plugin/__init__.py diff --git a/opt/ahenk/base/plugin/abstract_plugin.py b/src/base/plugin/abstract_plugin.py similarity index 100% rename from opt/ahenk/base/plugin/abstract_plugin.py rename to src/base/plugin/abstract_plugin.py diff --git a/opt/ahenk/base/plugin/file_handler.py b/src/base/plugin/file_handler.py similarity index 100% rename from opt/ahenk/base/plugin/file_handler.py rename to src/base/plugin/file_handler.py diff --git a/opt/ahenk/base/plugin/plugin.py b/src/base/plugin/plugin.py similarity index 100% rename from opt/ahenk/base/plugin/plugin.py rename to src/base/plugin/plugin.py diff --git a/opt/ahenk/base/plugin/plugin_install_listener.py b/src/base/plugin/plugin_install_listener.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_install_listener.py rename to src/base/plugin/plugin_install_listener.py diff --git a/opt/ahenk/base/plugin/plugin_manager.py b/src/base/plugin/plugin_manager.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_manager.py rename to src/base/plugin/plugin_manager.py diff --git a/opt/ahenk/base/plugin/plugin_manager_factory.py b/src/base/plugin/plugin_manager_factory.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_manager_factory.py rename to src/base/plugin/plugin_manager_factory.py diff --git a/opt/ahenk/base/plugin/plugin_queue.py b/src/base/plugin/plugin_queue.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_queue.py rename to src/base/plugin/plugin_queue.py diff --git a/opt/ahenk/base/registration/__init__.py b/src/base/registration/__init__.py similarity index 100% rename from opt/ahenk/base/registration/__init__.py rename to src/base/registration/__init__.py diff --git a/opt/ahenk/base/registration/registration.py b/src/base/registration/registration.py similarity index 100% rename from opt/ahenk/base/registration/registration.py rename to src/base/registration/registration.py diff --git a/opt/ahenk/base/scheduler/__init__.py b/src/base/scheduler/__init__.py similarity index 100% rename from opt/ahenk/base/scheduler/__init__.py rename to src/base/scheduler/__init__.py diff --git a/opt/ahenk/base/scheduler/base_scheduler.py b/src/base/scheduler/base_scheduler.py similarity index 100% rename from opt/ahenk/base/scheduler/base_scheduler.py rename to src/base/scheduler/base_scheduler.py diff --git a/opt/ahenk/base/scheduler/custom/__init__.py b/src/base/scheduler/custom/__init__.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/__init__.py rename to src/base/scheduler/custom/__init__.py diff --git a/opt/ahenk/base/scheduler/custom/all_match.py b/src/base/scheduler/custom/all_match.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/all_match.py rename to src/base/scheduler/custom/all_match.py diff --git a/opt/ahenk/base/scheduler/custom/custom_scheduler.py b/src/base/scheduler/custom/custom_scheduler.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/custom_scheduler.py rename to src/base/scheduler/custom/custom_scheduler.py diff --git a/opt/ahenk/base/scheduler/custom/schedule_job.py b/src/base/scheduler/custom/schedule_job.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/schedule_job.py rename to src/base/scheduler/custom/schedule_job.py diff --git a/opt/ahenk/base/scheduler/custom/scheduledb.py b/src/base/scheduler/custom/scheduledb.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/scheduledb.py rename to src/base/scheduler/custom/scheduledb.py diff --git a/opt/ahenk/base/scheduler/scheduler_factory.py b/src/base/scheduler/scheduler_factory.py similarity index 100% rename from opt/ahenk/base/scheduler/scheduler_factory.py rename to src/base/scheduler/scheduler_factory.py diff --git a/opt/ahenk/base/scope.py b/src/base/scope.py similarity index 100% rename from opt/ahenk/base/scope.py rename to src/base/scope.py diff --git a/opt/ahenk/base/system/system.py b/src/base/system/system.py similarity index 100% rename from opt/ahenk/base/system/system.py rename to src/base/system/system.py diff --git a/opt/ahenk/base/task/__init__.py b/src/base/task/__init__.py similarity index 100% rename from opt/ahenk/base/task/__init__.py rename to src/base/task/__init__.py diff --git a/opt/ahenk/base/task/task_in_queue.py b/src/base/task/task_in_queue.py similarity index 100% rename from opt/ahenk/base/task/task_in_queue.py rename to src/base/task/task_in_queue.py diff --git a/opt/ahenk/base/task/task_job.py b/src/base/task/task_job.py similarity index 100% rename from opt/ahenk/base/task/task_job.py rename to src/base/task/task_job.py diff --git a/opt/ahenk/base/task/task_manager.py b/src/base/task/task_manager.py similarity index 100% rename from opt/ahenk/base/task/task_manager.py rename to src/base/task/task_manager.py diff --git a/opt/ahenk/base/timer/setup_timer.py b/src/base/timer/setup_timer.py similarity index 100% rename from opt/ahenk/base/timer/setup_timer.py rename to src/base/timer/setup_timer.py diff --git a/opt/ahenk/base/timer/timer.py b/src/base/timer/timer.py similarity index 100% rename from opt/ahenk/base/timer/timer.py rename to src/base/timer/timer.py diff --git a/opt/ahenk/base/util/util.py b/src/base/util/util.py similarity index 100% rename from opt/ahenk/base/util/util.py rename to src/base/util/util.py diff --git a/opt/ahenk/helper/__init__.py b/src/helper/__init__.py similarity index 100% rename from opt/ahenk/helper/__init__.py rename to src/helper/__init__.py From 998010cb1bdafde0e8b3647d4a4d37b63d81dbbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 11:44:15 +0300 Subject: [PATCH 05/12] Remove unnecessary debian related scripts --- scripts/build-ahenk.sh | 33 --------------------------------- scripts/checkout-ahenk.sh | 13 ------------- 2 files changed, 46 deletions(-) delete mode 100755 scripts/build-ahenk.sh delete mode 100755 scripts/checkout-ahenk.sh diff --git a/scripts/build-ahenk.sh b/scripts/build-ahenk.sh deleted file mode 100755 index a914070..0000000 --- a/scripts/build-ahenk.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -### -# This script generates Ahenk package (ahenk.deb). -# Make sure you have debhelper & build-essential packages installed! -# -# Generated file can be found under /tmp/ahenk -### -set -e - -pushd $(dirname $0) > /dev/null -PRJ_ROOT_PATH=$(dirname $(pwd -P)) -popd > /dev/null -echo "Project path: $PRJ_ROOT_PATH" - -# Generate Ahenk packages -echo "Generating Ahenk packages..." -cd "$PRJ_ROOT_PATH" -dpkg-buildpackage -b -uc -echo "Generated Ahenk packages" - -EXPORT_PATH=/tmp/ahenk -echo "Export path: $EXPORT_PATH" - -# Copy resulting files -echo "Copying generated Ahenk packages to $EXPORT_PATH..." -mkdir -p "$EXPORT_PATH" -cp -rf "$PRJ_ROOT_PATH"/../ahenk*.deb "$EXPORT_PATH" -cp -rf "$PRJ_ROOT_PATH"/../ahenk*.changes "$EXPORT_PATH" -echo "Copied generated Ahenk packages." - -echo "Built finished successfully!" -echo "Files can be found under: $EXPORT_PATH" diff --git a/scripts/checkout-ahenk.sh b/scripts/checkout-ahenk.sh deleted file mode 100755 index ca015d7..0000000 --- a/scripts/checkout-ahenk.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -### -# This script updates the local repo with the latest changes from Github. -# -# The master branch will be REPLACED with what's in Github and all local changes -# will be LOST. -### - -git checkout master -git fetch -f origin -git fetch --tags origin -git reset --hard origin/master From 9b784bb6565eec925678efc59008bec887b28b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 13:49:09 +0300 Subject: [PATCH 06/12] Deprecate calling sub process 'ifconfig' use netifaces instead --- src/base/system/system.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/base/system/system.py b/src/base/system/system.py index 0206eb6..7473586 100644 --- a/src/base/system/system.py +++ b/src/base/system/system.py @@ -10,6 +10,7 @@ import platform import re import socket import struct +import netifaces from uuid import getnode as get_mac import cpuinfo @@ -460,12 +461,17 @@ class System: @staticmethod def ip_addresses(): arr = [] - for iface in psutil.net_io_counters(pernic=True): - f = os.popen('ifconfig {0} | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'.format(iface)) - ip = str(f.read()).replace('\n', '') - if re.match(r'^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$', + for iface in netifaces.interfaces(): + link = None + try: + link = netifaces.ifaddresses(iface)[netifaces.AF_INET][0] + except: + link = None + if link is not None: + ip = link['addr'] + if re.match(r'^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$', ip) and str(ip) != 'localhost' and str(ip) != '127.0.0.1': - arr.append(ip) + arr.append(ip) return arr @staticmethod From 73b1f5a6111b0852ef46db5a575ca5d9b5885762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 13:51:00 +0300 Subject: [PATCH 07/12] Move libpam-script directory into source tree --- {usr/share/libpam-script => libpam-script}/pam_script_ses_close | 0 {usr/share/libpam-script => libpam-script}/pam_script_ses_open | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {usr/share/libpam-script => libpam-script}/pam_script_ses_close (100%) rename {usr/share/libpam-script => libpam-script}/pam_script_ses_open (100%) diff --git a/usr/share/libpam-script/pam_script_ses_close b/libpam-script/pam_script_ses_close similarity index 100% rename from usr/share/libpam-script/pam_script_ses_close rename to libpam-script/pam_script_ses_close diff --git a/usr/share/libpam-script/pam_script_ses_open b/libpam-script/pam_script_ses_open similarity index 100% rename from usr/share/libpam-script/pam_script_ses_open rename to libpam-script/pam_script_ses_open From 77093f05ea6efda00235202e7fb35373245ed123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 13:57:29 +0300 Subject: [PATCH 08/12] Move config files into source directory --- etc/ahenk/ahenk.conf => ahenk.conf | 0 {etc/init.d => init.d}/ahenk | 0 etc/ahenk/log.conf => log.conf | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename etc/ahenk/ahenk.conf => ahenk.conf (100%) rename {etc/init.d => init.d}/ahenk (100%) rename etc/ahenk/log.conf => log.conf (100%) diff --git a/etc/ahenk/ahenk.conf b/ahenk.conf similarity index 100% rename from etc/ahenk/ahenk.conf rename to ahenk.conf diff --git a/etc/init.d/ahenk b/init.d/ahenk similarity index 100% rename from etc/init.d/ahenk rename to init.d/ahenk diff --git a/etc/ahenk/log.conf b/log.conf similarity index 100% rename from etc/ahenk/log.conf rename to log.conf From dde8e3083105509140adc1a9ef80e80f8e570f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 13:58:44 +0300 Subject: [PATCH 09/12] Refactor init.d script of ahenk --- init.d/ahenk => ahenk_init | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename init.d/ahenk => ahenk_init (100%) diff --git a/init.d/ahenk b/ahenk_init similarity index 100% rename from init.d/ahenk rename to ahenk_init From 8cbd0821e2ad33fce0405f191e6f4d658ae1ac96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Tue, 21 Nov 2017 14:02:18 +0300 Subject: [PATCH 10/12] Move service file into source tree --- lib/systemd/system/ahenk.service => ahenk.service | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/systemd/system/ahenk.service => ahenk.service (100%) diff --git a/lib/systemd/system/ahenk.service b/ahenk.service similarity index 100% rename from lib/systemd/system/ahenk.service rename to ahenk.service From 98336ec19b324b864d48d42de2b408629f183fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Wed, 22 Nov 2017 10:04:59 +0300 Subject: [PATCH 11/12] Re arrange source tree --- ahenk.conf => config/ahenk.conf | 0 log.conf => config/log.conf | 0 ahenk_init => service-files/ahenk | 0 ahenk.service => service-files/ahenk.service | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename ahenk.conf => config/ahenk.conf (100%) rename log.conf => config/log.conf (100%) rename ahenk_init => service-files/ahenk (100%) rename ahenk.service => service-files/ahenk.service (100%) diff --git a/ahenk.conf b/config/ahenk.conf similarity index 100% rename from ahenk.conf rename to config/ahenk.conf diff --git a/log.conf b/config/log.conf similarity index 100% rename from log.conf rename to config/log.conf diff --git a/ahenk_init b/service-files/ahenk similarity index 100% rename from ahenk_init rename to service-files/ahenk diff --git a/ahenk.service b/service-files/ahenk.service similarity index 100% rename from ahenk.service rename to service-files/ahenk.service From 0f78be26761114099970671fbf5ef324091c5cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunusemre=20=C5=9Eent=C3=BCrk?= Date: Wed, 22 Nov 2017 11:33:56 +0300 Subject: [PATCH 12/12] Merge upstream to master --- src/api/service/ps_util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/service/ps_util.py b/src/api/service/ps_util.py index 222c998..d0cdb58 100644 --- a/src/api/service/ps_util.py +++ b/src/api/service/ps_util.py @@ -4,4 +4,5 @@ import psutil if __name__ == '__main__': + pass