nu (ν)
Running
Configuration
The application can be configured using a .env
file. Here are the available options:
RESPONSE_TIMEOUT
-
Specifies the response timeout in seconds.
-
Default:
5
-
Example:
RESPONSE_TIMEOUT=5
CLIENT_IDLE_TIMEOUT
-
Defines the client idle timeout in seconds.
-
Default:
60
-
Example:
CLIENT_IDLE_TIMEOUT=60
VERBOSITY
-
Determines the logging verbosity level.
-
Valid values: DEBUG, INFO, WARNING, ERROR, CRITICAL.
-
Default:
INFO
-
Example:
VERBOSITY=DEBUG
SCAN_PORT_RANGE
-
Defines the port range to scan as
PORT:PORT
separated by colon (:
). -
The ports must be valid and there must be exactly two of them.
-
Example:
SCAN_PORT_RANGE=65525:65535
IP
-
Manually set the IP address.
-
Example:
IP=127.0.0.1
Running
The application requires a few dependenices, specified in requirements.txt
.
To install these dependencies run
pip install -r requirements.txt
Upon successful installation, the program is ready to run. The database used is SQLite, hence no SQL structure is needed to be imported, nor are any credentials required.
To run the app, run
python src/app.py
If the verbosity set in .env
is DEBUG
, the program will print many useful descriptions of it's actions together with a detailed location of the action including file, line and process name.
Definitions
The program uses the following protocol over TCP
Operation | Request Format | Response Format |
---|---|---|
Bank code | BC | BC <ip> |
Account create | AC <account>/<ip> | AC |
Account deposit | AD <account>/<ip> <number> | AD |
Account withdrawal | AW <account>/<ip> <number> | AW |
Account balance | AB <account>/<ip> | AB <number> |
Account remove | AR <account>/<ip> | AR |
Bank (total) amount | BA | BA <number> |
Bank number of clients | BN | BN <number> |
Any of these commands may return an error message in format
ER <message>
Sources
Signal catching
- Catch SIGTERM
- Windows termination signals
Get ENUM name from value
Unused because of required compatibility with lower version python (3.9)