Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
df632a2
Defer dependency installation to the Dockerfile inheriting from this …
gillianwebb Oct 18, 2015
7914cdb
Fix Dockerfile for deferred dependency installation
gillianwebb Oct 18, 2015
2ea7805
Use proper virtualenv path for CMD
gillianwebb Oct 18, 2015
2c98ef1
Make priority_plugins work regardless of setup vagaries
kitsuta May 25, 2016
8cb2787
Merge pull request #14 from magfest/fix-13
EliAndrewC May 25, 2016
5eed1b8
Merge pull request #4 from magfest/master
thaeli May 25, 2016
4a0fe92
sort glob() output for consistent results
binary1230 May 28, 2016
9c51322
Merge pull request #16 from magfest/sort_glob
binary1230 Jun 15, 2016
b7c01ad
remove default logging from development-defaults.ini
binary1230 Jul 1, 2016
9914b0c
add multiline indentation support to sideboard
binary1230 Jul 1, 2016
0afe30c
Merge pull request #17 from magfest/centralized_logging
binary1230 Jul 12, 2016
4c699a5
turn up all logging thresholds to the highest levels
binary1230 Aug 13, 2016
0640561
Merge pull request #18 from magfest/turn_up_logging_thresholds
binary1230 Aug 14, 2016
36523cd
added @request_cached_property decorator
EliAndrewC Aug 14, 2016
e1fe2c9
Merge pull request #20 from magfest/request_cached_property
binary1230 Aug 14, 2016
ecc4a47
set thread names on startup
binary1230 Aug 20, 2016
69c1bbe
add override for thread names for DaemonTasks
binary1230 Aug 20, 2016
6b51bca
made use of prctl switch on Python version
EliAndrewC Aug 21, 2016
51a6473
install libcap for travis builds
binary1230 Aug 21, 2016
da18ab6
install libcap-dev for travis builds instead of just libcap
binary1230 Aug 21, 2016
27c52f4
Merge remote-tracking branch 'origin/name_threads' into name_threads
binary1230 Aug 21, 2016
0c3b3d0
fix python2 prctl dependencies / install / thread bootstrap function
binary1230 Aug 21, 2016
f2ead43
style fix
binary1230 Aug 21, 2016
435afc7
Merge pull request #22 from magfest/thread_name_overrides
binary1230 Aug 21, 2016
9493061
Merge pull request #21 from magfest/name_threads
EliAndrewC Aug 21, 2016
40a0b13
enable system diagnostics package 1 for threading info
binary1230 Aug 27, 2016
a295ab3
add message to exception if not running on linux
binary1230 Aug 31, 2016
3844d3e
Merge pull request #23 from magfest/diagnostics_package1
binary1230 Aug 31, 2016
b0298e3
upgrade pytest to latest version
binary1230 Aug 31, 2016
fec66a7
Merge pull request #24 from magfest/upgrade_pytest
binary1230 Sep 2, 2016
660bed2
rebased local changes to sync with open source repo
EliAndrewC Sep 12, 2016
fc643fa
merged local changes with public repo
EliAndrewC Sep 12, 2016
37d920f
fixed unit tests following merge
EliAndrewC Sep 12, 2016
20b1cd7
fixes https://github.com/magfest/sideboard/issues/25
EliAndrewC Sep 13, 2016
7895b23
removed unused build files
EliAndrewC Sep 13, 2016
bad97a3
updated documentation links
EliAndrewC Sep 13, 2016
006d885
bumped version number
EliAndrewC Sep 13, 2016
f57c8f8
Merge branch 'resyncing_with_public' into 'master'
EliAndrewC Sep 13, 2016
5a30843
Merge branch 'resyncing_with_public' into 'master'
Sep 13, 2016
96c13ee
added missing __future__ import for Python 2 compatibility
EliAndrewC Sep 13, 2016
5932c5a
Merge branch 'resyncing_with_public'
EliAndrewC Sep 13, 2016
bf6ac37
Merge branch 'resyncing_with_public'
EliAndrewC Sep 13, 2016
87032db
added fix for newer versions of paver/setuptools
EliAndrewC Sep 13, 2016
9014a4f
added fix for newer versions of paver/setuptools
EliAndrewC Sep 13, 2016
501588c
added workaround for newer versions of six
EliAndrewC Sep 13, 2016
59659b3
added workaround for newer versions of six
EliAndrewC Sep 13, 2016
1a017fd
@declarative_base now fills in a __init__ which applies default colum…
EliAndrewC Sep 20, 2016
b5dac10
Merge branch 'defaults_applied_at_init' into 'master'
EliAndrewC Sep 21, 2016
ec6ccaf
PMS-54: Registering set JSON serializer in sideboard
EliAndrewC Sep 26, 2016
2e5f901
Merge branch 'PMS-54' into 'master'
EliAndrewC Sep 26, 2016
395c4f4
fixes #31: pluggable authentication
EliAndrewC Oct 3, 2016
22295ec
added pep8 to sideboard and tweaked formatting to make codebase pep-8…
EliAndrewC Oct 4, 2016
3874267
further pep8 fixes
EliAndrewC Oct 4, 2016
1a8c3c4
minor plugin skeleton tweak
EliAndrewC Oct 4, 2016
83b8e32
added ability for plugins to define a preprocessing step for API calls
EliAndrewC Oct 5, 2016
00528b4
Merge branch 'pluggable_auth' into 'master'
EliAndrewC Oct 6, 2016
f89ae26
Merge branch 'websocket_preprocessing' into 'master'
EliAndrewC Oct 27, 2016
161cda9
root and module_root now tied together
EliAndrewC Oct 27, 2016
28eb5ad
added ability for plugins to define a preprocessing step for API calls
EliAndrewC Oct 5, 2016
9f4da96
Merge branch 'Add_preset_UID&GID' into 'master'
EliAndrewC Oct 27, 2016
49a91fd
simplified get_dirnames() docstring
EliAndrewC Oct 28, 2016
e199ca7
updated docstring to include a full explanation of get_config_files()…
EliAndrewC Oct 28, 2016
638456f
added missing sentence to get_config_files() docstring
EliAndrewC Oct 28, 2016
c313921
Merge branch 'refactored_module_root' into 'master'
EliAndrewC Oct 31, 2016
6b0ed6a
fixes #44: decrease sideboard.lib.WebSocket.call latency
EliAndrewC Oct 31, 2016
37a8129
Merge branch 'websocket_call_speedup' into 'master'
EliAndrewC Oct 31, 2016
b8ca20f
fixed unit tests for WebSocket.call
EliAndrewC Oct 31, 2016
f51dbb8
Merge branch 'websocket_call_speedup' into 'master'
EliAndrewC Oct 31, 2016
01cdacc
bumped version after tagging
EliAndrewC Nov 1, 2016
681f1ca
Update get_dirnames() so that root and module_root can correctly be i…
EliAndrewC Nov 2, 2016
a31d15c
Merge branch 'redecouple_root_and_module_root' into 'master'
EliAndrewC Nov 2, 2016
df1c687
use new format for setup.cfg so pytest stops complaining
binary1230 Nov 8, 2016
4c3e4a8
implemented a read/write lock utility class in sideboard.lib
EliAndrewC Nov 22, 2016
d0fc75a
implemented a read/write lock utility class in sideboard.lib
EliAndrewC Nov 22, 2016
c463da5
Merge pull request #48 from magfest/approval_workflow_improvements
EliAndrewC Nov 29, 2016
1b484c4
three edge case fixes for websocket subscriptions, plus a lot more do…
EliAndrewC Dec 1, 2016
bc4cd93
added extra logging for unexpected websocket errors
EliAndrewC Dec 2, 2016
ce40da5
Merge pull request #46 from magfest/read_write_locking
EliAndrewC Dec 5, 2016
1f821c1
Merge pull request #46 from magfest/read_write_locking
EliAndrewC Dec 5, 2016
bcca1b4
tweaks based on peer review feedback
EliAndrewC Dec 5, 2016
7a53942
Merge branch 'misc_websocket_subscription_fixes' into 'master'
EliAndrewC Dec 5, 2016
24490dd
Merge remote-tracking branch 'origin/resyncing_with_public' into feat…
EliAndrewC Dec 6, 2016
31a6736
Merge branch 'feature/resyncing_with_public' into 'master'
EliAndrewC Dec 7, 2016
3f3da09
added additional websocket closing checks and bumped the cherrypy too…
EliAndrewC Dec 21, 2016
d90840a
Merge branch 'master' into master
kitsuta Dec 22, 2016
fe98382
Merge pull request #50 from RAMSProject/master
kitsuta Dec 22, 2016
1c8eb0a
Revert "Update from MAGFest master"
kitsuta Dec 22, 2016
f300f01
Merge pull request #51 from magfest/revert-50-master
kitsuta Dec 22, 2016
e5f07d9
Merge branch 'feature/websocket-robustness' into 'master'
EliAndrewC Dec 22, 2016
fbe9720
added new unit test for don't-send-when-closed behavior and fixed exi…
EliAndrewC Dec 22, 2016
0f955c0
Update versions of Python and Node, fix Dockerfile build
thaeli Jan 6, 2017
02e05b7
Merge pull request #6 from RAMSProject/fixes
kitsuta Jan 6, 2017
a62f390
implemented configurable list of session fields to be copied into thr…
EliAndrewC Jan 18, 2017
a105741
Merge branch 'feature/configurable_websocket_session_fields' into 'ma…
EliAndrewC Jan 19, 2017
a3cb3a3
Merge pull request #27 from magfest/resyncing_with_public
EliAndrewC Jan 30, 2017
7fb2cec
Merge pull request #27 from magfest/resyncing_with_public
EliAndrewC Jan 30, 2017
556655a
fixed typo in session_fields copy
EliAndrewC Feb 1, 2017
9bcdf59
Merge branch 'session_typo_fix' into 'master'
EliAndrewC Feb 1, 2017
cfb5c5c
SIDEB-139: Drop the timestamp from the syslog log handler
EliAndrewC Feb 7, 2017
deb0136
Merge branch 'SIDEB-139' into 'master'
EliAndrewC Feb 7, 2017
268115e
pin cherrypy at 8.9.1 to workaround bug with ws4py referencing deprec…
binary1230 Feb 13, 2017
698dcfd
pin cherrypy at 8.9.1 to workaround bug with ws4py referencing deprec…
binary1230 Feb 13, 2017
19554f1
fixed forwarded websocket subscriptions to update the existing subscr…
EliAndrewC Mar 6, 2017
0eddb63
Merge branch 'forwarded_subscription_updates' into 'master'
EliAndrewC Mar 7, 2017
0c62d70
Fixes #2373: Prevents hybrid_property fields from being used in to_di…
RobRuana Mar 7, 2017
6cabb26
Fixes #2373: Prevents hybrid_property fields from being used in to_di…
RobRuana Mar 7, 2017
211ede9
Merge pull request #57 from RobRuana/master
kitsuta Mar 7, 2017
801552a
Merge pull request #57 from RobRuana/master
kitsuta Mar 7, 2017
4fb64f3
Updates coveralls.io badge
RobRuana Mar 7, 2017
3bebfb8
Updates coveralls.io badge
RobRuana Mar 7, 2017
05e359b
Merge pull request #58 from RobRuana/master
EliAndrewC Mar 7, 2017
a57647a
Merge pull request #58 from RobRuana/master
EliAndrewC Mar 7, 2017
057fea4
Per 698dcfd, pinning cherrypy to 8.9.1 to see that will fix the Travi…
RobRuana Mar 8, 2017
540a579
Merge branch 'master' into resync_with_public
RobRuana Mar 8, 2017
0452989
Merge branch 'master' into resync_with_public
RobRuana Mar 8, 2017
ea5cabb
Merge pull request #62 from magfest/resync_with_public
RobRuana Mar 8, 2017
9e405b0
Merge pull request #62 from magfest/resync_with_public
RobRuana Mar 8, 2017
c97d7c2
refactored notify delay to take a boolean instead of a time
EliAndrewC Mar 9, 2017
ac4aee9
added documentation of new delay parameter to notify in our Sphinx docs
EliAndrewC Mar 9, 2017
763ed50
Fixes #59: Test server uses an ephemeral port instead of binding to 8…
RobRuana Mar 9, 2017
884ec58
Fixes #59: Test server uses an ephemeral port instead of binding to 8…
RobRuana Mar 9, 2017
e9d7165
cleared out 'sideboard.delayed_notifications' after use to protect ag…
EliAndrewC Mar 10, 2017
a3c64d9
added SIDEBOARD_CONFIG_ROOT environment variable
EliAndrewC Mar 10, 2017
409f8fa
updated SIDEBOARD_CONFIG_ROOT to allow nonexistent /etc/sideboard
EliAndrewC Mar 10, 2017
adf3094
Merge pull request #67 from magfest/configurable_config
RobRuana Mar 10, 2017
aa40f7e
Merge pull request #67 from magfest/configurable_config
RobRuana Mar 10, 2017
55f359c
Merge branch 'configurable_config' into 'master'
EliAndrewC Mar 13, 2017
892e2db
Store HTTP header fields in threadlocal
EliAndrewC Mar 15, 2017
d3e3b95
Merge branch 'feature/header_fields' into 'master'
EliAndrewC Mar 15, 2017
acff520
Updating unit tests for the new header fields
EliAndrewC Mar 15, 2017
50066a3
Fixes #66: Adds support for SIDEBOARD_CONFIG_OVERRIDES env var (#68)
RobRuana Mar 15, 2017
ed02745
Fixes #66: Adds support for SIDEBOARD_CONFIG_OVERRIDES env var (#68)
RobRuana Mar 15, 2017
ab1159e
Fixes #69: Allows port to be configurable via test.ini
RobRuana Mar 15, 2017
a5b0409
Fixes #69: Allows port to be configurable via test.ini
RobRuana Mar 15, 2017
401ce09
Merge pull request #70 from magfest/fix-69-configurable-test-server-port
EliAndrewC Mar 15, 2017
65887f8
Merge pull request #70 from magfest/fix-69-configurable-test-server-port
EliAndrewC Mar 15, 2017
067eecf
Merge branch 'feature/header_field_tests' into 'master'
EliAndrewC Mar 15, 2017
77965f5
Merge branch 'notify_delay_refactor' into 'master'
EliAndrewC Mar 16, 2017
2d5e54c
post-merge
EliAndrewC Mar 17, 2017
2c98a79
Merge branch 'public_master' into 'master'
EliAndrewC Mar 17, 2017
0f37c4a
PEP-8 fixes, removed distribute, and updated CherryPy and SQLAlchemy …
EliAndrewC Mar 17, 2017
e3abc05
fixed distribute to be Python 2 only in setup.py
EliAndrewC Mar 17, 2017
041108c
Updates #66: Fixes bad environment variable formatting in tox.ini
RobRuana Mar 17, 2017
254599f
Adds '--show-missing' to coverage report to print exactly which lines…
RobRuana Mar 17, 2017
b80a258
Adds pep8 back to tox and travis
RobRuana Mar 17, 2017
7dca380
bumped version
EliAndrewC Mar 22, 2017
3c4969b
Bumps required Jinja2 version to 2.7 to ensure urlencode() filter is …
RobRuana Mar 24, 2017
4f6823e
Only run coveralls once for each major python version (2.7 & 3.5)
RobRuana Mar 31, 2017
7d01a30
Speeds up tox tasks
RobRuana Apr 2, 2017
ee3ead5
forwarded subscriptions can now have their methods updated
EliAndrewC Apr 4, 2017
3b5ea27
Merge branch 'forwarded_method_updates' into 'master'
EliAndrewC Apr 5, 2017
b4c3a8a
fixes https://github.com/magfest/sideboard/issues/45
EliAndrewC Apr 5, 2017
445af8c
Merge branch 'fixed_connection_checker' into 'master'
EliAndrewC Apr 6, 2017
9a32418
SIDEB-146: Move testing-related eggs from requirements.txt to a test…
EliAndrewC Apr 11, 2017
db1d8c5
SIDEB-146: forgot test_requirements.txt
EliAndrewC Apr 11, 2017
008a864
Merge branch 'SIDEB-146' into 'master'
EliAndrewC Apr 12, 2017
642130e
Fixes #72: Adds support for declarative_base parameters (#73)
RobRuana Apr 20, 2017
56520f2
Adds custom unnamed CheckedConstraint naming convention to support Al…
RobRuana Apr 23, 2017
686bde7
Preserves plugin import order using OrderedDict (#75)
RobRuana Apr 23, 2017
4d584b0
Print sep usage with no args.
RobRuana Apr 23, 2017
a8496c2
Adds "create" keyword to "initialize_db" to support DB migration gene…
RobRuana Apr 24, 2017
55be8c1
sideboard.websockets.WebSocketDispatcher now resets subscription cach…
EliAndrewC Apr 24, 2017
17a1b81
Merge branch 'method_cache_clearing' into 'master'
EliAndrewC Apr 25, 2017
a44ff63
bumped version
EliAndrewC Apr 25, 2017
f124e1d
Populates plugin_dirs before importing plugins so it will be availabl…
RobRuana Apr 27, 2017
fafa0d0
Fixes missing call to .items(), this is what I get for not running th…
RobRuana Apr 27, 2017
39008a9
passthru subscriptions now get cleaned up properly
EliAndrewC May 2, 2017
cac73a0
Merge branch 'passthru_subscription_cleanup' into 'master'
EliAndrewC May 3, 2017
0e8817c
bumped version after tagging
EliAndrewC May 3, 2017
ca0091f
Add Dockerfile from upstream
kitsuta May 4, 2017
07e9bdc
Merge pull request #8 from magfest/add-dockerfile
kitsuta May 4, 2017
80063f5
Merge pull request #79 from magfest/add-dockerfile
kitsuta May 4, 2017
c39a00b
Update NodeJS Docker instructions
kitsuta May 6, 2017
24d9fd6
Adds profiling tools and exposes profiler web UI (#81)
RobRuana May 8, 2017
a7ef685
Turns out the plugins_dir configuration is required when running the …
RobRuana May 8, 2017
051dd29
Missed the quoted 'False' in test-defaults.ini from the review
RobRuana May 8, 2017
d9d3e6e
post-merge
EliAndrewC May 9, 2017
4d5cb83
added test_requirements.txt to travis install prereqs
EliAndrewC May 9, 2017
15076b7
added test_requirements.txt to tox deps
EliAndrewC May 9, 2017
e7aaa2c
Merge pull request #82 from magfest/public-resync-2017-05-09
EliAndrewC May 9, 2017
f5722c1
added unicode_literals import to files missing it
EliAndrewC May 9, 2017
a01ff76
removed unnecessary dependency line in travis config
EliAndrewC May 9, 2017
b13e6c2
Merge pull request #83 from magfest/public-resync-2017-05-09-2
RobRuana May 10, 2017
da6f4ec
Fixes #56: Removes upper bounds on cherrypy version requirement (#84)
RobRuana Jun 12, 2017
f8ad249
Changes name used for cached property to avoid collisions with common…
RobRuana Jul 29, 2017
69482f9
Avoids executing column defaults when they aren't needed
RobRuana Jul 30, 2017
f061603
Only skip executing column defaults if the argument is None
RobRuana Jul 30, 2017
7e0cbce
Merge pull request #9 from magfest/master
thaeli Sep 6, 2017
88469b9
Makes jsonrpc_handler more flexible (#92)
RobRuana Nov 18, 2017
455cef2
add psutil and prctl
binary1230 Nov 25, 2017
5d8b4f0
python-prctl is only available on linux
RobRuana Nov 26, 2017
f30b6ea
Nope, setup.py does not support environment markers in install_requires
RobRuana Nov 26, 2017
72c690f
Adds basic support for pip environment markers to setup.py (#94)
RobRuana Nov 26, 2017
fa96380
Ugh, ok, environment markers should _actually_ be working now
RobRuana Nov 26, 2017
f1c762a
Merge pull request #96 from RAMSProject/master
RobRuana Dec 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .coveragerc

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ dist/
*.pyc
*.pyo
development.ini
test.ini
sideboard/docs
plugins/*
!plugins/conftest.py
data/sessions/*
data/profiler/*
*-bootstrap.py
data/*.db
.tox
node_modules/
.cache
distribute-*.tar.gz
distribute_setup.py
.eggs/
.eggs/
.coverage
28 changes: 21 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
language: python
python: 2.7
env:
- TOX_ENV=py27
- TOX_ENV=py33
- TOX_ENV=py34
matrix:
include:
- python: "2.7"
env: TOX_ENV=pep8
- python: "2.7"
env: TOX_ENV=py27
- python: "3.3"
env: TOX_ENV=py33
- python: "3.4"
env: TOX_ENV=py34
- python: "3.5"
env: TOX_ENV=py35
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y build-essential libcap-dev
install:
- pip install tox
- pip install python-coveralls
- if [[ $TOX_ENV == py27 ]] || [[ $TOX_ENV == py35 ]]; then
pip install coveralls;
fi
script:
- tox -e $TOX_ENV
after_success:
coveralls
- if [[ $TOX_ENV == py27 ]] || [[ $TOX_ENV == py35 ]]; then
coveralls;
fi
79 changes: 50 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,59 @@
FROM python:3.4.3
FROM python:3.4.5
MAINTAINER RAMS Project "code@magfest.org"
LABEL version.sideboard ="1.0"

WORKDIR /app

# verify gpg and sha256: http://nodejs.org/dist/v0.10.30/SHASUMS256.txt.asc
# gpg: aka "Timothy J Fontaine (Work) <tj.fontaine@joyent.com>"
# gpg: aka "Julien Gilli <jgilli@fastmail.fm>"
# This is actually the least bad way to compose two Dockerfile tech stacks right now.
# The following is copied and pasted from the Node Dockerfile at
# https://github.com/nodejs/docker-node/blob/28425ed95cebaea2ff589c1516d79c60181983b2/7.4/Dockerfile
# Update this comment and change the entire copypasta section to upgrade Node version

#########################################
# START NODEJS DOCKERFILE COPYPASTA #
# https://github.com/nodejs/docker-node #
#########################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

# gpg keys listed at https://github.com/nodejs/node#release-team
RUN set -ex \
&& for key in \
7937DFD2AB06298B2293C3187D33FF9D0246406D \
114F43EE0176B71C7BC219DD50A3051F888C628D \
; do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
done

ENV NODE_VERSION 0.12.7
ENV NPM_VERSION 2.14.1
ENV BOWER_VERSION 1.5.2
ENV GRUNT_VERSION 0.1.13

RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --verify SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc \
&& npm install -g npm@"$NPM_VERSION" \
&& npm install -g bower@"$BOWER_VERSION" grunt-cli@"$GRUNT_VERSION" \
&& echo '{ "allow_root": true }' > /root/.bowerrc \
&& npm cache clear
&& for key in \
9554F04D7259F04124DE6B476D5A82AC7E37093B \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
56730D5401028683275BD23C23EFEFE93C4CFFFE \
; do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \
done

ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 7.10.0

RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
###################################
# END NODEJS DOCKERFILE COPYPASTA #
###################################

# required for python-prctl
RUN apt-get update && apt-get install -y libcap-dev && rm -rf /var/lib/apt/lists/*

ADD . /app/
RUN python3 setup.py develop
RUN pip3 install virtualenv \
&& virtualenv --always-copy /app/env \
&& /app/env/bin/pip3 install paver
RUN /app/env/bin/paver install_deps

CMD python3 /app/sideboard/run_server.py
CMD /app/env/bin/python3 /app/sideboard/run_server.py
EXPOSE 8282
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sideboard [![Build Status](https://travis-ci.org/appliedsec/sideboard.svg)](https://travis-ci.org/appliedsec/sideboard)[![Coverage Status](https://coveralls.io/repos/appliedsec/sideboard/badge.png)](https://coveralls.io/r/appliedsec/sideboard)
Sideboard [![Build Status](https://travis-ci.org/magfest/sideboard.svg)](https://travis-ci.org/magfest/sideboard) [![Coverage Status](https://coveralls.io/repos/github/magfest/sideboard/badge.svg?branch=master)](https://coveralls.io/github/magfest/sideboard?branch=master)
=========

Getting Started
Expand Down
18 changes: 10 additions & 8 deletions data/paver/skeleton/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
from datetime import datetime

import six
Expand All @@ -9,25 +10,26 @@

__here__ = os.path.dirname(os.path.abspath(__file__))


def render(to_render, settings):
if isinstance(to_render, six.string_types):
return env.from_string(to_render).render(settings)
else:
with open(os.path.join(__here__, *to_render)) as template_file:
return env.from_string(template_file.read()).render(settings)


def create_plugin(plugins_dir, plugin, **settings):
assert ' ' not in plugin, "plugins probably shouldn't have spaces; but either way we aren't specifically handling spaces"
module = plugin.replace('-', '_')
plugin = plugin.replace('_', '-')
settings.update({'plugin': plugin, 'module': module, 'generated_date': datetime.utcnow()})

package_dir = os.path.join(plugins_dir, plugin)
assert not os.path.exists(package_dir), '{} plugin already exists at {}'.format(plugin, package_dir)
os.makedirs(os.path.join(package_dir, module, 'tests'))
for fname, template in TEMPLATES.items():
fname = render(fname, settings)

if fname:
fpath = os.path.join(package_dir, fname)
try:
Expand All @@ -36,17 +38,19 @@ def create_plugin(plugins_dir, plugin, **settings):
pass

with open(fpath, 'w') as f:
f.write(render(template, settings) + '\n')
# our templates often have a lot of {% if %} clauses which lead to a lot of blank lines,
# so we collapse those such that we never have more than 1 blank line in a row
f.write(re.sub(r'\n{3,}', '\n\n', render(template, settings).strip() + '\n'))

if settings.get('generate_sphinx', True):
if settings.get('sphinx', True):
sphinx_settings = dict(
path=os.path.join(package_dir, 'docs'),
sep=False,
dot='_',
project=plugin,
author='{} Team'.format(plugin),
release='0.1',
version='0.1',
release='0.1.0',
version='0.1.0',
suffix='.rst',
master='index',
epub=False,
Expand All @@ -62,10 +66,8 @@ def create_plugin(plugins_dir, plugin, **settings):
makefile=True,
batchfile=False
)

sphinx.quickstart.generate(sphinx_settings)


TEMPLATES = {
'{{ module }}/_version.py': ('templates', '_version.py.template'),
'requirements.txt': ('templates', 'requirements.txt.template'),
Expand Down
35 changes: 32 additions & 3 deletions data/paver/skeleton/templates/__init__.py.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from __future__ import unicode_literals

{% if webapp %}import cherrypy
from __future__ import unicode_literals{% if django %}
import os
import sys
{% endif %}

{% if webapp or django %}
import cherrypy
{% if django %}
import django
from django.core.handlers.wsgi import WSGIHandler
{% endif %}
{% endif %}

from sideboard.lib import log, parse_config{% if webapp %}, render_with_templates{% endif %}{% if service or sqlalchemy %}, services{% endif %}
from {{ module }}._version import __version__

Expand All @@ -13,6 +21,7 @@ from {{ module }} import service
services.register(service, '{{ module }}')

{% endif %}

{% if sqlalchemy %}
from {{ module }} import sa
services.register(sa.Session.crud, '{{ module }}_crud')
Expand All @@ -30,3 +39,23 @@ class Root(object):

cherrypy.tree.mount(Root(), '/{{ module }}')
{% endif %}

{% if django %}
# add our Django site to our Python path so we can import it
sys.path.append(os.path.join(config['root'], '{{ django }}'))

# since we're not using mod_wsgi we'll use the env var approach to setting up Django
os.environ['DJANGO_SETTINGS_MODULE'] = '{{ django }}.settings'
django.setup()
cherrypy.tree.graft(WSGIHandler(), '/{{ django }}')

# expose the static files used by the Django admin interface
# NOTE: if you have Apache serving these files directly then you can remove this part
class Static(object):
admin = cherrypy.tools.staticdir.handler(
section="/admin",
dir=os.path.dirname(django.__file__) + '/contrib/admin/static/admin'
)

cherrypy.tree.mount(Static(), '/{{ django }}/static')
{% endif %}
3 changes: 2 additions & 1 deletion data/paver/skeleton/templates/_version.py.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from __future__ import unicode_literals
__version__ = '0.1'

__version__ = '0.1.0'
15 changes: 12 additions & 3 deletions data/paver/skeleton/templates/fabfile.py.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import unicode_literals
import time
from os.path import abspath, basename, dirname, join

from sh import pip, fpm, chmod
Expand All @@ -12,24 +13,32 @@ POSTINSTALL = '/tmp/postinstall.sh'
def _make_postinstall_script():
with open(POSTINSTALL, 'w') as f:
f.write('#!/bin/bash\n')
f.write('/opt/sideboard/bin/pip install --use-wheel --find-links /opt/sideboard/plugins/{package_name}/wheelhouse/ -r /opt/sideboard/plugins/{package_name}/requirements.txt'
f.write('set -e\n')
f.write('source /opt/sideboard/bin/activate && /opt/sideboard/bin/pip install --use-wheel --find-links /opt/sideboard/plugins/{package_name}/wheelhouse/ -r /opt/sideboard/plugins/{package_name}/requirements.txt\n'
.format(package_name=package_name))
f.write('chown -R sideboard.sideboard /opt/sideboard\n')
chmod('755', POSTINSTALL)

def package(package_type):
def package(package_type, iteration='testing'):
import sideboard
plugin = __import__(plugin_name)
pip('wheel', r='requirements.txt')
_make_postinstall_script()
if iteration == 'testing':
iteration = '0.{}'.format(int(time.time()))
fpm('-t', package_type,
'-s', 'dir',
'--{}-user'.format(package_type), 'sideboard',
'--{}-group'.format(package_type), 'sideboard',
'--name', 'sideboard-{}'.format(package_name),
'--version', plugin.__version__,
'--license', 'COMPANY-PROPRIETARY',
'--iteration', iteration,
'--depends', 'sideboard >= {}'.format(sideboard.__version__),
'--after-install', POSTINSTALL,
'--config-files', '/etc/sideboard/plugins.d/{package_name}.cfg'.format(package_name=package_name),
'./package-support/{package_name}.cfg=/etc/sideboard/plugins.d/{package_name}.cfg'.format(package_name=package_name),
'./requirements.txt=/opt/sideboard/plugins/{}/requirements.txt'.format(package_name),
'./wheelhouse=/opt/sideboard/plugins/{}'.format(package_name),
'./wheelhouse=/opt/sideboard/plugins/{}'.format(package_name),{% if django %}
'./{{ django }}=/opt/sideboard/plugins/{}/{{ django }}'.format(package_name),{% endif %}
'./{}=/opt/sideboard/plugins/{}'.format(plugin_name, package_name))
12 changes: 6 additions & 6 deletions data/paver/skeleton/templates/index.html.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
{% raw %}<!doctype html>
<html>
<head><title>$(( plugin ))$ skeleton page</title></head>
<head><title>{{ plugin }} skeleton page</title></head>
<body>
((% if header %))
<h1>Hello $(( plugin ))$ developer!</h1>
((% endif %))
{% if header %}
<h1>Hello {{ plugin }} developer!</h1>
{% endif %}
</body>
</html>
</html>{% endraw%}
13 changes: 1 addition & 12 deletions development-defaults.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@

debug = True
ws.auth_required = False
# set priority plugin so the main uber plugin always loads first
priority_plugins = uber,

[cherrypy]
server.socket_host = "0.0.0.0"
engine.autoreload.on = True
tools.sessions.timeout = 4320 # 30 days (in minutes)


[loggers]
root = "DEBUG"

[handlers]
[[stdout]]
class = "logging.StreamHandler"
stream = "ext://sys.stderr"

#[[syslog]]
#class = "logging.handlers.SysLogHandler"
#address = "/dev/log"
Loading