Compare commits

..

No commits in common. "7535d8bb037cacc483d5859d5bc26ef3358c7bb7" and "06d923e0426f7781142451590ed6238503121bf6" have entirely different histories.

3 changed files with 4 additions and 18 deletions

View file

@ -7,13 +7,9 @@ COPY README.md README.md
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
COPY LICENSE LICENSE COPY LICENSE LICENSE
RUN apk add --no-cache curl
RUN python -m pip install --upgrade pip RUN python -m pip install --upgrade pip
RUN python -m pip install --no-cache-dir -r requirements.txt RUN python -m pip install --no-cache-dir -r requirements.txt
CMD ["python", "src/main.py"] CMD ["python", "src/main.py"]
HEALTHCHECK --interval=1m --timeout=30s --start-period=10s --retries=3 CMD curl -f http://localhost:80 || exit 1
EXPOSE 80 EXPOSE 80

View file

@ -45,6 +45,10 @@ if not config.artifact_names:
app = Flask(__name__, template_folder='templates') app = Flask(__name__, template_folder='templates')
@app.route('/')
def index():
return render_template('404.html')
async def fetch_tasks(): async def fetch_tasks():
url = f'{config.base_url}/api/v1/repos/{config.user}/{config.repo}/actions/tasks' url = f'{config.base_url}/api/v1/repos/{config.user}/{config.repo}/actions/tasks'
headers = { headers = {
@ -87,10 +91,6 @@ for artifact_name in config.artifact_names:
endpoint = f'handle_{artifact_name}' endpoint = f'handle_{artifact_name}'
app.add_url_rule(route, view_func=create_handle_artifact(artifact_name), endpoint=endpoint) app.add_url_rule(route, view_func=create_handle_artifact(artifact_name), endpoint=endpoint)
@app.route('/')
def index():
return render_template('index.html', artifact_urls=[f'/{artifact_name}/GalacticFactory' for artifact_name in config.artifact_names])
def handle_sigterm(*args): def handle_sigterm(*args):
print("Received SIGTERM, exiting gracefully...") print("Received SIGTERM, exiting gracefully...")
sys.exit(0) sys.exit(0)

View file

@ -1,10 +0,0 @@
{% block body %}
<h1>GalacticFactory Downloader</h1>
<p>Welcome to the download site for the GalacticFactory modpack!</p>
<p>The links below link to the available artifacts:</p>
<ul>
{% for artifact_url in artifact_urls %}
<li><a href="{{ artifact_url }}">{{ artifact_url }}</a></li>
{% endfor %}
</ul>
{% endblock %}