Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6a56891
1st pass at docker files/script to create environment for development
mlippert Mar 27, 2018
ec8d0e2
update Dockerfile to use node version 8
mlippert Mar 27, 2018
123cb3e
cleaned up dependencies in package.json
mlippert Mar 27, 2018
9d4cf4f
Install using yarn succeeded w/ new package.json
mlippert Mar 28, 2018
eaf7b66
1st pass at adding a docker container for rhythm-rtc
mlippert Mar 29, 2018
45b5324
work on docker-compose to replace custom docker scripts (testenv.sh, …
mlippert Mar 31, 2018
4535424
add some bash aliases (e.g. ll) in both rhythm-server & rhythm-rtc do…
mlippert Apr 5, 2018
b0a6c14
Merge branch 'feature/docker-development' into develop
mlippert Apr 7, 2018
c22cdc6
use node user in rhythm server & rtc containers, set the interactive …
mlippert Apr 26, 2018
0d59690
Merge branch 'feature/dev-env-enhancements' into develop
mlippert Apr 26, 2018
3af7a36
changes made by feathers cli upgrade
mlippert Apr 5, 2018
e9efcec
the feathers cli upgrade added a couple of semicolons _standard_ didn…
mlippert Apr 5, 2018
3d5035c
use the discard method from feathers-hooks-common to replace the hook…
mlippert Apr 5, 2018
5e66220
migrate feathers authentication from v2 to v3
mlippert Apr 7, 2018
bdcc0a7
more feathers v2 -> v3 migration
mlippert Apr 9, 2018
95cbc7b
more feathers migration - global authentication filter is replaced by…
mlippert Apr 9, 2018
f76d01c
make channels.js conform to style enforced by `standard` pkg
mlippert Apr 9, 2018
20c5f99
more feathers v2 -> v3 migration
mlippert Apr 23, 2018
aaa7f55
more feathers v2 -> v3 migration (& update mongodb package)
mlippert Apr 24, 2018
565039b
turn off winston logging to the console when running tests
mlippert Apr 24, 2018
4de50b2
update d3, jsdom, nodemailer & promise dependent packages and mocha d…
mlippert Apr 25, 2018
e0b56a6
fix standard formatting reported errors
mlippert May 13, 2018
14c497b
another fix for feathers authentication migration
mlippert May 13, 2018
7a65ec5
improve Makefile start-dev target
mlippert Apr 28, 2018
49d850a
Merge remote-tracking branch 'origin/feature/0001-update-pkgs' into d…
mlippert May 16, 2018
2cea9af
Add github issue and pull request templates
mlippert May 16, 2018
a83d563
Bump pre-release version number to 0.4.0-dev.1
mlippert May 16, 2018
57312de
remove standard package & unused eslint related packages, update rema…
mlippert May 14, 2018
5b7cef6
eslint rules
mlippert May 14, 2018
eb1e9b2
added eslint promise plugin rules
mlippert Apr 29, 2018
9ec9733
add eslint config for files in test
mlippert Apr 29, 2018
ec09a23
Makefile changes to support linting
mlippert May 14, 2018
744a208
logs/lint.log added to track lint errors/warnings
mlippert May 14, 2018
21c0529
source file changes to match lint rules
mlippert Apr 29, 2018
72e304d
test file changes to pass eslint
mlippert May 13, 2018
880fb6b
test file changes to pass eslint
mlippert May 14, 2018
4666fe6
updated lint.log w/ report after changes to address easy lint errors
mlippert May 14, 2018
863db6c
Merge remote-tracking branch 'origin/feature/0002-use-eslint' into de…
mlippert May 17, 2018
73272f2
Bump pre-release version number to 0.4.0-dev.2
mlippert May 17, 2018
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
184 changes: 184 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
---
plugins:
- promise
env:
node: true
extends:
- eslint:recommended
- plugin:promise/recommended
parserOptions:
ecmaVersion: 2017
sourceType: script
rules:
array-bracket-spacing:
- error
- always
-
objectsInArrays: false
arrow-parens:
- error
- as-needed
-
requireForBlockBody: true
arrow-spacing: error
block-spacing: error
brace-style:
- error
- 1tbs # I very much prefer allman -mjl
-
allowSingleLine: true
camelcase:
- error
-
properties: always
comma-dangle:
- error
- only-multiline
comma-spacing: error
comma-style: error
computed-property-spacing: error
consistent-return: error
consistent-this: error
curly:
- error
- multi-line
dot-location:
- error
- property
eqeqeq: error
func-call-spacing: error
generator-star-spacing:
- error
-
before: false
after: true
global-require: error
indent:
- error
- 2
-
SwitchCase: 1
FunctionDeclaration:
parameters: first
body: 1
FunctionExpression:
parameters: first
body: 1
MemberExpression: off
CallExpression:
arguments: first
ArrayExpression: first
ObjectExpression: first
ImportDeclaration: first
key-spacing:
- error
-
beforeColon: false
afterColon: true
mode: minimum
keyword-spacing: error
linebreak-style:
- error
- unix
max-len:
- warn
-
code: 120
ignoreStrings: false
ignoreTemplateLiterals: false
ignoreRegExpLiterals: false
ignoreTrailingComments: true
ignoreUrls: true
newline-per-chained-call:
- error
-
ignoreChainWithDepth: 3
no-console: warn
no-eq-null: error
no-extend-native: error
no-extra-parens: warn
no-fallthrough: error
no-global-assign: error
no-magic-numbers: off
no-multi-assign: error
no-multi-spaces:
- error
-
ignoreEOLComments: true
no-new: error
no-octal-escape: error
no-shadow: error
no-shadow-restricted-names: error
no-trailing-spaces: error
no-unused-vars: warn
no-use-before-define:
- error
-
functions: false
no-useless-call: error
no-useless-return: error
no-var: off # this is probably worth turning on and fixing at some point
no-whitespace-before-property: error
object-curly-newline: off
object-curly-spacing:
- error
- always
object-property-newline:
- error
-
allowAllPropertiesOnSameLine: true
one-var-declaration-per-line:
- error
- always
operator-linebreak: off
promise/no-nesting: off
prefer-rest-params: error
prefer-spread: error
quote-props:
- error
- as-needed
-
keywords: true
quotes:
- error
- single
-
avoidEscape: true
allowTemplateLiterals: true
rest-spread-spacing: error
semi:
- error
- never
semi-spacing: error
sort-imports: error
space-before-blocks: error
space-before-function-paren:
- error
-
anonymous: always
named: always
asyncArrow: ignore
space-in-parens: error
space-infix-ops: error
space-unary-ops:
- error
-
words: true
nonwords: false
spaced-comment:
- warn
- always
-
line:
markers:
- /
block:
exceptions:
- "*"
balanced: true
symbol-description: error
template-curly-spacing:
- error
- never
valid-jsdoc: warn
yoda: error
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--- Provide a general summary of the issue in the title above -->

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from the current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Debug Info
<!--- Paste debug info from Help → About here -->
rhythm-server - VERSION

Operating system: OS
CPU architecture: ARCH
Kernel: KERNEL

Docker environment (if applicable):
Using `make up` from `rhythm-docker`
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--- Provide a general summary of your changes in the title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? -->
<!--- Please remove all lines which don't apply. -->
- ✅ Bug fix (non-breaking change which fixes an issue)
- ✅ New feature (non-breaking change which adds functionality)
- ✅ Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:
<!--- Please go over all the following points. -->
<!--- Again, remove any lines which don't apply. -->
<!--- Pull Requests that don't fulfill all [REQUIRED] requisites are likely -->
<!--- to be sent back to you for correction or will be rejected. -->
- ✅ My code follows the code style of this project. **[REQUIRED]**
- ✅ All new and existing tests passed. **[REQUIRED]**
- ✅ My change requires a change to the documentation and I have updated it accordingly.
- ✅ I have added tests to cover my changes.
72 changes: 72 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Makefile to build and test the rhythm-server
# duplicates (and should be kept in sync with) some of the scripts in package.json
#

GIT_TAG_VERSION = $(shell git describe)

COMPILER = ./node_modules/.bin/tsc
LINT = ./node_modules/.bin/eslint
MOCHA = ./node_modules/.bin/mocha

LINT_LOG = logs/lint.log
TEST_LOG = logs/test.log

# Add --quiet to only report on errors, not warnings
LINT_OPTIONS =
LINT_FORMAT = stylish

.DELETE_ON_ERROR :
.PHONY : help all build doc lint test load-test wtftest clean clean-build start-dev

help :
@echo "" ; \
echo "Useful targets in this rhythm-server Makefile:" ; \
echo "- all : run lint, build, test" ; \
echo "- build :" ; \
echo "- lint : run lint over the sources & tests; display results to stdout" ; \
echo "- lint-log : run lint concise diffable output to $(LINT_LOG)" ; \
echo "- test : run the mocha (unit) tests" ; \
echo "- load-test : run the mocha (load) tests" ; \
echo "- wtftest : run the mocha (unit) tests w/ wtfnode to help debug the test run hanging at the end" ; \
echo "- start-dev : start a dev container for the rhythm-server" ; \
echo "- vim-lint : run lint in format consumable by vim quickfix" ; \
echo ""

all : lint build test

build :
@echo build would run the compiler: $(COMPILER)

doc :
@echo doc would run the compiler: $(COMPILER)

lint-log: LINT_OPTIONS = --output-file $(LINT_LOG)
lint-log: LINT_FORMAT = unix
vim-lint: LINT_FORMAT = unix
lint vim-lint lint-log:
$(LINT) $(LINT_OPTIONS) --format $(LINT_FORMAT) src test

test :
$(MOCHA) --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test | tee $(TEST_LOG)

load-test :
$(MOCHA) --reporter spec -r dotenv/config test/load.test.js

wtftest : ./node_modules/.bin/wtfnode
# This is helpful for determining why the tests seem to be hanging after they've "finished"
# it requires the wtfnode package to be installed.
./node_modules/.bin/wtfnode ./node_modules/.bin/_mocha --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test

clean : clean-build

clean-build :
-rm -f dist/*

start-dev :
-docker-compose run rhythm-server bash
-docker-compose rm --force
-docker-compose stop

./node_modules/.bin/wtfnode :
npm install wtfnode --no-save
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3'
services:
rhythm-server:
build: docker/rhythm-server
ports:
- '3000:3000'
volumes:
- ${RHYTHM_SERVER_PATH-.}:/app
depends_on:
- mongo-server
rhythm-rtc:
build: docker/rhythm-rtc
ports:
- '3001:3001'
volumes:
- ${RHYTHM_RTC_PATH-../rhythm-rtc}:/app
depends_on:
- rhythm-server
mongo-server:
image: mongo:latest
volumes:
- ${RHYTHM_DB_PATH-./data}:/data/db
18 changes: 18 additions & 0 deletions docker/rhythm-rtc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:8
LABEL Description="This image runs rhythm-rtc which serves the pages to enable video chat w/ the Media Manager"

# Modified bashrc which defines some aliases and an interactive prompt (for both root & node users)
COPY bashrc /root/.bashrc

# node images have a node user w/ UID 1000 (works well for me for now, but more thought may be needed later) -mjl
USER node
COPY bashrc /home/node/.bashrc

EXPOSE 3001

# rhythm-rtc repository working directory must be bound at /app and all dependent packages installed
VOLUME /app
WORKDIR /app
CMD ["npm", "start"]
# ENTRYPOINT ["/bin/bash"]

23 changes: 23 additions & 0 deletions docker/rhythm-rtc/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ~/.bashrc: executed by bash(1) for non-login shells.

# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

servicename=rhythm-rtc
PS1='\[\033[00;33m\]('${servicename}') \[\033[01;33m\]\u\[\033[00;37m\] \w \[\033[01;36m\]\$\[\033[00m\] '
unset servicename

# colorize `ls'
export LS_OPTIONS='--color=auto'
eval "`dircolors --sh`"

# common ls aliases
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias lla='ls $LS_OPTIONS -lA'
alias l='ls $LS_OPTIONS -CF'
Loading