mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 03:52:17 +03:00
Merge pull request #5 from yunusem/master
Ahenk 1.0.0 tagged master and debian/1.0.0-2 tagged debian branch
This commit is contained in:
commit
61ce1123f1
95 changed files with 18 additions and 158 deletions
|
@ -3,7 +3,7 @@ logconfigurationfilepath = /etc/ahenk/log.conf
|
||||||
dbpath = /etc/ahenk/ahenk.db
|
dbpath = /etc/ahenk/ahenk.db
|
||||||
|
|
||||||
[PLUGIN]
|
[PLUGIN]
|
||||||
pluginfolderpath = /opt/ahenk/plugins/
|
pluginfolderpath = /usr/share/ahenk/plugins/
|
||||||
mainmodulename = main
|
mainmodulename = main
|
||||||
|
|
||||||
[CONNECTION]
|
[CONNECTION]
|
4
debian/ahenk.install
vendored
4
debian/ahenk.install
vendored
|
@ -1,4 +0,0 @@
|
||||||
opt/ /
|
|
||||||
etc/ /
|
|
||||||
lib/ /
|
|
||||||
usr/ /
|
|
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -1,5 +0,0 @@
|
||||||
ahenk (1.0) unstable; urgency=low
|
|
||||||
|
|
||||||
* Ahenk core app
|
|
||||||
|
|
||||||
-- volkansahin <volkan.sahin@agem.com.tr> Thu, 10 Dec 2015 22:21:04 +0200
|
|
1
debian/compat
vendored
1
debian/compat
vendored
|
@ -1 +0,0 @@
|
||||||
9
|
|
12
debian/control
vendored
12
debian/control
vendored
|
@ -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.
|
|
1
debian/files
vendored
1
debian/files
vendored
|
@ -1 +0,0 @@
|
||||||
ahenk_1.0_amd64.deb unknown optional
|
|
44
debian/postinst
vendored
44
debian/postinst
vendored
|
@ -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
|
|
5
debian/prerm
vendored
5
debian/prerm
vendored
|
@ -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
|
|
28
debian/rules
vendored
28
debian/rules
vendored
|
@ -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)
|
|
|
@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
||||||
TTY_DISPLAY="$PAM_TTY"
|
TTY_DISPLAY="$PAM_TTY"
|
||||||
fi
|
fi
|
||||||
log "logout: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY"
|
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
|
||||||
fi
|
fi
|
|
@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
||||||
TTY_DISPLAY="$PAM_TTY"
|
TTY_DISPLAY="$PAM_TTY"
|
||||||
fi
|
fi
|
||||||
log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY"
|
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
|
||||||
fi
|
fi
|
|
@ -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"
|
|
|
@ -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
|
|
|
@ -4,8 +4,8 @@ After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 /opt/ahenk/ahenkd.py start
|
ExecStart=/usr/bin/python3 /usr/share/ahenk/ahenkd.py start
|
||||||
ExecStop=/usr/bin/python3 /opt/ahenk/ahenkd.py stop
|
ExecStop=/usr/bin/python3 /usr/share/ahenk/ahenkd.py stop
|
||||||
PIDFile=/var/run/ahenkd.pid
|
PIDFile=/var/run/ahenkd.pid
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
0
opt/ahenk/ahenkd.py → src/ahenkd.py
Executable file → Normal file
0
opt/ahenk/ahenkd.py → src/ahenkd.py
Executable file → Normal file
|
@ -14,7 +14,7 @@ class Agreement:
|
||||||
self.message_manager = scope.get_message_manager()
|
self.message_manager = scope.get_message_manager()
|
||||||
self.messenger = scope.get_messenger()
|
self.messenger = scope.get_messenger()
|
||||||
self.db_service = scope.get_db_service()
|
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.')
|
self.logger.debug('Instance initialized.')
|
||||||
|
|
||||||
def agreement_contract_update(self):
|
def agreement_contract_update(self):
|
0
opt/ahenk/base/agreement/ask.py → src/base/agreement/ask.py
Executable file → Normal file
0
opt/ahenk/base/agreement/ask.py → src/base/agreement/ask.py
Executable file → Normal file
0
opt/ahenk/base/agreement/confirm.py → src/base/agreement/confirm.py
Executable file → Normal file
0
opt/ahenk/base/agreement/confirm.py → src/base/agreement/confirm.py
Executable file → Normal file
|
@ -10,6 +10,7 @@ import platform
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
|
import netifaces
|
||||||
from uuid import getnode as get_mac
|
from uuid import getnode as get_mac
|
||||||
|
|
||||||
import cpuinfo
|
import cpuinfo
|
||||||
|
@ -460,12 +461,17 @@ class System:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def ip_addresses():
|
def ip_addresses():
|
||||||
arr = []
|
arr = []
|
||||||
for iface in psutil.net_io_counters(pernic=True):
|
for iface in netifaces.interfaces():
|
||||||
f = os.popen('ifconfig {0} | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'.format(iface))
|
link = None
|
||||||
ip = str(f.read()).replace('\n', '')
|
try:
|
||||||
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])$',
|
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':
|
ip) and str(ip) != 'localhost' and str(ip) != '127.0.0.1':
|
||||||
arr.append(ip)
|
arr.append(ip)
|
||||||
return arr
|
return arr
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
|
@ -316,7 +316,7 @@ class Util:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def ask_permission(display, username, message, title):
|
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:
|
try:
|
||||||
|
|
||||||
if username is not None:
|
if username is not None:
|
Loading…
Reference in a new issue