Commit Graph

791 Commits

Author SHA1 Message Date
Mikael Nordfeldth
1ee79dc379 Merge request from chimo adding getvaliddaemons to stopdaemons.php
Source: https://gitorious.org/statusnet/gnu-social/merge_requests/15
2014-07-14 23:53:55 +02:00
Mikael Nordfeldth
04f60fd1d9 Favorites not part of simulation, must implement plugin support 2014-06-28 11:22:07 +02:00
Mikael Nordfeldth
fcdd061b4f pluginified most of hasFave, getFaves and related calls
The code is now more event-driven when it comes to rendering notices
and their related HTML elements, since we can't have direct calls from
core to a plugin.

lib/activitymover.php has a function to move a Favorite activity which
will not happen now. The move must be pluginified and performed as an
event which plugins can catch on to.
2014-06-27 14:09:02 +02:00
chimo
6d9681d398 stopdaemons.sh: dynamic daemons list
Use getvaliddaemons.php instead of the hardcoded list of daemons
2014-06-07 10:34:51 -04:00
Mikael Nordfeldth
fb82c75b49 adminUpdates setting not available now
We don't run a service similar to update.status.net yet. Maybe we should,
but that's for the future to decide. Currently I view it as a callback
that we want to avoid.
2014-05-19 14:53:52 +02:00
Mikael Nordfeldth
37e57610fb Minor script fixes 2014-05-19 14:46:35 +02:00
Mikael Nordfeldth
bf8c26f835 Thumbnail cleaning script, for missing files and File entries
Should be safe to run at any time, since thumbnails are regenerated on demand.
2014-05-12 14:41:12 +02:00
Mikael Nordfeldth
214a10ddec File_thumbnail fixes (run scripts/upgrade.php)
We're now capable of doing image rotation for thumbnails based on
EXIF orientation data. Also, thumbnails are tracked by filenames and
thus we can delete them from storage when we feel like it.
2014-05-12 14:33:41 +02:00
Mikael Nordfeldth
c8c7f5b3fe Test against PHP_VERSION < 5.2.6, we don't support that low 2014-05-09 10:36:22 +02:00
Mikael Nordfeldth
1776c90cb9 Moved oEmbed stuff out to a plugin (Oembed). 2014-05-06 23:32:13 +02:00
Joshua Judson Rosen
15c0568d1b Make stopdaemons.sh work with on multi-instance servers. So: - Allow specifying a site on the command-line, just like startdaemons.sh. - If a site is specified, kill only its daemons--not all daemons with pid-files in the piddir. 2014-05-05 13:34:59 +02:00
Mikael Nordfeldth
e526909bd8 File width and height is now properly set for File 2014-04-22 12:09:24 +02:00
Mikael Nordfeldth
d59eb5e184 Dynamically generate thumbnails (see full text)
The File object now stores width and height of files that can
supply this kind of information. Formats which we can not read
natively in PHP do not currently benefit from this. However an
event hook will be introduced later.

The CreateFileImageThumbnail event is renamed to:
CreateFileImageThumbnailSource to clarify that the hooks should not
generate their own thumbnails but only the source image. Also it now
accepts File objects, not MediaFile objects.

The thumbnail generation is documented in the source code. For
developers, call 'getThumbnail' on a File object and hope for the best.

Default thumbnail sizes have increased to be more appealing.
2014-04-21 20:46:11 +02:00
Mikael Nordfeldth
0a4e1e0f1b Revert "Don't add redundant includedir INSTALLDIR.'/extlib/'"
This reverts commit 31d8069779.

I didn't notice any errors because I had php-pear installed. :]
2014-03-15 14:04:11 +01:00
Mikael Nordfeldth
31d8069779 Don't add redundant includedir INSTALLDIR.'/extlib/' 2014-03-09 22:11:08 +01:00
Mikael Nordfeldth
2272cc244d Removed Inbox from core (unused since 4b2a66ed29)
Added the following FIXME:
How should a Twitter user get their Inbox filled with foreign tweets?

Every imported Twitter user has a profile in the Profile table, so we
could setup a Subscription entry for each of those, meaning they get
collected in the InboxNoticeStream... But this would mean a lot of
unnecessary entries and listings that generally just point to the
locked down Twitter service.

