-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM alpine | ||
RUN apk -U upgrade && apk add --no-cache py3-pip curl &&\ | ||
pip3 install --no-cache-dir --upgrade pip --break-system-packages &&\ | ||
pip3 install --no-cache-dir flask requests --break-system-packages &&\ | ||
rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /code | ||
ADD . /code | ||
EXPOSE 5000 | ||
|
||
CMD ["python3", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from flask import Flask, render_template, request, jsonify, redirect, url_for | ||
|
||
import os | ||
import requests | ||
import json | ||
|
||
version = "0.1" | ||
app = Flask(__name__) | ||
|
||
@app.route('/json', methods=['GET']) | ||
def json_all_the_things(): | ||
rke_data = json.loads(requests.get("https://update.rke2.io/v1-release/channels").text) | ||
rke_out = json.dumps(rke_data["data"][0]["latest"]).replace('"', '') | ||
|
||
cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest").text) | ||
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '') | ||
|
||
rancher_data = json.loads(requests.get("https://api.github.com/repos/rancher/rancher/releases/latest").text) | ||
rancher_out = json.dumps(rancher_data["tag_name"]).replace('"', '') | ||
|
||
longhorn_data = json.loads(requests.get("https://api.github.com/repos/longhorn/longhorn/releases/latest").text) | ||
longhorn_out = json.dumps(longhorn_data["tag_name"]).replace('"', '') | ||
|
||
neuvector_data = json.loads(requests.get("https://api.github.com/repos/neuvector/neuvector/releases/latest").text) | ||
neuvector_out = json.dumps(neuvector_data["tag_name"]).replace('"', '') | ||
|
||
harvester_data = json.loads(requests.get("https://api.github.com/repos/harvester/harvester/releases/latest").text) | ||
harvester_out = json.dumps(harvester_data["tag_name"]).replace('"', '') | ||
|
||
hauler_data = json.loads(requests.get("https://api.github.com/repos/rancherfederal/hauler/releases/latest").text) | ||
hauler_out = json.dumps(hauler_data["tag_name"]).replace('"', '') | ||
|
||
k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text) | ||
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '') | ||
|
||
return jsonify({'k3s': k3s_out, 'rke2': rke_out, 'cert-manager': cert_out, 'rancher': rancher_out, 'longhorn': longhorn_out, 'neuvector': neuvector_out, 'harvester': harvester_out, 'hauler': hauler_out}), 200 | ||
|
||
@app.route('/', methods=['GET']) | ||
def curl_all_the_things(): | ||
rke_data = json.loads(requests.get("https://update.rke2.io/v1-release/channels").text) | ||
rke_out = json.dumps(rke_data["data"][0]["latest"]).replace('"', '') | ||
|
||
cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest").text) | ||
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '') | ||
|
||
rancher_data = json.loads(requests.get("https://api.github.com/repos/rancher/rancher/releases/latest").text) | ||
rancher_out = json.dumps(rancher_data["tag_name"]).replace('"', '') | ||
|
||
longhorn_data = json.loads(requests.get("https://api.github.com/repos/longhorn/longhorn/releases/latest").text) | ||
longhorn_out = json.dumps(longhorn_data["tag_name"]).replace('"', '') | ||
|
||
neuvector_data = json.loads(requests.get("https://api.github.com/repos/neuvector/neuvector/releases/latest").text) | ||
neuvector_out = json.dumps(neuvector_data["tag_name"]).replace('"', '') | ||
|
||
harvester_data = json.loads(requests.get("https://api.github.com/repos/harvester/harvester/releases/latest").text) | ||
harvester_out = json.dumps(harvester_data["tag_name"]).replace('"', '') | ||
|
||
hauler_data = json.loads(requests.get("https://api.github.com/repos/rancherfederal/hauler/releases/latest").text) | ||
hauler_out = json.dumps(hauler_data["tag_name"]).replace('"', '') | ||
|
||
k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text) | ||
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '') | ||
|
||
return render_template('index.html', rancher_ver=rancher_out, rke2_ver=rke_out, k3s_ver=k3s_out, longhorn_ver=longhorn_out, neu_ver=neuvector_out, cert_ver=cert_out, harv_ver=harvester_out, hauler_ver=hauler_out) | ||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0',debug=False) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Latest Rancher Stack Versions</title> | ||
<link rel="stylesheet" href="/static/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
<center> | ||
<br> | ||
<h2>Latest Rancher Stack Versions</h2> | ||
<div class="container mt-5"> | ||
<table class="table"> | ||
<tbody> | ||
<tr> | ||
<td>Rke2</td> | ||
<td>{{rke2_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>K3s</td> | ||
<td>{{k3s_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>Rancher</td> | ||
<td>{{rancher_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>Longhorn</td> | ||
<td>{{longhorn_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>NeuVector</td> | ||
<td>{{neu_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>Harvester</td> | ||
<td>{{harv_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>Hauler</td> | ||
<td>{{hauler_ver}}</td> | ||
</tr> | ||
<tr> | ||
<td>Cert-Manager</td> | ||
<td>{{cert_ver}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<br><br> | ||
json : <a href="https://dzver.rfed.io/json">https://dzver.rfed.io/json</a> | ||
</div> | ||
</center> | ||
</body> | ||
</html> |