Commit graph

213 commits

Author SHA1 Message Date
friendica
6f78d7a85d fix regdir 2015-03-31 21:06:48 -07:00
Mario Vavti
1821b099df this query can take quite a while if there were many updates but it has not been called for a long time (eg nobody called mod sharedwithme). might be a good idea to have this in the poller to clean up on a regular basis and call it once more in mod sharedwithme. what do you think? 2015-03-24 10:56:02 +01:00
friendica
ccef9e5636 put a lower time limit on time travellers 2015-03-22 18:23:37 -07:00
friendica
b1fd6c53a5 tweaks to directory registrations which don't seem to be happening, also downgrade any directory that claims to be a primary directory for RED_GLOBAL. 2015-03-19 15:56:30 -07:00
friendica
36af426538 Nag hub admins with self-signed certs to fix them. Otherwise we'll just have to start
marking them as dead sites.
2015-03-01 20:14:42 -08:00
friendica
b1a92d620e two tracks proceeding in parallel - first adding the ability to store a digital signature with ratings so that directories can pass them around, second provide some directory registration functions so we can obtain a list of directories from somewhere (to pass ratings around between them). This gives the primary directory role some value as that is where you register your directory. 2015-02-01 15:10:52 -08:00
friendica
0596097f86 provide storage for directory based reputation in the xlink table by setting xlink_static = 1, so that xlink_static = 0 is traditional poco linkages 2015-01-26 19:13:06 -08:00
Habeas Codice
9d9be768c5 fix dir server query take 2
rationale: use latest entry rather than latest update. update timestamp is updated for all entries upon success so they
are equivalent. prevents dupes from fake null dates.
2015-01-22 09:25:34 -08:00
Habeas Codice
90fbfb313e Rework directory server update selection query 2015-01-20 20:59:08 -08:00
friendica
7875b79f2f get rid of really old poco records once weekly 2015-01-20 14:04:44 -08:00
friendica
d3830aea96 provide last successful poll run time (using relative time) in siteinfo so that we can tell folks that have no idea what we're talking about that their poller definitely isn't running and this is probably why nothing works correctly. 2014-12-21 18:40:25 -08:00
friendica
1c249a5b06 some poller optimisations and a fix for undefined (empty) dbtype which shows up as a mysql error that 'rand' isn't found. 2014-11-16 15:51:42 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
961049f5fa revert that bit 2014-11-07 12:16:13 -08:00
friendica
1fbd1a79c7 Provide a way to mark photos as adult and hide them from the default album view. Still need a button or setting to enable "unsafe viewing". This has no effect anywhere but in the album views. They can still be viewed by flipping through the individual photos with 'prev' and 'next'. We probably need a comprehensive strategy for how to deal with n-s-f-w photos in albums so consider this a band-aid which requires additional work and integration with other facilities which access these photos. It is entirely optional. 2014-11-06 17:27:28 -08:00
Thomas Willingham
1fb2de6d55 Typo 2014-10-21 17:27:13 +01:00
Thomas Willingham
58431f948e Screwed up merge - put Mike's stuff back. 2014-10-20 19:35:02 +01:00
Thomas Willingham
48b2eafcaa Prevent more than one instance of the poller running at a time. 2014-10-20 19:31:47 +01:00
friendica
c909b8be06 don't auto-archive connections we can't poll. 2014-10-19 21:41:38 -07:00
Paolo Tacconi
15c1529e83 query for statistics are now executed by poller 2014-10-02 13:43:48 +02:00
friendica
0dc33900b6 provide a way to sync locations and get rid of bogus hublocs, now implemented 2014-09-14 22:19:19 -07:00
friendica
21290bffce one more time 2014-09-08 20:47:36 -07:00
friendica
b56e49d196 missed one 2014-09-08 20:45:17 -07:00
friendica
c6d07feff5 This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00' 2014-09-08 20:35:15 -07:00
friendica
844087bc71 implement service class for feed polling frequenecy, fixed a service class bug, moved service class stuff from plugin to account.php where it belongs and load that by default instead of on demand 2014-09-03 19:07:14 -07:00
Thomas Willingham
1c0be39943 Merge remote-tracking branch 'upstream/master' 2014-09-02 01:57:30 +01:00
friendica
2a37d99958 get out the sunnies 2014-08-31 22:15:00 -07:00
Thomas Willingham
473e582d1f Add check_upstream_directory() to check that your directory is still
a directory, and if it isn't, let find_upstream_directory() find you
a new one.
2014-08-31 16:58:17 +01:00
friendica
f11856f839 allow a site to run cron daily at a chosen hour 2014-07-16 16:21:01 -07:00
friendica
376a51f8d8 doc updates 2014-06-06 23:56:52 -07:00
friendica
2386bc4d00 bring back birthdays 2014-06-02 17:49:19 -07:00
friendica
2a6d7b6a07 cleanup dead directory entries. This was a real b#tch, so keep your eye out for issues - which you shouldn't see until next weekend when this is scheduled to run. We're only setting flags, so if anything goes wrong we should be able to recover without too much pain. 2014-05-28 21:42:46 -07:00
Thomas Willingham
1093e8d83e Default discover to on. 2014-03-30 22:59:37 +01:00
Alexandre Hannud Abdo
fedd19ec95 Let the site admin choose whether to display the Discover tab. 2014-03-30 00:03:12 -03:00
friendica
a0674af416 firehose fixes and optimisations. In particular get rid of the unresponsive script warning when trying to load updates (sine they aren't our posts, we can't check for unseen, hence we can't really load updates). Also make the url selection pluggable. 2014-03-27 15:35:29 -07:00
friendica
5a3903a40c firehose testing (network?f=&fh=1) - some possible security bugs so testing purposes only 2014-03-26 22:05:19 -07:00
friendica
20717e3416 let's limit this to two weeks so it doesn't pound servers and waste too much space 2014-03-26 19:23:45 -07:00
friendica
ed14c1f224 more work on firehose 2014-03-26 18:45:01 -07:00
friendica
68fc2a220e prune_hub_reinstalls() and add cron weekly as a side effect 2014-03-19 19:53:14 -07:00
friendica
86d60f572f change flags for one-way connections from hidden to unconnected so we can still use hidden for - well hiding connections 2014-03-04 14:35:42 -08:00
friendica
bfd9f5ec87 enable network/matrix expiration, this should be functional but the options have been reduced/restricted so we're only looking at network posts and ignore anything that is filed, starred, or is resource_type 'photo' (which should not be possible in non-wall posts, but we just want to be sure). Will require the adventurous tester(s) to set 'channel_expire_days' in their channel record. 2014-03-03 19:15:11 -08:00
cvogeley
7cdca97654 Typo 2014-02-27 09:54:07 +01:00
friendica
7d4916ec71 service class downgrade to the default service class on account expiration if using a non-default service class and account has expired. 2014-02-18 15:17:18 -08:00
friendica
9498ed17ab move expiration of notifications to the equivalent of "cron daily" to try and reduce the number of things the poller has to do on every run. 2014-02-11 14:35:02 -08:00
friendica
c0e1e7ed2c Merge https://github.com/friendica/red into zpull 2014-02-11 14:27:44 -08:00
friendica
d02529fde1 implement a forced directory update mode where we unconditionally create a directory sync packet. This is needed to ensure that monthly directory pings are propagated to other directory servers so they can each prove for themselves whether or not an account is alive or dead. We do not trust other directories to provide us information beyond "look at this entry and decide for yourself" as doing otherwise would invite rogue directory manipulations. As this scheduled update occurs on all channels across all servers, we should also pick up refresh messages from all existing channel clones and these should also propagate out to all directory servers using the same mechanism (though perhaps not at the same time). 2014-02-11 14:19:20 -08:00
Thomas Willingham
2d9655627a Clear out old notifications in the poller. 2014-02-11 20:14:45 +00:00
friendica
59094cda51 reversed args in update_modtime, incorrect ud_guid and ud_hash 2014-02-10 20:38:26 -08:00
friendica
06e0272db8 populate some posts when somebody is granted "read stream" permission 2013-11-17 16:50:32 -08:00