Let's figure out a good relation so we can connect any profile to any
imported foreign notice, so it shows up in the "all" feed.
2014-03-06 04:46:29 +01:00
Mikael Nordfeldth
4b2a66ed29 New mechanism for "all" feed (InboxNoticeStream)
Also cleaned up and made typing stricter for the stream, so only
profiles can be submitted. This reasonably also means we can create
"inbox" or "all" streams for foreign profiles as well using the same
stream handler (but of course only for messages we already know about).

To avoid looking up posts for a long time in a large notice database,
the lookback period for the inbox is no longer than the profile creation
date. (this matches the behaviour of Inbox)

Inbox class can probably be removed now.
2014-03-06 04:18:54 +01:00
Jean Baptiste Favre
88c4630063 Dynamically enable scripts/queuedaemon.php into scripts/getvaliddaemons.php depending on common_config('queue', 'daemon') value. True = enabled, False=disabled. Default is false (see previous commit) 2014-03-01 12:16:38 +01:00
Mikael Nordfeldth
5487c596fc Remove callback sneakery by StatusNet 2014-02-23 14:57:12 +01:00
Mikael Nordfeldth
0cd93c2761 Cron plugin added and now default queue handler
Generally the Cron plugin will run if there's still execution time for
1 second since starting the Action processing. If you want to change
this (such as disabling, 0 seconds, or maybe running bigger chunks,
for like 4 seconds) you can do this, where 'n' is time in seconds.

   addPlugin('Cron', array('secs_per_action', n));

Add 'rel_to_pageload'=>false to the array if you want to run the queue
for a certain amount of seconds _despite_ maybe already having run that
long in the previous parts of Action processing.

Perhaps you want to run the cron script remotely, using a machine capable
of background processing (or locally, to avoid running daemon processes),
simply do an HTTP GET request to the route /main/cron of your GNU social.
Setting secs_per_action to 0 in the plugin config will imply that you run
all your queue handling by calling /main/cron (which runs as long as it can).

