Commit Graph

2909 Commits

Author SHA1 Message Date
Zach Copley
923b7de3c6 - Check for read-only vs. read-write access to protected API resources (OAuth)
- Some cleanup
2010-01-27 08:41:26 +00:00
Siebrand Mazeland
4202ffff91 Make more complete sentence. 2010-01-27 00:57:47 +00:00
Zach Copley
aad42427cc New access admin panel for site registration settings 2010-01-26 15:56:19 -08:00
Brion Vibber
58be61b641 Control channel for queue daemons to request graceful shutdown, restart, or update to listen to a newly added or reconfigured site.
queuectl.php --update -s<site>
  queuectl.php --stop
  queuectl.php --restart

Default control channel is /topic/statusnet-control. For external utilities to send a site update ping direct to the queue server, connect via Stomp and send a message formatted thus:

  update:<nickname>

(Nickname here, *not* server hostname! The rest of the queues will be updated to use nicknames later.)

Note that all currently-connected queue daemons will get these notifications, including both queuedaemon.php and xmppdaemon.php. (XMPP will ignore site update requests for sites that it's not handling.)

Limitations:
* only implemented for stomp queue manager so far
* --update may not yet handle a changed server name properly
* --restart won't reload PHP code files that were already loaded at startup. Still need to stop and restart the daemons from 'outside' when updating code base.
2010-01-26 11:49:49 -08:00
Evan Prodromou
655573c213 Single-user mode
New configuration options to define a single-user mode. This hides
most of the "community" pages, like the public timeline and groups.
The main user's timeline becomes the main page, and most other URLs
are changed.

Switching back and forth between 1-user and multi-user mode is
probably hazardous.

Squashed commit of the following:

commit d814aa5c92d14a27a12baba7893f3f8bf63f1d08
Author: Evan Prodromou <evan@status.net>
Date:   Tue Jan 26 00:17:27 2010 -0500

    don't show inbox and outbox in single-user mode

commit 47f19b9523a7015d4c6e460b73ea32c839e00aa1
Author: Evan Prodromou <evan@status.net>
Date:   Tue Jan 26 00:15:22 2010 -0500

    show correct URL for logo in single-user mode

commit 552010cffc33eadbc512ec5a67619dbc2015239a
Author: Evan Prodromou <evan@status.net>
Date:   Tue Jan 26 00:15:06 2010 -0500

    make singleuser its own config section

commit 786ab260a3ca172e57b555c75ca10946d8f258a1
Author: Evan Prodromou <evan@status.net>
Date:   Tue Jan 26 00:05:19 2010 -0500

    make single-user mode work

commit 5b21d7309b3a8dd5a4e0f29aea76f7897f1818b1
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 23:45:55 2010 -0500

    add single-user mode
2010-01-26 00:21:05 -05:00
Evan Prodromou
663e4e02a1 Merge branch 'master' into testing
Conflicts:
	lib/queuemanager.php
2010-01-25 18:13:09 -05:00
Evan Prodromou
b6aa1511eb Merge branch 'master' into 0.9.x 2010-01-25 18:10:59 -05:00
Evan Prodromou
e26a843caf Offload inbox updates to a queue handler to speed up posting online
Moved much of the writing that happens when posting a notice to a new
queuehandler, distribqueuehandler. This updates tags, groups, replies
and inboxes at queue time (or at Web time, if queues are disabled).

To make this work well, I had to break up the monolithic
Notice::blowCaches() and make cache blowing happen closer to where
data is updated.

Squashed commit of the following:

commit 5257626c62750ac4ac1db0ce2b71410c5711cfa3
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 14:56:41 2010 -0500

    slightly better handling of blowing tag memory cache

commit 8a22a3cdf6ec28685da129a0313e7b2a0837c9ef
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:42:56 2010 -0500

    change 'distribute' to 'distrib' so not too long for dbqueue

commit 7a063315b0f7fad27cb6fbd2bdd74e253af83e4f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:39:15 2010 -0500

    change handle_notice() to handle() in distributqueuehandler

commit 1a39ccd28b9994137d7bfd21bb4f230546938e77
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 16:05:25 2010 -0500

    error with queuemanager

commit e6b3bb93f305cfd2de71a6340b8aa6fb890049b7
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:11:34 2010 -0500

    Blow memcache at different point rather than one big function for Notice class

commit 94d557cdc016187d1d0647ae1794cd94d6fb8ac8
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 00:48:44 2010 -0500

    Blow memcache at different point rather than one big function for Notice class

commit 1c781dd08c88a35dafc5c01230b4872fd6b95182
Author: Evan Prodromou <evan@status.net>
Date:   Wed Jan 20 08:54:18 2010 -0500

    move broadcasting and distributing to new queuehandler

commit da3e46d26b84e4f028f34a13fd2ee373e4c1b954
Author: Evan Prodromou <evan@status.net>
Date:   Wed Jan 20 08:53:12 2010 -0500

    Move distribution of notices to new distribute queue handler
2010-01-25 18:08:21 -05:00
Brion Vibber
f3beed6889 Fix presence notification on XMPP thread (now foreground, not background) 2010-01-25 13:49:02 -08:00
Brion Vibber
1ab2483296 Fix presence notification on XMPP thread (now foreground, not background) 2010-01-25 13:48:24 -08:00
Zach Copley
4daf76212a - Had to remove checking read vs. read-write in OAuth authenticated methods
- Will now pick up source attr from OAuth app
2010-01-25 00:51:56 +00:00
Zach Copley
8b24b5ac7b Add Start/EndSetApiUser events when setting API user via OAuth 2010-01-24 16:46:37 -08:00
Zach Copley
1f8ddf716d Check for read vs. read-write access on OAuth authenticated API mehtods. 2010-01-24 16:36:06 -08:00
Zach Copley
9e7f47652d Revoke access token UI 2010-01-24 16:36:05 -08:00
Zach Copley
cff2cfd7a7 Fix approval date and label on apps list 2010-01-24 16:36:05 -08:00
Zach Copley
c0eee277d1 Make sure applications are really looked up by consumer key 2010-01-24 16:36:05 -08:00
Zach Copley
e101a6df6b Rework application registration workflow to be more private 2010-01-24 16:36:04 -08:00
Zach Copley
8da5e98cba OAuth 1.0 working now 2010-01-24 16:36:04 -08:00
Sarven Capadisli
8d02a897dc Updated markup for application edit form; image, radios 2010-01-24 16:36:04 -08:00
Sarven Capadisli
a009052036 A little minimization 2010-01-24 16:36:04 -08:00
Sarven Capadisli
276c4a2a23 Added vcard and photo classes 2010-01-24 16:36:04 -08:00
Sarven Capadisli
34cc03c617 Moved application image inside the anchor 2010-01-24 16:36:03 -08:00
Sarven Capadisli
40c6d09c9f Added missing end tag 2010-01-24 16:36:03 -08:00
Zach Copley
8e91e05392 Make API auth handle OAuth requests w/access tokens 2010-01-24 16:36:03 -08:00
Sarven Capadisli
d998c4b1b8 Fixed tabbing 2010-01-24 16:36:03 -08:00
Sarven Capadisli
0b90f7645e Updated class for application list 2010-01-24 16:36:03 -08:00
Sarven Capadisli
4fb9b43aa2 Updated markup for application edit form submits 2010-01-24 16:36:03 -08:00
Zach Copley
c78937537e Better detial in connected OAuth applications list 2010-01-24 16:36:03 -08:00
Zach Copley
a0b8438773 Exchanging authorized request tokens for access tokens working 2010-01-24 16:36:02 -08:00
Zach Copley
e9e448bcee Workflow for request tokens and authorizing request tokens 2010-01-24 16:36:02 -08:00
Zach Copley
fa81a580bb Action for issuing a request token 2010-01-24 16:36:02 -08:00
Zach Copley
6472331be5 Stubs for API OAuth token exchange stuff 2010-01-24 16:36:02 -08:00
Zach Copley
48e5f2b3c5 Add icons/icon upload to Oauth apps 2010-01-24 16:36:02 -08:00
Zach Copley
3c2b05d222 Workflow for registering new OAuth apps pretty much done. 2010-01-24 16:36:02 -08:00
Zach Copley
9d958fd539 Reorganized the OAuth app URLs and more work on the register app workflow 2010-01-24 16:36:01 -08:00
Zach Copley
ae46bc5fff Started work on interface for displaying connected OAuth apps 2010-01-24 16:36:01 -08:00
Brion Vibber
cb07fd29a3 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 16:01:19 -08:00
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