server side of the comment service
Перейти к файлу
Toby Lawrence 7281673648 Add a default response size and a response size limit.
By default, we currently allow a user to retrieve all responses from a
thread, which is terrible from a performance standpoint.

This change adds a default response size of 100, which was chosen to
match typical production pagination parameters, and a response limit of
200.  Given that responses can include children comments, 200 is still a
large number, but far less disastrous than, say, getting 3000 responses,
with all of their children comments.

Both of these values are configurable, and can be overriden via
environment variables.
2016-11-03 08:02:42 -04:00
.tx Update Transifex project name 2014-02-10 16:21:39 -05:00
api Add a default response size and a response size limit. 2016-11-03 08:02:42 -04:00
bin Added binstubs 2016-01-06 00:15:41 -05:00
config Add a default response size and a response size limit. 2016-11-03 08:02:42 -04:00
edx_specs Remove email from User model and API 2014-05-02 11:32:18 -04:00
lib Remove sort order. 2016-09-12 14:30:50 -04:00
locale Add a default response size and a response size limit. 2016-11-03 08:02:42 -04:00
models Add method tracing inside user. 2016-09-28 12:29:30 -04:00
presenters Add the ability to request a thread without its responses. 2016-09-07 09:26:37 -04:00
scripts MA-2678: replace use of 'updated_at' for 'read' state 2016-09-02 11:06:35 +05:00
spec Add a default response size and a response size limit. 2016-11-03 08:02:42 -04:00
.gitignore Added binstubs 2016-01-06 00:15:41 -05:00
.ruby-gemset Replaced .rvmrc with .ruby-version and .ruby-gemset 2015-12-30 19:05:57 -05:00
.travis.yml Revert "Merge pull request #196 from edx/platform/upgrade-to-ruby23" 2016-08-22 15:08:29 -04:00
AUTHORS Add Clinton Blackburn as an author 2015-12-30 18:32:21 -05:00
CHANGELOG.rst Fix Content-Type header 2013-11-06 14:36:29 -05:00
Gemfile Revert "Merge pull request #196 from edx/platform/upgrade-to-ruby23" 2016-08-22 15:08:29 -04:00
Gemfile.lock Switch to using MongoDB 3.0 in tests. 2016-08-10 16:16:39 -04:00
Guardfile Actually use guard for something useful and restart Unicorn when files change. 2012-09-17 16:38:19 -07:00
LICENSE.txt clarify LICENSE 2013-07-10 02:12:26 -04:00
Procfile fix unicorn defaults; keep using old version of config in Procfile 2014-02-21 14:34:05 -05:00
README.rst Revert "Replaced Tire with elasticsearch-model" 2016-08-09 15:37:16 -04:00
Rakefile Revert "Replaced Tire with elasticsearch-model" 2016-08-09 15:37:16 -04:00
app.rb Fix new relic traces. 2016-08-10 11:23:02 -04:00
config.ru Add message for rack config load. 2016-08-10 12:24:51 -04:00
openedx.yaml Specify an owner 2016-09-07 11:06:51 -04:00

README.rst

Part of `edX code`__.

__ http://code.edx.org/

edX Comments Service/Forums   |Travis|_ |Codecov|_
==================================================
.. |Travis| image:: https://travis-ci.org/edx/cs_comments_service.svg?branch=master
.. _Travis: https://travis-ci.org/edx/cs_comments_service

.. |Codecov| image:: http://codecov.io/github/edx/cs_comments_service/coverage.svg?branch=master
.. _Codecov: http://codecov.io/github/edx/cs_comments_service?branch=master

An independent comment system which supports voting and nested comments. It
also supports features including instructor endorsement for education-aimed
discussion platforms.


Running the Server
------------------
If you are running cs_comments_service as part of edx-platform__ development under
devstack, it is strongly recommended to read `those setup documents`__ first.  Note that
devstack will take care of just about all of the installation, configuration, and
service management on your behalf. If running outside of devstack, continue reading below.

__ https://github.com/edx/edx-platform
__ https://github.com/edx/configuration/wiki/edX-Developer-Stack

This service relies on Elasticsearch and MongoDB. By default the service will use the Elasticsearch server available at
`http://localhost:9200` and the MongoDB server available at `localhost:27017`. This is suitable for local development;
however, if you wish to change these values, refer to `config/application.yml` and `config/mongoid.yml` for the
environment variables that can be set to override the defaults.

Before the server is first run, ensure gems are installed by doing ``bundle install``.

To run the server, do ``ruby app.rb [-p PORT]`` where PORT defaults to 4567.


Running Tests
-------------
To run tests, do ``bundle exec rspec``.  Append ``--help`` or see rspec documentation
for additional options to this command.

Internationalization (i18n) and Localization (l10n)
---------------------------------------------------

To run the comments service in a language other than English, set the
``SERVICE_LANGUAGE`` environment variable to the `language code` for the
desired language.  Its default value is en-US.

Setting the language has no effect on user content stored by the service.
However, there are a few data validation messages that may be seen by end
users via the frontend in edx-platform__.  These will be
translated to ``SERVICE_LANGUAGE`` assuming a suitable translation file is
found in the locale/ directory.

__ https://github.com/edx/edx-platform

edX uses Transifex to host translations. To use the Transifex client, be sure
it is installed (``pip install transifex-client`` will do this for you), and
follow the instructions here__ to set up your ``.transifexrc`` file.

__ http://support.transifex.com/customer/portal/articles/1000855-configuring-the-client

To upload strings to Transifex for translation when you change the set
of translatable strings: ``bundle exec rake i18n:push``

To fetch the latest translations from Transifex: ``bundle exec rake i18n:pull``

The repository includes some translations so they will be available
upon deployment. To commit an update to these: ``bundle exec rake i18n:commit``

License
-------

The code in this repository is licensed under version 3 of the AGPL unless
otherwise noted.

Please see ``LICENSE.txt`` for details.

How to Contribute
-----------------

Contributions are very welcome. The easiest way is to fork this repo, and then
make a pull request from your fork. The first time you make a pull request, you
may be asked to sign a Contributor Agreement.

Reporting Security Issues
-------------------------

Please do not report security issues in public. Please email security@edx.org

Mailing List and IRC Channel
----------------------------

You can discuss this code on the `edx-code Google Group`__ or in the
``edx-code`` IRC channel on Freenode.

__ https://groups.google.com/forum/#!forum/edx-code