Commit d3861235 authored by Samer Afach's avatar Samer Afach

Final fixes for the first version

parent 849bd5a6
......@@ -12,4 +12,12 @@ SamAuthenticator is a simple replace to Google Authenticator. The main feature o
### Who is SamAuthenticator for?
It's for those who know how to manage their security but can't stand the annoyance of Google Authenticator, Authy, and similar services.
### Requirements
sudo pip3 install samauth
should do it. You should have OpenSSL installed. On Ubuntu and Debian, this installs it:
sudo apt-get install libssl-dev
\ No newline at end of file
......@@ -209,6 +209,7 @@ class AuthenticatorGUI(QMainWindow):
self.keys_data_model_proxy = QSortFilterProxyModel()
self.keys_data_model_proxy.setFilterCaseSensitivity(Qt.CaseInsensitive)
self.keys_data_model = model.AuthenticatorKeysDataModel(keys)
self.keys_table_view.set_real_data_model(self.keys_data_model)
self.keys_data_model_proxy.setSourceModel(self.keys_data_model)
self.keys_table_view.setModel(self.keys_data_model_proxy)
......@@ -223,7 +224,9 @@ class AuthenticatorGUI(QMainWindow):
def load_geometry(self):
settings = QSettings("SamApps", "SamAuthenticator")
self.restoreGeometry(settings.value("geometry"))
geometry_values = settings.value("geometry")
if geometry_values is not None:
self.restoreGeometry(geometry_values)
def closeEvent(self, event):
settings = QSettings("SamApps", "SamAuthenticator")
......
......@@ -8,6 +8,8 @@ class KeyDataView(QTableView):
def __init__(self):
super().__init__()
self.data_model = None
self.add_key_dialog = AddKeyDialog()
self.add_key_dialog.new_key_to_add_signal.connect(self.add_new_key)
......@@ -61,10 +63,13 @@ class KeyDataView(QTableView):
def add_new_key(self, name, secret):
try:
self.model().getKeysObject().test_secret_validity(secret)
self.model().getKeysObject().set_secret(name, secret)
self.model().refreshAll()
self.data_model.getKeysObject().test_secret_validity(secret)
self.data_model.getKeysObject().set_secret(name, secret)
self.data_model.refreshAll()
except Exception as e:
self.add_key_dialog.close()
QMessageBox.warning(self, "Error", "Testing the secret you entered failed. " + str(e))
return
def set_real_data_model(self, the_model):
self.data_model = the_model
SOFTWARE_VERSION = "1.0.6"
__version__ = SOFTWARE_VERSION
from SamAuthenticator.Authenticator import *
from SamAuthenticator.AuthenticatorGUIApp import *
# from SamAuthenticator.Authenticator import *
# from SamAuthenticator.AuthenticatorGUIApp import *
import SamAuthenticator as auth
from SamAuthenticator.AuthenticatorGUIApp import *
auth.start()
start()
@echo off
RMDIR /S /Q dist
RMDIR /S /Q build
CALL python setup.py bdist_wheel --universal
if NOT %ERRORLEVEL% == 0 goto errorHandling
cd ..
pause
exit 0
:errorHandling
echo "Error while building..."
pause
exit 1
#!/bin/bash
#go to the directory of the script
reldir=`dirname $0`
cd $reldir
directory=`pwd`
rm -rf build
rm -rf dist
python3 setup.py sdist
if [ $? -ne 0 ]; then
echo 'Python packager source distribution tool failed.'
exit
fi
@echo off
python -c "import SamAuthenticator.Meta;print(SamAuthenticator.Meta.__version__)" > ver.txt
set /p VER=<ver.txt
call pip install dist\samauth-%VER%-py2.py3-none-any.whl --upgrade --verbose
call rm ver.txt
#!/bin/bash
#go to the directory of the script
reldir=`dirname $0`
cd $reldir
directory=`pwd`
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
pip3 install dist/samauth* --upgrade
if [ $? -ne 0 ]; then
echo 'Package installation failed. Did you build the package? Do you have pip3 installed?'
exit
fi
python setup.py register sdist upload
#!/bin/bash
#python3 setup.py register sdist upload
twine upload dist/*.tar.gz
# from distutils.core import setup
import SamAuthenticator.Meta
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
del os.link
except:
pass
include_files = ["SamAuthenticator/images/key.png"]
setup(
name="samauth",
version = SamAuthenticator.Meta.__version__,
author="Samer Afach",
author_email="samer@afach.de",
packages=["SamAuthenticator"],
include_package_data=True,
url="https://git.afach.de/samerafach/SamAuthenticator",
description="A simple Google Authenticator replacement",
data_files=include_files,
install_requires=['pyqt5', 'onetimepass', 'cryptography', 'argon2'],
extras_requires=['pyqt5', 'onetimepass', 'cryptography', 'argon2'],
python_requires='>=3.4',
entry_points={
'console_scripts': [
'samauth = SamAuthenticator.AuthenticatorGUIApp:start',
'samauthenticator = SamAuthenticator.AuthenticatorGUIApp:start'
]}
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment