Commit Graph

2872 Commits

Author SHA1 Message Date
Evan Prodromou
49d500e3e1 defaults for nickname and wildcard 2010-01-24 16:01:08 -08:00
Brion Vibber
60ce2ff3d0 Use new StatusNetwork->serverName() to get full domain for wildcard config until we rebuild queues to be based on nicknames.
Fixes live bug with new *.status.net sites breaking queuedaemon.php
2010-01-24 15:44:09 -08:00
Evan Prodromou
7cd666ae92 defaults for nickname and wildcard 2010-01-24 18:19:13 -05:00
Evan Prodromou
4f213f985f Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	lib/stompqueuemanager.php
2010-01-24 16:12:40 -05:00
Evan Prodromou
54ebb0a2b9 Merge branch 'master' into 0.9.x
Conflicts:
	lib/stompqueuemanager.php
2010-01-24 15:59:57 -05:00
Sarven Capadisli
fed111f08a Removed mobile stylesheet from core output. If Mobile support is
seeked, MobileProfile plugin should be used.
2010-01-24 00:25:31 +01:00
Sarven Capadisli
0f3658d3da Updated path to farbtastic stylesheet 2010-01-24 00:21:14 +01:00
Sarven Capadisli
51fdba09d4 Event hooks for before and after site_notice 2010-01-24 00:14:19 +01:00
Craig Andrews
23c0d663d6 Allow for instances as well as class names to be passed as queue handlers and iomanagers. 2010-01-23 01:03:41 -05:00
Craig Andrews
845f051c2f StompQueueManager uses decode() to decode queued frames 2010-01-22 18:02:05 -05:00
Brion Vibber
a66181c900 Fix unqueuemanager for updated QueueHandler interface 2010-01-22 14:06:20 -08:00
Brion Vibber
6d055ce09e Fix unqueuemanager for updated QueueHandler interface 2010-01-22 13:49:05 -08:00
Brion Vibber
aa038fa9cb Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x 2010-01-22 12:59:52 -08:00
Brion Vibber
6e4cad71e5 Fix for stuck queue messages: wrap processing in stomp transactions so our lack of an ACK if PHP dies actually triggers redelivery.
Previously, messages once delivered would just get stuck in the queue seemingly forever if they never got ACKed.
Note this could lead to partial duplication, for instance if the OMB or Twitter queue handlers die after 1/2 of the outgoing sends.

Recommendations:
* catch exceptions more aggressively within queue handlers (so only PHP fatal errors are likely to kill in the middle)
* for processing that involves sending to multiple clients, consider a second queue similar to the XMPP output, eg for OMB:
 - first queue gets delivery list and builds message data, enqueueing it for each target address
 - second queue can handle each individual outgoing message (and attempt redelivery etc separately)

This would also protect better against a recurring error preventing delivery in the second part, and could spread out any slow sends over multiple threads.
2010-01-22 12:52:56 -08:00
Brion Vibber
c7507e7e9d XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.

Conflicts:

	scripts/xmppdaemon.php
2010-01-22 12:52:36 -08:00
Brion Vibber
99866a459b Fix for stuck queue messages: wrap processing in stomp transactions so our lack of an ACK if PHP dies actually triggers redelivery.
Previously, messages once delivered would just get stuck in the queue seemingly forever if they never got ACKed.
Note this could lead to partial duplication, for instance if the OMB or Twitter queue handlers die after 1/2 of the outgoing sends.

Recommendations:
* catch exceptions more aggressively within queue handlers (so only PHP fatal errors are likely to kill in the middle)
* for processing that involves sending to multiple clients, consider a second queue similar to the XMPP output, eg for OMB:
 - first queue gets delivery list and builds message data, enqueueing it for each target address
 - second queue can handle each individual outgoing message (and attempt redelivery etc separately)

This would also protect better against a recurring error preventing delivery in the second part, and could spread out any slow sends over multiple threads.
2010-01-22 12:35:05 -08:00
Eric Helgeson
b7940ef39f Fix unqueuemanager to work with new Queue layout pushed in 0e852def6a
"* Queue handlers should now define a handle() method instead of handle_notice()"

And Queue managers should call handle() :)
2010-01-22 11:02:23 -05:00
Craig Andrews
7be5e7e524 stupid mistake... let's not talk about this. 2010-01-22 10:40:21 -05:00
Craig Andrews
672126968f Updated some references to the long gnone "isEnclosure" function to the new "getEnclosure" 2010-01-22 10:12:26 -05:00
Brion Vibber
0e852def6a XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.
2010-01-21 22:40:35 -08:00
Brion Vibber
26fdf0c9d2 XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.
2010-01-21 16:42:50 -08:00
Brion Vibber
c9c7bb3234 Merge commit 'origin/testing' into 0.9.x 2010-01-21 16:33:11 -08:00
Brion Vibber
8dafe09ab2 Option to log slow db queries or all db queries
$config['db']['log_queries'] = true; // all
$config['db']['log_slow_queries'] = 10; // queries taking > 10 seconds
2010-01-21 11:07:52 -08:00
Sarven Capadisli
373206ac00 Event hooks for before and after site_notice 2010-01-21 16:49:49 +01:00
Sarven Capadisli
d4fcc8777f Removed mobile stylesheet from core output. If Mobile support is
seeked, MobileProfile plugin should be used.
2010-01-21 13:23:04 +01:00
Zach Copley
fd276ff9e7 Add Start/EndSetApiUser events when setting API user via OAuth 2010-01-20 18:01:07 -08:00
Michele
05156b708a HTTP auth provided is evaluated even if it's not required 2010-01-20 17:55:37 -08:00
Evan Prodromou
c63832f7bf add PubSubHubBub and RSSCloud to list of default plugins 2010-01-20 17:58:23 -05:00
Evan Prodromou
dd0a99f58a Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-19 00:32:05 -05:00
Evan Prodromou
01dc77c2fd Merge branch 'master' into 0.9.x 2010-01-19 00:31:42 -05:00
Evan Prodromou
c7f14cd777 allow all rights reserved, private data 2010-01-19 00:04:58 -05:00
Evan Prodromou
71f519f64a add event for showing content license in action 2010-01-18 23:25:45 -05:00
Brion Vibber
3bf4056055 Fix order of params on 'plugin not found' exception 2010-01-18 09:28:58 -08:00
Sarven Capadisli
187a70873a Updated path to farbtastic stylesheet 2010-01-18 11:29:05 +00:00
Evan Prodromou
1f6bbc1890 Merge branch 'master' into 0.9.x 2010-01-16 08:06:02 -08:00
Evan Prodromou
21c3e08804 Merge branch 'master' of git@gitorious.org:statusnet/mainline 2010-01-16 07:48:59 -08:00
Evan Prodromou
d6b8b13116 change rc3 to beta3 2010-01-16 07:48:46 -08:00
Brion Vibber
598072468c --xmpp-only hack for queuedaemon.php to run separate queue daemon with only xmpp threads 2010-01-15 11:13:06 -08:00
Brion Vibber
ef016dca45 Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x 2010-01-15 09:52:50 -08:00
Brion Vibber
038287c1ff fix for --skip-xmpp hack -- forgot to do it on the ping & confirm handlers 2010-01-14 17:14:41 -08:00
Craig Andrews
a27aef9206 Add nickname suggestion capability for use during autoregistration. 2010-01-14 19:52:11 -05:00
Brion Vibber
58bc33850a temporary --skip-xmpp flag on queuedaemon.php, allows to run queue daemons but skip subscription to xmpp-based queues
(still working on making these behave gracefully when server is down)
2010-01-14 15:32:37 -08:00
Siebrand Mazeland
6d8469947e Make more complete sentence. 2010-01-14 23:38:29 +01:00
Brion Vibber
2f32181c93 Keep handler registration per-site to fix queue registration in mixed config environment 2010-01-14 13:22:33 -08:00
Brion Vibber
7211896b2f Keep handler registration per-site to fix queue registration in mixed config environment 2010-01-14 13:21:48 -08:00
Brion Vibber
8a7171fde6 Don't barf on io loop if xmpp connection failed 2010-01-13 23:38:51 -08:00
Brion Vibber
4b839cfc53 fix for non-% memory soft limit 2010-01-13 21:41:42 -08:00
Brion Vibber
e8abb0c2ed fix for non-% memory soft limit 2010-01-13 21:35:47 -08:00
Brion Vibber
b25deaacea queue daemon fixes: path fix for xmpp, suppress warning in memcached init 2010-01-13 21:24:36 -08:00
Brion Vibber
cb962ed475 queue daemon fixes: path fix for xmpp, suppress warning in memcached init 2010-01-13 21:24:02 -08:00
Zach Copley
33df392289 - Had to remove checking read vs. read-write in OAuth authenticated methods
- Will now pick up source attr from OAuth app
2010-01-14 02:41:11 +00:00
Zach Copley
bbde4d42cc Check for read vs. read-write access on OAuth authenticated API mehtods. 2010-01-14 02:41:10 +00:00
Zach Copley
38269a6579 Revoke access token UI 2010-01-14 02:41:10 +00:00
Zach Copley
9f3c47ccb4 Fix approval date and label on apps list 2010-01-14 02:41:09 +00:00
Zach Copley
6c8bf36fe1 Make sure applications are really looked up by consumer key 2010-01-14 02:41:09 +00:00
Zach Copley
7c34ac8cc2 Rework application registration workflow to be more private 2010-01-14 02:41:09 +00:00
Zach Copley
42a82a024a OAuth 1.0 working now 2010-01-14 02:41:09 +00:00
Sarven Capadisli
881e1c50b9 Updated markup for application edit form; image, radios 2010-01-14 02:41:08 +00:00
Sarven Capadisli
7ffa258196 A little minimization 2010-01-14 02:41:08 +00:00
Sarven Capadisli
69bb4efe00 Added vcard and photo classes 2010-01-14 02:41:07 +00:00
Sarven Capadisli
2b78c061fc Moved application image inside the anchor 2010-01-14 02:41:07 +00:00
Sarven Capadisli
bf53456710 Added missing end tag 2010-01-14 02:41:07 +00:00
Zach Copley
61b3f56647 Make API auth handle OAuth requests w/access tokens 2010-01-14 02:41:07 +00:00
Sarven Capadisli
c80652824a Fixed tabbing 2010-01-14 02:41:07 +00:00
Sarven Capadisli
284301db81 Updated class for application list 2010-01-14 02:41:06 +00:00
Sarven Capadisli
c6bdbd478b Updated markup for application edit form submits 2010-01-14 02:41:06 +00:00
Zach Copley
31c5ebb95c Better detial in connected OAuth applications list 2010-01-14 02:41:06 +00:00
Zach Copley
d8abad7478 Exchanging authorized request tokens for access tokens working 2010-01-14 02:41:06 +00:00
Zach Copley
aba299c5d1 Workflow for request tokens and authorizing request tokens 2010-01-14 02:41:05 +00:00
Zach Copley
2e23638615 Action for issuing a request token 2010-01-14 02:41:05 +00:00
Zach Copley
bcbe013385 Stubs for API OAuth token exchange stuff 2010-01-14 02:41:05 +00:00
Zach Copley
b14a97f5f9 Add icons/icon upload to Oauth apps 2010-01-14 02:41:05 +00:00
Zach Copley
dad67b030f Workflow for registering new OAuth apps pretty much done. 2010-01-14 02:41:04 +00:00
Zach Copley
f802542885 Reorganized the OAuth app URLs and more work on the register app workflow 2010-01-14 02:41:04 +00:00
Zach Copley
5bff6651ba Started work on interface for displaying connected OAuth apps 2010-01-14 02:41:04 +00:00
Sarven Capadisli
085406ea88 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-14 01:50:21 +00:00
Sarven Capadisli
acc48289e5 Update geo location UI for notice form where the geo data info is only
visible on @title of the enable/disable button.
2010-01-14 01:48:57 +00:00
Evan Prodromou
fba840ed56 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-13 17:30:22 -08:00
Evan Prodromou
52bbb2262a rev version in lib/common.php 2010-01-13 17:29:58 -08:00
Brion Vibber
82e57b6204 Fix for dbqueuehandler: if a queue is unrecognized, discard entries rather than attempting to re-run them forever! 2010-01-13 16:33:03 -08:00
Evan Prodromou
464ce741a4 remove session info in syslog 2010-01-13 16:19:20 -08:00
Brion Vibber
0e1f2d4b47 Fix regressions in XMPP output during inbox refactoring
- NOTICE_INBOX_SOURCE_* constants moved to common.php since Notice_inbox.php not always loaded
- fixed typo in User::staticGet() call which caused user #1 to receive messages once for each subscriber instead of for him/herself
- 'continue' -> 'continue 2' inside switch() statement to fix loop escape (PHP considers switch() a looping construct for break & continue)
2010-01-13 18:17:36 +00:00
Sarven Capadisli
2000d2d36b Added timeout error handling for geo location 2010-01-13 15:36:42 +00:00
Sarven Capadisli
9b2fdefe39 Using a JSON object for NoticeDataGeo text instead 2010-01-13 15:21:43 +00:00
Evan Prodromou
430bd69312 add events for subscribing to people and joining groups 2010-01-13 02:16:13 -08:00
Evan Prodromou
23599da91e refactor jabber broadcast for notice_inbox removal 2010-01-13 01:13:49 -08:00
Evan Prodromou
155e4ef4f3 remove some debugging statements from util.php 2010-01-12 23:58:25 -08:00
Evan Prodromou
cc25d3baf0 ws changes for phpcs 2010-01-12 23:56:21 -08:00
Evan Prodromou
e34ece8b06 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-12 23:25:25 -08:00
Brion Vibber
ec145b73fc Major refactoring of queue handlers to support running multiple sites in one daemon.
Key changes:
* Initialization code moved from common.php to StatusNet class;
  can now switch configurations during runtime.
