teamlockr
Core Module for Team Lockr Projects
Last updated 9 months ago by nielswh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install teamlockr 
SYNC missed versions from official npm registry.

#version 1.23.7 Twilio Phone integration:

  • Set the variables TWILIO_AUTH_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_PHONE_NUMBER in your environment:
  1. for the raw path.
  2. permanently in your bash_rc or bash_profile file

$ export TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxx
$ export TWILIO_ACCOUNT_SID=jjjjjjxyyypalslz1
$ export TWILIO_PHONE_NUMBER=+0123465789

Summarizer scheduler Please see file server/summarizer/README.md

Algolia Elastic Search integration:

  • Set variables AlgoliaApiKey, AlgoliaApplicationId, and optionally AlgoliaSearchOnlyApiKey
$ export AlgoliaApiKey=xxxxxx
$ export AlgoliaApplicationId=yyyyyy
$ export AlgoliaSearchOnlyApiKey=zzzzzz

Expects req.params to contain the data above

Localhost https

This thing always has https even for localhost, but add this for mac sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/login.keychain ./config/cert.pem

Document extractor and summarizer

To use the document content extractor and summarizer

  • Make sure to have your: app.settings.projectConfig.appName setup.

  • Make sure to set these variables in your env:

      `DOCS\_USERNAME\_REDIS`
      `DOCS\_PASSWORD\_REDIS`
      `DOCS\_HOST\_REDIS`
      `DOCS\_DB\_REDIS`
      `DOCS\_PORT\_REDIS`
    
  • Also optionally you can set env variable:

      `MAX\_DESCRIPTION\_LENGTH`
    

To run the job

$ cd server/docs-helper && node helper.js [options...]

Allowed Video input formats

  • Retrieved from encoding.com http://www.encoding.com/formats/

    • 3GP/3GP2 (3gp, 3g2)
    • ASF (Windows Media) (asf, wma, wmv)
    • Audio Interchange File Format (AIFF) (aiff, aif, aifc)
    • AVI (avi)
    • DNxHD (SMPTE VC-3)
    • DV video (dv, df)
    • Flash Video (flv, f4v, f4p, f4a, f4b)
    • Matroska (mkv, mk3d, mka, mks)
    • MOV (Quicktime) (mov)
    • RED Camera R3D (r3d)
    • MP4 Audio-only (mp4)
    • MP4 Video/Audio (mp4)
    • MPEG-2 TS (ts, tsv, tsa, m2ts, mts)
    • MPEG-2 PS (mpg, mpeg, m2p, ps)
    • MPEG-1 (mp1, mp2, mp3, m1v, m1a, m2a, mpa, mpv)
    • MPEG audio layer 3
    • Ogg (ogg, ogv, oga, ogx, ogm, spx, opus)
    • PCM (L16, au, pcm, aiff, wav0)
    • RealMedia (rm)
    • VOB (Video Object) (vob)
    • WAV (wav, wave)
    • WebM

Allowed Document input formats

* indd
* rtf
* ppt, pptx
* odt
* jpg, jpeg
* svg
* gif
* png
* pdf
* txt
* eps
* number, numbers
* key, keynote
* tif
* psd
* xls, xlsx
* mp3
* doc, docx
* csv
* wps

