Skip to content

Commit 5f7817b

Browse files
committed
Initial release
0 parents  commit 5f7817b

35 files changed

+1789
-0
lines changed

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
*.py[cod]
2+
3+
# C extensions
4+
*.so
5+
6+
# Packages
7+
*.egg
8+
*.egg-info
9+
dist
10+
build
11+
eggs
12+
parts
13+
bin
14+
var
15+
sdist
16+
develop-eggs
17+
.installed.cfg
18+
lib
19+
lib64
20+
21+
# Installer logs
22+
pip-log.txt
23+
24+
# Unit test / coverage reports
25+
.coverage
26+
.tox
27+
nosetests.xml
28+
29+
# PyCharm
30+
.idea
31+
32+
settingslocal.py
33+
logs

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM python:2.7-onbuild
2+
EXPOSE 8000
3+
CMD gunicorn -b 0.0.0.0:8000 main:app

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: newrelic-admin run-program gunicorn main:app

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
Link Server
3+
===========
4+
5+
Intends to be a horizontally scalable, platform agnostic link redirection server.
6+
7+
## Running the server
8+
9+
python manage.py runserver
10+
11+
## Running Unittests
12+
13+
python manage.py test
14+

main.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from logging import config
2+
from flask import Flask
3+
4+
from sdk import beaker
5+
6+
import settings
7+
8+
# Setup logging
9+
config.dictConfig(settings.LOGGING)
10+
11+
12+
# Creating the Flask app object
13+
app = Flask(__name__)
14+
app.debug = settings.DEBUG
15+
16+
beaker_client = beaker.Client()
17+
18+
import views

manage.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
import os
3+
4+
from flask.ext.script import Manager, Command, Option
5+
6+
from main import app
7+
from settings import PROJECT_NAME
8+
9+
10+
class Test(Command):
11+
"""
12+
Starts unit tests
13+
"""
14+
15+
start_discovery_dir = "tests"
16+
17+
def get_options(self):
18+
return [
19+
Option(
20+
'--start_discover', '-s', dest='start_discovery',
21+
help='Pattern to search for features',
22+
default=self.start_discovery_dir),
23+
]
24+
25+
def run(self, start_discovery):
26+
import unittest
27+
28+
if os.path.exists(start_discovery):
29+
argv = [PROJECT_NAME, "discover"]
30+
argv += ["-s", start_discovery]
31+
32+
unittest.main(argv=argv)
33+
else:
34+
print("Directory '%s' was not found in project root." % start_discovery)
35+
36+
37+
if __name__ == "__main__":
38+
manager = Manager(app)
39+
manager.add_command("test", Test())
40+
manager.run()

requirements.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
git+https://github.com/MailBeaker/mailbeaker-sdk.git
2+
Flask==0.10.1
3+
Flask-Script==2.0.5
4+
Jinja2==2.7.3
5+
Werkzeug==0.10.4
6+
argparse==1.2.1
7+
cffi==0.9.2
8+
cryptography==0.8.2
9+
enum34==1.0.4
10+
gunicorn==0.17.4
11+
http-parser==0.8.1
12+
pyasn1==0.1.7
13+
pycparser==2.12
14+
python-json-logger==0.1.2
15+
newrelic==2.50.0.39
16+
redis==2.8.0
17+
requests==2.6.0
18+
restkit==4.2.1
19+
six==1.9.0
20+
socketpool==0.5.2
21+
splunk-handler==1.1.3
22+
statsd==3.0.1

requirements_dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-r requirements.txt
2+
mock==1.0.1
3+
coverage==3.7.1
4+
nose==1.3.3
5+

runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.4.2

sdk_settingslocal.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
REDIS_ENABLED = True
2+
REDIS_SERVER_HOST = "127.0.0.1"
3+
4+
# Beaker Server Settings
5+
BEAKER_SERVER_URL = "http://localhost:5000/api/v1/service/"
6+
BEAKER_API_USERNAME = 'changeme'
7+
BEAKER_API_PASSWORD = 'changeme'

0 commit comments

Comments
 (0)