Merge pull request 'master' (#81) from master into dev
Reviewed-on: #81
This commit is contained in:
commit
15b05eb4cf
@ -2,7 +2,7 @@ FROM nginx
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install certbot --yes
|
RUN apt-get install certbot --yes
|
||||||
RUN apt-get install python3-certbot-nginx python3-pip --yes
|
RUN apt-get install python3-certbot-nginx python3-pip --yes
|
||||||
RUN pip3 install --break-system-packages requests minio
|
RUN pip3 install --break-system-packages minio
|
||||||
COPY ./config /etc/nginx
|
COPY ./config /etc/nginx
|
||||||
COPY ./fullchain.pem /etc/nginx/fullchain.pem
|
COPY ./fullchain.pem /etc/nginx/fullchain.pem
|
||||||
COPY ./privkey.pem /etc/nginx/privkey.pem
|
COPY ./privkey.pem /etc/nginx/privkey.pem
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
from requests import get
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
from urllib.request import urlopen
|
||||||
|
from json import loads
|
||||||
|
|
||||||
|
|
||||||
minio_client = Minio(
|
minio_client = Minio(
|
||||||
@ -11,10 +12,14 @@ minio_client = Minio(
|
|||||||
secure=False
|
secure=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get(url):
|
||||||
|
with urlopen('https://example.com') as response:
|
||||||
|
data = response.read().decode('utf-8')
|
||||||
|
return loads(data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = get('http://configurator/api/v1/fetch?project=certupdater&stage=development')
|
response = get('http://configurator/api/v1/fetch?project=certupdater&stage=development')
|
||||||
response.raise_for_status() # Raises an exception for HTTP errors
|
hosts = response['configs']['hosts']
|
||||||
hosts = response.json()['configs']['hosts']
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error fetching config: {e}", file=sys.stderr)
|
print(f"Error fetching config: {e}", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user