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 { AuthenticationError } from 'apollo-server-errors'; | |
import { defaultFieldResolver } from 'graphql'; | |
import { SchemaDirectiveVisitor } from 'graphql-tools'; | |
import { verifyAndDecodeToken } from '../common/verifyAndDecodeToken'; | |
export class AuthDirective extends SchemaDirectiveVisitor { | |
visitObject(type) { | |
this.ensureFieldsWrapped(type); | |
type._requiredAuthRole = this.args.role; |
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 json | |
import graphene | |
from django.middleware.csrf import CsrfViewMiddleware | |
from backend.todo_list.schema import Query, Mutation | |
schema = graphene.Schema(query=Query, mutation=Mutation) | |
class CustomCsrfMiddleware(CsrfViewMiddleware): | |
def process_view(self, request, callback, callback_args, callback_kwargs): |
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
# Criando um script .sh para executar todos os comandos: | |
#root@servidor:~# vi script.sh | |
#root@servidor:~# chmod +x script.sh | |
#root@servidor:~# ./script.sh | |
apt-get update | |
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git |
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
// router/index.js | |
import Vue from 'vue' | |
import VueRouter from 'vue-router' | |
import routes from './routes' | |
import middlewarePipeline from './middleware-pipeline' | |
Vue.use(VueRouter) |
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
#@@@ nginx virtual server configuration | |
### make link | |
# $ ln -s /etc/nginx/sites-available/DOMAIN_NAME.TLD /etc/nginx/sites-enabled/ | |
# $ nginx -t | |
# $ systemctl restart nginx | |
### letsencrypt | |
# $ cd /PATH_NAME/www | |
# $ mkdir _.letsencrypt |