§
½@¾jX. ã óø — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm Z m
Z
d dlZd dl
mZ dZdZdZdZej e¦ « ZdZej ed ¦ « Zej ed
¦ « Zej ed¦ « ZdZd
ZdZdZeddœeddœdœZdZ G d„ d¦ « Z! e!¦ « Z"de#fd„Z$de#de%fd„Z&d„ Z'd„ Z(d„ Z)d„ Z*d„ Z+d „ Z,d!„ Z-d"„ Z.dS )#é N)ÚerrorÚrequest)Úmod_makedirsz/usr/sbin/rhn_checkz/usr/sbin/rhnreg_ksz--activationkey=-z/var/lve/lveinfo.verz/etc/sysconfig/rhnÚsystemidz jwt.tokenÚjwt_last_update_tsi€ô i@8 z1/usr/share/cloudlinux/no_valid_license_screen.txtz3/usr/share/cloudlinux/license_out_of_date_email.txtz3Error: License out of date, email template missing.)Ú
template_fileÚ error_msgz3Error: No valid license found, template is missing.)ÚEmailÚNoValidz!https://cloudlinux.com/showip.phpc óN — e Zd ZdZdZdZed„ ¦ « Zd„ Zd„ Z d„ Z
d„ Zd„ ZdS ) ÚLicenseDataÚ c ój — t j t ¦ « r£t j t ¦ « sdS t t j t ¦ « ¦ « }|t t j ¦ « ¦ « t z
k rdS t t ¦ « }||k rdS dS t j t ¦ « rGt j t ¦ « }|t j | ¦ « k S dS )aý
Update license when:
in case JWT token present:
- if no timestamp file with jwt token last update time
- if jwt token was not updated during last 4 hours
- if jwt token was updated later than our timestamp in file
in case JWT token is not present, but systemid exists
(fallback for licensing w/o token)
- update license only if systemid was changed after last timestamp update
when no jwt and no systemid - re-update license
TF)ÚosÚpathÚexistsÚ JWT_TOKENÚJWT_TOKEN_TIMESTAMP_FILEÚintÚgetmtimeÚtimeÚJWT_UPDATE_INTERVALÚread_time_from_fileÚRHN_SYSTEMID)Úlicense_timestamp_fileÚrhn_updatedÚjwt_last_update_timestamps úpy/cllicenselib.pyÚ_is_license_needs_updatez$LicenseData._is_license_needs_updateR sè € õ Œ7�>Š>�)Ñ$Ô$ð Ý”7—>’>Õ":Ñ;Ô;ð
Ø�tÝ�bœg×.Ò.yÑ9Ô9Ñ:Ô:ˆKØ�S¥¤¡¤Ñ-Ô-Õ0CÑCÒCÐCØ�tÝ(;Õ