Permalink
Browse files

Update from head

  • Loading branch information...
1 parent fdd29f7 commit 78be07f6b025b94d82e8042602b7114ff0a2ff14 @twiforce committed Nov 18, 2016
Showing with 11,813 additions and 3,654 deletions.
  1. +47 −0 ISSUE_TEMPLATE.md
  2. +63 −0 NEWS.md
  3. +2 −0 build-player.js
  4. +25 −5 config.template.yaml
  5. +24 −0 docs/gdrive-userscript-serveradmins.md
  6. +29 −0 docs/new-account-chat-restrictions.md
  7. +57 −0 docs/raw-videos.md
  8. +210 −0 gdrive-userscript/cytube-google-drive.user.js
  9. +19 −0 gdrive-userscript/generate-userscript.js
  10. +75 −1 index.js
  11. +35 −10 package.json
  12. +2 −0 player/base.coffee
  13. +1 −0 player/embed.coffee
  14. +35 −0 player/gdrive-player.coffee
  15. +29 −0 player/gdrive-youtube.coffee
  16. +1 −10 player/hitbox.coffee
  17. +23 −0 player/hls.coffee
  18. +1 −1 player/raw-file.coffee
  19. +14 −18 player/rtmp.coffee
  20. +10 −2 player/soundcloud.coffee
  21. +100 −23 player/twitch.coffee
  22. +12 −2 player/update.coffee
  23. +27 −8 player/videojs.coffee
  24. +116 −0 servcmd.sh.js
  25. +25 −77 src/account.js
  26. +23 −0 src/backend/backendconfiguration.js
  27. +93 −0 src/backend/backendmodule.js
  28. +45 −0 src/backend/iobackend.js
  29. +54 −0 src/backend/proxiedsocket.js
  30. +91 −0 src/backend/proxyinterceptor.js
  31. +8 −5 src/bgtask.js
  32. +4 −4 src/channel-storage/channelstore.js
  33. +31 −34 src/channel-storage/dbstore.js
  34. +2 −2 src/channel-storage/filestore.js
  35. +31 −2 src/channel-storage/migrator.js
  36. +8 −12 src/channel/accesscontrol.js
  37. +138 −90 src/channel/channel.js
  38. +34 −1 src/channel/chat.js
  39. +14 −0 src/channel/emotes.js
  40. +22 −11 src/channel/kickban.js
  41. +7 −4 src/channel/library.js
  42. +89 −15 src/channel/mediarefresher.js
  43. +17 −1 src/channel/opts.js
  44. +85 −84 src/channel/playlist.js
  45. +46 −25 src/channel/poll.js
  46. +1 −0 src/channel/ranks.js
  47. +31 −10 src/config.js
  48. +6 −0 src/configuration/webconfig.js
  49. +42 −21 src/counters.js
  50. +8 −1 src/database.js
  51. +15 −44 src/database/accounts.js
  52. +1 −0 src/database/channels.js
  53. +1 −1 src/database/tables.js
  54. +0 −72 src/emitter.js
  55. +130 −44 src/ffmpeg.js
  56. +2 −1 src/flags.js
  57. +69 −44 src/get-info.js
  58. +27 −0 src/io/cluster/dualclusterclient.js
  59. +14 −0 src/io/cluster/partitionclusterclient.js
  60. +22 −0 src/io/cluster/redisclusterclient.js
  61. +110 −47 src/io/ioserver.js
  62. +23 −0 src/legacymodule.js
  63. +2 −1 src/media.js
  64. +55 −0 src/partition/announcementrefresher.js
  65. +66 −0 src/partition/partitionchannelindex.js
  66. +83 −0 src/partition/partitioncli.js
  67. +23 −0 src/partition/partitionconfig.js
  68. +37 −0 src/partition/partitiondecider.js
  69. +83 −0 src/partition/partitionmap.js
  70. +109 −0 src/partition/partitionmodule.js
  71. +30 −0 src/partition/read_channel_list.lua
  72. +56 −0 src/partition/redispartitionmapreloader.js
  73. +3 −1 src/poll.js
  74. +128 −13 src/server.js
  75. +53 −0 src/servsock.js
  76. +7 −7 src/setuid.js
  77. +11 −0 src/switches.js
  78. +83 −79 src/user.js
  79. +35 −0 src/util/murmur.js
  80. +9 −0 src/util/throttle.js
  81. +11 −8 src/utilities.js
  82. +45 −44 src/web/account.js
  83. +2 −2 src/web/acp.js
  84. +22 −18 src/web/auth.js
  85. +86 −0 src/web/middleware/ipsessioncookie.js
  86. +13 −0 src/web/middleware/x-forwarded-for.js
  87. +12 −15 src/web/{jade.js → pug.js}
  88. +2 −2 src/web/routes/channel.js
  89. +2 −2 src/web/routes/contact.js
  90. +7 −0 src/web/routes/google_drive_userscript.js
  91. +5 −3 src/web/routes/index.js
  92. +18 −22 src/web/webserver.js
  93. +8 −2 src/xss.js
  94. +8 −8 templates/{account-channels.jade → account-channels.pug}
  95. +5 −5 templates/{account-edit.jade → account-edit.pug}
  96. +5 −5 templates/{account-passwordrecover.jade → account-passwordrecover.pug}
  97. +5 −5 templates/{account-passwordreset.jade → account-passwordreset.pug}
  98. +5 −5 templates/{account-profile.jade → account-profile.pug}
  99. +5 −5 templates/{acp.jade → acp.pug}
  100. +34 −33 templates/{channel.jade → channel.pug}
  101. +52 −25 templates/{channeloptions.jade → channeloptions.pug}
  102. +15 −15 templates/{contact.jade → contact.pug}
  103. +5 −5 templates/{csrferror.jade → csrferror.pug}
  104. 0 templates/{footer.jade → footer.pug}
  105. +60 −0 templates/google_drive_userscript.pug
  106. +8 −3 templates/{head.jade → head.pug}
  107. +8 −8 templates/{httperror.jade → httperror.pug}
  108. +9 −8 templates/{index.jade → index.pug}
  109. +5 −5 templates/{login.jade → login.pug}
  110. +5 −5 templates/{logout.jade → logout.pug}
  111. +22 −15 templates/{nav.jade → nav.pug}
  112. 0 templates/{pagefooter.jade → pagefooter.pug}
  113. +5 −5 templates/{privacy-policy.jade → privacy-policy.pug}
  114. +5 −5 templates/{register.jade → register.pug}
  115. +5 −5 templates/{tos.jade → tos.pug}
  116. +14 −14 templates/{useroptions.jade → useroptions.pug}
  117. +35 −4 www/css/cytube.css
  118. +5 −1 www/css/themes/bootstrap-theme.min.css
  119. +5 −1 www/css/themes/cyborg.css
  120. +6 −1 www/css/themes/light.css
  121. +7 −2 www/css/themes/modern.css
  122. +5 −1 www/css/themes/slate.css
  123. +320 −235 www/css/video-js.css
  124. +2 −1 www/js/acp.js
  125. +178 −101 www/js/callbacks.js
  126. +11 −5 www/js/data.js
  127. +337 −65 www/js/player.js
  128. +4 −3 www/js/theme.js
  129. +121 −40 www/js/ui.js
  130. +489 −156 www/js/util.js
  131. +6,559 −1,903 www/js/video.js
  132. +12 −0 www/js/videojs-contrib-hls.min.js