ElasticSearch

  • Sample search get(/search/multiSearch', body: { profileIds: [ 'profileA', 'profileB', ], siteIds: [ '53373ff0904f286edbfcbb99', ], postTypes: [ git c 1, 3, ], terms: ['indigenous food', 'niels'], };

Re-indexing

  • To re-index all site posts and comments get('/index/all')

  • To re-index all videos get('/index/all/videos')

  • To re-index all documents get('/index/all/docs')

  • To re-index all comments get('/index/all/comments')

  • To re-index all articles get('/index/all/articles')

Posts Archiving

  • To dynamically change the pagination limits and threshold for achiving: In your env set e.g:
    export ARCHIVE\THRESHOLD=100
    export ARCHIVE\_PAGE\_LIMIT=50

To run a job periodically that combs through the entire site:

$ cd server/postArchiver <db_type>

VerifiedSmsNumber copy from social.phone

Until verifyYourSms is integrated into the UI, users won't have the functionality to set their verifiedSmsNumber. However, the UI allows for setting of social.phone. To allow for a one off job to enable this transfer from social.phone to verifiedSmsNumber make sure to set in your env

export ALLOW_COPY_FROM_SOCIAL_TO_VERIFIED_SMS_NUMBER=true

Get top items

  • Takes different flavours of url:

    1. /site/topitems/:id/select <- searching exactly for topitems in a site

    2. /site/topitems <- searching for topitems in multiple sites

    3. /profile/topitems/:id/select <- searching exactly for topitems in a profile

    4. /profile/topitems <- searching for topitems in profiles

  • Scenarios

    1. and 3)
    req.params.id = '558fe921f1ecd2cdf11'

    req.body = {
        types: [2, 3, 4, 5], // Required (postTypes) 1 - Post, 2 - Event, 3 - Document, 4 - Video, 5 - Attachment, 10 - Folder
        fields: '', // Optional
        limit:  10, // Optional default most likely is 50
        sortby: 'atitle', // the same sortby attribute for folders
        query:  {}, // Optional
    }
    1. and 4)
    {
        types: [2, 3, 4, 5], // Required: postTypes
        fields: '', // Optional
        limit:  10, // Optional
        sortby: 'atitle', // the same sortby attribute for folders
        query:  {}, // Optional
    }

In the routes:

app.get('/top/site/:id', function(req, res, next) {
    var body = {
        siteId: req.params.id,
        types:  [1, 3],
        limit:  5,
        sortby: 'atitle',
    };

    req.app.models.Site.getTopItems(body, function(status, result) {
        res.status(status).send(result);
    });
});

Configure Setup Settings per site:

Configure disableSetup in (/config/projConfig.js).SiteInfo.disableSetup; This setting determines when the setup process that the user goes through when the user logs in if the settings have not yet been set.

disableSetup is returned when GET /sessionInfo/:id is called. It is included in PageInfo.sessionInfo model.


Fanout jobs

To enable notifications and server side jobs such as image resizing, message delivery, posting to multiple clients etc, you'll need to run

$ node server/fanoutapp/notifier.js [options...]
  • In lieu of messages being batched up as opposed to being delivered one by one, a side summarizer has been added
$ cd server/summarizer && ./instantAsHourly.sh [options...]

OR

$ cd server/summarizer && node loader.js instantAsHourly [options...]

Image resizing

To enable image resizing, make sure to install either imagemagick or graphicsmagick. For example on Mac OS X, if you already have brew:

$ brew install imagemagick

Next to make sure the jobs are running:

$ cd server/fanoutapp && notifier.js [options...]

Configure Token expiry durations

Note:

These durations are in milli seconds (ms)

To configure token expiry durations by scope, you'll need to define them either in the process.env or config/modelSettings either as

  • ScopeEmailExpiryDuration
  • ScopeSmsExpiryDuration

e.g

set ScopeEmailExpiryDuration=1000000000


Setting up a vulcanized project

Projects share vulcan as the common denominator and do this by including it as a submodule.

If it does contain a submodule, then we actually need to setup the submodule after cloning the repo itself.

Steps:

  • Clone the repo from the remote source.
  • Clone the submodule.
  • npm install.

To get started after cloning a repo e.g "krakken"

$ git clone git@bitbucket.org:cmgcanada/krakken.git
$ git submodule update --init --recursive
$ npm install

Requirements

The common denominator relationship requires on pre-requisites to be setup above, as symlinks:

-- trailing "/" denotes a directory

  • setup/
  • newrelic.js
  • config/

So basically this will be the view, with "krakken" as the sample

  • krakken ++ config/ ++ setup/ ++ newrelic.js ++ vulcan/ +++ config/ -> ../config
    +++ setup/ -> ../setup +++ newrelic.js -> ../newrelic.js

To learn more about submodules, go to "http://git-scm.com/docs/git-submodule"

Current Tags

  • 1.30.2                                ...           latest (9 months ago)

1 Versions

  • 1.30.2                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (61)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |