Commit Graph

18527 Commits

Author SHA1 Message Date
Alexei Sorokin
318d2cb6ca Set the character set before making a connection
Ideally the character set should be set with the connection, and so this is
exactly what's being done now.

And now the character set code is attempted to be generalised.
2021-07-16 19:44:41 +01:00
SENOO, Ken
0b4a49d262 Change required MySQL database character set variable
Changing `character_set_server` requires root permissions and rebooting
the server.

Which is impossible on shared web hosting services.

So use `character_set_database`. This variable can be changed with
user permissions using `ALTER DATABASE`.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
a0f72fe5c6 Avoid ordering just by a timestamp
Try to also employ an id when possible.
Involves reworking some of the indices.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
ae4f3176b1 Remove "magic quotes" code and avoid wrong order implode
"Magic quotes" were removed in PHP 5.4, no need to mitigate it anymore.

Avoid implode() with the join()-like order of arguments which was deprecated
since PHP 7.4 and implicitly since PHP 5.3.
Also avoid implode() with an implicit separator for stylistic reasons.

mktime() with no arguments has been deprecated since PHP 5.1.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
22f6d3ce14 [UTIL] Sanitise instead of validate in common_copy_args()
And remove common_validate_utf8() which is now unused.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
9e94b7f145 [DATABASE] Switch from PEAR DB to MDB2 2021-07-16 19:44:41 +01:00
Alexei Sorokin
2f7d6ef07b [ActivityPub][INBOX][Delete] Stop if the ID is not present 2021-07-16 19:44:41 +01:00
Alexei Sorokin
04018ea4ca [ActivityPub] Fix use of ActivityPubPlugin::pull_remote_profile
It does not throw but return null.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
160b6ccd94 Fix "Implement a class for automatic temporary file handling"
TemporaryFile::commit throws instead of returning a bool.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
d7e7396d17 [Memcached_DataObject] Do not encache on insert
This resulted in N=0 and empty "modified" in cache.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
7e1091eb8c [DATABASE] Make sure the session always uses UTF-8 and UTC 2021-07-16 19:44:41 +01:00
Alexei Sorokin
4e02cb437a [API] Fix /api/statuses/update reporting a failure 2021-07-16 19:44:41 +01:00
Alexei Sorokin
9efbef720d Avoid use of assignments bare inside statements
Either use them in a subroutine call or put parentheses around the assignment.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
7c2cf605f4 [Profile] Extend the allowed length of nicknames to 191 characters 2021-07-16 19:44:41 +01:00
Alexei Sorokin
7fa4d56f05 Implement a class for automatic temporary file handling
And adopt it all over the code.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
590891139f [Memcached_DataObject] Change how multiGet achieves an ordered result
The previous approach sent the key values twice, which for large sets is
twice as bad.

As an optional feature of this approach multiGet now allows retrieving tuples
in exact order and amount of the requested key values.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
b2e009bcd3 [DirectMessage] Simplify the inbox query 2021-07-16 19:44:41 +01:00
Alexei Sorokin
6cb3a0c390 [ActivityPub] Check if a Notice is public via CC as well 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
238652b15d [ActivityPub] Fix note URIs 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
c3cdde0873 [ActivityPub] Tombstones now have datetimes 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
cb78573f59 [TheFreeNetwork] Fix invalid index on lookup 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
82f1fc7ca2 [ActivityPub] Implement Failed Queue 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
751b23f6fe [ActivityPub] Fix DELETE 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
af0366ed58 [ActivityPub] Fix issues concerning Activity URIs
And some other minor bugs.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
d71eea1ba4 [DATABASE] Fix use of ORDER BY with DISTINCT
statuses/retweets_of_me has performance fixed, so it is also stripped of its
"bad query" status.
2021-07-16 19:44:41 +01:00
Diogo Cordeiro
300c4e3d04 [ActivityPub] Revert moving Disfavor to Queues
It seems this kind of notice isn't queued?
2021-07-16 19:44:41 +01:00
Diogo Cordeiro
5f35d9633d [ActivityPub][Queues] Fix Like 2021-07-16 19:44:41 +01:00
Diogo Cordeiro
c834d27dd6 [TheFreeNetwork] Do not allow lower priority protocols to handle remote actors already handled by the higher ones 2021-07-16 19:44:41 +01:00
Alexei Sorokin
a0a37352c8 [Directory] Fix SQL string quotation 2021-07-16 19:44:41 +01:00
Alexei Sorokin
6e5217dc3a [Foreign_link] Change the type of "credentials" to blob
TwitterOAuthClient::packToken uses \0 as a delimeter which can cause issues on
TEXT or VARCHAR.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
912a0cb16c [OpenID] Correct table definition types
"server_url" should not be blob.
Lengths are adjusted to Auth/OpenID/(PostgreSQL|MySQL)Store.php.
2021-07-16 19:44:41 +01:00
Alexei Sorokin
3b514abd6b [Queue_item] Let DataObject construct WHERE IN 2021-07-16 19:44:41 +01:00
Alexei Sorokin
8290b137fa [TwitterBridge][DAEMONS] Fix database connection clean-up 2021-07-16 19:44:40 +01:00
Alexei Sorokin
681aa5b326 [NOTICES] Condition pushdown in the subquery in inboxnoticestream
This improves performance on PostgreSQL.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
47c9bea46f [DATABASE][PostgreSQL] Ignore index prefix length 2021-07-16 19:44:40 +01:00
Alexei Sorokin
2d8f320586 [PostgreSQL] Set timezone to UTC
And remove some redundant neighbouring cruft:
utf8mb4 is already set in mysqlschema more than enough times.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
1f3edd8fdf Rename the mysql_foreign_keys option to foreign_keys
And apply it universally.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
ed68659ece [SESSION] Session ID can be as long as 128 characters 2021-07-16 19:44:40 +01:00
Alexei Sorokin
ddc3371b43 [NOTICE] Store "url" as TEXT and not VARCHAR(191) 2021-07-16 19:44:40 +01:00
Alexei Sorokin
3075cffcd7 [DATABASE] Change collation handling
Before now table definitions could define collations only for MariaDB using the
MariaDB's collation names directly.
Now instead definitions get a slightly more abstract collation name syntax, but
only supporting the collations utf8mb4_bin and utf8mb4_unicode_(cs|ci) (wrapped
as utf8_bin, utf8_general_(cs|ci)), because those are the ones that have
practical use for GNU social.

Which also means that on MariaDB the formerly used utf8mb4_general_(cs|ci) have
been superseded by utf8mb4_unicode_(cs|ci), as they are the more modern
replacement.

Introduce collation support on PostgreSQL which results in use of the C (POSIX)
collation as utf8_bin and the und-x-icu collation as utf8_general_cs.
utf8_general_ci is also mapped to und-x-icu, which makes it case-sensitive,
unfortunately.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
86826a1a68 [SEARCH][PostgreSQL] Make LIKE search case-insensitive 2021-07-16 19:44:40 +01:00
Alexei Sorokin
598e8e4d56 [TwitterBridge] Create Foreign_user before Foreign_link
To keep foreign key constraints intact.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
c11629035b [SEARCH][MariaDB] Change user-facing fulltext search syntax
Now analogous to the simple and safe PostgreSQL's websearch_to_tsquery syntax.
MariaDB's full-text boolean search queries will fail on input such as "@user"
(unquoted) which is particularly noticeable to the user.
2021-07-16 19:44:40 +01:00
Alexei Sorokin
2d6e4e3912 [SEARCH] Exclude message scope 2021-07-16 19:44:40 +01:00
tenma
b7cf60c7b4 [FFmpeg] Add FFmpeg plugin
FFmpeg plugin serves as a better performant/quality alternative to
resize animated GIFs than the ImageMagick plugin.
2021-07-16 19:44:40 +01:00
tenma
4a50579ef1 [MEDIA] Add WebP support
WebP format is now the default image format for anything that
is not an animated GIF. Image Intervention doesn't support
animated WebPs so we don't convert animated GIFs.

ImageFile:
MediaFile:
default:
- Add WebP support
2021-07-16 19:44:40 +01:00
tenma
228e7c423e [ImageMagick] Remove unnecessary code
ImageMagickPlugin:
- Remove animated thumbnail setting, we'll be able to use FFmpeg for performance
- Remove onFillImageFileMetadata and onCreateFileImageThumbnailSource(), these
  are handled just fine by ImageFile
- Bump minor version number

README:
- Update
2021-07-16 19:44:40 +01:00
Alexei Sorokin
e62e429302 [File] Fix file deletion violating foreign keys 2021-07-16 19:44:40 +01:00
Alexei Sorokin
8fc807343b [RedisCache] Connections should not be shared by daemon threads 2021-07-16 19:44:40 +01:00
Alexei Sorokin
a9ae96fa4c [Memcached] Do not set persistent connections for daemons 2021-07-16 19:44:40 +01:00