Skip to content

Instantly share code, notes, and snippets.

View andrewsmedina's full-sized avatar

Andrews Medina andrewsmedina

View GitHub Profile

tsuru new authorization system

This document is a draft for the issue #1220

The goal is to change the authorization system to be more flexible based on users, permissions and roles. An user can have more than one role, and a role can have one or more permissions.

Use cases

#! /bin/bash
curl -H "authorization: bearer $TSURU_TOKEN" "${TSURU_TARGET}apps"
#! /bin/bash
echo "plugin envs"
echo ""
env
echo ""
#! /bin/bash
# tsuru wordpress <appname>
echo "criando app $1"
tsuru app-create $1 php
servicename="mysql-$1"
echo "criando mysql $servicename"
tsuru service-add mysql $servicename
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
#!/usr/bin/env python
import pymongo, redis, os
REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
REDIS_PORT = os.getenv('REDIS_PORT', 6379)
MONGO_HOST = os.getenv('MONGODB_HOST', 'localhost')
MONGO_PORT = os.getenv('MONGODB_PORT', 27017)
mongo = pymongo.MongoClient(MONGO_HOST, MONGO_PORT)
#! /bin/bash
echo $1
#! /bin/bash
echo $1
...
smtp:
server: server.com
user: email@email.com
import redis, os
HOST = os.getenv("HOST", "localhost")
PORT = os.getenv("PORT", 6379)
r = redis.StrictRedis(host=HOST, port=PORT)
cnames_app = r.get("cname*")
for cname_app in cnames_app:
cname = r.get(cname_app)