diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c4bd5a4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +## Builder +FROM node:14-alpine as builder + +WORKDIR /src + +COPY . /src +RUN npm install \ + && npm run build + + +## App +FROM nginx:alpine + +COPY --from=builder /src/dist /app +COPY --from=builder /src/olm.wasm /app/olm.wasm + +# Insert wasm type into Nginx mime.types file so they load correctly. +RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types + +RUN rm -rf /usr/share/nginx/html \ + && ln -s /app /usr/share/nginx/html diff --git a/src/app/templates/auth/Auth.jsx b/src/app/templates/auth/Auth.jsx index a16206d..d66617b 100644 --- a/src/app/templates/auth/Auth.jsx +++ b/src/app/templates/auth/Auth.jsx @@ -16,8 +16,8 @@ import CinnySvg from '../../../../public/res/svg/cinny.svg'; // This regex validates historical usernames, which don't satisy today's username requirements. // See https://matrix.org/docs/spec/appendices#id13 for more info. const LOCALPART_LOGIN_REGEX = /^[!-9|;-~]+$/; -const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-+./]+$/; -const BAD_LOCALPART_ERROR = 'Username must contain only lowercase letters, numbers, dashes and underscores.'; +const LOCALPART_SIGNUP_REGEX = /^[a-z0-9_\-.=/]+$/; +const BAD_LOCALPART_ERROR = 'Username must contain only a-z, 0-9, ., _, =, -, and /.'; const USER_ID_TOO_LONG_ERROR = 'Your user ID, including the hostname, can\'t be more than 255 characters long.'; const PASSWORD_REGEX = /.+/;