pyvserv


Namepyvserv JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/pglen/pyvserv
SummaryHigh power secure server with blockchain backend.
upload_time2024-05-16 13:14:35
maintainerNone
docs_urlNone
authorPeter Glen
requires_python>=3
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #  PyvServer

## 	Fully encrypted TCP/IP server.

     PyvServ is an encrypting TCP/IP server written in Python. The
encryption algorithm is AES. (Advanced Encryption Standard) The key exchange
uses ECC. (Elliptic curve) The server can be fully administered from the
protocol side.

## How to use, what it is for:

    Public Voting System Blockchain server.
    Charity administration, trust maintenance. (Zakat)
    Internal currency / resource maintenance.

#### Public Voting System Blockchain server.

  The system maintains an encrypted chain of vote events. Every entry has
(among others) the Voter ID, an Electronic ID, and the vote action (register / cast /
un-cast / withdraw), and of course, the vote.

  The voter ID is a number allocated by authorities, the Electronic ID is a
number allocated on initial login / registration / transaction by the system.
The Voter Block Chain, the associated IDs, and the vote is visible to the public,
so every voter can verify his / her participation. The voter ID is visible, but
the data behind it is known by the electorate only.

  The blockchain may be replicated to independent hosts, so falsifying it
would require breaching multiple services.

 The blockchain visibility allows that every voter can verify their participation.
This also allows all parties to verify the chain, and create independent counts.

 The chain can  be verified for legitimate and singular registration. This system
crates accountability from both the voter's side and the electorate (authority's) side.

#### Charity administration, trust maintenance. (Zakat)

 The blockchain will allow the donation's public visibility and the donation's
usage. It can accommodate arbitrary information, for instance: disbursement
target, fund source, funding entity ... etc. The system handles unique IDs
transparently, which allows privileged information to be encoded as a unique ID.
This unique ID than can be turned back to real information by the publisher
of the Unique ID, preserving privacy.

#### Internal resource / currency maintenance

 The blockchain will allow monitoring internal resource allocation / usage.

     PyvServ contains protocol level encryption, which can be switched on by
instructing the server to use an encryption (session) key.

     PyvServ contains a key exchange protocol, so the new session keys
can be transmitted securely. The key exchange is based on ECC.

 PyvServ has utilities to generate encryption keys. At least one
key needs to be generated before use. (now automatic) The server picks from
a pool of keys, so communication data is always distinctive. Make sure you
generate some new keys with the 'pyvgenkeys' utility before production
deployment.

 PyvServ has blockchain empowered back end. The new data is linked to the
previous record. Utilities to verify the data are also provided.
(dbaseadm and chainadm)

 PyvServ has file upload / download capabilities with encrypted transport.

 PyvServ has replication facilities via a client based 'I have You have'
 mechanism featuring encrypted transport. It is also capable of replication
 on a 'replicate when received' mechanism. The replicated records are marked
 with a replication count, so replication does not enter looping. By default,
 the replicated records are not replicated any further, assuming a flat
 structure of replication.

#### Installation:

    pip install pyvserv

 Newer Linux-es do not allow pip to modify the system, pyvserv may be installed
 with pipx, which separates the sever process into a virtual environment.

 Dependencies:

 Most linux systems already have all the dependencies by default. Some dependencies
 are added automatically on installation.

     pydbase, pyvpacker, pyvecc, pyvguicom

 The firewall needs to be opened for incoming connections on port NN

For example (assuming port 6666):

    sudo iptables -A INPUT -p tcp --dport 6666
    sudo iptables -A INPUT -p tcp --sport 6666

 Please note that this is not a recommendation, it is a port we used during
 development.

#### Start server

 The python server can be added to the system servers with the Makefile targets
'make genservice' and 'make instservice'
 The scripts will generate the service file to run under current user's
 credentials, and install it onto the running system. (requires sudo)

#### Platforms:

 This project was developed on Ubuntu 22.x. Most linux distributions should work.
It is ported to Windows MSYS2, with all major functions operating as expected.

 On Fedora, the service files need to be re-written to accomodate the
quirk that the Fedora systectl does not allow user executables.

One solution is to install the 'pip pyvserv' as root, and adjust the service
file accordingly. If you want to use pyvserv with particular data directory,
use the -r option.

On Debian and newer Ubuntu-s (23+) the system needs the --break-system-packages
option on pip. If that is not desired, one may create a venv for pyvserv.
This is a cautionary arrangement for the OS, pyvserv does not break anything.
The other solution is to use pipx.

    pip install pyvserv --break-system-packages

