This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import NextAuth from 'next-auth' | |
| import Providers from 'next-auth/providers' | |
| import jwt from 'jsonwebtoken' | |
| import {TOKEN_SECRET} from "../../../lib/auth"; | |
| import logger from "../../../lib/logger"; | |
| export default NextAuth({ | |
| // Configure one or more authentication providers | |
| providers: [ | |
| Providers.Facebook({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const graphQlServer = graphqlHTTP(async (req, res, graphQLParams) => { | |
| const infraToken = req.header('infraToken'); | |
| let user = null; | |
| if (infraToken) { | |
| try { | |
| var _jwt$verify; | |
| _logger.default.debug("infra token found "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| location / { | |
| proxy_pass http://next_server:3000; | |
| } | |
| location /api/rest/ { | |
| proxy_pass http://graphql_server:4000; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM nginx:1.21-alpine | |
| COPY ./data/nginx/. /etc/nginx/conf.d/. | |
| RUN apk add python3 python3-dev py3-pip build-base libressl-dev musl-dev libffi-dev rust cargo | |
| RUN pip3 install pip --upgrade | |
| RUN pip3 install certbot-nginx | |
| RUN mkdir /etc/letsencrypt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.9" | |
| services: | |
| nginx: | |
| container_name: nginx | |
| image: 'nginx:0.1' | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.9" | |
| services: | |
| nginx: | |
| container_name: nginx | |
| image: 'nginx:0.1' | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # GRAPHQL_SERVER_VERSION=$1 | |
| # NEXT_SERVER_VERSION=$2 | |
| # set variables from .env to system: https://gist.github.com/mihow/9c7f559807069a03e302605691f85572 | |
| if [ -f .env ] | |
| then | |
| export $(cat .env | sed 's/#.*//g' | xargs) | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # GRAPHQL_SERVER_VERSION=$1 | |
| # NEXT_SERVER_VERSION=$2 | |
| # set variables from .env to system: https://gist.github.com/mihow/9c7f559807069a03e302605691f85572 | |
| if [ -f .env ] | |
| then | |
| export $(cat .env | sed 's/#.*//g' | xargs) | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * inspired from https://www.yld.io/blog/global-notifications-with-reacts-context-api/ | |
| */ | |
| import React, { useState, useCallback } from 'react'; | |
| export const ToastContext = React.createContext({ | |
| toasts: null, | |
| addToast: () => {}, | |
| removeToast: () => {}, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {useContext} from 'react'; | |
| import {ToastContext} from '../ToastContextProvider'; | |
| function useToast(timeout) { | |
| const {toasts, addToast: originalAddToast, removeToast} = useContext(ToastContext); | |
| function addToast(toast) { | |
| originalAddToast(toast) | |
| let appliedTimeout = toast.timeout ?? timeout | |
| if (appliedTimeout > 0) |