Skip to content

Commit

Permalink
Merge pull request #216 from eurofurence/issue-213-ef-2024-part2
Browse files Browse the repository at this point in the history
Issue 213 ef 2024 part2
  • Loading branch information
Jumpy-Squirrel committed Dec 22, 2023
2 parents d12c8aa + 1c864f1 commit bdd3876
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 54 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ RUN apk add --no-cache apache2 apache2-http2 apache2-proxy \
&& mkdir -p /static-html/htdocs

COPY ./httpd-container.conf /etc/apache2/regsys.conf
COPY ./public /static-html/regsys/app

# TODO set up minimal base website under /static-html/
# (favicon, 404.html, blank white page index.html, ...)
COPY ./public /static-html/reg-frontend/app
COPY ./html /static-html/reg-frontend

RUN chmod -R go=rX /static-html /etc/apache2/regsys.conf

RUN find /static-html
RUN mkdir -p /run/apache2 && chmod 777 /run/apache2

EXPOSE 8080

USER 8877

CMD ["/usr/sbin/httpd", "-f", "/etc/apache2/regsys.conf"]
CMD ["/usr/sbin/httpd", "-f", "/etc/apache2/regsys.conf", "-DNO_DETACH", "-DFOREGROUND"]
8 changes: 8 additions & 0 deletions html/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<title>Not found!</title>
</head>
<body bgcolor="white">
<p>The requested resource is not available.</p>
</body>
</html>
Binary file added html/favicon.ico
Binary file not shown.
7 changes: 7 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>
<head>
<title>Nothing here!</title>
<meta http-equiv="expires" content="0"/>
</head>
<body bgcolor="white">OK</body>
</html>
103 changes: 56 additions & 47 deletions httpd-container.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ ServerTokens OS
ServerRoot /static-html
Listen 8080

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
# LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_http2_module modules/mod_proxy_http2.so
LoadModule mpm_prefork_module /usr/lib/apache2/mod_mpm_prefork.so
LoadModule authn_file_module /usr/lib/apache2/mod_authn_file.so
LoadModule authn_core_module /usr/lib/apache2/mod_authn_core.so
LoadModule authz_host_module /usr/lib/apache2/mod_authz_host.so
LoadModule authz_groupfile_module /usr/lib/apache2/mod_authz_groupfile.so
LoadModule authz_user_module /usr/lib/apache2/mod_authz_user.so
LoadModule authz_core_module /usr/lib/apache2/mod_authz_core.so
LoadModule access_compat_module /usr/lib/apache2/mod_access_compat.so
LoadModule auth_basic_module /usr/lib/apache2/mod_auth_basic.so
LoadModule reqtimeout_module /usr/lib/apache2/mod_reqtimeout.so
LoadModule filter_module /usr/lib/apache2/mod_filter.so
LoadModule substitute_module /usr/lib/apache2/mod_substitute.so
LoadModule mime_module /usr/lib/apache2/mod_mime.so
LoadModule log_config_module /usr/lib/apache2/mod_log_config.so
LoadModule env_module /usr/lib/apache2/mod_env.so
LoadModule headers_module /usr/lib/apache2/mod_headers.so
LoadModule setenvif_module /usr/lib/apache2/mod_setenvif.so
LoadModule version_module /usr/lib/apache2/mod_version.so
LoadModule unixd_module /usr/lib/apache2/mod_unixd.so
LoadModule status_module /usr/lib/apache2/mod_status.so
LoadModule autoindex_module /usr/lib/apache2/mod_autoindex.so
LoadModule dir_module /usr/lib/apache2/mod_dir.so
# LoadModule alias_module /usr/lib/apache2/mod_alias.so
LoadModule rewrite_module /usr/lib/apache2/mod_rewrite.so

LoadModule negotiation_module /usr/lib/apache2/mod_negotiation.so

LoadModule proxy_module /usr/lib/apache2/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/mod_proxy_http.so
# LoadModule proxy_http2_module /usr/lib/apache2/mod_proxy_http2.so

ServerAdmin ${HTTPD_CONF_SERVER_ADMIN_EMAIL}
ServerSignature Off
Expand Down Expand Up @@ -91,36 +91,45 @@ LogLevel warn
Allow from all
</Proxy>

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/regsys http://reg-regsys-classic:8080
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/regsys http://reg-regsys-classic:8080
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/regsys http://regsys-classic:8080 disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/regsys http://regsys-classic:8080

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/attsrv/ http://reg-attendee-service:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/attsrv/ http://reg-attendee-service:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/attsrv/ http://attendee-service:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/attsrv/ http://attendee-service:8080/

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/roomsrv/ http://reg-room-service:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/roomsrv/ http://reg-room-service:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/authsrv/ http://auth-service:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/authsrv/ http://auth-service:8080/

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/authsrv/ http://reg-auth-service:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/authsrv/ http://reg-auth-service:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/cncrdsrv/ http://payment-cncrd-adapter:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/cncrdsrv/ http://payment-cncrd-adapter:8080/

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/paysrv/ http://reg-payment-service:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/paysrv/ http://reg-payment-service:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/mailsrv/ http://mail-service:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/mailsrv/ http://mail-service:8080/

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/cncrdsrv/ http://reg-payment-cncrd-adapter:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/cncrdsrv/ http://reg-payment-cncrd-adapter:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/roomsrv/ http://room-service:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/roomsrv/ http://room-service:8080/

# ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/expsrv/ http://reg-export-service:8080/
# ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/expsrv/ http://reg-export-service:8080/

ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/mailsrv/ http://reg-mail-service:8080/
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/mailsrv/ http://reg-mail-service:8080/
ProxyPass /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/paysrv/ http://payment-service:8080/ disablereuse=On
ProxyPassReverse /${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/paysrv/ http://payment-service:8080/

# configuration for reg-frontend

RewriteEngine on

# special rules to prevent deep reloads and base link without trailing /
RewriteRule "^/${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/app/register/[a-z-]+/.*$" "/${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/app/register/index.html"
RewriteRule "^/${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/app/register$" "/${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/app/register/index.html"

# we have built the gatsby static app with this context base path, so we use inline content substitution
# and a rewrite rule

RewriteRule "^/${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}/app/(.*)$" "/app/$1"

AddOutputFilterByType SUBSTITUTE text/html
AddOutputFilterByType SUBSTITUTE application/javascript
AddOutputFilterByType SUBSTITUTE text/css
AddOutputFilterByType SUBSTITUTE text/javascript
SubstituteMaxLineLength 5M
Substitute "s|aN3nNFwFoi5QkyPaVJ54dDTDc6HrrCYGAL6U6GUuyV2uvvekgOxqYe6K2hur|${HTTPD_CONF_PATH_PREFIX_NO_SLASHES}|n"

ErrorLog /dev/stdout
Expand Down
19 changes: 19 additions & 0 deletions src/components/funnels/funnels/register/steps/ticket/level.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ReadonlyRouteComponentProps } from '~/util/readonly-types'
import { useAppSelector } from '~/hooks/redux'
import { getTicketType } from '~/state/selectors/register'
import { createLuxonFluentDateTime } from '~/util/fluent-values'
import TicketLevelFootnote from '~/components/funnels/funnels/register/steps/ticket/level/footnote'

const TicketLevelGrid = styled.section`
display: grid;
Expand All @@ -25,6 +26,10 @@ const TicketLevelGrid = styled.section`
}
`

const ModifiersSection = styled.section`
margin-top: 1em;
`

const AddonsSection = styled.section`
margin-top: 4.5em;
`
Expand Down Expand Up @@ -71,6 +76,20 @@ const TicketLevel = (_: ReadonlyRouteComponentProps) => {
</RadioGroup>
</TicketLevelGrid>
</section>
<ModifiersSection>
<Localized id="register-ticket-level-modifiers-early-bird" attrs={{ label: true, description: true, price: true }}>
<TicketLevelFootnote
marker="*"
label="Early Bird Discount"
price="-5" ></TicketLevelFootnote>
</Localized>
<Localized id="register-ticket-level-modifiers-at-door" attrs={{ label: true, description: true, price: true }}>
<TicketLevelFootnote
marker=""
label="At the Door"
price="+10" ></TicketLevelFootnote>
</Localized>
</ModifiersSection>
<AddonsSection>
<Localized id="register-ticket-level-addons-title"><h3>Select add-ons</h3></Localized>
<AddonsContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const TicketLevelCard = forwardRef(({ id, price, priceLabel, children, ...rest }
<PriceLabelContainer>
<PriceLabel>{priceLabel}</PriceLabel>
</PriceLabelContainer>
<Price price={price}/>
<Price price={price}/>*
</Footer>
</RadioCard>,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import styled from '@emotion/styled'
import { MediaQueries } from '@eurofurence/reg-component-library'

export type TicketLevelFootnoteProps = {
readonly marker: string
readonly label: string
readonly price: string
}

const Container = styled.section`
display: grid;
@media ${MediaQueries.phone}, ${MediaQueries.tablet} {
grid: "marker label price" auto
/ 1fr auto;
}
@media ${MediaQueries.laptop}, ${MediaQueries.desktop} {
grid: "marker label price" auto
/ fit-content(60rem) auto;
}
gap: 0.2rem;
`

const Marker = styled.section`
grid-area: marker;
font-size: 2rem;
width: 2rem;
justify-self: left;
`

const Label = styled.section`
grid-area: label;
font-size: 2rem;
justify-self: left;
text-align: left;
`

const PriceContainer = styled.section`
grid-area: price;
justify-self: end;
`

const Price = styled.section`
color: var(--color-brand-2-900);
font-family: Roboto;
font-weight: 700;
font-size: 2.4rem;
label[data-checked] & {
color: var(--color-semantic-info);
}
`

// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
const TicketLevelFootnote = ({ marker, label, price }: TicketLevelFootnoteProps) => {
return <Container>
<Marker>{marker}</Marker>
<Label>{label}</Label>
<PriceContainer><Price>{price}</Price></PriceContainer>
</Container>
}

export default TicketLevelFootnote
8 changes: 8 additions & 0 deletions src/localizations/de-DE.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ register-ticket-level-card-super-sponsor =
[day] Super-Sponsor-Tagesticket
}
register-ticket-level-modifiers-early-bird =
.label = Frühbucherrabatt (bei Zahlung vor 1. März)
.price = -5 €
register-ticket-level-modifiers-at-door =
.label = Abendkasse vor Ort
.price = +10 €
register-ticket-level-expiration-notice = Registriere Dich vor dem {DATETIME($expirationDate, day: "numeric", month: "long")}
register-ticket-level-addons-title = Zusatzoptionen auswählen
Expand Down
8 changes: 8 additions & 0 deletions src/localizations/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ register-ticket-level-card-super-sponsor =
[day] Super sponsor day ticket
}
register-ticket-level-modifiers-early-bird =
.label = Early Bird Discount (if paid before March 1st)
.price = - €5
register-ticket-level-modifiers-at-door =
.label = At the Door
.price = + €10
register-ticket-level-expiration-notice = Register before {DATETIME($expirationDate, day: "numeric", month: "long")}
register-ticket-level-addons-title = Select add-ons
Expand Down

0 comments on commit bdd3876

Please sign in to comment.