or ..

    pipx install pyvserv

pip installs the scripts in ~/.local/bin, so add the following line
  to the end of ~/.bashrc:

    PATH=$PATH:~/.local/bin

This workaround is not needed if one installs pyvserv in a virtual environment.

    python3 -m venv pip_pyvserv
    cd pip_pyvserv
    source ./bin/avtivate
    pip install pyvserv
    ... continue as needed.

 The makefile target 'make installvirt' will install pyvserv in a virtual
environment.

  Running pyvserv as a system daemon from virtual environment needs extra
configuration steps. You may use the make target: 'make genservice_virt'
and activate with 'make instservice'
Please see the relevant systemctl manuals.

#### Quick map:

    Server.     subdir: pyvserver       -- Server has most all the commands
    Client.     subdir: pyvclient       -- Exercise server commands / demo code
    Test Suite. subdir: pyvclient/tests -- official pytest tests
    Tool Suite. subdir: pyvtools        -- Key generation ... etc
    GUI base    subdir: pyvgui          -- Monitoring / Administering the server
    Studies.    subdir: study           -- Testing/learning subsystems (ignore it)

#### Quick start:

 One can mimic global connectivity on a single machine. This would allow the study
of the client / server interaction before live deployment. This chapter assumes
installation / clone from github, replicating directory structure on the
local drive.

    open terminal window
    navigate to the server's pyvserver subdir
    type: ./pyvserv.py

    open another terminal window
    navigate to the pyvclient subdir
    type: ./pyvcli_hello.py

The following (and more) should be printed on the command line:

    ./pyvcli_hello.py

    Server initial: ['OK', 'pyvserv 1.0.4 ready']
    resp ['OK', 'Hello', '4814b46a-9489-4720-af7d-aa14ba19f2be', '11367']
    Server quit response: ['OK', 'Bye', '11367']

Quick rundown of the above test:

    1.) Server responds to connection with signin message
    2.) Delivers OK status, hello message, server serial number, and a unique id
    3.) Server signs off. Repeats unique id / session number.

This interaction is typical of all the commands.

The unique ID is the session's thread ID and it is not meant to be used other than
identifying the session on the client side.

 The best way to learn about the operation of the server is to look at the
sample client examples in the client source tree. (Files named pyvcli_*)

## The pip install

Scripts are provided for the server, and some test clients. The
server can be started as

    pyvserver

 The -P option is for non Developer mode, enabling 2FA authentication.
(two factor authentication)

The command line client can be started as:

    pyvcli_cli

  In the command line client most of the server functions can be exercised.
See the pyvcli_* utils for more examples of driving the server. On a
fresh install, one may need to execute the pyvcli_uini.py to create an initial
admin user, with password 1234. The uini command will prompt if this is
what was intended.

 The cli utility command 'help' will deliver information on the available commands.

!!! IMPORTANT !!! Make sure you change this when testing / learning is over.

## Command line help

    Usage: pyvserv.py [options]

    Options:
            -n   --host                 -  Set server hostname / interface.
            -r   --dataroot  dataroot   -  Set data root for server.
            -P   --pmode                -  Production mode ON. (allow 2FA)
            -l   --loglevel             -  Log level (0 - 10) default = 1
            -m   --mem                  -  Show memory trace.
            -N   --norepl               -  No replication. (for testing)
            -d   --debug     debug      -  Debug level 0-10
            -p   --port      port       -  Listen on port
            -v   --verbose              -  Verbose
            -q   --quiet                -  Quiet
            -V   --version              -  Print Version
            -h   --help                 -  Show Help

## Client command line help example:

 While most command line clients have their own help screen, here as a typical
