mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-13 06:34:45 -04:00
Removed sqliteweb support
This commit is contained in:
parent
fdf1445187
commit
5a8a21abda
6 changed files with 1 additions and 38 deletions
|
@ -47,7 +47,6 @@ For more information please refer to the Helm Install command documentation loca
|
|||
| py-kms.environment.IP | string | `"::"` | |
|
||||
| py-kms.environment.LOGLEVEL | string | `"INFO"` | |
|
||||
| py-kms.environment.LOGSIZE | int | `2` | |
|
||||
| py-kms.environment.SQLITE | bool | `true` | |
|
||||
| replicaCount | int | `1` | |
|
||||
| resources | object | `{}` | |
|
||||
| securityContext | object | `{}` | |
|
||||
|
|
|
@ -20,7 +20,6 @@ py-kms:
|
|||
LOGSIZE: 2
|
||||
LOGFILE: /var/log/py-kms.log
|
||||
HWID: RANDOM
|
||||
SQLITE: true
|
||||
IP: '::'
|
||||
|
||||
serviceAccount: {}
|
||||
|
|
|
@ -8,8 +8,6 @@ ENV LCID 1033
|
|||
ENV CLIENT_COUNT 26
|
||||
ENV ACTIVATION_INTERVAL 120
|
||||
ENV RENEWAL_INTERVAL 10080
|
||||
ENV SQLITE true
|
||||
ENV SQLITE_PORT 8080
|
||||
ENV HWID RANDOM
|
||||
ENV LOGLEVEL INFO
|
||||
ENV LOGFILE STDOUT
|
||||
|
@ -43,7 +41,6 @@ RUN chmod 755 /usr/bin/entrypoint.py
|
|||
WORKDIR /home/py-kms
|
||||
|
||||
EXPOSE ${PORT}/tcp
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=5m --timeout=3s --start-period=10s --retries=4 CMD echo | nc -z ${IP%% *} ${PORT} || exit 1
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@ argumentVariableMapping = {
|
|||
'-e': 'EPID'
|
||||
}
|
||||
|
||||
sqliteWebPath = '/home/sqlite_web/sqlite_web.py'
|
||||
enableSQLITE = os.environ.get('SQLITE', 'false').lower() == 'true' and os.environ.get('TYPE') != 'MINIMAL'
|
||||
dbPath = os.path.join(os.sep, 'home', 'py-kms', 'db', 'pykms_database.db')
|
||||
log_level_bootstrap = log_level = os.environ.get('LOGLEVEL', 'INFO')
|
||||
if log_level_bootstrap == "MININFO":
|
||||
|
@ -29,7 +27,6 @@ if log_level_bootstrap == "MININFO":
|
|||
log_file = os.environ.get('LOGFILE', 'STDOUT')
|
||||
listen_ip = os.environ.get('IP', '::').split()
|
||||
listen_port = os.environ.get('PORT', '1688')
|
||||
sqlite_port = os.environ.get('SQLITE_PORT', '8080')
|
||||
|
||||
|
||||
def start_kms_client():
|
||||
|
@ -48,7 +45,6 @@ def start_kms_client():
|
|||
|
||||
|
||||
def start_kms():
|
||||
sqlite_process = None
|
||||
# Build the command to execute
|
||||
command = [PYTHON3, '-u', 'pykms_Server.py', listen_ip[0], listen_port]
|
||||
for (arg, env) in argumentVariableMapping.items():
|
||||
|
@ -61,25 +57,9 @@ def start_kms():
|
|||
command.append("-n")
|
||||
command.append(listen_ip[i] + "," + listen_port)
|
||||
|
||||
if enableSQLITE:
|
||||
loggersrv.info("Storing database file to %s" % dbPath)
|
||||
command.append('-s')
|
||||
command.append(dbPath)
|
||||
os.makedirs(os.path.dirname(dbPath), exist_ok=True)
|
||||
|
||||
loggersrv.debug("server_cmd: %s" % (" ".join(str(x) for x in command).strip()))
|
||||
pykms_process = subprocess.Popen(command)
|
||||
|
||||
# In case SQLITE is defined: Start the web interface
|
||||
if enableSQLITE:
|
||||
time.sleep(5) # The server may take a while to start
|
||||
start_kms_client()
|
||||
sqlite_cmd = ['sqlite_web', '-H', listen_ip[0], '--read-only', '-x',
|
||||
dbPath, '-p', sqlite_port]
|
||||
|
||||
loggersrv.debug("sqlite_cmd: %s" % (" ".join(str(x) for x in sqlite_cmd).strip()))
|
||||
sqlite_process = subprocess.Popen(sqlite_cmd)
|
||||
|
||||
try:
|
||||
pykms_process.wait()
|
||||
except Exception:
|
||||
|
@ -88,8 +68,6 @@ def start_kms():
|
|||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
if enableSQLITE:
|
||||
if None != sqlite_process: sqlite_process.terminate()
|
||||
pykms_process.terminate()
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ services:
|
|||
- 8080:8080
|
||||
environment:
|
||||
- IP='::'
|
||||
- SQLITE=true
|
||||
- HWID=RANDOM
|
||||
- LOGLEVEL=INFO
|
||||
restart: always
|
||||
|
@ -62,7 +61,6 @@ Below is a little bit more extended run command, detailing all the different sup
|
|||
docker run -it -d --name py3-kms \
|
||||
-p 8080:8080 \
|
||||
-p 1688:1688 \
|
||||
-e SQLITE=true \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
--restart unless-stopped ghcr.io/py-kms-organization/py-kms:[TAG]
|
||||
```
|
||||
|
|
|
@ -230,14 +230,6 @@ ENV ACTIVATION_INTERVAL 120
|
|||
# Use this flag to specify the renewal interval (in minutes). Default is 10080 minutes (7 days).
|
||||
ENV RENEWAL_INTERVAL 10080
|
||||
|
||||
# Use SQLITE
|
||||
# Use this flag to store request information from unique clients in an SQLite database.
|
||||
ENV SQLITE false
|
||||
|
||||
# TCP-port
|
||||
# The network port to listen with the web interface on. The default is "8080".
|
||||
ENV SQLITE_PORT 8080
|
||||
|
||||
# hwid
|
||||
# Use this flag to specify a HWID.
|
||||
# The HWID must be an 16-character string of hex characters.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue