Commit graph

34 commits

Author SHA1 Message Date
Calvin Montgomery cc69b3c225 Revert "Remove legacy /sioconfig and user agreement link"
ACP has a dependency on `/sioconfig`.  Reverting until that can be
fixed.

This reverts commit a48cab81b9.
2017-08-23 23:15:30 -07:00
Calvin Montgomery cacde7f72d Fix unhandled rejections in webserver 2017-08-23 23:02:08 -07:00
Calvin Montgomery a48cab81b9 Remove legacy /sioconfig and user agreement link
- `/sioconfig` has been deprecated for ages in favor of
    `/socketconfig/${channel}.json`
  - Each website administrator should be responsible for determining the
    appropriate terms of service for their website instead of CyTube
    providing a default one.
2017-08-21 23:19:19 -07:00
Calvin Montgomery d16cfb7328 Add message bus for #677 2017-08-15 18:23:03 -07:00
Calvin Montgomery d0c1e8cbd9 Change metric names to follow prometheus naming guide 2017-08-12 13:12:58 -07:00
Calvin Montgomery 6043647cb7 Skip full user auth for most page renders
Previously, the user's session cookie was being checked against the
database for all non-static requests.  However, this is not really
needed and wastes resources (and is slow).

For most page views (e.g. index, channel page), just parsing the value
of the cookie is sufficient:

  * The cookies are already HMAC signed, so tampering with them ought to
    be for all reasonable purposes, impossible.
  * Assuming the worst case, all a nefarious user could manage to do is
    change the text of the "Welcome, {user}" and cause a (non-functional)
    ACP link to appear clientside, both of which are already possible by
    using the Inspect Element tool.

For authenticated pages (currently, the ACP, and anything under
/account/), the full database check is still performed (for now).
2017-08-01 21:40:26 -07:00
Calvin Montgomery e780e7dadb Deprecate stats table in favor of prometheus integration 2017-07-17 21:58:58 -07:00
Calvin Montgomery c7bec6251e Begin prometheus integration
Add a dependency on `prom-client` and emit a basic latency metric for
testing purposes.  Add a new configuration file for enabling/disabling
prometheus exporter and configuring the listen address.
2017-07-16 22:35:33 -07:00
Calvin Montgomery 07179d6c83 Upgrade to jsli 2.0 2017-07-08 20:11:54 -07:00
Calvin Montgomery 76e0d1b7ec Use proxy-addr for parsing x-forwarded-for
Closes #683 by providing functionality to trust proxies other than
localhost.
2017-06-27 23:37:18 -07:00
Xaekai 6d4558c978 Allow channel path to be customizable
We now allow server operators to customize the /r/ part of the channel links
The new config option in the template is commented and the config module validates and will terminate with status 78 if an improper value is used.
We've also dropped some old cruft and uses a more elegant method to assign CHANNEL.name

Resolves #668
2017-06-16 20:09:36 -07:00
Calvin Montgomery 8306d2d1b6 Refactor logging 2017-04-04 23:02:31 -07:00
Calvin Montgomery 70be35e3fa Experimental ustream fix 2017-03-02 18:47:47 -08:00
Calvin Montgomery 84fa7972e3 Skip minification for userscript 2016-08-30 21:20:42 -07:00
Calvin Montgomery af6e958c49 Merge remote-tracking branch 'origin' into ip-session-age 2016-08-24 19:48:58 -07:00
Calvin Montgomery 5a81ab7ce7 Add a prompt explaining the situation as well as documentation 2016-08-23 21:50:18 -07:00
calzoneman 016b125f49 Initial IP session cookie implementation 2016-08-08 23:03:16 -07:00
Xaekai df5c5cd54f The Puggening: Update from Jade to Pug
1.) module dependency updated from jade 1.11.0 to pug 2.0.0-beta3
2.) All references to Jade have been changed to Pug
3.) /srv/web/jade.js is renamed to pug.js
4.) all template files renamed accordingly
5.) "mixin somename" is automatically considered a declaration, invocations must use "+somename"
6.) variable interpolation is no longer supported inside element attributes, use direct references and string concatenation instead.
7.) bumped minor version
2016-07-07 21:48:09 -07:00
calzoneman aedd0df228 Limit the number of channels displayed on the index page 2016-05-21 16:59:28 -07:00
calzoneman 80c35b4190 Remove unused code 2015-12-12 16:28:24 -08:00
calzoneman 27af66075e Centralize x-forwarded-proto handling; fixes #542 2015-12-12 16:26:14 -08:00
calzoneman fac11ee312 Fix variable misuse 2015-11-03 19:34:12 -08:00
calzoneman 04336c9712 Fix merge error 2015-11-02 21:13:02 -08:00
calzoneman 5ead24e45e Merge branch '3.0' into web-refactoring 2015-11-02 21:07:50 -08:00
calzoneman 6505aa2f5e More refactoring 2015-11-01 17:42:20 -08:00
calzoneman a8cc8e4b04 Add more counters for diagnostic information 2015-10-28 23:38:17 -07:00
calzoneman c2726898e5 Move x-forwarded-for middleware 2015-10-27 23:54:32 -07:00
calzoneman 13d4a49976 Move contact page to its own route handler 2015-10-27 22:04:21 -07:00
calzoneman 88236e036c Add better error pages 2015-10-27 20:44:40 -07:00
calzoneman 50ca141f1d Web refactoring 2015-10-26 22:56:53 -07:00
calzoneman 40e2a608f6 Initial sioconfig migration work 2015-10-19 22:32:00 -07:00
calzoneman 27b501e655 Add /sioconfig.json 2015-09-30 18:36:50 -07:00
calzoneman 22a4115217 webserver: update matcher for HTTP 416 errors 2015-09-27 09:33:42 -07:00
calzoneman 0109a87e55 package: build with babel for ES2015 support
* Rename lib/ -> src/
* Add `postinstall` npm target for compiling src files to lib
* Add `build-watch` npm target for development with babel --watch
* Add `lib/` to .gitignore
* Add `source-map-support` module for babel-generated sourcemaps
2015-09-23 19:27:04 -07:00
Renamed from lib/web/webserver.js (Browse further)