Skip to content

Commit

Permalink
Merge pull request #11 from osg-htc/el9
Browse files Browse the repository at this point in the history
El9
  • Loading branch information
CannonLock committed Jul 1, 2024
2 parents 0d065d7 + 2069b8a commit 61c8185
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@

ARG IMAGE_BASE_TAG=release
ARG BASE_OSG_SERIES=23
ARG BASE_OS=el9
ARG BASE_YUM_REPO=release

FROM opensciencegrid/software-base:3.6-el7-$IMAGE_BASE_TAG
FROM opensciencegrid/software-base:$BASE_OSG_SERIES-$BASE_OS-$BASE_YUM_REPO

LABEL maintainer OSG Software <support@opensciencegrid.org>
LABEL maintainer OSG Software <help@osg-htc.org>

RUN \
yum update -y && \
yum install -y condor && \
yum install -y python3-pip httpd mod_auth_openidc mod_ssl python3-mod_wsgi && \
yum remove -y python3-requests && \
yum clean all && rm -rf /var/cache/yum/*

COPY portal run_local.sh requirements.txt /opt/portal/
Expand Down
6 changes: 6 additions & 0 deletions portal/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
from portal.website import website_bp
from portal.api import api_bp

from portal.template_filters import contact_us

BLUEPRINTS = [website_bp, api_bp]
CONTEXT_PROCESSORS = []
TEMPLATE_FILTERS = [contact_us]

if os.path.exists("config.py"):
HERE = os.getcwd() + "/"
Expand Down Expand Up @@ -74,6 +77,9 @@ def page_not_found(e):
for cp in CONTEXT_PROCESSORS:
app.context_processor(cp)

for tf in TEMPLATE_FILTERS:
app.add_template_filter(tf)

app.logger.debug("Created!")
return app

Expand Down
8 changes: 8 additions & 0 deletions portal/template_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from flask import Markup, current_app

def contact_us(text):
return Markup(
'<a href="mailto:{target}">{text}</a>'.format(
target=current_app.config["SUPPORT_EMAIL"], text=text
)
)
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pycparser==2.21
requests==2.28.1
sh==1.14.3
six==1.16.0
typing_extensions==4.3.0
urllib3==1.26.11
webassets==2.0
Werkzeug==2.2.1
Expand Down
10 changes: 1 addition & 9 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,14 @@
}
},
"handlers": {
"file": {
"class": "logging.handlers.RotatingFileHandler",
"level": "DEBUG",
"formatter": "default",
"filename": os.path.join(logdir, "registration.log"),
"maxBytes": 10485760,
"backupCount": 5,
},
"wsgi": {
"class": "logging.StreamHandler",
"level": "DEBUG",
"formatter": "default",
"stream": "ext://flask.logging.wsgi_errors_stream",
},
},
"root": {"level": "DEBUG", "handlers": ["file", "wsgi"]},
"root": {"level": "DEBUG", "handlers": ["wsgi"]},
}
)

Expand Down

0 comments on commit 61c8185

Please sign in to comment.