client utility's help screen:

    Usage: pyvcli_uman.py [options] [hostname]

    Options:    -d level  - Debug level 0-10
                -p        - Port to use (default: 6666)
                -l login  - Login Name; default: 'user'
                -s lpass  - Login Pass; default: '1234'
                -u user   - User Name; default: 'user'
                -t        - prompt for login pass
                -a        - Add user. Must be a unique user name.
                -r        - Remove user
                -u user   - User Name; default: 'user'
                -p pass   - User password; default: '1234' (!!for tests only!!)
                -T        - prompt for new pass
                -m        - Add admin instead of regular user
                -e enflag - Enable / Disable user.
                -i kind   - List users (user or admin
                -v        - Verbose
                -q        - Quiet
                -h        - Help

     One of Add / Remove / Enable / List option is needed.

## pyvser clients

 Some client programs are supplied to administer / drive / monitor pyvserv.
 The -h option on the client programs give a brief help of usage / purpose.

 | Client name  | Description               |        Purpose                |
 | -----------  |  -----------              |  ------------------------     |
 | pyvcli_cli   | Command line interface    | All aspects of pyvserv        |
 | pyvcli_uini  | Create initial user       | Create initial admin user     |
 | pyvcli_fman  | File manager              | Upload / Download files       |
 | pyvcli_uman  | User manager              | Add remove users / admins     |
 | pyvcli_rman  | Record manager            | Get / Put Blockchain Records  |
 | pyvcli_hello | Get hello message         | Connectivity test             |
 | pyvcli_ver   | Get Version number        | Check for server version      |

 The utilities can also be executed from the 'pyvclient' sub directory by
 post fixing with script extension. (add the .py extension like: ./pyvcli_cli.py)

 The date formats for specifying record date filter dates are:

   'Y-m-d+H:M' 'Y-m-d' 'm-d' 'm-d+H-M'

Where Y=year m=month d=day H=hour M=minutes, just like in strftime.
The hour is in 24 hour notation.

The following are all valid dates specs, specifying the same date
(in 2024 apr 15 at 00:00):

    '2024-04-15' '2024-04-15+0:0' '04-15 04-15+00:00'

## Testing:

   All pytest cases pass successfully. Note that for the pytest client
tests one needs to start the server. ('./pyvserv.py' or pyvserv if installed)
The server --port and --dataroot option can be used to start the server in
an alternate 'universe', so it does not interfere with production.

    ============================ test session starts ==============================
    platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.0.0
    rootdir: /home/<homedir>/pgpygtk/pyvserv
    collected 15 items

    test_afirst.py .                                                         [  6%]
    test_file.py ..                                                          [ 20%]
    test_hello.py .                                                          [ 26%]
    test_help.py .                                                           [ 33%]
    test_id.py .                                                             [ 40%]
    test_key.py .                                                            [ 46%]
    test_login.py .                                                          [ 53%]
    test_noadmn.py .                                                         [ 60%]
    test_rget.py .                                                           [ 66%]
    test_rput.py .                                                           [ 73%]
    test_sess.py ..                                                          [ 86%]
    test_user.py .                                                           [ 93%]
    test_ver.py .                                                            [100%]

    ============================== 15 passed in 9.47s ==============================

Additional tests can be found in the tests/ directory. The pyvcli_* files in the
'pyvclient' directory may also serve as test cases.

## Production:

Once the testing phase is complete, deploying it for production needs a
complete wipe of the data. There are Makefile targets that do that
(make cleanall). Restarting the server will create the new environment without
any users. To allow operation one may create the initial user with the pyvcli_uini
functions and / or scripts. Make sure you create strong passwords.
The uini command can only operate successfully if there are no users present in the
pyvserv system, and it is executed from the loopback interface. For example,
the command line utility ./pyvcli_uini.py can be used;
For production, uini should executed with the -t option to prompt for a password.

## Screen shots:

 Following, a set of screen shots to demonstrate the sub systems from entering
voter data, casting votes, monitoring vote servers, watching vote tallies.

### Screen shot of the Monitoring tool:

![Screen Shot](montool.png)

 This screen shot depicts the monitoring (control panel) application 'pyvcpanel'.
The top left area contains a live view of the pyvserver syslog. The top right
contains a live view of the replicator log.

 The bottom area of the window contains a live view of the incoming data, as it is
originally formatted, without the blockchain and hash details.

  All views monitor the live log files, on the default setup. The montor functions
operate, without interfering with any of the operations.

### Screen shot of the Voter Entry tool:

![Screen Shot](people.png)

The UUID fields serve identification of the voter, the organization hosting
the record entry, and the operator that entered this record.

### Screen shot of the Ballot Editing tool:

![Screen Shot](ballot.png)

The UUID fields serve identification of the ballot, the organization hosting
the ballot entry, and the operator that entered this record.

### Screen shot of the Vote Casting tool:

![Screen Shot](cast.png)

The vote choices are presented in random order, as recent studies show the
order influences the voting process.
The UUID fields serve identification of the vote, the organization hosting
the ballot entry, and the operator that entered this record.

## Windows compatibility

  Pyvserv now functions in the Windows MSYS2 subsystem. All the major
functionalities are ported. The file locking mechanism works, and all the
pytests pass. Naturally, logging and readline etc ... works with the usual
windows caveat.

  For the GUI functions ona my need to install the PyGobject subsystem.
Instructions can be found very easily for that.

Below, a screenshot of the pyvserv control panel in MSYS2.

![Screen Shot](winscreen.png)

The project is functional in MSYS2, but for real deployment we recommend Linux.

## History:

 Recent history kept, for the full list of changes consult the github site.

    1.0.0   Sun 03.Mar.2024    Beta ready
    1.0.0   Mon 11.Mar.2024    PIP installation with utils
    1.0.0   Wed 13.Mar.2024    rget rput and family (rget=BC record get)
    1.0.0   Thu 14.Mar.2024    Started GUI tools
    1.0.1   Fri 15.Mar.2024    Added LIC, verification, doc, tally
    1.0.3   Wed 03.Apr.2024    Ported to MSYS2, throttle, for multiprocess
    1.0.4   Tue 09.Apr.2024    Cleanup, uman fman rman completed
    1.0.4   Mon 06.May.2024    Progress on vote tools

## Statistics

    Project name
        pyvserv
    Generated
        2024-04-09 20:45:56
    Report Period
        2018-12-31 20:50:04 to 2024-04-09 20:41:24
    Age
        1927 days, 111 active days (5.76%)
    Total Files
        211
    Total Lines of Code
        44443 (258657 added, 214214 removed)
    Total Commits
        257 (average 2.3 commits per active day, 0.1 per all days)
    Authors
        6 (average 42.8 commits per author)

![Screen Shot](commits_by_year_month.png)

## Security review:

 &nbsp;  As of today, (Fri 15.Mar.2024) the 256 bit AES is considered unbreakable by
available state of the art means. The key exchange algorithm ECC 384 bit is
also considered safe. These algorithms are used dynamically, as a randomly picked
key is used in every session. The session is also able to dynamically change keys
mid flight, on command.

 &nbsp; The checksum verification and link verification both use SHA256 (256 bit)
hashes. This is generated every time a transaction is created.

 &nbsp; The proof of work is a modest 3 generations deep. This can be calculated
with an everyday desktop in one ... to ... three seconds. Even though this looks like
a small amount, it adds up if one wants to re-generate (fake) a whole chain.
Additionally, the check sum, the link sum, and proof of work interact, changing one
will effect the other. This way a sum verification and link verification and the
proof of work verification together create an ironclad safety solution.

Written by Peter Glen, 2022, 2023, 2024
Released under MIT License (MIT)

// EOF

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pglen/pyvserv",
    "name": "pyvserv",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": null,
    "author": "Peter Glen",
    "author_email": "peterglen99@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ff/14/efdcfb2942884fcf76d3c7298b687ccf323fe8d2c5849324f26babfa7412/pyvserv-1.1.0.tar.gz",
    "platform": null,
    "description": "#  PyvServer\n\n## \tFully encrypted TCP/IP server.\n\n &nbsp; &nbsp; PyvServ is an encrypting TCP/IP server written in Python. The\nencryption algorithm is AES. (Advanced Encryption Standard) The key exchange\nuses ECC. (Elliptic curve) The server can be fully administered from the\nprotocol side.\n\n## How to use, what it is for:\n\n    Public Voting System Blockchain server.\n    Charity administration, trust maintenance. (Zakat)\n    Internal currency / resource maintenance.\n\n#### Public Voting System Blockchain server.\n\n  The system maintains an encrypted chain of vote events. Every entry has\n(among others) the Voter ID, an Electronic ID, and the vote action (register / cast /\nun-cast / withdraw), and of course, the vote.\n\n  The voter ID is a number allocated by authorities, the Electronic ID is a\nnumber allocated on initial login / registration / transaction by the system.\nThe Voter Block Chain, the associated IDs, and the vote is visible to the public,\nso every voter can verify his / her participation. The voter ID is visible, but\nthe data behind it is known by the electorate only.\n\n  The blockchain may be replicated to independent hosts, so falsifying it\nwould require breaching multiple services.\n\n The blockchain visibility allows that every voter can verify their participation.\nThis also allows all parties to verify the chain, and create independent counts.\n\n The chain can  be verified for legitimate and singular registration. This system\ncrates accountability from both the voter's side and the electorate (authority's) side.\n\n#### Charity administration, trust maintenance. (Zakat)\n\n The blockchain will allow the donation's public visibility and the donation's\nusage. It can accommodate arbitrary information, for instance: disbursement\ntarget, fund source, funding entity ... etc. The system handles unique IDs\ntransparently, which allows privileged information to be encoded as a unique ID.\nThis unique ID than can be turned back to real information by the publisher\nof the Unique ID, preserving privacy.\n\n#### Internal resource / currency maintenance\n\n The blockchain will allow monitoring internal resource allocation / usage.\n\n &nbsp; &nbsp; PyvServ contains protocol level encryption, which can be switched on by\ninstructing the server to use an encryption (session) key.\n\n &nbsp; &nbsp; PyvServ contains a key exchange protocol, so the new session keys\ncan be transmitted securely. The key exchange is based on ECC.\n\n PyvServ has utilities to generate encryption keys. At least one\nkey needs to be generated before use. (now automatic) The server picks from\na pool of keys, so communication data is always distinctive. Make sure you\ngenerate some new keys with the 'pyvgenkeys' utility before production\ndeployment.\n\n PyvServ has blockchain empowered back end. The new data is linked to the\nprevious record. Utilities to verify the data are also provided.\n(dbaseadm and chainadm)\n\n PyvServ has file upload / download capabilities with encrypted transport.\n\n PyvServ has replication facilities via a client based 'I have You have'\n mechanism featuring encrypted transport. It is also capable of replication\n on a 'replicate when received' mechanism. The replicated records are marked\n with a replication count, so replication does not enter looping. By default,\n the replicated records are not replicated any further, assuming a flat\n structure of replication.\n\n#### Installation:\n\n    pip install pyvserv\n\n Newer Linux-es do not allow pip to modify the system, pyvserv may be installed\n with pipx, which separates the sever process into a virtual environment.\n\n Dependencies:\n\n Most linux systems already have all the dependencies by default. Some dependencies\n are added automatically on installation.\n\n     pydbase, pyvpacker, pyvecc, pyvguicom\n\n The firewall needs to be opened for incoming connections on port NN\n\nFor example (assuming port 6666):\n\n    sudo iptables -A INPUT -p tcp --dport 6666\n    sudo iptables -A INPUT -p tcp --sport 6666\n\n Please note that this is not a recommendation, it is a port we used during\n development.\n\n#### Start server\n\n The python server can be added to the system servers with the Makefile targets\n'make genservice' and 'make instservice'\n The scripts will generate the service file to run under current user's\n credentials, and install it onto the running system. (requires sudo)\n\n#### Platforms:\n\n This project was developed on Ubuntu 22.x. Most linux distributions should work.\nIt is ported to Windows MSYS2, with all major functions operating as expected.\n\n On Fedora, the service files need to be re-written to accomodate the\nquirk that the Fedora systectl does not allow user executables.\n\nOne solution is to install the 'pip pyvserv' as root, and adjust the service\nfile accordingly. If you want to use pyvserv with particular data directory,\nuse the -r option.\n\nOn Debian and newer Ubuntu-s (23+) the system needs the --break-system-packages\noption on pip. If that is not desired, one may create a venv for pyvserv.\nThis is a cautionary arrangement for the OS, pyvserv does not break anything.\nThe other solution is to use pipx.\n\n    pip install pyvserv --break-system-packages\n\nor ..\n\n    pipx install pyvserv\n\npip installs the scripts in ~/.local/bin, so add the following line\n  to the end of ~/.bashrc:\n\n    PATH=$PATH:~/.local/bin\n\nThis workaround is not needed if one installs pyvserv in a virtual environment.\n\n    python3 -m venv pip_pyvserv\n    cd pip_pyvserv\n    source ./bin/avtivate\n    pip install pyvserv\n    ... continue as needed.\n\n The makefile target 'make installvirt' will install pyvserv in a virtual\nenvironment.\n\n  Running pyvserv as a system daemon from virtual environment needs extra\nconfiguration steps. You may use the make target: 'make genservice_virt'\nand activate with 'make instservice'\nPlease see the relevant systemctl manuals.\n\n#### Quick map:\n\n    Server.     subdir: pyvserver       -- Server has most all the commands\n    Client.     subdir: pyvclient       -- Exercise server commands / demo code\n    Test Suite. subdir: pyvclient/tests -- official pytest tests\n    Tool Suite. subdir: pyvtools        -- Key generation ... etc\n    GUI base    subdir: pyvgui          -- Monitoring / Administering the server\n    Studies.    subdir: study           -- Testing/learning subsystems (ignore it)\n\n#### Quick start:\n\n One can mimic global connectivity on a single machine. This would allow the study\nof the client / server interaction before live deployment. This chapter assumes\ninstallation / clone from github, replicating directory structure on the\nlocal drive.\n\n    open terminal window\n    navigate to the server's pyvserver subdir\n    type: ./pyvserv.py\n\n    open another terminal window\n    navigate to the pyvclient subdir\n    type: ./pyvcli_hello.py\n\nThe following (and more) should be printed on the command line:\n\n    ./pyvcli_hello.py\n\n    Server initial: ['OK', 'pyvserv 1.0.4 ready']\n    resp ['OK', 'Hello', '4814b46a-9489-4720-af7d-aa14ba19f2be', '11367']\n    Server quit response: ['OK', 'Bye', '11367']\n\nQuick rundown of the above test:\n\n    1.) Server responds to connection with signin message\n    2.) Delivers OK status, hello message, server serial number, and a unique id\n    3.) Server signs off. Repeats unique id / session number.\n\nThis interaction is typical of all the commands.\n\nThe unique ID is the session's thread ID and it is not meant to be used other than\nidentifying the session on the client side.\n\n The best way to learn about the operation of the server is to look at the\nsample client examples in the client source tree. (Files named pyvcli_*)\n\n## The pip install\n\nScripts are provided for the server, and some test clients. The\nserver can be started as\n\n    pyvserver\n\n The -P option is for non Developer mode, enabling 2FA authentication.\n(two factor authentication)\n\nThe command line client can be started as:\n\n    pyvcli_cli\n\n  In the command line client most of the server functions can be exercised.\nSee the pyvcli_* utils for more examples of driving the server. On a\nfresh install, one may need to execute the pyvcli_uini.py to create an initial\nadmin user, with password 1234. The uini command will prompt if this is\nwhat was intended.\n\n The cli utility command 'help' will deliver information on the available commands.\n\n!!! IMPORTANT !!! Make sure you change this when testing / learning is over.\n\n## Command line help\n\n    Usage: pyvserv.py [options]\n\n    Options:\n            -n   --host                 -  Set server hostname / interface.\n            -r   --dataroot  dataroot   -  Set data root for server.\n            -P   --pmode                -  Production mode ON. (allow 2FA)\n            -l   --loglevel             -  Log level (0 - 10) default = 1\n            -m   --mem                  -  Show memory trace.\n            -N   --norepl               -  No replication. (for testing)\n            -d   --debug     debug      -  Debug level 0-10\n            -p   --port      port       -  Listen on port\n            -v   --verbose              -  Verbose\n            -q   --quiet                -  Quiet\n            -V   --version              -  Print Version\n            -h   --help                 -  Show Help\n\n## Client command line help example:\n\n While most command line clients have their own help screen, here as a typical\nclient utility's help screen:\n\n    Usage: pyvcli_uman.py [options] [hostname]\n\n    Options:    -d level  - Debug level 0-10\n                -p        - Port to use (default: 6666)\n                -l login  - Login Name; default: 'user'\n                -s lpass  - Login Pass; default: '1234'\n                -u user   - User Name; default: 'user'\n                -t        - prompt for login pass\n                -a        - Add user. Must be a unique user name.\n                -r        - Remove user\n                -u user   - User Name; default: 'user'\n                -p pass   - User password; default: '1234' (!!for tests only!!)\n                -T        - prompt for new pass\n                -m        - Add admin instead of regular user\n                -e enflag - Enable / Disable user.\n                -i kind   - List users (user or admin\n                -v        - Verbose\n                -q        - Quiet\n                -h        - Help\n\n     One of Add / Remove / Enable / List option is needed.\n\n## pyvser clients\n\n Some client programs are supplied to administer / drive / monitor pyvserv.\n The -h option on the client programs give a brief help of usage / purpose.\n\n | Client name  | Description               |        Purpose                |\n | -----------  |  -----------              |  ------------------------     |\n | pyvcli_cli   | Command line interface    | All aspects of pyvserv        |\n | pyvcli_uini  | Create initial user       | Create initial admin user     |\n | pyvcli_fman  | File manager              | Upload / Download files       |\n | pyvcli_uman  | User manager              | Add remove users / admins     |\n | pyvcli_rman  | Record manager            | Get / Put Blockchain Records  |\n | pyvcli_hello | Get hello message         | Connectivity test             |\n | pyvcli_ver   | Get Version number        | Check for server version      |\n\n The utilities can also be executed from the 'pyvclient' sub directory by\n post fixing with script extension. (add the .py extension like: ./pyvcli_cli.py)\n\n The date formats for specifying record date filter dates are:\n\n   'Y-m-d+H:M' 'Y-m-d' 'm-d' 'm-d+H-M'\n\nWhere Y=year m=month d=day H=hour M=minutes, just like in strftime.\nThe hour is in 24 hour notation.\n\nThe following are all valid dates specs, specifying the same date\n(in 2024 apr 15 at 00:00):\n\n    '2024-04-15' '2024-04-15+0:0' '04-15 04-15+00:00'\n\n## Testing:\n\n   All pytest cases pass successfully. Note that for the pytest client\ntests one needs to start the server. ('./pyvserv.py' or pyvserv if installed)\nThe server --port and --dataroot option can be used to start the server in\nan alternate 'universe', so it does not interfere with production.\n\n    ============================ test session starts ==============================\n    platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.0.0\n    rootdir: /home/<homedir>/pgpygtk/pyvserv\n    collected 15 items\n\n    test_afirst.py .                                                         [  6%]\n    test_file.py ..                                                          [ 20%]\n    test_hello.py .                                                          [ 26%]\n    test_help.py .                                                           [ 33%]\n    test_id.py .                                                             [ 40%]\n    test_key.py .                                                            [ 46%]\n    test_login.py .                                                          [ 53%]\n    test_noadmn.py .                                                         [ 60%]\n    test_rget.py .                                                           [ 66%]\n    test_rput.py .                                                           [ 73%]\n    test_sess.py ..                                                          [ 86%]\n    test_user.py .                                                           [ 93%]\n    test_ver.py .                                                            [100%]\n\n    ============================== 15 passed in 9.47s ==============================\n\nAdditional tests can be found in the tests/ directory. The pyvcli_* files in the\n'pyvclient' directory may also serve as test cases.\n\n## Production:\n\nOnce the testing phase is complete, deploying it for production needs a\ncomplete wipe of the data. There are Makefile targets that do that\n(make cleanall). Restarting the server will create the new environment without\nany users. To allow operation one may create the initial user with the pyvcli_uini\nfunctions and / or scripts. Make sure you create strong passwords.\nThe uini command can only operate successfully if there are no users present in the\npyvserv system, and it is executed from the loopback interface. For example,\nthe command line utility ./pyvcli_uini.py can be used;\nFor production, uini should executed with the -t option to prompt for a password.\n\n## Screen shots:\n\n Following, a set of screen shots to demonstrate the sub systems from entering\nvoter data, casting votes, monitoring vote servers, watching vote tallies.\n\n### Screen shot of the Monitoring tool:\n\n![Screen Shot](montool.png)\n\n This screen shot depicts the monitoring (control panel) application 'pyvcpanel'.\nThe top left area contains a live view of the pyvserver syslog. The top right\ncontains a live view of the replicator log.\n\n The bottom area of the window contains a live view of the incoming data, as it is\noriginally formatted, without the blockchain and hash details.\n\n  All views monitor the live log files, on the default setup. The montor functions\noperate, without interfering with any of the operations.\n\n### Screen shot of the Voter Entry tool:\n\n![Screen Shot](people.png)\n\nThe UUID fields serve identification of the voter, the organization hosting\nthe record entry, and the operator that entered this record.\n\n### Screen shot of the Ballot Editing tool:\n\n![Screen Shot](ballot.png)\n\nThe UUID fields serve identification of the ballot, the organization hosting\nthe ballot entry, and the operator that entered this record.\n\n### Screen shot of the Vote Casting tool:\n\n![Screen Shot](cast.png)\n\nThe vote choices are presented in random order, as recent studies show the\norder influences the voting process.\nThe UUID fields serve identification of the vote, the organization hosting\nthe ballot entry, and the operator that entered this record.\n\n## Windows compatibility\n\n  Pyvserv now functions in the Windows MSYS2 subsystem. All the major\nfunctionalities are ported. The file locking mechanism works, and all the\npytests pass. Naturally, logging and readline etc ... works with the usual\nwindows caveat.\n\n  For the GUI functions ona my need to install the PyGobject subsystem.\nInstructions can be found very easily for that.\n\nBelow, a screenshot of the pyvserv control panel in MSYS2.\n\n![Screen Shot](winscreen.png)\n\nThe project is functional in MSYS2, but for real deployment we recommend Linux.\n\n## History:\n\n Recent history kept, for the full list of changes consult the github site.\n\n    1.0.0   Sun 03.Mar.2024    Beta ready\n    1.0.0   Mon 11.Mar.2024    PIP installation with utils\n    1.0.0   Wed 13.Mar.2024    rget rput and family (rget=BC record get)\n    1.0.0   Thu 14.Mar.2024    Started GUI tools\n    1.0.1   Fri 15.Mar.2024    Added LIC, verification, doc, tally\n    1.0.3   Wed 03.Apr.2024    Ported to MSYS2, throttle, for multiprocess\n    1.0.4   Tue 09.Apr.2024    Cleanup, uman fman rman completed\n    1.0.4   Mon 06.May.2024    Progress on vote tools\n\n## Statistics\n\n    Project name\n        pyvserv\n    Generated\n        2024-04-09 20:45:56\n    Report Period\n        2018-12-31 20:50:04 to 2024-04-09 20:41:24\n    Age\n        1927 days, 111 active days (5.76%)\n    Total Files\n        211\n    Total Lines of Code\n        44443 (258657 added, 214214 removed)\n    Total Commits\n        257 (average 2.3 commits per active day, 0.1 per all days)\n    Authors\n        6 (average 42.8 commits per author)\n\n![Screen Shot](commits_by_year_month.png)\n\n## Security review:\n\n &nbsp;  As of today, (Fri 15.Mar.2024) the 256 bit AES is considered unbreakable by\navailable state of the art means. The key exchange algorithm ECC 384 bit is\nalso considered safe. These algorithms are used dynamically, as a randomly picked\nkey is used in every session. The session is also able to dynamically change keys\nmid flight, on command.\n\n &nbsp; The checksum verification and link verification both use SHA256 (256 bit)\nhashes. This is generated every time a transaction is created.\n\n &nbsp; The proof of work is a modest 3 generations deep. This can be calculated\nwith an everyday desktop in one ... to ... three seconds. Even though this looks like\na small amount, it adds up if one wants to re-generate (fake) a whole chain.\nAdditionally, the check sum, the link sum, and proof of work interact, changing one\nwill effect the other. This way a sum verification and link verification and the\nproof of work verification together create an ironclad safety solution.\n\nWritten by Peter Glen, 2022, 2023, 2024\nReleased under MIT License (MIT)\n\n// EOF\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "High power secure server with blockchain backend.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/pglen/pyvserv"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c8498472f8181f4cde3832b0c02366d5dfe87a228f451d6c180b0ed0c239d9e",
                "md5": "088031cdbba2f622c3cb9f5a2f96a906",
                "sha256": "3ef68b9e28af6cc16dbb8dc167cd22645450db01ba5a9f30feed699388c0e363"
            },
            "downloads": -1,
            "filename": "pyvserv-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "088031cdbba2f622c3cb9f5a2f96a906",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 746421,
            "upload_time": "2024-05-16T13:14:30",
            "upload_time_iso_8601": "2024-05-16T13:14:30.567902Z",
            "url": "https://files.pythonhosted.org/packages/7c/84/98472f8181f4cde3832b0c02366d5dfe87a228f451d6c180b0ed0c239d9e/pyvserv-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff14efdcfb2942884fcf76d3c7298b687ccf323fe8d2c5849324f26babfa7412",
                "md5": "d9281a173606e6c7c99de16b0d24d111",
                "sha256": "378410b1965a0d8c433e5a6137da890be0dc8b33ce32dde3d04d479b4e1d6ea9"
            },
            "downloads": -1,
            "filename": "pyvserv-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d9281a173606e6c7c99de16b0d24d111",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 370725,
            "upload_time": "2024-05-16T13:14:35",
            "upload_time_iso_8601": "2024-05-16T13:14:35.546678Z",
            "url": "https://files.pythonhosted.org/packages/ff/14/efdcfb2942884fcf76d3c7298b687ccf323fe8d2c5849324f26babfa7412/pyvserv-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-16 13:14:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pglen",
    "github_project": "pyvserv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyvserv"
}
        
Elapsed time: 0.27185s