Compare commits

..

No commits in common. "68fe0600293526a36de6ca53e6dbcbee92947de0" and "7fb06749765492dd90a1c1b4eaf73f44a4c207cb" have entirely different histories.

3 changed files with 13 additions and 16 deletions

View File

@ -5,7 +5,7 @@ Disables the "No valid subscription" dialog on all Proxmox products.
## Features ## Features
Works for: Works for:
- Proxmox VE (5.x or later, tested up to 7.2) - Proxmox VE (5.x or later, tested up to 7.0)
- Proxmox Mail Gateway (5.x or later) - Proxmox Mail Gateway (5.x or later)
- Proxmox Backup Server (1.x) - Proxmox Backup Server (1.x)
@ -49,6 +49,6 @@ Run everything as root on a Debian 10 system:
```shell ```shell
apt-get install ruby ruby-dev rubygems build-essential apt-get install ruby ruby-dev rubygems build-essential
gem install fpm gem install --no-ri --no-rdoc fpm
./package.sh ./package.sh
``` ```

View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
set -Eeuo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1 cd "$( dirname "${BASH_SOURCE[0]}" )"
fpm -s dir -t deb --force \ fpm -s dir -t deb --force \
-n pve-fake-subscription \ -n pve-fake-subscription \
--description "Pollute the subscription cache of Proxmox VE (>=5.0), Proxmox Mail Gateway (>=5.0) & Proxmox Backup Server (>=1.0) so it won't alert you on dashboard login" \ --description "Pollute the subscription cache of Proxmox VE (>=5.0), Proxmox Mail Gateway (>=5.0) & Proxmox Backup Server (>=1.0) so it won't alert you on dashboard login" \
--url "https://github.com/Jamesits/pve-fake-subscription" \ --url "https://github.com/Jamesits/pve-fake-subscription" \
-v 0.0.8 \ -v 0.0.7 \
--license "GLWTS(Good Luck With That Shit) Public License" \ --license "GLWTS(Good Luck With That Shit) Public License" \
--depends "python3" \ --depends "python3" \
--architecture all \ --architecture all \

View File

@ -32,9 +32,6 @@ def md5_base64_rs(x: str) -> str:
def generate_server_id(key: str) -> str: def generate_server_id(key: str) -> str:
return hashlib.md5(key.encode()).hexdigest().upper() return hashlib.md5(key.encode()).hexdigest().upper()
def dt_string(format: str, offset_secs: int = 0) -> str:
return (datetime.now() + timedelta(seconds=offset_secs)).strftime(format)
def generate_subscription_pve_pmg(key: str, server_ids: List[str]) -> str: def generate_subscription_pve_pmg(key: str, server_ids: List[str]) -> str:
localinfo = { localinfo = {
"checktime": get_timestamp(), "checktime": get_timestamp(),
@ -42,8 +39,8 @@ def generate_subscription_pve_pmg(key: str, server_ids: List[str]) -> str:
"key": key, "key": key,
"validdirectory": ",".join(server_ids), "validdirectory": ",".join(server_ids),
"productname": "YajuuSenpai", "productname": "YajuuSenpai",
"regdate": dt_string("%Y-%m-%d %H:%M:%S"), "regdate": get_timestamp(),
"nextduedate": dt_string("%Y-%m-%d", 1296000), "nextduedate": 2147483647,
} }
data = base64.standard_b64encode(json.dumps(localinfo).encode()).decode() data = base64.standard_b64encode(json.dumps(localinfo).encode()).decode()
@ -82,8 +79,8 @@ def generate_subscription_pbs(key: str, server_ids: List[str]) -> str:
"key": key, "key": key,
"message": "Yajuu Senpai has got your back", "message": "Yajuu Senpai has got your back",
"productname": "YajuuSenpai", "productname": "YajuuSenpai",
"regdate": dt_string("%Y-%m-%d %H:%M:%S"), "regdate": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
"nextduedate": dt_string("%Y-%m-%d", 1296000), # 1296000: MAX_LOCAL_KEY_AGE in src/tools/subscription.rs "nextduedate": (datetime.now() + timedelta(seconds=1296000)).strftime("%Y-%m-%d"), # 1296000: MAX_LOCAL_KEY_AGE in src/tools/subscription.rs
"url": "https://github.com/Jamesits/pve-fake-subscription", "url": "https://github.com/Jamesits/pve-fake-subscription",
} }