* As a consequence, configuration files must now be idempotent...
  Be careful with constant, function or class definitions.
* Control structure for daemons/QueueManager/QueueHandler has been refactored;
  the run loop is now managed by IoMaster run via scripts/queuedaemon.php
  IoManager subclasses are woken to handle socket input or polling, and may
  cover multiple sites.
* Plugins can implement notice queue handlers more easily by registering a
  QueueHandler class; no more need to add a daemon.

The new QueueDaemon runs from scripts/queuedaemon.php:

* This replaces most of the old *handler.php scripts; they've been refactored
  to the bare handler classes.
* Spawns multiple child processes to spread load; defaults to CPU count on
  Linux and Mac OS X systems, or override with --threads=N
* When multithreaded, child processes are automatically respawned on failure.
* Threads gracefully shut down and restart when passing a soft memory limit
  (defaults to 90% of memory_limit), limiting damage from memory leaks.
* Support for UDP-based monitoring: http://www.gitorious.org/snqmon

Rough control flow diagram:
QueueDaemon -> IoMaster -> IoManager
                           QueueManager [listen or poll] -> QueueHandler
                           XmppManager [ping & keepalive]
                           XmppConfirmManager [poll updates]

Todo:

* Respawning features not currently available running single-threaded.
* When running single-site, configuration changes aren't picked up.
* New sites or config changes affecting queue subscriptions are not yet
  handled without a daemon restart.
