This file contains 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 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 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 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 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 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 {useMemo} from 'react' | |
import {ApolloClient, HttpLink, gql} from '@apollo/client' | |
import merge from 'deepmerge' | |
import {cache} from './cache' | |
import {isSSR} from "../constants/util"; | |
import isEqual from 'lodash/isEqual' | |
import logger from "../lib/logger"; | |
export const APOLLO_STATE_PROP_NAME = '__APOLLO_STATE__' |
This file contains 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
export async function getServerSideProps(context) { | |
const session = await getSession(context) | |
const client = initializeApollo({}) | |
//await getDataFromTree(Index) replaced by manual client.query calls | |
const cpl = await client.query({ | |
query: ComplaintsQuery, context: { | |
headers: {'infra-token': session?.infraToken} | |
} | |
}) | |
//... |
This file contains 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 logger from '../../lib/logger' | |
import {getSession} from "next-auth/client"; | |
import dynamic from "next/dynamic"; | |
function isTrueStr(str) { | |
return str === true || | |
(str != null && | |
str.toString().toLowerCase() === 'true') | |
} |
This file contains 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
# Instructions found in the following links | |
# https://docs.docker.com/engine/install/ubuntu/ | |
# https://docs.docker.com/engine/install/linux-postinstall/ | |
#: clean previous | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
#: install | |
sudo apt-get update | |
sudo apt-get install \ |
This file contains 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
# start: docker-compose up (-d for detached mode) | |
# stop: docker-compose down | |
version: "3.9" | |
services: | |
redis-server: | |
container_name: redis-server | |
image: 'redis:6.2-alpine' | |
networks: | |
- weally |