View
@@ -0,0 +1,47 @@
+Please fill out the templates below to the best of your ability, based on whether your problem is with using the website or with running your own server.
+
+## Website Problem ##
+
+**Please confirm whether you've tried the following debugging steps:**
+
+ - [ ] Clearing cache and refreshing the page (On Firefox, press Ctrl+F5. On Chrome, press F12, then right click the refresh button and click "Empty Cache and Hard Reload")
+ - [ ] Disabling all browser extensions
+ - [ ] Using a clean channel with no customizations
+
+### Description of the Problem ###
+
+ - What triggers the problem?
+ - What happens?
+ - What do you expect to happen instead?
+
+### System Information ###
+
+ - **Operating System (Windows / Mac / Linux / Android / iOS):**
+ - **Web Browser (Firefox / Chrome / Other):**
+ - **Error Messages Displayed:**
+ - **Screenshot of JavaScript Console:**
+
+_On Firefox, press `Ctrl+Shift+K` to open the JavaScript console. On Chrome, press `Ctrl+Shift+J`._
+
+## Server Problem ##
+
+_If your issue is related to using the website and not about running a server, you can remove this section._
+
+**Please confirm whether you've tried the following debugging steps:**
+
+ - [ ] Run `npm run build-server` to regenerate `lib/` from `src/`
+ - [ ] Run `rm -rf node_modules && npm install` to get a fresh install of dependencies
+ - [ ] Restarted the server
+
+### Description of the Problem ###
+
+ - What triggers the problem?
+ - What happens?
+ - What do you expect to happen instead?
+
+### System Information ###
+
+ - **Operating System:**
+ - **Node Version:** _(run `node -v`)_
+ - **CyTube Version:** _(displayed at startup)_
+ - **Error Messages Displayed:**
View
@@ -1,3 +1,66 @@
+2016-11-02
+==========
+
+After upgrading the dependency on `yamljs`, you may see this error if you didn't
+notice and correct a typo in the config.yaml template:
+
+ Error loading config file config.yaml:
+ { [Error: Unexpected characters near ",".]
+ message: 'Unexpected characters near ",".',
+ parsedLine: 88,
+ snippet: 'title: \'CyTube\',' }
+
+The fix is to edit config.yaml and remove the trailing comma for the `title:`
+property under `html-template`. If there are other syntax errors that the old
+version didn't detect, you will need to correct those as well.
+
+Longer term, I am looking to move away from using `yamljs` to parse
+configuration because it's a little buggy and the current configuration system
+is confusing.
+
+2016-10-20
+==========
+
+Google Drive changed the URL schema for retrieving video metadata, which broke
+CyTube's Google Drive support, even with the userscript. I have updated the
+userscript source with the new URL, so server administrators will have to
+regenerate the userscript for their site and users will be prompted to install
+the newer version.
+
+Additionally, fixing Drive lookups required an update to the `mediaquery`
+module, so you will have to do an `npm install` to pull that fix in.
+
+2016-08-23
+==========
+
+A few weeks ago, the previous Google Drive player stopped working. This is
+nothing new; Google Drive has consistently broken a few times a year ever since
+support for it was added. However, it's becoming increasingly difficult and
+complicated to provide good support for Google Drive, so I've made the decision
+to phase out the native player and require a userscript for it, in order to
+bypass CORS and allow each browser to request the video stream itself.
+
+See [the updated documentation](docs/gdrive-userscript-serveradmins.md) for
+details on how to enable this for your users.
+
+2016-04-27
+==========
+
+A new dependency has been added on `cytube-common`, a module that will hold
+common code shared between the current version of CyTube and the upcoming work
+around splitting it into multiple services. You will need to be sure to run
+`npm install` after pulling in this change to pull in the new dependency.
+
+2016-01-06
+==========
+
+This release updates socket.io to version 1.4.0. The updates to socket.io
+include a few security-related fixes, so please be sure to run `npm install`
+to ensure the updated version is installed before restarting your CyTube server.
+
+ * https://nodesecurity.io/advisories/67
+ * https://github.com/socketio/engine.io/commit/391ce0dc8b88a6609d88db83ea064040a05ab803
+
2015-10-25
==========
View
@@ -8,6 +8,7 @@ var order = [
'youtube.coffee',
'dailymotion.coffee',
'videojs.coffee',
+ 'gdrive-player.coffee',
'raw-file.coffee',
'soundcloud.coffee',
'embed.coffee',
@@ -19,6 +20,7 @@ var order = [
'ustream.coffee',
'imgur.coffee',
'gdrive-youtube.coffee',
+ 'hls.coffee',
'update.coffee'
];
View
@@ -66,6 +66,9 @@ http:
gzip-threshold: 1024
# Secret used for signed cookies. Can be anything, but make it unique and hard to guess
cookie-secret: 'change-me'
+ index:
+ # Maximum number of channels to display on the index page public channel list
+ max-entries: 50
# HTTPS server details
https:
@@ -88,7 +91,7 @@ https:
# Page template values
# title goes in the upper left corner, description goes in a <meta> tag
html-template:
- title: 'CyTube',
+ title: 'Sync'
description: 'Free, open source synchtube'
# Socket.IO server details
@@ -105,6 +108,11 @@ io:
default-port: 1337
# limit the number of concurrent socket connections per IP address
ip-connection-limit: 10
+ # Whether or not to use zlib to compress each socket message (this option is
+ # passed through to socket.io/engine.io).
+ # Note that while this may save a little bandwidth, it also consumes a lot
+ # more CPU and will bottleneck pretty quickly under heavy load.
+ per-message-deflate: false
# Mailer details (used for sending password reset links)
# see https://github.com/andris9/Nodemailer
@@ -182,10 +190,12 @@ reserved-names:
pagetitles: []
# Provide a contact list for the /contact page
-contacts:
- - name: 'calzoneman'
- title: 'Developer'
- email: 'cyzon@cytu.be'
+# Example:
+# contacts:
+# - name: 'my_name'
+# title: 'administrator
+# email: 'me@my.site'
+contacts: []
playlist:
max-items: 4000
@@ -229,3 +239,13 @@ setuid:
# concurrent updates), then run `node lib/channel-storage/migrate.js`.
channel-storage:
type: 'file'
+
+# Allows for external services to access the system commandline
+# Useful for setups where stdin isn't available such as when using PM2
+service-socket:
+ enabled: false
+ socket: 'service.sock'
+
+# Twitch Client ID for the data API (used for VOD lookups)
+# https://github.com/justintv/Twitch-API/blob/master/authentication.md#developer-setup
+twitch-client-id: null
@@ -0,0 +1,24 @@
+# Google Drive Userscript Setup
+
+In response to increasing difficulty and complexity of maintaining Google Drive
+support, the native player is being phased out in favor of requiring a
+userscript to allow each client to fetch the video stream links for themselves.
+Users will be prompted with a link to `/google_drive_userscript`, which explains
+the situation and instructs how to install the userscript.
+
+As a server admin, you must generate the userscript from the template by using
+the following command:
+
+```sh
+npm run generate-userscript <site name> <url> [<url>...]
+```
+
+The first argument is the site name as it will appear in the userscript title.
+The remaining arguments are the URL patterns on which the script will run. For
+example, for cytu.be I use:
+
+```sh
+npm run generate-userscript CyTube http://cytu.be/r/* https://cytu.be/r/*
+```
+
+This will generate `www/js/cytube-google-drive.user.js`.
@@ -0,0 +1,29 @@
+Restricting New Accounts from Chat
+==================================
+
+With the rising availability and popularity of VPNs and proxies, dedicated
+trolls may often come back again and again with a new proxy after being IP
+banned and continue spamming. In order to combat this, a new feature has been
+added to make it more difficult to rejoin quickly and continue spamming.
+
+Channel moderators now have the ability to configure 2 different settings:
+
+ * How long an account must be active before the user can send any chat message
+ * How long an account must be active before the user can send a chat message
+ containing a link
+
+This limit applies to both chat messages sent to the channel as well as private
+messages. Both of these settings can be configured from the Channel Settings
+menu at the top of the page, under the General Settings tab. By default,
+accounts must be at least 10 minutes old to chat, and 1 hour old to send links
+in chat. Setting either restriction to 0 will disable that restriction.
+
+The age of an account is determined as follows:
+
+ * If the user is logged in as a registered account, the registration time of
+ the account is used.
+ * Otherwise, the timestamp of the session cookie is used.
+
+The session cookie is set whenever a user first joins a channel, and is reset
+whenever the user's IP address changes. Different browsers will have different
+session cookies.
View
@@ -0,0 +1,57 @@
+# Raw Videos / Audio #
+
+Want to host your own video/audio files for use on CyTube? For servers with the
+ffprobe module enabled, CyTube supports this! However, in order to provide a
+consistent experience, there are limitations.
+
+## Hosting the File ##
+
+CyTube requires a direct link to the file in order to query it for metadata such
+as duration and encoding. The website where you host the file needs to be able
+to serve the video directly (rather than embedding it in a flash
+player/iframe/etc.). It also needs to serve the correct MIME type for the video
+in the `Content-Type` HTTP header, e.g. `video/mp4`.
+
+I don't recommend hosting videos on Dropbox-type services, as they aren't built
+to distribute video to many users at a time and often have strict bandwidth
+limits. File hosting sites such as Putlocker also cause problems due to being
+unable to serve the file directly, or due to binding the link to the IP address
+of the user who retrieved it. For best results when using raw video, host the
+video yourself on a VPS or dedicated server with plenty of bandwidth.
+
+Note that CyTube only queries the file for metadata, it does not proxy it for
+users! Every user watching the video will be downloading it individually.
+
+## Encoding the Video ##
+
+Current internet browsers are very limited in what codecs they can play
+natively. Accordingly, CyTube only supports a few codecs:
+
+**Video**
+
+ * MP4 (H.264)
+ * WebM (VP8)
+ * WebM (VP9)
+ * Ogg/Theora
+
+**Audio**
+
+ * MP3
+ * Ogg/Vorbis
+
+If your video is in some other format (such as MKV or AVI), then it will need to
+be re-encoded. There are plenty of free programs available to re-encode video
+files, such as [ffmpeg](http://ffmpeg.org/) and
+[handbrake](http://handbrake.fr/).
+
+For best results, encode as an MP4 using H.264. This is natively supported by
+many browsers, and can also be played using a fallback flash player for older
+browsers that don't support it natively. Always encode with the
+[faststart](https://trac.ffmpeg.org/wiki/Encode/H.264#faststartforwebvideo)
+flag.
+
+### Subtitles ###
+
+Unfortunately, soft-subtitles are not supported right now. This is something
+that may be supported in the future, but currently if you need subtitles, they
+will have to be hardsubbed onto the video itself.
Oops, something went wrong.

0 comments on commit 78be07f

Please sign in to comment.