Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
py-kms no longer supports python2 (SystemRage#72)
Browse files Browse the repository at this point in the history
* Removed python2 references

* Removed python2 build files

* Typo

* Removed old python2 imports

* Added IPv6 note to README

Co-authored-by: Matteo ℱan <SystemRage@protonmail.com>
  • Loading branch information
simonmicro and SystemRage committed Jul 8, 2020
1 parent de61c66 commit 3d203cb
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 258 deletions.
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,38 @@ _py-kms_ is a port of node-kms created by [cyrozap](http://forums.mydigitallife.
- Microsoft Office 2016 ( Volume License )
- Microsoft Office 2019 ( Volume License )
- It's written in Python:
- tested with Python 2.7.15rc1
- tested with Python 3.6.7

# Dependencies
- Python 3.x or Python 2.7.x or Python 2.6.x with the `argparse` module installed.
- Python 3.x.
- Tkinter module.
- If the `tzlocal` module is installed, the "Request Time" in the verbose output will be converted into local time. Otherwise, it will be in UTC.
- It can use the `sqlite3` module so you can use the database function, storing activation data so it can be recalled again.
- Installation example on Ubuntu / Mint:
- `sudo apt-get update`
- for python3
- `sudo apt-get install python3-tk python3-pip`
- `sudo pip3 install tzlocal pysqlite3`
- or for python2
- `sudo apt-get install python-tk python-pip`
- `sudo pip install tzlocal pysqlite`

# Usage
- __NOTE__: Pay attention to how invoke scripts, if you want to run with python2 use `python...` while for python3 use `python3...`, also depending on the Python versions that resides in your PC.
- To start the server, execute `python pykms_Server.py [IPADDRESS] [PORT]`, the default _IPADDRESS_ is "0.0.0.0" ( all interfaces ) and the default _PORT_ is "1688".
- To run the client (only for testing purposes), use `python pykms_Client.py [IPADDRESS] [PORT]`, with the same defaults of `pykms_Server.py`.
- To show the help pages type: `python pykms_Server.py -h` and `python pykms_Client.py -h`.
- To generate a random HWID use `-w` option: `python pykms_Server.py -w RANDOM`.
- To get the HWID from any server use the client, for example type: `python pykms_Client.py 0.0.0.0 1688 -m Windows8.1 -V INFO`.
- To start the server, execute `python3 pykms_Server.py [IPADDRESS] [PORT]`, the default _IPADDRESS_ is `0.0.0.0` or `::` ( all interfaces ) and the default _PORT_ is "1688".
- To run the client (only for testing purposes), use `python3 pykms_Client.py [IPADDRESS] [PORT]`, with the same defaults of `pykms_Server.py`.
- To show the help pages type: `python3 pykms_Server.py -h` and `python3 pykms_Client.py -h`.
- To generate a random HWID use `-w` option: `python3 pykms_Server.py -w RANDOM`.
- To get the HWID from any server use the client, for example type: `python3 pykms_Client.py 0.0.0.0 1688 -m Windows8.1 -V INFO`.

- To change your logfile path use `-F` option, for example: `python pykms_Server.py -F /path/to/your/logfile.log -V DEBUG`.
- To view a minimal set of logging information use `-V MINI` option, for example: `python pykms_Server.py -F /path/to/your/logfile.log -V MINI`.
- To redirect logging on stdout use `-F STDOUT` option, for example: `python pykms_Server.py -F STDOUT -V DEBUG`.
- You can create logfile and view logging information on stdout at the same time with `-F FILESTDOUT` option, for example: `python pykms_Server.py -F FILESTDOUT /path/to/your/logfile.log -V DEBUG`.
- With `-F STDOUTOFF` you disable all stdout messages (but a logfile will be created), for example: `python pykms_Server.py -F STDOUTOFF /path/to/your/logfile.log -V DEBUG`.
- To change your logfile path use `-F` option, for example: `python3 pykms_Server.py -F /path/to/your/logfile.log -V DEBUG`.
- To view a minimal set of logging information use `-V MINI` option, for example: `python3 pykms_Server.py -F /path/to/your/logfile.log -V MINI`.
- To redirect logging on stdout use `-F STDOUT` option, for example: `python3 pykms_Server.py -F STDOUT -V DEBUG`.
- You can create logfile and view logging information on stdout at the same time with `-F FILESTDOUT` option, for example: `python3 pykms_Server.py -F FILESTDOUT /path/to/your/logfile.log -V DEBUG`.
- With `-F STDOUTOFF` you disable all stdout messages (but a logfile will be created), for example: `python3 pykms_Server.py -F STDOUTOFF /path/to/your/logfile.log -V DEBUG`.
- With `-F FILEOFF` you disable logfile creation.

- Select timeout (seconds) for py-kms with `-t0` option, for example `python pykms_Server.py -t0 10`.
- Select timeout (seconds) for py-kms with `-t0` option, for example `python3 pykms_Server.py -t0 10`.
- Option `-y` enables printing asynchronously of messages (pretty / logging).
- For launching py-kms GUI make executable `pykms_Server.py` file with `chmod +x /path/to/folder/py-kms/pykms_Server.py`, then simply run `pykms_Server.py` double-clicking.
- You can run py-kms daemonized (via [Etrigan](https://github.com/SystemRage/Etrigan)) using a command like: `python pykms_Server.py etrigan start` and stop it with: `python pykms_Server.py etrigan stop`.
- With Etrigan you have another way to launch py-kms GUI (specially suitable if you're using a virtualenv), so: `python pykms_Server.py etrigan start -g`
and stop the GUI with `python pykms_Server.py etrigan stop` (or interact with the EXIT button).
- You can run py-kms daemonized (via [Etrigan](https://github.com/SystemRage/Etrigan)) using a command like: `python3 pykms_Server.py etrigan start` and stop it with: `python3 pykms_Server.py etrigan stop`.
- With Etrigan you have another way to launch py-kms GUI (specially suitable if you're using a virtualenv), so: `python3 pykms_Server.py etrigan start -g`
and stop the GUI with `python3 pykms_Server.py etrigan stop` (or interact with the EXIT button).

# Docker
![auto-docker](https://img.shields.io/docker/cloud/automated/pykmsorg/py-kms)
Expand All @@ -71,8 +65,7 @@ There are three tags of the images available:

* `latest`, currently the same like minimal...
* `minimal`, wich is based on the python3 minimal configuration of py-kms. _This image does NOT include SQLLite support!_
* `python2`, which is fully configurable and equiped with SQLLite support and web interface.
* `python3`, which is like the `python2` tag - just with Python 3...
* `python3`, which is fully configurable and equiped with SQLLite support and web interface.

If you just want to use the image and don't want to build them yourself, you can use the official image at the docker hub (`pykmsorg/py-kms`).
To ensure that the image is always up-to-date you should check [watchtower](https://github.com/containrrr/watchtower) out!
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ ENV LOGFILE /var/log/pykms_logserver.log
# EN: log file size in MB
# RU: Максимальный размер Лог-файл в мегабайтах
ENV LOGSIZE ""
# Use this flag to set a maximum size (in MB) to the output log file. Desactivated by default.
# Use this flag to set a maximum size (in MB) to the output log file. Deactivated by default.
```
119 changes: 0 additions & 119 deletions docker/docker-py2-kms/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions docker/docker-py2-kms/build-py2-kms.sh

This file was deleted.

17 changes: 0 additions & 17 deletions docker/docker-py2-kms/run-py2-kms.sh

This file was deleted.

52 changes: 0 additions & 52 deletions docker/docker-py2-kms/start.sh

This file was deleted.

21 changes: 5 additions & 16 deletions py-kms/pykms_GuiBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,11 @@
import sys
import threading
from time import sleep

try:
# Python 2.x imports
import Tkinter as tk
import ttk
import tkMessageBox as messagebox
import tkFileDialog as filedialog
import tkFont
except ImportError:
# Python 3.x imports
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import tkinter.font as tkFont

import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import tkinter.font as tkFont
from pykms_Server import srv_options, srv_version, srv_config, server_terminate, serverqueue, serverthread
from pykms_GuiMisc import ToolTip, TextDoubleScroll, TextRedirect, ListboxOfRadiobuttons
from pykms_GuiMisc import custom_background, custom_pages
Expand Down
15 changes: 3 additions & 12 deletions py-kms/pykms_GuiMisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@
from collections import Counter
from time import sleep
import threading

try:
# Python 2.x imports
import Tkinter as tk
import ttk
import tkFont
except ImportError:
# Python 3.x imports
import tkinter as tk
from tkinter import ttk
import tkinter.font as tkFont

import tkinter as tk
from tkinter import ttk
import tkinter.font as tkFont
from pykms_Format import MsgMap, unshell_message, unformat_message

#------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down
18 changes: 4 additions & 14 deletions py-kms/pykms_Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,10 @@
import os
import threading
import pickle

try:
# Python 2 import.
import SocketServer as socketserver
import Queue as Queue
import pykms_Selectors as selectors
from pykms_Time import monotonic as time
except ImportError:
# Python 3 import.
import socketserver
import queue as Queue
import selectors
from time import monotonic as time

import socketserver
import queue as Queue
import selectors
from time import monotonic as time
import pykms_RpcBind, pykms_RpcRequest
from pykms_RpcBase import rpcBase
from pykms_Dcerpc import MSRPCHeader
Expand Down

0 comments on commit 3d203cb

Please sign in to comment.