/main/cron will output "0" if it has finished processing, "1" if it should
be called again to complete processing (because it ran out of time due to
PHP's max_execution_time INI setting).

The Cron plugin also runs events as close to hourly, daily and weekly
as you get, based on the opportunistic method of running whenever a user
visits the site. This means of course that the cron events should be as
fast as possible, not only to avoid delaying page load for users but
also to minimize the risk of running into PHP's max_execution_time. One
suggestion is to only use the events to add new queue items for later processing.

These events are called CronHourly, CronDaily, CronWeekly - however there
is no guarantee that all events will execute, so some kind of failsafe,
transaction-ish method must be implemented in the future.
2013-11-19 14:13:33 +01:00
Mikael Nordfeldth
c942bdcb43 Comment and typing improvements
To make the StatusNet::addPlugin() accept only arrays,
the lib/default.php had to be changed because all plugins
had 'null' as default value instead of an array.
2013-11-19 13:29:26 +01:00
Mikael Nordfeldth
06b068d43b Don't allow double plugin loading 2013-11-19 13:25:02 +01:00
Mikael Nordfeldth
5308e04e83 Don't disable queuedaemons before Cron stuff is done 2013-11-18 00:50:12 +01:00
Mikael Nordfeldth
1a0e17fea6 Minor queue fixes, probably not very important. Preparing for cron 2013-11-13 18:15:21 +01:00
Mikael Nordfeldth
f110fc5c9a Using GNUSOCIAL_VERSION instead of STATUSNET_VERSION 2013-11-01 13:51:41 +01:00
Mikael Nordfeldth
9b6633698c Group discovery from text functions polished
Also removed the entirely unused saveGroups function.

Now avoiding multiGet and using listFind in Profile->getGroups()
so we don't have to deal with ArrayWrapper.
2013-10-29 13:40:14 +01:00
Mikael Nordfeldth
fcba540a14 Removed legacy OMB. Use OStatus for remote profiles. 2013-10-28 16:22:09 +01:00
Mikael Nordfeldth
53b8412aae printv doesn't exist. Use echo to always print on errors. 2013-10-20 21:02:47 +02:00
Mikael Nordfeldth
352bef2374 Add support (and upgrade path) for group profiles 2013-10-15 11:12:50 +02:00
Mikael Nordfeldth
5da72e5aa2 Legacy fixup script from bad block/sub interaction 2013-10-15 11:00:11 +02:00
Mikael Nordfeldth
202f6ad7a9 Removing legacy code and fixup_* for Status_network tags 2013-10-15 10:54:03 +02:00
Mikael Nordfeldth
01935c7cd0 Legacy StatusNet <0.8 stuff, not needed anymore 2013-10-14 13:40:38 +02:00
Mikael Nordfeldth
a0e107f17f Implemented WebFinger and replaced our XRD with PEAR XML_XRD
New plugins:
* LRDD
    LRDD implements client-side RFC6415 and RFC7033 resource descriptor
    discovery procedures. I.e. LRDD, host-meta and WebFinger stuff.

    OStatus and OpenID now depend on the LRDD plugin (XML_XRD).

* WebFinger
    This plugin implements the server-side of RFC6415 and RFC7033. Note:
    WebFinger technically doesn't handle XRD, but we serve both that and
    JRD (JSON Resource Descriptor), depending on Accept header and one
    ugly hack to check for old StatusNet installations.

    WebFinger depends on LRDD.

We might make this even prettier by using Net_WebFinger, but it is not
currently RFC7033 compliant (no /.well-known/webfinger resource GETs).

Disabling the WebFinger plugin would effectively render your site non-
federated (which might be desired on a private site).

Disabling the LRDD plugin would make your site unable to do modern web
URI lookups (making life just a little bit harder).
2013-09-30 22:04:52 +02:00
Mikael Nordfeldth
633191d808 Making sure scripts and tests check for GNUSOCIAL defined (instead of STATUSNET)
Orbited plugin may not work at all anymore, I had no means to try it.
But there's a check whether 'LACONICA' is defined there, which is a
very unlikely thing in the future. So far only tests and scripts have
been migrated consistently, though.
2013-09-28 15:20:10 +02:00
Mikael Nordfeldth
4ca1c10fb8 IMPORTANT: 'GNUSOCIAL' defined, or daemons wouldn't work
Apparently I forgot scripts/commandline.inc in the commit for 'GNUSOCIAL'
definition 4c6803a054.

define('GNUSOCIAL', true); indicates that we're running GNUSOCIAL, and that
one should be aware of this if applying patches.
2013-09-23 22:10:26 +02:00
Mikael Nordfeldth
63306081bc Subscription "get by" functions now don't use ArrayWrappers
They were getting in the way of some strict-typing stuff.
2013-09-21 18:38:14 +02:00
Mikael Nordfeldth
93e878d7ca Make better use of Subscription class
removed lib/subs.php as it was essentially only a wrapper for Subscription
2013-09-19 17:29:05 +02:00
Mikael Nordfeldth
f00949946b minor fixes and cleanups in the scripts directory 2013-09-18 00:25:11 +02:00
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Mikael Nordfeldth
0cb5b6fba7 No need for newline when running 'echo' 2013-08-12 15:22:23 +02:00
Mikael Nordfeldth
542f00f735 printf tries to evaluate "%" in paths, echo does not 2013-08-12 13:18:40 +02:00
Mikael Nordfeldth
20bad68845 Added SSL option to web and cli installers 2013-08-12 13:08:14 +02:00
Evan Prodromou
3fc1d245a1 Merge 1.1.x into master 2013-07-16 10:57:06 -07:00
Evan Prodromou
66f4a39105 Squashed commit of the following:
commit bd23a7da105d635414643dfcedd9c8f710d565b8
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 07:49:03 2013 -0400

    Make the after flag work correctly

commit 5c5845a2f866f0bbffedd8e2e5d1f512f87d5329
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 06:14:43 2013 -0400

    Add an 'after' flag for backup script
2013-06-29 07:52:09 -04:00
Evan Prodromou
4092ee1bd1 Squashed commit of the following:
commit bd23a7da105d635414643dfcedd9c8f710d565b8
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 07:49:03 2013 -0400

    Make the after flag work correctly

commit 5c5845a2f866f0bbffedd8e2e5d1f512f87d5329
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 06:14:43 2013 -0400

    Add an 'after' flag for backup script
2013-06-29 07:49:43 -04:00
Evan Prodromou
0a23946e6b Add messages, directed notices to sim 2013-06-17 20:16:49 -07:00
Evan Prodromou
fb3981bb04 Set the site profile on install 2013-06-17 20:16:31 -07:00
Evan Prodromou
faf4e7e535 Make favorites in createsim 2013-06-16 02:18:19 +00:00
Jean Baptiste Favre
f175512748 Remove static definition of imdaemon.php as valid daemon. 2013-06-15 18:59:17 +02:00
Evan Prodromou
1c1bcd7cc6 Add JSON output for backups
Conflicts:
	lib/useractivitystream.php
2013-05-24 13:51:57 -04:00
Evan Prodromou
4f818c5c81 Add JSON output for backups 2013-05-24 13:50:24 -04:00
Evan Prodromou
4b7a91bb81 Squashed commit of the following:
commit cd43ac412c90722e3b83ec750d9232a2ac2f12c9
Merge: dad72cc adaf175
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jul 9 09:41:05 2012 -0400

    Merge commit 'refs/merge-requests/196' of git://gitorious.org/statusnet/mainline into merge-requests/196

commit adaf17552d3ab35d451c00cdb32d87a107e0e56a
Author: Jeremy Pope <jpope@jpope.org>
Date:   Thu Jul 5 12:33:06 2012 -0500

    fix for XMPP high CPU usage - issue no 3232

commit e573e8ee6690af94259ff8793a84652a139d0662
Author: Jeremy Pope <jpope@jpope.org>
Date:   Thu Jul 5 12:30:34 2012 -0500

    fix for queuedaemon and imdaemon not being stopped by stopdaemons.sh
2012-07-09 09:43:40 -04:00
Evan Prodromou
4a95a0bb60 scripts to join and leave groups 2012-02-07 16:26:51 +01:00
Evan Prodromou
6793616521 Success exit from settag.php if desired state already exists
If you're adding a tag that already exists, or deleting a tag that
doesn't exist, using settag.php, the exit value is 0 instead of
previous -1. This makes scripting around tags a wee bit easier.
2011-10-24 20:13:10 -04:00
Evan Prodromou
b42cc773ed Script to move a statusnetwork from one db server to another
This script helps move a statusnetwork from one DB server to
another. It's for use with multi-site installations (like status.net).
2011-10-16 04:44:08 -04:00
Evan Prodromou
841c71f37d Add profile lists for all tags on upgrade 2011-09-27 11:16:14 -04:00
Evan Prodromou
b0667ea6d4 correct source for createsim notices 2011-09-18 12:37:14 -04:00
Evan Prodromou
73afcad34c add hooks for upgrades 2011-09-15 17:05:32 -04:00
Evan Prodromou
b2ed258e42 Avoid resetting modified for Faves in upgrade script 2011-09-12 15:24:47 -04:00
Evan Prodromou
14f03a237e initialize fave, sub, and membership URIs 2011-09-12 12:13:04 -04:00
Evan Prodromou
b7a5041e80 better output for updateurls.php (and it runs) 2011-09-07 18:53:06 -04:00
Evan Prodromou
e06202852a Make sure reshare notices get the right object_type and verb 2011-09-07 18:34:31 -04:00
Evan Prodromou
f77c850b80 initialize the local_group table 2011-09-07 18:27:20 -04:00
Evan Prodromou
5d54b6019e Move all URL-update scripts to one script 2011-09-07 18:20:14 -04:00
Evan Prodromou
f9f33e2c72 Remove dangerous old database destroyer script 2011-09-07 16:59:33 -04:00
Evan Prodromou
c5d332f40a move yet-another-rediscover-script to OStatus plugin 2011-09-07 16:56:38 -04:00
Evan Prodromou
f0f9435248 one too many cache-clearing scripts. 2011-09-07 16:54:03 -04:00
Evan Prodromou
c262243113 SearchMonkey was shut down October 2010 2011-09-07 16:50:02 -04:00
Evan Prodromou
9ed1beb3a0 Move inbox initialization to upgrade.php
Move the inbox initialization code to upgrade.php. Might not catch
group messages, but maybe that's not a big deal.
2011-09-07 16:48:10 -04:00
Evan Prodromou
dc4f2c3b10 Move conversation table initialization to upgrade script 2011-09-07 16:23:49 -04:00
Evan Prodromou
9e64ae59ba move fixup group uri code to upgrade.php 2011-09-07 16:14:21 -04:00
Evan Prodromou
c265463112 fixup conversations in upgrade.php 2011-09-07 16:09:05 -04:00
Evan Prodromou
3065911afd move fixup_conversations.php to upgrade.php 2011-09-07 16:08:52 -04:00
Evan Prodromou
196be4e6fb move notices-rendered code into upgrade script 2011-09-07 12:10:26 -04:00
Evan Prodromou
34c7c7112a remove script to initialize old-format inboxes 2011-09-07 12:03:52 -04:00
Evan Prodromou
eaf32b7728 remove obsolete sitemap script 2011-08-23 13:31:47 -04:00
Evan Prodromou
f2387d9ad8 remove old and dangerous rebuild scripts 2011-08-22 18:23:28 -04:00
Zach Copley
fc2e6ea172 Fix syntax err 2011-08-04 12:06:57 -07:00
Zach Copley
b2c8f1292d Adjustment to the simulation script so I can use my own word list for test notices 2011-08-03 09:46:29 +00:00
Evan Prodromou
7e9c17bd15 make the default scope depend on site/private 2011-07-01 21:50:04 -04:00
Evan Prodromou
c7608a9ddd fix missing variable for createsim.php 2011-06-27 17:29:33 -04:00
Siebrand Mazeland
a0c80bb478 Use _() instead of _m() as there is no context or plural. 2011-06-19 11:49:33 +02:00
Zach Copley
321060ca71 Script to update (pull) OStatus profiles info and avatars 2011-06-02 18:18:46 -07:00
Evan Prodromou
7f1a30dc40 allow setting some initial tags on a new network 2011-06-01 10:53:46 -04:00
Evan Prodromou
4fd25301b8 add options to show sites with/without a tag 2011-06-01 10:21:03 -04:00
Evan Prodromou
78a9d4966e set the permissions properly for installer 2011-05-05 14:38:19 -07:00
Evan Prodromou
f8c3458216 Option to pre-load a plugin with checkschema script
One of the problems we've had with running large-scale hosting systems
for StatusNet is enabling new plugins. If the plugin is not enabled,
its database tables are not checked at script time. Conversely, if it
is enabled, it may take several hours to run checkschema for tens of
thousands of sites -- during which time users might see DB errors.

A new argument to checkschema lets it pre-load one or more plugins
before checking the schema. This lets us prepare the plugins' database
tables before they're used in production. In a multihome environment,
this can be combined with tags to gradually roll out a new plugin.

In the config file, a stanza like:

   $site = Status_network::getFromHostname(...);

   if ($site->hasTag('fooenabled')) {
      addPlugin('Foo');
   }

...will only enable the plugin on certain sites. Meanwhile, a bash
script like this should gradually enable the plugin:

   # For all sites...
   for site in `php allsites.php`; do
       # Update the schema for the Foo plugin
       php checkschema.php -s$site.wildcard -xFoo;
       # Enable the Foo plugin
       php settag.php -s$site.wildcard fooenabled;
   done
2011-05-04 21:05:25 -07:00
Evan Prodromou
5b23b82b0d script to show software version 2011-04-26 13:01:00 -04:00
Evan Prodromou
239d92176d More interesting test notices in createsim.php 2011-04-12 14:28:26 -04:00
Evan Prodromou
5b9062a518 pre-fill users and groups in createsim.php 2011-04-11 12:38:12 -04:00
Evan Prodromou
9cfd1a59ee use InboxNoticeStream for createsim 2011-04-07 15:29:56 -04:00
Brion Vibber
065a327a86 Add the root index.php to gettext .pot template file generation; some error messages and such in there weren't making it into the TranslateWiki.net database. 2011-04-03 15:22:11 -07:00
Evan Prodromou
47b3fdf059 add scope limit flags to some notices in createsim.php 2011-03-26 16:06:17 -04:00
Evan Prodromou
841a9130e9 fix off-by-one and more replies 2011-03-26 15:36:47 -04:00
Evan Prodromou
efab3c6558 All groups start with a random admin 2011-03-26 15:16:04 -04:00
Evan Prodromou
6902c0af35 Add group posts to createsim.php 2011-03-26 15:08:27 -04:00
Evan Prodromou
bc2f64d7ab Add reply_to to make conversations in createsim.php 2011-03-26 14:58:11 -04:00
Evan Prodromou
3e293363f6 add groups and joins to createsim.php 2011-03-25 17:39:14 -04:00
Evan Prodromou
83fb5e6023 Mass replacement of #-comments with //-comments
like leprous boils in our code. So, I've replaced all of them with //
comments instead. It's a massive, meaningless, and potentially buggy
change -- great one for the middle of a release cycle, eh?
2011-03-22 11:54:23 -04:00
Brion Vibber
09a4cebd47 fix flushrouter.php -- tried to call Cache::delete statically 2011-03-16 15:01:58 -07:00