* SNMP monitoring output to integrate with general tools (nagios, ganglia)
* Convert XMPP confirmation message sends to use stomp queue instead of polling
* Convert xmppdaemon.php to IoManager?
* Convert Twitter status, friends import polling daemons to IoManager
* Clean up some error reporting and failure modes
* May need to adjust queue priorities for best perf in backlog/flood cases

Detailed code history available in my daemon-work branch:
http://www.gitorious.org/~brion/statusnet/brion-fixes/commits/daemon-work
2010-01-12 20:45:09 -08:00
Brion Vibber
2b10e359fe Avoid PHP notice when outputting API data for remote users; no $user means no $user->timezone :)
Trying to get property of non-object (/srv/com.leuksman.status/lib/api.php:171)
2010-01-12 12:28:24 -08:00
Evan Prodromou
392bc728c7 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-12 12:11:37 -08:00
Brion Vibber
cbc3c7b141 Ticket 2152: avoid fatal when php.ini disables dl via disabled_functions (function_exists returns false even though it exists and cannot be redefined) 2010-01-12 07:24:43 -08:00
Evan Prodromou
7e5c15fa80 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-11 16:23:48 -08:00
Zach Copley
3a9e24e077 Fix format specifier on page title 2010-01-11 23:21:09 +00:00
Evan Prodromou
57ac912519 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-11 15:12:13 -08:00
Evan Prodromou
5d676352c3 strip out session ID from root URL 2010-01-11 15:09:46 -08:00
Sarven Capadisli
c7b768b4c8 Removed period 2010-01-11 16:33:46 +01:00
Evan Prodromou
8809e577b2 Merge branch 'sessionidparam' into 0.9.x
Conflicts:
	lib/command.php
2010-01-11 00:45:26 -08:00
Evan Prodromou
ae7469a127 accept session from 2010-01-11 08:39:02 +00:00