Compare commits

..

3008 Commits

Author SHA1 Message Date
Mario
deb4c54ebf version 11.2.1 2026-05-20 07:53:27 +02:00
Mario
281f518705 update changelog
(cherry picked from commit 496dade675)

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-20 05:51:49 +00:00
Mario
a8d9747b12 test variable before using it
(cherry picked from commit 82b8ed2652)

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-20 05:49:33 +00:00
Mario
4b15b07b8b update changelog
(cherry picked from commit 2625fe9527)

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-20 05:43:42 +00:00
Mario
607a5488d6 Improve detecting suspicious ActivityStreams keys
Using string comparison on the whole key does not work, as some keys
will be given prefixes during expansion. We need to check if the payload
has keys that _contain_ the suspicious keywords we're looking for.


(cherry picked from commit 0c7731bb76)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2026-05-18 19:06:06 +00:00
Mario
519b52ccdc check for currently unsafe json-ld constructs
(cherry picked from commit 67d73f74ac)

45460e99 check for currently unsafe constructs
5ebb8546 move the jsonld unsafe keys check up a little so that it will actually terminate if positive.
363e2ab5 fix invalid json
b2362c8c only expand and check jsonld if verifying
d21ac6ef jsonld: refactor and hard fail on normalisation or expansion error
2e64496e Merge branch 'dev' into json-ld
c0918861 revert always hard fail

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-18 19:05:16 +00:00
Mario
99fd2e1cb9 tests: Use minimal channel for LDSignature tests
Move the channel keypair and other fields needed by the
LDSignature::verify function to the test case itself. This makes the
test case independent on any potential future changes to the fixtures.


(cherry picked from commit 8d283e0be5)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2026-05-18 19:03:59 +00:00
Mario
a69c460ee6 tests: Add basic test for LDSignature::verify
(cherry picked from commit 0cd682d85e)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2026-05-18 19:03:11 +00:00
Mario
71ba6406e3 tests: Fix invalid keypair for channel fixture
(cherry picked from commit 9aff1d4024)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2026-05-18 19:02:48 +00:00
Mario
4922acb18a actually there is no need to set App::$profile here because it will be set in profile_load() if applicable
(cherry picked from commit 0376b5d442)

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-18 19:01:04 +00:00
Mario
a0ea19e51c do not set App::$profile for removed channels and minor cleanup
(cherry picked from commit b20ed4f455)

Co-authored-by: Mario <mario@mariovavti.com>
2026-05-18 19:00:15 +00:00
Mario
8c4457db8b messageFilter: make sure we do not choke if we expect a string but an array is given 2026-03-27 21:53:04 +00:00
Mario
89a1af1794 Merge branch '11.2RC' 2026-03-26 08:08:37 +00:00
Mario
d5e0c24e13 version 11.2 2026-03-26 08:06:51 +00:00
Mario
8fe73d73ce Merge branch 'dev' into 11.2RC 2026-03-26 08:05:53 +00:00
Mario
7559d6bb5c update changelog 2026-03-26 08:05:06 +00:00
Mario
6c40576f94 Merge branch 'dev' into 11.2RC 2026-03-26 07:50:56 +00:00
Mario
1c9c0dc70e update changelog 2026-03-26 07:50:08 +00:00
Mario
bf4227bfef Merge branch 'drop-private-members-from-apidocs' into 'dev'
Remove private members from API docs

See merge request hubzilla/core!2275
2026-03-25 18:12:54 +00:00
Mario
c296d4bbed Merge branch 'drop-custom-ca-certs' into 'dev'
Remove custom CA certs

See merge request hubzilla/core!2274
2026-03-25 18:12:21 +00:00
Harald Eilertsen
68452fb07b Remove private members from API docs
Private class members are internal implementation details, and should
not be in public API documentation.
2026-03-25 18:29:38 +01:00
Harald Eilertsen
7f98cd606b Remove custom CA certs
The included collection of CA certificates has not been updated since
2021, which means it's outdated and possibly a security risk. Also it
should not be necessary, as curl is able to find the system installed CA
certs which is more likely to be up to date and safer.
2026-03-25 18:06:39 +01:00
Mario
d0ae7a0493 Merge branch 'route-apidoc-fixes' into 'dev'
Zotlabs\Extend\Route: API docs and visibility/type fixes

See merge request hubzilla/core!2273
2026-03-25 15:18:27 +00:00
Harald Eilertsen
81e79eec04 Zotlabs\Extend\Route: Add type annotations
Make the code safer by adding type annotations for parameters and return
values.
2026-03-25 15:34:24 +01:00
Harald Eilertsen
7d70f2f0f2 Zotlabs\Extend\Route: Set method visibility
Make `Route::set()` private. It is not referenced outside of the class
itself, and is also unsafe as it uncritically replaces the system routes
with whatever value it was passed.

The remaining functions are set to public visibility.
2026-03-25 12:45:44 +01:00
Harald Eilertsen
016a11ad27 Zotlabs\Extend\Route: Add API docs + licence info 2026-03-25 12:33:11 +01:00
Mario
1637e61681 update changelog 2026-03-25 10:30:27 +00:00
Mario
1ec0e91405 fix issue in route and widget unregister: we should remove only if both arguments are different. Also only register routes and widgets if they are not yet registered 2026-03-25 10:16:49 +00:00
Mario
3ab52a060b add sleep intervals when adding worker tasks in a loop in Activity::init_background_fetch()
(cherry picked from commit 955ee217e3)

Co-authored-by: Mario <mario@mariovavti.com>
2026-03-25 07:54:51 +00:00
Mario
866cd52073 Convo: fetched collections can be huge - add a slight delay between storing items if we did not fetch them from the network to allow the DB to do its thing
(cherry picked from commit 6d8bfe58ef)

Co-authored-by: Mario <mario@mariovavti.com>
2026-03-25 07:52:33 +00:00
Mario
1774140307 Storage/Directory: fix issue where we returned a partial path instead of throwing exception if a directory of a path could not be found 2026-03-23 20:57:46 +00:00
Mario
698dce044d rc2 2026-03-18 09:13:58 +00:00
Mario
bf0d73515e Merge branch 'dev' into 11.2RC 2026-03-18 09:13:23 +00:00
Mario
8152da1275 update changelog 2026-03-18 09:13:00 +00:00
Mario
01de48b994 Merge branch 'dev' into 11.2RC 2026-03-18 09:02:20 +00:00
Mario
eb10820195 Merge branch 'daemon-externals-endless-loop' into 'dev'
Daemon/Externals: Shorten endless loop

See merge request hubzilla/core!2272
2026-03-18 09:01:32 +00:00
Harald Eilertsen
9d33456c89 Daemon/Externals: Shorten endless loop
If the query towards the hubloc table don't return any entries, the loop
would continue without modifying any of the variables that could
possibly make the loop end.
2026-03-17 21:42:28 +01:00
Mario
56c7f76230 Merge branch 'dev' into 11.2RC 2026-03-17 11:47:27 +00:00
Mario
3dd9559d9f fix spdx info and remove superfluous use statements 2026-03-17 06:24:03 +00:00
Mario Vavti
51ac502d97 refactor drop_query_params() to deal with array params and add test 2026-03-16 10:32:59 +01:00
Mario
955ee217e3 add sleep intervals when adding worker tasks in a loop in Activity::init_background_fetch() 2026-03-14 19:58:09 +00:00
Mario
6d8bfe58ef Convo: fetched collections can be huge - add a slight delay between storing items if we did not fetch them from the network to allow the DB to do its thing 2026-03-14 19:41:26 +00:00
Mario
f98f540256 update changelog 2026-03-14 19:37:37 +00:00
Mario
54c7319075 fix version 2026-03-14 10:33:06 +00:00
Mario
72c930f964 remove accent color test 2026-03-14 10:31:32 +00:00
Mario
ce24b86841 fix fatal error in italian hstrings.php 2026-03-14 10:29:48 +00:00
Mario
f63ba541d7 bump dev version 2026-03-13 16:14:46 +00:00
Mario
a9f54473db version and strings and move hmessages.po to hmessages.pot 2026-03-13 16:11:13 +00:00
Mario
eb5ea6536b fix php warning 2026-03-11 19:05:39 +00:00
Mario
2e9b64347d Merge branch 'gettext-updates' into 'dev'
util/run_xgettext: Rename template to .pot and force PHP matching

See merge request hubzilla/core!2271
2026-03-11 18:48:47 +00:00
Mario
4fcff43fb5 Merge branch 'tests-make-loadFixtures-public' into 'dev'
tests: Make loadFixtures public

See merge request hubzilla/core!2270
2026-03-11 18:41:24 +00:00
Harald Eilertsen
260b61ba3b util/run_xgettext: Use PHP matching rules
Explicitly tell xgettext to use PHP matching rules to find translatable
strings.

Project......: Improve Superblock Addon
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-11 11:51:35 +01:00
Harald Eilertsen
d0b7e4ea79 util/run_xgettext: Rename template to .pot
Renaming the translation template to *.pot, works better with some
tooling like poedit and lokalize.

Project......: Improve Superblock Addon
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-11 11:48:09 +01:00
Harald Eilertsen
33c95c810a tests: Make loadFixtures public
Some tests will need to load their own database fixtures. By making this
API public we make it easy for them to do so.

This change is needed by the tests for the Superblock addon.

Project......: Improve Superblock Addon
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-11 11:40:31 +01:00
Mario
81105ff9de Merge branch 'null-date-fix' into 'dev'
Remove use of NULL_DATE constant in core

See merge request hubzilla/core!2269
2026-03-08 17:07:41 +00:00
Harald Eilertsen
ced3113516 Remove unneccessary use statements 2026-03-07 12:00:56 +01:00
Harald Eilertsen
cbd208eea3 Remove use of NULL_DATE constant in core
The NULL_DATE constant is defined conditionally in the DBA static class.
This causes issues with static analyzing tools like PHPStan, because
they can not really know if the constant is defined or not.

We could make PHPStan ignore this, but since there already is a
`get_null_date()` method on the `dba_driver` class, this patch
changes the code to use this method instead.

We could also use the public static attribute `$null_date` on the DBA
class directly, but using a method feels cleaner, and allows for making
the attribute private, or even removing it completely at some later
time.

I'm not removing the NULL_DATE constant for now, in case it is in use by
any extensions.
2026-03-07 11:15:46 +01:00
Mario Vavti
ad85825cab remove composer dev stuff 2026-03-04 18:34:45 +01:00
Mario Vavti
2fb816139a guzzlehttp/psr7 has been removed from the HttpSigner library because it is not required there, hubzilla still needs it 2026-03-04 18:29:33 +01:00
DDEV User
c9166b26c5 update composer libs 2026-03-04 17:51:14 +01:00
Mario Vavti
86d58065b3 deal with leading or missing @ and add more tests 2026-03-04 10:25:32 +01:00
Mario
1f265cc6d5 fix tests (hopefully) 2026-03-04 08:44:09 +00:00
Mario
4474fdd4f9 introduce parse_webbie() with basic tests 2026-03-04 08:34:45 +00:00
Mario
f71eeab5be fix php warning 2026-03-03 11:27:01 +00:00
Mario
b3526415f9 allow to override curl useragent 2026-03-03 10:59:11 +00:00
Mario
471ded3efa Merge branch 'sys_stat_fixes' into dev 2026-03-03 09:19:09 +00:00
Mario
e954d8c55e mod network: dismiss privacy filter for various filter options - fix issue #1973 2026-03-03 09:17:56 +00:00
Mario
70f82c3967 stop duplicating content in reactions - fix issue #1970 2026-03-03 07:57:39 +00:00
Mario
707e07bbbc Merge branch 'sys_stat_fixes' into 'dev'
Only poll perfstats if the widget is actually visible

See merge request hubzilla/core!2267
2026-03-02 13:47:51 +00:00
Mario
e89eb04427 Merge branch 'dev' into sys_stat_fixes 2026-03-02 08:59:45 +00:00
Mario
ae0e82ee3a wait for domn content loaded 2026-03-02 08:48:14 +00:00
Mario
9ea5d20a3d use JS listener instead of jquery 2026-03-02 08:45:42 +00:00
Mario
fd69008484 this probably should not be const but keep it non global anyway 2026-03-02 08:05:31 +00:00
Mario
3256aa8be9 only poll perfstats if the widget id actually visible (the widget is mostly hidden when viewing content in HQ) 2026-03-02 07:34:43 +00:00
Mario
add26a5b5f fix Queue::count() return value 2026-03-01 19:12:01 +00:00
Mario
dc03263bef Merge branch 'system-status-activity-widget' into 'dev'
Add system status activity widget to HQ for admins

See merge request hubzilla/core!2266
2026-03-01 18:42:54 +00:00
Harald Eilertsen
1897cd0b1b Make system status widget a bit more snappy
Fetch the initial data when the widget loads, and then update every five
sec after that. Also better indication of uninitialized values.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-01 11:47:39 +01:00
Harald Eilertsen
ba24958b37 Remove some debug logging in system status widget
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-01 11:38:07 +01:00
Harald Eilertsen
52a2a0d89a Pass loadavg as array from Perfstats
There's no reason we should format the data into a string in the
Perfstats module. Let the recipient do what they want with it instead.

As an example, we reduce the precision of the loadavg stats in the
system status widget. 3 digits precision should be more than enough for
this type of status display.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-01 11:34:28 +01:00
Harald Eilertsen
91944da69e Report queries/sec in system status widget
The total number of queries is not that interesting for performance
measurements, so let's do queries pr/second instead. Adds a timestamp
column to the dataset, which could be useful for other purposes as well
(like making a graph over time etc.)

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-01 11:16:05 +01:00
Harald Eilertsen
78e30a4d32 Simplify stats for getting size of output queue
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-26 16:28:59 +01:00
Harald Eilertsen
ccd6d1a38c Move db stats to separate classes for each db type
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-26 16:19:17 +01:00
Mario
f14c1be963 Some projects use double typing for its objects (bandwagon in this case) - we do not support this, hence go with the first entry and hope for the best. 2026-02-26 11:31:56 +00:00
Harald Eilertsen
db5e92b72d Remove unused/incomplete function
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:34:04 +01:00
Harald Eilertsen
3d3580b23f Validate requests to perfstats
Make some stricter rules for accessing the perfstats module. We only
want to respond to GET request for json data made by a site admin.

This means we also need to pass along the credentials in the request.
Didn't immediately figure out how to do that using `z_fetch_url`, so we
just fall back to using the JavaScript to populate the widget. This
makes it idle for about 5 sec before it gets the first data sample.

I think that's probably OK.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
04d44c9965 Remove link from system status widget title
At least for now, there's no sensible link target, so it's better to not
link anywhere.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
82bd91d9d7 Log error if system status can't load
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
492533729d Human labels for system status widget
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
283b606c09 Update system status activity widget periodically
Adds a bit of javascript that requests the performance stats every 5
seconds.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
b0b5523f2b Add perfstat module
Moves collecting performance statistics for the system status activity
widget to a separate module. This will make it easier to get the data
from JavaScript or external monitoring tools.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:21:09 +01:00
Harald Eilertsen
738797467d Turn dba_driver params into attributes
To allow for inspecting the params used to connect to the database, we
now save the params in the dba_driver object instance as readonly
attributes. An exception is made to the $pass parameter which is set to
protected access, to make it slightly harder to accidentally leak it.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 21:20:52 +01:00
Harald Eilertsen
a2ee5705f4 Add System Status panel to HQ for admins
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 20:15:58 +01:00
Harald Eilertsen
cc1713b69a Add Queue::get_undelivered() helper function
Returns the number of undelivered messages in the outq.

Instead of having direct database queries at various places in the code,
I thought it would be better to keep them in a more logical place.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 20:15:06 +01:00
Harald Eilertsen
6f5e4c5c2e Add QueueWorkerStats class
A simple class to fetch and hold queueworker stats.

Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-23 20:13:33 +01:00
Mario
3e0b9c01b6 Merge branch 'channel-manage-tpl' into 'dev'
move manage channel alert to tpl

See merge request hubzilla/core!2265
2026-02-17 09:22:07 +00:00
SK
25218fea43 move manage channel alert to tpl
allows a way to customize appearance of html for channel manager alerts
2026-02-15 06:42:35 +05:30
Mario
c907e569f1 fix wrong var after refactor 2026-02-14 10:41:52 +00:00
Mario
b6bec6f7b7 reverse logic 2026-02-14 10:29:14 +00:00
Mario
31b5cfe7ef if the event timezone is different from the channel timezone, display the timezone we have adjusted to instead of the actual event timezone. Otherwise we might create UX confusion about if the displayed time is already timezone adjusted or not. 2026-02-13 08:50:25 +00:00
Mario
0efb3c5c95 comment out deprecated use of tags and attachments in activities 2026-02-13 08:25:05 +00:00
Mario
d88f3169c8 fix possibly duplicated terms in activity object 2026-02-13 08:22:19 +00:00
Mario
3772e910df fixup after testing to get a minimalistic working config 2026-02-12 20:12:18 +00:00
Mario
e995d45b53 Merge branch 'patch-1' into 'dev'
Updated the nginx config example to meet the more modern approach.

See merge request hubzilla/core!2249
2026-02-12 19:45:21 +00:00
spirillen
669136bce7 Updated the nginx config example to meet the more modern approach. 2026-02-12 19:45:20 +00:00
Mario
2448e6df27 Merge branch 'fix-undefined-var-issues' into 'dev'
Fix various possibly undefined var issues

See merge request hubzilla/core!2264
2026-02-12 18:30:59 +00:00
Mario
4c0b37db66 fix required $x variable overwritten with attach_mkdirp() data on update 2026-02-12 18:18:00 +00:00
Mario Vavti
85d42cebe2 Merge branch '11.0RC' 2026-01-30 14:21:21 +01:00
Mario Vavti
fcafaef190 version 11.0 2026-01-30 14:20:12 +01:00
Mario
6fa8deddb5 update changelog
(cherry picked from commit 0ea3f3d36d)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-30 13:18:14 +00:00
Mario Vavti
0ea3f3d36d update changelog 2026-01-30 14:14:11 +01:00
Mario
1ef7fcda0a Remove capability to update xchan entries via api. If this functionality is required it should be implemented over a channel endpoint where xchan and channel info would be updated after verification.
(cherry picked from commit cb7dc2059a)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-30 13:00:39 +00:00
Mario Vavti
cb7dc2059a Remove capability to update xchan entries via api. If this functionality is required it should be implemented over a channel endpoint where xchan and channel info would be updated after verification. 2026-01-30 13:34:54 +01:00
Harald Eilertsen
e988bc9fae Fix various possibly undefined var issues
These are all cases where a variable is used where it may possibly be
undefined at the time of use. Typically the var is defined within a
conditional block, but is used outside of that block, or even within
other conditional blocks.

In the common case the variables will most likely be defined, but it is
possible to reach the code where they are used without the variable
being defined.

All issues discovered with PHPStan at level 1.
2026-01-29 22:31:16 +01:00
Mario
bbd60c1a31 update changelog
(cherry picked from commit cb23a9e235)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 16:28:59 +00:00
Mario
951187e540 fix issue where reply-to button is not diplayed for anonymous visitors allthough permission is granted
(cherry picked from commit 8d9623674d)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 16:28:37 +00:00
Mario Vavti
cb23a9e235 update changelog 2026-01-29 17:27:29 +01:00
Mario Vavti
8d9623674d fix issue where reply-to button is not diplayed for anonymous visitors allthough permission is granted 2026-01-29 17:25:45 +01:00
Mario
0c835c3403 update changelog
(cherry picked from commit 6d181ee69e)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 15:57:25 +00:00
Mario Vavti
6d181ee69e update changelog 2026-01-29 16:56:58 +01:00
Mario
0b491a6626 fix wrong icon class
(cherry picked from commit 2d97f8fa25)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 15:55:11 +00:00
Mario
1a0684cc55 fix issue deleting multiple files
(cherry picked from commit 98a3c97820)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 15:54:48 +00:00
Mario Vavti
2d97f8fa25 fix wrong icon class 2026-01-29 16:45:27 +01:00
Mario Vavti
98a3c97820 fix issue deleting multiple files 2026-01-29 16:36:07 +01:00
Mario
081a61a276 update changelog
(cherry picked from commit 89e1328ed0)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 11:39:34 +00:00
Mario Vavti
89e1328ed0 update changelog 2026-01-29 12:38:59 +01:00
Mario
3b516f2ded another hotfix for an issue which requires investigation
(cherry picked from commit 99a1569d07)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-29 11:36:21 +00:00
Mario
8c386191fa move html from search module to tpl
(cherry picked from commit a0cb5fcb3f)

Co-authored-by: SK <sk@utsukta.org>
2026-01-29 11:17:49 +00:00
Mario
5cb4db0353 Merge branch 'dev-send_reg_approval' into 'dev'
(Re?)enable email to user after account approval

See merge request hubzilla/core!2263
2026-01-29 10:45:25 +00:00
Mario
dc43cd9a85 Merge branch 'dev-fix-approve-email' into 'dev'
Add new send_reg_approval_email_from_register function

See merge request hubzilla/core!2262
2026-01-29 10:42:21 +00:00
Mario
5a6a7386a8 Merge branch 'more-xchan-tests' into 'dev'
tests: A few more xchan tests

See merge request hubzilla/core!2261
2026-01-29 10:38:35 +00:00
Mario
4f545e31dd Merge branch 'tests-add-ajax-request-helper' into 'dev'
tests: Add ajax request helper to module test case

See merge request hubzilla/core!2260
2026-01-29 10:35:43 +00:00
Mario
437c0a8913 Merge branch 'search-module-tpl' into 'dev'
move html from search module to tpl

See merge request hubzilla/core!2258
2026-01-29 10:33:05 +00:00
ltning
268fccdb30 Fix SQL in send_reg_confirmation_email_from_register 2026-01-28 20:06:59 +00:00
ltning
bb7689be93 Return boolean instead of nonexistent array 2026-01-28 02:51:58 +00:00
ltning
bd63af69b2 (Re?)enable email to user after account approval
Existing function account_allow() does not seem to be used a whole
lot, and certainly not when approving a registration request.

Created new function send_reg_confirmation_email_from_register
(going for longest-function-name-in-Hubzilla) which attempts to
send such a confirmation email, and also a new email template.

Plugged this into the create_account_from_register function.

Open question: Should the sending of this email be among the success
criteria for the create_account_from_register function?
2026-01-28 02:51:46 +00:00
ltning
e5d4358d61 Clean up send_reg_approval_email_from_register, new email template
Since there is no easy way to produce direct links to approve/reject
registrations, create new email template which simply links to the
Accounts admin page.

In response to comments:
 - Add type annotations
 - Simplify some 'if' statements
 - add and fix some whitespace
 - simplify input arguments to the function
2026-01-27 16:32:16 +00:00
ltning
0fa4962620 Clean up some whitespace confusion in the previous commit 2026-01-27 16:32:16 +00:00
ltning
fe4d6229a4 Add new send_reg_approval_email_from_register function
Current send_reg_approval_email function expects account to already
exist, and does not seem to be called anywhere. New function takes
necessary information from the register table.

Added call to new function in Regate.php after verification is
done. Will fail and roll back if the function call fails or if no
admin accounts were found to notify (delivered<1).
2026-01-27 16:32:16 +00:00
Mario
10c5de4f6e another hotfix for an issue which requires investigation
(cherry picked from commit 99a1569d07)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-27 11:27:01 +00:00
Mario Vavti
99a1569d07 another hotfix for an issue which requires investigation 2026-01-27 12:26:06 +01:00
Harald Eilertsen
9fb5cd12be tests: A few more xchan tests 2026-01-27 09:43:44 +01:00
Harald Eilertsen
d85c737db7 tests: Add ajax request helper to module test case
This is a bit crude, but serves the purpose for now. To emulate an AJAX
request we set the `Content-Type` header to `application/json`, and json
encode the params in the body of the request.
2026-01-26 23:03:07 +01:00
Mario Vavti
9657fc50e9 Merge branch 'dev' into 11.0RC 2026-01-25 13:06:34 +01:00
Mario
de468a29b0 hotfix for issue with the potential to stuff up the queuewrker
(cherry picked from commit 794b456b8a)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2026-01-25 12:05:49 +00:00
Mario Vavti
794b456b8a hotfix for issue with the potential to stuff up the queuewrker 2026-01-25 13:02:15 +01:00
SK
a0cb5fcb3f move html from search module to tpl 2026-01-22 15:26:20 +05:30
Mario
0d382634ec Merge branch 'access_dropdown-tpl' into 'dev'
move html from accesslist module to tpl

See merge request hubzilla/core!2257
2026-01-21 13:24:35 +00:00
SK
225c83dfbe move html from accesslist module to tpl 2026-01-19 14:00:39 +05:30
Mario Vavti
083c4c95d1 Merge branch 'dev' into 11.0RC 2026-01-18 13:07:17 +01:00
Mario Vavti
e736945f1d update changelog 2026-01-18 13:06:42 +01:00
Mario Vavti
4a2e5add36 update changelog 2026-01-18 12:56:59 +01:00
Mario Vavti
067a79a778 Merge branch 'dev' into 11.0RC 2026-01-17 13:02:37 +01:00
Mario
cb0102b971 Merge branch 'channel-activities-header' into 'dev'
move channel-activities header to its tpl

See merge request hubzilla/core!2254
2026-01-17 11:44:55 +00:00
Saiwal K
8b46767d30 move channel-activities header to its tpl 2026-01-17 11:44:54 +00:00
Mario Vavti
26b5dabe72 Merge branch 'dev' into 11.0RC 2026-01-16 12:38:41 +01:00
Mario Vavti
3f39d0d249 fix cloud root folder shows unknown error 2026-01-16 12:38:02 +01:00
Mario Vavti
2b4d2baa7b version 2026-01-16 10:35:29 +01:00
Mario Vavti
3130a94a4c bump redbasic min/max version 2026-01-16 10:27:54 +01:00
Mario Vavti
d44c004bd0 bump dev version 2026-01-15 17:24:39 +01:00
Mario Vavti
c655046e1f version, strings and updated util/run_xgettext.sh 2026-01-15 17:13:32 +01:00
Mario Vavti
b32c1c1e22 composer update 2026-01-15 14:50:39 +01:00
Mario
38f040f9b5 Merge branch 'minor-test-improvements' into 'dev'
tests: Make addonname/tests base addon tests dir

See merge request hubzilla/core!2250
2026-01-15 10:53:57 +00:00
Mario
7dcaebf281 Merge branch 'italian-translation' into 'dev'
Italian translation

See merge request hubzilla/core!2253
2026-01-15 10:53:04 +00:00
Mario
fad5f98405 Merge branch 'bookmarks-layout-tpl' into 'dev'
move html from bookmarks module to its tpl

See merge request hubzilla/core!2255
2026-01-15 10:48:01 +00:00
SK
ea07bd1693 move html from bookmarks module to its tpl 2026-01-15 02:15:26 +05:30
Mario
4a7b2e92a5 make sure we deal with a string
(cherry picked from commit b6153edf6b)

Co-authored-by: Mario <mario@mariovavti.com>
2026-01-08 19:50:31 +00:00
Mario Vavti
deaab14c5f revert revert 2026-01-07 11:37:22 +01:00
Mario Vavti
8258b8b088 revert 2026-01-07 10:52:22 +01:00
Mario Vavti
db5c217a21 reuse the stored filetype 2026-01-07 10:48:11 +01:00
prealpinux
724ee7dbab Italian translation 2026-01-06 22:40:30 +01:00
Mario Vavti
fb9fe0d3c4 bump version 2026-01-05 15:43:32 +01:00
Mario Vavti
9019636449 update attach.filetype field length to match photo.mimetype field length and attempt to find mimetype with finfo class if applicable. 2026-01-05 15:34:42 +01:00
Mario Vavti
933b4fbcfe bump version 2026-01-05 12:21:55 +01:00
Mario Vavti
7675ed0145 add (not exactly correct -> see fixme) mime types for docx and xlsx 2026-01-05 12:14:01 +01:00
Mario
73e7f0aad2 Escape args in xchan_fetch
(cherry picked from commit cedc6c4230)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2026-01-04 19:58:46 +00:00
Mario
f25211d7ff Merge branch 'xchan-fetch-escape-args' into 'dev'
Escape args in xchan_fetch

See merge request hubzilla/core!2252
2026-01-04 19:53:51 +00:00
Mario
30cf6d827c Merge branch 'issue-1960-fix-grammar-in-enotify' into 'dev'
Fix grammar in Enotify::submit

See merge request hubzilla/core!2251
2026-01-04 19:49:42 +00:00
Mario
1323ea8e18 Merge branch 'dev' into 'dev'
move shared post formatting to its own tpl

See merge request hubzilla/core!2248
2026-01-04 19:36:06 +00:00
Saiwal K
9f98f6bbd5 move shared post formatting to its own tpl 2026-01-04 19:36:06 +00:00
Harald Eilertsen
cedc6c4230 Escape args in xchan_fetch 2026-01-04 14:55:03 +01:00
Mario Vavti
b6a58fbf6e make sure editor init also works from the tiles view 2026-01-03 19:31:56 +01:00
Mario Vavti
e295765bef fix typo and wrongedited timestamp. also add data-{id, type} to cloud directory listings 2026-01-02 15:31:54 +01:00
Harald Eilertsen
141dc2fdb7 Fix grammar in Enotify::submit
Fixes issue #1960: https://framagit.org/hubzilla/core/-/issues/1960
2025-12-29 20:37:20 +01:00
Harald Eilertsen
c051c4d0aa tests: Make addonname/tests base addon tests dir
This makes it easier to treat anything under tests/ as namespaced for
PSR-4 autoloading.
2025-12-21 11:05:37 +01:00
Harald Eilertsen
e289078f82 tests: Fix content-type/length in Module\TestCase 2025-12-21 11:04:25 +01:00
Mario
87f79381d9 MessageFilter: move decoding to the caller and also check the summary field 2025-12-19 08:24:22 +00:00
Mario
98840ae1d0 fix deprecation warning 2025-12-16 12:07:20 +00:00
Mario
28746891c8 curl_close() is deprected and noop since PHP version 8.0 2025-12-16 11:47:10 +00:00
Mario
e5d0ef79ef GD imagedestroy() is deprected and noop since PHP version 8.0 2025-12-16 11:16:28 +00:00
Mario Vavti
2eb51233f6 fix hashtag and mentions count after fixing encoding and add tests 2025-12-12 19:15:28 +01:00
Mario Vavti
5432819788 add test for encoded filter entry 2025-12-12 18:51:53 +01:00
Mario
c03f543b54 encoding issue 2025-12-12 17:44:27 +00:00
Mario
de6506eb57 bump version 2025-12-12 11:53:31 +00:00
Mario
fb48bbe2c1 fix replies id reference 2025-12-12 11:52:05 +00:00
Mario
65132c8fdc Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-12-12 11:44:45 +00:00
Mario
2c0936187a improved replies id detection 2025-12-12 11:44:08 +00:00
Mario Vavti
48dbba2f4d implement new version of MessageFilter derived from forte and add some more tests 2025-12-12 12:42:01 +01:00
Mario
16068af0bb remove sodium-plus 2025-12-10 18:42:08 +00:00
Mario
d09b01245f generate password hash with PBKDF2 instead of built in hash function based on argon2 which too resource heavy for our usecase (see comments) also the nonsumo library is almost half in size - we ship both libs now but only use the nonsumo. This fixes crypto for chromium mobile versions. drawback: this change is not backward compatible. 2025-12-10 18:37:18 +00:00
Mario
bdd0b0a6fb sodium-plus is not maintained anymore - use https://github.com/jedisct1/libsodium.js (sumo version because it contains the crypto_pwhash() function) directly instead 2025-12-10 09:41:25 +00:00
Mario
48030617ab check for sodium in decrypt function 2025-12-10 07:34:36 +00:00
Mario
bb49a51be3 feed: fix channel links and check for top=0. also filter out Add and Remove activities when building the feed (we should probably do this in fetch_items() but that will require some refactoring 2025-12-09 12:05:19 +00:00
Mario
da266f5739 Merge branch 'dev' into 'dev'
add active themes list to siteinfo

See merge request hubzilla/core!2247
2025-12-09 11:34:05 +00:00
Mario
f6a4997d6f fix issue #1954 2025-12-09 11:29:51 +00:00
Mario
7a99089204 refactor module feed to allow a (for now) hidden pconfig to allow switching between simple (toplevels only) and complete activity feed, defaulting to simple. Also reomve option for json formatted feed since it is not supported in the backend - issue #1953 2025-12-09 10:51:07 +00:00
Mario
2e55973da2 remove ofeed and ochannel modules which were here to serve deprecated and removed ostatus 2025-12-09 10:02:00 +00:00
Mario
80f4eea9e9 remove support for deprecated AS1 verbs and objects in the network stream filters - improves performance 2025-12-09 08:26:41 +00:00
Mario
be5c8aa2a3 more work on determining whether an event should be adjusted is an all-day event 2025-12-09 08:24:53 +00:00
Mario
643d25b34b simplify and be slightly more strict to define allday events 2025-12-05 22:38:20 +00:00
Mario Vavti
c29d79854e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-12-05 22:24:33 +01:00
Mario
2834544451 an attempt to better deal with events that have no endTime and events that inline timezone offset in the timestamp 2025-12-05 21:16:30 +00:00
Mario Vavti
60eb8aa42b provide the event hash and timezone in the event object 2025-12-05 22:04:52 +01:00
Mario
aff39521cd revert removing of iconfig parsing (it is still required for events for now). Dismiss activitypub.rawmsg and diaspora.fields from parsing 2025-12-05 19:24:28 +00:00
Mario
f19ad4b087 bump version 2025-12-05 09:26:19 +00:00
Mario
fc243196d9 store the object cache right on and remove some commented out code 2025-12-05 09:19:26 +00:00
SK
42e78d9666 add active themes list to siteinfo
Helps choosing instance when creating clones for compatible themes.
2025-12-05 07:36:13 +05:30
Mario
26d1653bfb Merge branch 'hooks-update-api-docs' into 'dev'
Update API docs for Hook interface

See merge request hubzilla/core!2245
2025-12-04 18:41:02 +00:00
Mario Vavti
f39ccab6c1 update composer libs 2025-12-04 14:24:20 +01:00
Mario
a0e6dcbb77 allow the post_mail permission to work independend from the send_stream/post_comment permissions and leave the post_mail perm limit at PERMS_SPECIFIC for the public channel role - issue #1951 2025-12-04 12:31:04 +00:00
Mario
320a0c1b62 only reset obj cache if edited timestamp has changed 2025-12-03 21:02:16 +00:00
Mario
84d52a9ad1 Merge branch 'improve-test-isolation' into 'dev'
Improve test isolation

See merge request hubzilla/core!2246
2025-12-03 19:33:27 +00:00
Mario
dc298ce6c1 bump version 2025-12-03 19:31:11 +00:00
Mario
b464cd6181 this is somehow delicate: make sure we will not relay an item again in case it comes back to us from a channel that sources our channel 2025-12-03 19:05:17 +00:00
Harald Eilertsen
4eb7e29bab Improve test isolation
To ensure tests don't step on each others toes, make sure we back up
the static properties of the global App class before running tests that
modify any of these properties.
2025-12-02 19:58:41 +01:00
Mario
63243808b8 add quoteUri for mastodon which seems to have removed support for quoteUrl 2025-12-02 12:23:38 +00:00
Mario
f271448767 also remove the comment now that we do not use the effective_uid param anymore 2025-12-02 11:57:51 +00:00
Mario
3915164bb4 we do not need to decode iconfig anymore 2025-12-02 10:24:54 +00:00
Harald Eilertsen
94e5aa172c Update API docs for hooks 2025-11-29 22:52:30 +01:00
Harald Eilertsen
ff68bee174 Doxygen: New tag @sideeffect
Use this tag to document unexpected side effects of an API.
2025-11-29 22:49:54 +01:00
Mario
25aa7d5738 fix activity signer not set 2025-11-27 10:10:24 +00:00
Mario
07e3a218cb only check author and owner mismatch 2025-11-27 09:59:33 +00:00
Mario
e6ad00dabc lookup only one item 2025-11-26 10:07:10 +00:00
Mario
23d781e348 improved checks 2025-11-26 08:39:34 +00:00
Mario
b53cacd54c bump version 2025-11-26 07:38:46 +00:00
Mario
ade3da4d89 dismiss objects where the force flag is set for now 2025-11-25 22:50:47 +00:00
Mario
1e5f614a5e Revert "more check possible ownership mismatch"
This reverts commit 159c8dbd5f.
2025-11-25 11:03:27 +00:00
Mario
159c8dbd5f more check possible ownership mismatch 2025-11-25 10:23:03 +00:00
Mario
5faa285f6f version 2025-11-25 08:38:53 +00:00
Mario
c9af19cdb2 check possible ownership mismatch 2025-11-25 08:38:05 +00:00
Mario
3e74e4784c move ObjCache::Set() from Activity::decode_note() to Activity::store() and Libzot::import() where we have already gathered more infos 2025-11-24 22:34:29 +00:00
Mario
bcbd7f4f6d bump version 2025-11-24 07:53:41 +00:00
Mario
7ead6086dc remove trailing slash 2025-11-24 07:49:30 +00:00
Mario
4685568e0d item links will be replaced at the sync receiver side - use the channel url of the current site when storing. fixes issue #1932 2025-11-24 07:48:54 +00:00
Mario
ec57f8293a refine shre to quote conversion 2025-11-23 10:50:21 +00:00
Mario
9e5344d624 fix typo in last commit 2025-11-22 19:57:28 +00:00
Mario
4c122fd3b3 do not attempt tag delivery if not item type post - fix issue #1941 2025-11-22 19:54:58 +00:00
Mario
d318a1b807 make postgres happy
(cherry picked from commit 7959dd9f57)

Co-authored-by: Mario <mario@mariovavti.com>
2025-11-21 22:05:10 +00:00
Mario
7959dd9f57 make postgres happy 2025-11-21 21:54:15 +00:00
Mario
fde03c7ae0 remove commented out code 2025-11-21 20:50:14 +00:00
Mario
7fcc770fbf rename (un)serialise() -> json_(un)serialize() 2025-11-21 20:43:35 +00:00
Mario Vavti
dcb09a8b39 update smarty and base58 2025-11-21 16:45:54 +01:00
Mario
57c22f4d0f fix test 2025-11-21 10:45:45 +00:00
Mario
ed1cfa5c7b fix block/unblock account - issue #1947 2025-11-21 09:25:51 +00:00
Mario
3878dbd6bd show viewsource link for pubstream items 2025-11-21 08:27:53 +00:00
Mario Vavti
e80de634d3 version 10.6.1 2025-11-21 08:10:44 +01:00
Mario
536f80e50b update changelog
(cherry picked from commit 554577fad7)

Co-authored-by: Mario <mario@mariovavti.com>
2025-11-21 07:08:50 +00:00
Mario
554577fad7 update changelog 2025-11-21 07:04:28 +00:00
Mario
3eeb173efd fix insufficient target attribution for forums - channel_url() requires the channel array not the address
(cherry picked from commit 7cadb43029)

Co-authored-by: Mario <mario@mariovavti.com>
2025-11-21 06:53:05 +00:00
Mario
3ac99479fe Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-11-20 23:06:02 +00:00
Mario
7cadb43029 fix insufficient target attribution for forums - channel_url() requires the channel array not the address 2025-11-20 23:05:12 +00:00
Mario
f25ac63f18 Merge branch 'fix-warnings-in-owatest' into 'dev'
Set content type/length for module test requests

See merge request hubzilla/core!2244
2025-11-20 21:20:27 +00:00
Mario
8a79d8d06f Merge branch 'more-tests+speedups' into 'dev'
More tests + speed improvements

See merge request hubzilla/core!2243
2025-11-20 20:49:55 +00:00
Harald Eilertsen
ddf7fad82f Set content type/length for module test requests
Just use default values of 'text/html' and 0 for now. Should probably be
set to more realistic values at some point, but for now it seems to
work.

This fixes warnings in the OwaTest.
2025-11-20 21:48:53 +01:00
Mario
6a9d569d5a singleton object cache - initial commit 2025-11-20 20:41:40 +00:00
Mario
ad017baaa6 singleton object cache - initial commit 2025-11-20 20:41:20 +00:00
Mario
b5d673c102 Merge branch 'test-reload-fixtures-from-db' into 'dev'
Reload fixures from db

See merge request hubzilla/core!2242
2025-11-20 07:21:16 +00:00
Mario Vavti
d7fa707f00 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-11-20 08:02:58 +01:00
Mario Vavti
b4b7ec1693 cross protocol message payload restructuring - initial commit 2025-11-20 07:58:50 +01:00
Harald Eilertsen
6f8b7f177d Replace use of create_identity in MagicTest
Use db fixtures instead. Make the test much snappier.
2025-11-19 22:01:42 +01:00
Harald Eilertsen
7a2a621309 Add hubloc test db fixture
Added entries in the hubloc table to correspond to the channel entries
in channel.yml. These would normally be created by `create_identity`, so
some code expects them to be there.
2025-11-19 21:59:45 +01:00
Harald Eilertsen
fe25bab3a7 Stub crypto calls from CreateIdentityTest
This speeds up the test runs significantly.
2025-11-19 16:58:08 +01:00
Harald Eilertsen
3abd764512 Drop create_identity from Zotfinger test 2025-11-16 22:14:33 +01:00
Harald Eilertsen
dc255a4ecf Begin tests for Profiles module 2025-11-15 11:26:23 +01:00
Harald Eilertsen
fc201ae067 Fix warnings in profile_edit template 2025-11-15 11:26:23 +01:00
Harald Eilertsen
de5455b401 Fix warnings for optional args in field templates 2025-11-15 11:26:22 +01:00
Harald Eilertsen
1243207b8f Fix undefined vars in Profiles module 2025-11-15 11:26:22 +01:00
Harald Eilertsen
39f4a56348 Begin tests for Zotfinger module 2025-11-15 11:26:11 +01:00
Mario
d48c9ce562 only unserialis(z)e if we deal with a string 2025-11-14 18:34:25 +00:00
Mario
6ced694b53 more streamline with jsalmon signature removal 2025-11-14 14:10:46 +00:00
Mario
bc128c604b streamline with jsalmon signature removal 2025-11-14 12:35:29 +00:00
Mario
a2168870b9 add a hint vor cahed state 2025-11-14 12:20:27 +00:00
Mario
c0197b698e fix undefined var 2025-11-14 12:01:58 +00:00
Mario
f2ae99f64e adapt mod viewsrc 2025-11-14 10:06:19 +00:00
Mario
14f6667687 more json serialisation for iconfig 2025-11-14 10:05:59 +00:00
Mario Vavti
6f9348540e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-11-14 10:45:29 +01:00
Mario Vavti
51b667020e use json serialisation for iconfig 2025-11-14 10:44:56 +01:00
Mario
c6d54d03de try to provide the complete raw object in viewsrc 2025-11-13 20:43:56 +00:00
Harald Eilertsen
8e35ef2faa Add test db fixtures for channel table
Add the system user and a test user to the table for use by tests.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
b74a2dff9e Reload test fixtures from db
Reload inserted rows from the DB when loading the test fixtures. This
ensures that we get all default fields and id columns initialized and
validated. Some code under test will require this to work as expected.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
6400bcc81f Set logged in shannel for delete account test
If the logged in account is not set, it triggers a warning.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
4abe0703d7 tests: Use root passwd to set up MySQL test db 2025-11-13 19:51:39 +01:00
Mario
4b389ddba9 Merge branch 'dba-fix-insert' into 'dev'
Improve dba_pdo::insert function

See merge request hubzilla/core!2241
2025-11-13 16:14:06 +00:00
Harald Eilertsen
1e92aeb7f9 Improve dba_pdo::insert function 2025-11-13 16:14:05 +00:00
Mario
b6153edf6b make sure we deal with a string 2025-11-13 09:50:46 +00:00
Mario
93c333a9bc bump version 2025-11-11 11:49:23 +00:00
Mario
43142dde9f OWA2: initial commit 2025-11-11 11:47:57 +00:00
Mario
63bc905061 wrong order of args 2025-11-10 21:03:22 +00:00
Mario
573c6f3df3 shares kiss 2025-11-10 19:50:10 +00:00
Mario
28692b867c nesting shares will be too messy in regard to interop. so when sharing a post with shares, just pick the shares. 2025-11-10 09:25:31 +00:00
Mario
74b8f1f240 Revert "correctly parse and display nested shares"
This reverts commit 0be74299ca.
2025-11-10 09:01:38 +00:00
Mario
0be74299ca correctly parse and display nested shares 2025-11-10 08:01:18 +00:00
Mario
e90fc6d714 fix quote issue with forums
(cherry picked from commit 866d88de53)

Co-authored-by: Mario <mario@mariovavti.com>
2025-11-07 20:30:35 +00:00
Mario
866d88de53 fix quote issue with forums 2025-11-07 20:29:51 +00:00
Mario
69acee497d bump dev version 2025-11-07 19:57:49 +00:00
Mario Vavti
6c74672d40 bump composer PHP version to 8.2 and update libs 2025-11-07 20:55:45 +01:00
Mario
6320506c27 update install document 2025-11-07 19:36:56 +00:00
Mario
1ee0f3ce1d remove unused sprintf.js 2025-11-07 19:23:53 +00:00
Mario
0730d31c22 move twitteroauth to addon_common 2025-11-07 19:04:04 +00:00
Mario
a2a8b2e9fb move slinky to addon_common 2025-11-07 18:57:18 +00:00
Mario
8821fa9a0e this is only used by the openid addon. move it there. 2025-11-07 18:40:14 +00:00
Mario
363100a612 this is only used by the wppost addon. move it there. 2025-11-07 15:09:08 +00:00
Mario
1f7ac5e787 this is only usewd by the wiki addon. move it there. 2025-11-07 14:59:16 +00:00
Mario
2233a0317e remove bootbox lib and unused code 2025-11-07 14:52:30 +00:00
Mario
498ef78e6f remove unused images 2025-11-07 14:45:12 +00:00
Mario
8a606365c8 update path 2025-11-07 14:42:52 +00:00
Mario
9c27f94709 move language specific folders into its own subfolder in /view 2025-11-07 14:38:55 +00:00
Mario
a99e067b91 remove deprecated sjcl library and references 2025-11-07 12:39:58 +00:00
Mario
831f4324ae fix fullscreen button class 2025-11-07 11:59:54 +00:00
Mario
ad205abd90 Merge branch 'profile-visibility-editor-tpl' into 'dev'
updated profile visibility editor to use tpl file for layout

See merge request hubzilla/core!2240
2025-11-07 11:13:38 +00:00
Mario
231f4a28eb remove deprecated code 2025-11-05 20:47:38 +00:00
Mario
95b52b6aa9 adapt mod dreport to the changes in 385c23a2b 2025-11-05 20:43:50 +00:00
Mario
385c23a2b6 fix delivery report when syncing cloned channels 2025-11-05 20:29:29 +00:00
Mario
3a81edbcb0 bump version 2025-11-04 10:45:55 +00:00
Mario
2f377089e6 deprecate outbound JSalmon signatures 2025-11-04 10:45:15 +00:00
Mario
6427e84053 release date 2025-11-04 09:29:51 +00:00
Mario
f1def0c03a Merge branch '10.6RC' 2025-11-04 09:26:29 +00:00
Mario
b8a5ebe0f7 version 10.6 2025-11-04 09:24:43 +00:00
Mario
24a9ad6260 Merge branch 'dev' into 10.6RC 2025-11-03 21:12:42 +00:00
Mario
88577e1e97 Fix encoding for webpage, layout and block title and body when editing - issue #1946 2025-11-03 21:12:04 +00:00
Mario
38225aabc9 Merge branch 'dev' into 10.6RC 2025-11-03 20:43:12 +00:00
Mario
3653ae1af0 fix typo in sql query and some missing data which prevented files and photos to be updated correctly via dav - issue #1944 2025-11-03 09:31:45 +00:00
Mario
f2aa42f18a fix typo 2025-11-03 08:51:21 +00:00
Mario
aa5bd9bbfc do not allow observer posting files to wall if they do not have permission - issue #1940 part two 2025-11-03 08:50:39 +00:00
SK
73b931ed14 updated building profile visibility editor to use tpl file for layout 2025-11-01 01:47:30 +05:30
Mario
42f75842c6 Merge branch 'dev' into 10.6RC 2025-10-30 21:46:41 +00:00
Mario
73fafd9f2b update changelog 2025-10-30 21:46:13 +00:00
Mario
13c51e519d Merge branch 'dev' into 10.6RC 2025-10-30 21:42:38 +00:00
Mario
ef05cecaeb make sure to only call init_contact_edit() on pageload if we have a fragment and are in /connections. this is to prevent fragment hijacking for other pages 2025-10-30 21:37:41 +00:00
Mario
5b6d70fd60 Revert "make sure to only call init_contact_edit() on pageload if we have a fragment and are in /connections. this is to prevent fragment hijacking for other pages"
This reverts commit cfb8bf3ab9.
2025-10-30 21:37:08 +00:00
Mario
cfb8bf3ab9 make sure to only call init_contact_edit() on pageload if we have a fragment and are in /connections. this is to prevent fragment hijacking for other pages 2025-10-30 21:32:30 +00:00
Mario Vavti
3cf7e09609 switch from mmccooks php-json-canonicalization library to root23s which, according to mike, better deals with floating point values 2025-10-30 21:30:18 +01:00
Mario Vavti
a127f76bad Merge branch 'dev' into 10.6RC 2025-10-30 19:37:25 +01:00
Mario Vavti
d11b05de71 unserialise is being called in the get method now 2025-10-30 19:36:01 +01:00
Mario
a03b440139 Merge branch 'dev' into 10.6RC 2025-10-30 10:12:31 +00:00
Mario
2865dc45eb update changelog 2025-10-30 10:12:06 +00:00
Mario
923e80d143 fix merge conflict 2025-10-30 09:58:55 +00:00
Mario
ba96b2ce85 Merge branch 'upgrade-ci-php-82' into 'dev'
CI: Upgrade images to php8.2

See merge request hubzilla/core!2239
2025-10-30 09:41:12 +00:00
Mario
d9f467f215 Merge branch 'fix-test-deprecation' into 'dev'
Fix deprecation notice in MessageWidgetTest

See merge request hubzilla/core!2238
2025-10-30 09:39:44 +00:00
Harald Eilertsen
23a8c2f0a8 CI: Upgrade images to php8.2
PHP 8.1 is is reaching end-of-life in about two months, so to prepare
for setting PHP 8.2 as minimum supported version we upgrade the CI
runners right away.

PostgreSQL 13 is also reaching EOL in mid november, so upgrade that as
well.
2025-10-29 22:21:51 +01:00
Mario
76856188e1 remove not in abook restriction for convo operations. it is not required anymore since we run convo on fetched items only 2025-10-29 11:02:53 +00:00
Harald Eilertsen
f3d8838256 Fix deprecation notice in MessageWidgetTest
Creating dynamic properties in an object is deprecated in PHP 8.2.

Reference: https://www.php.net/manual/en/migration82.deprecated.php
2025-10-29 10:33:06 +01:00
Mario
2871ef2897 fix another case where the whole URL was punified 2025-10-28 11:55:32 +00:00
Mario
aa7358c837 bump version 2025-10-27 21:13:13 +00:00
Mario
57b553a79f no need for is_sys_channel() here - we already have the complete channel. Saves a DB lookup. 2025-10-27 21:12:20 +00:00
Mario
f08498440a further improve how and in which cases we will attempt fetching the replies collection 2025-10-27 21:03:26 +00:00
Mario
e9c07c554a move the connected check to Activity::init_background_fetch() to omit redundant abook queries in each Activity::store() 2025-10-26 20:32:43 +00:00
Mario Vavti
a570ef4691 add test for ASCache::isCacheable() 2025-10-26 19:19:36 +01:00
Mario
7cf7aa397e refactor Lib/ASCache so that we can easily determine cacheable activities (we will not cache limited activities anymore), refactor the Daemon/Convo so that we will not waste a process for each channel (similar to Daemon/Fetchparents) 2025-10-26 17:43:10 +00:00
Mario
8ba378bc6f Merge branch 'dev' into 10.6RC 2025-10-24 19:01:13 +00:00
Mario
03af9d415f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-10-24 18:37:08 +00:00
Mario
e5acf404ab punify() will turn everything to lower case. We should just use it on the host part, otherwise case senstive URLs will be rendered useless 2025-10-24 18:36:27 +00:00
Mario Vavti
2e89cfe5ed fix pattern to make tests happy again 2025-10-24 20:19:55 +02:00
Mario
21951ec5ee update changelog 2025-10-24 13:36:08 +00:00
Mario
10786336c5 Merge branch 'dev' into 10.6RC 2025-10-24 09:58:48 +00:00
Mario
9e33fa8ee2 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-10-24 09:52:52 +00:00
Mario
1658244b09 only match a single whitespace at the end when pasting a quote, lookup url for plink in question activities 2025-10-24 09:52:28 +00:00
Mario Vavti
3c60e33d74 fix rc version 2025-10-23 14:47:58 +02:00
Mario Vavti
5fb28cb51c fix setup checks 2025-10-23 14:46:04 +02:00
Mario
1677c664f0 bump dev version 2025-10-23 09:09:22 +00:00
Mario
d35a79515f version and strings 2025-10-23 09:06:01 +00:00
Mario
872fced729 bump version 2025-10-22 18:32:03 +00:00
Mario
4ae65a63c6 photo_upload(): moderate photo items where observer has write_storage perm but not post_wall perm - fix issue #1940 2025-10-22 18:31:49 +00:00
Mario
acc43bbbad fix not all notification icons updated and use anon function shortcut for consistency 2025-10-22 16:54:25 +00:00
Mario
947d827431 bump version 2025-10-22 07:35:59 +00:00
Mario
339f787b92 retrieve available notification types from dom element instead of passing them around (which had issues) 2025-10-22 07:35:29 +00:00
Mario
c71a6dbbd2 phpstan: remove conditional constants from ignoreErrors for level 0 2025-10-22 06:45:01 +00:00
Mario
cd5815dcdc install libgmp-dev in gitlab-ci 2025-10-22 06:38:09 +00:00
Mario
19c478421d add gmp extension to gitlab-ci 2025-10-22 06:21:13 +00:00
Mario
a5f311665c bump version 2025-10-21 20:53:06 +00:00
Mario
d8c14eec58 fix issue with notification on screen size where notifications are hidden and isVisible would always return false 2025-10-21 20:52:31 +00:00
Mario Vavti
4798fa79c3 update composer libs - requires gmp extension (in favor of bcmath) 2025-10-21 22:06:03 +02:00
Mario Vavti
b50aa43542 remove redundant args 2025-10-21 21:09:13 +02:00
Mario Vavti
6bf1b15666 remove redundant args 2025-10-21 21:08:28 +02:00
Mario Vavti
9d4f2c7817 email change logic is in Settings/Account 2025-10-21 19:05:27 +02:00
Mario Vavti
040b52a1d5 fix undefined constant 2025-10-21 18:57:15 +02:00
Mario
c8c9e4a901 fix some of the constant not found errors 2025-10-21 16:00:06 +00:00
Mario Vavti
b4f6241357 composer update macgirvin/http-message-signer to version 0.2.6 2025-10-21 16:01:28 +02:00
Mario
4ba414fb8d HTTPSig: return early if we got no key info 2025-10-21 10:23:47 +00:00
Mario
33718ff16f fix error in case when no forums are available 2025-10-21 10:02:43 +00:00
Mario
19437f45ef Merge branch 'helpindex-fix' into 'dev'
add support for json formatted table of contents and specific tpl for helpindex

See merge request hubzilla/core!2237
2025-10-21 09:31:38 +00:00
Harald Eilertsen
7a7ff97e63 Unbreak test failure in Helpindex test
We need to mock the call to `is_readable`, since the file requested in
the test does not actually exist in the file system.
2025-10-20 10:54:12 +02:00
Mario
ef7cedca2d implement ASCache in ASCollection to possibly prevent timeouts when fetching large collections 2025-10-19 09:07:16 +00:00
SK
cbb2cabd74 corrections with accordion id and data-bs-parent 2025-10-19 14:28:47 +05:30
SK
f7cc249b50 better accordion 2025-10-19 08:55:55 +05:30
SK
9530b5b313 removed else conditional 2025-10-19 08:31:45 +05:30
SK
f91409a9ec removed unused toc.html 2025-10-19 08:18:53 +05:30
SK
4330e0bb94 add support for json formatted table of contents and specific tpl
Allows for precise control over layout of table of contents so that
theme specific changes can be implemented. Introduced a new layout file
help-index.tpl.
Table of contents is stored in json format within toc.json, support for
toc.html is retained since other languages still use it but can be
migrated to json if needed.
2025-10-19 08:18:43 +05:30
Mario
6ad561dc4c remove deprecated conv_list.tpl 2025-10-17 05:49:36 +00:00
Mario
70c7817a5c fix undefined variable 2025-10-16 13:11:39 +00:00
Mario
cc9237c7ce more work on notification: mark seen for pubstream, hidden configs for inverted notifications order and count limit (issue #1917) 2025-10-16 12:08:29 +00:00
Mario
e75e8ed8f1 add missing changelog 2025-10-16 08:40:51 +00:00
Mario
2e85852a9c fix en string as per @ferret 2025-10-16 08:20:55 +00:00
Mario
c49a646bef fix undefined var warning 2025-10-16 08:15:24 +00:00
Mario
c130c3ee45 enable filters and mark-all-seen button to forum notifications 2025-10-16 07:55:05 +00:00
Mario
c96fe501ef bump version 2025-10-15 16:52:06 +00:00
Mario
2f0f7b9df6 make sure we add the channel address to the url field 2025-10-15 16:51:08 +00:00
Mario
9fec396fa2 whitespace 2025-10-15 06:41:15 +00:00
Mario
bf774caf0e we should probably also handle image/gif here 2025-10-15 06:37:43 +00:00
Mario
f08b0edad2 only request quality for types that have support for it. otherwise getQuality() will choke with
UnhandledMatchError
2025-10-15 06:35:42 +00:00
Mario Vavti
63e41c233f the correct mime type for .jpg images is image/jpeg 2025-10-15 07:55:08 +02:00
Mario
48433c9479 Merge branch 'some-photo-cleanup' into 'dev'
Some cleanup in Zotlabs\Photo\PhotoGd

See merge request hubzilla/core!2236
2025-10-14 06:28:04 +00:00
Mario
4691bd37c9 Merge branch 'compile-templates-in-ci' into 'dev'
Improve compile_smarty3 script, and add CI check

See merge request hubzilla/core!2235
2025-10-14 06:22:06 +00:00
Mario
d24a3a2713 fix issue where not all seen items where removed from the notifications 2025-10-13 19:58:12 +00:00
Harald Eilertsen
57af09ad47 Simplify PhotoGd::imageString
Since the validity of the image type is checked upon construction, we
can assume that the functions for writing the valid types are already
available, and we don't need to check it again here.
2025-10-13 18:49:17 +02:00
Harald Eilertsen
c5fc4827c8 Refactor PhotoGd::imageString to reduce complexity 2025-10-13 18:47:46 +02:00
Harald Eilertsen
3c89c7d4f4 Add ImageQuality class to hold quality values 2025-10-13 18:43:13 +02:00
Harald Eilertsen
2a3dc6cc50 Fix trivial phpcs warnings in PhotoGD 2025-10-13 17:05:19 +02:00
Mario
c748d3f0f8 remove logging 2025-10-13 06:14:39 +00:00
Mario
9b2ea44000 fix regression setting the offset and fix js error if notify_menu is null (can happen when forum notifications are ddisabled) 2025-10-13 06:11:24 +00:00
Mario
83f6846143 properly implement forum notifications 2025-10-12 15:29:50 +00:00
Harald Eilertsen
3b2311f356 CI: Check that templates compile
Introduce a quick test to check that templates compile in the pretest
stage. This is to prevent merge requests unintentionally breaking
templates like in issue #1938.

https://framagit.org/hubzilla/core/-/issues/1938
2025-10-11 10:54:27 +02:00
Harald Eilertsen
ea0229dcfc Return with error code if precompile_smarty fails
The Smarty API for compiling templates don't return any meaningful error
status if a template fails, so we buffer the output and scan it for
error messages instead. If we find one, we return a non-zero error code
to signal the error to the shell or calling process.

Also added more detailed copyright headers.
2025-10-10 22:22:39 +02:00
Mario
3cdfa94c29 announced toplevel items will have type Announce in our case - possible fix for issue #1936 2025-10-10 15:47:49 +00:00
Mario
2fd5762125 wrong array key 2025-10-10 15:41:54 +00:00
Mario
52ecdb007f use space instead of EOL constant which contains HTML 2025-10-10 09:01:00 +00:00
Mario
9b8fed738b escape sequence must not contain spaces 2025-10-10 09:00:09 +00:00
Mario
ee3fafc9fb Merge branch 'ci-pretest-and-upgrade-psql' into 'dev'
CI: Add pretest CI step and run PHPStan

See merge request hubzilla/core!2233
2025-10-09 09:53:14 +00:00
Mario
47867a0993 Merge branch 'fix-phpunit-deprecation' into 'dev'
tests: Dataproviders should be static

See merge request hubzilla/core!2232
2025-10-09 09:51:52 +00:00
Mario Vavti
a2ba81afe1 version 10.4.4 2025-10-06 23:27:14 +02:00
Mario
a15254a1e2 remove check for current user and apply update 2025-10-06 23:16:22 +02:00
Mario
1a68dbccf1 remove check for current user and apply update 2025-10-06 20:42:27 +00:00
Harald Eilertsen
fc87ef282e CI: Upgrade to postgres 13
Postgres 12 has been EOL for almost a year!
2025-10-05 23:07:02 +02:00
Harald Eilertsen
ab0e5e3eee CI: Add pretest CI step and run PHPStan
The idea is to avoid the more expensive phpunit tests if a set of
simpler checks fail. These should check the code without actually
running it. For now we only run PHPStan, but this may expand in the
future.
2025-10-05 23:03:42 +02:00
Harald Eilertsen
356b6127d3 Better check if default_timezone is set 2025-10-05 23:03:42 +02:00
Harald Eilertsen
87c62db41e tests: Dataproviders should be static 2025-10-05 20:27:08 +02:00
Mario
0d3855cd63 whitespace 2025-10-05 15:48:21 +00:00
Mario Vavti
ffce0a705b added test for Activity::pasteQuote() 2025-10-05 15:43:42 +02:00
Mario
49e65902d7 improve placing quote in post and move it to separate function - test will follow 2025-10-05 13:19:26 +00:00
Mario
2e1fd79c7a implement as cache in get_quote() 2025-10-05 07:46:22 +00:00
Mario
0c577b5fd0 replace both variants 2025-10-04 20:22:10 +00:00
Mario
3178a96a89 improved quote handling 2025-10-04 18:49:21 +00:00
Mario
c1cec623bb this restriction should not be required anymore 2025-10-04 18:47:08 +00:00
Mario
d3cc098070 Revert "this restriction should not be required anymore"
This reverts commit 69e7812646.
2025-10-04 18:45:53 +00:00
Mario
69e7812646 this restriction should not be required anymore 2025-10-04 18:44:07 +00:00
Mario
d39320475c remove logging 2025-10-03 16:08:37 +00:00
Mario
0faf47b3ca deal with multiple quoteUrl's - just in case 2025-10-03 16:07:45 +00:00
Mario
660ff3da7b for consistency show webfinger addr instead of url like in the other tabs 2025-10-03 06:51:23 +00:00
Mario
7ec8a2267a we should also store the terms of a quote post for custom emojis, tags, etc. 2025-10-03 05:39:43 +00:00
Mario
4a35764e13 we must decode the entire message for attached images etc. 2025-10-02 17:35:38 +00:00
Mario
3a50b185ce fix heading
(cherry picked from commit 57e2904cc0)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 10:02:37 +00:00
Mario
57e2904cc0 fix heading 2025-10-02 10:01:38 +00:00
Mario
77866625cc fix path
(cherry picked from commit b49c844a23)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 09:58:06 +00:00
Mario
b49c844a23 fix path 2025-10-02 09:57:31 +00:00
Mario
f6275fdb79 Ãadd en tos which seems to have been lost in transition
(cherry picked from commit 2c55ee5a73)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 09:52:05 +00:00
Mario
2c55ee5a73 Ãadd en tos which seems to have been lost in transition 2025-10-02 09:17:07 +00:00
Mario
548b0c4931 Merge branch 'misc-phpstan-fixes' into 'dev'
Fix remaining issues flagged by PHPStan level 0

See merge request hubzilla/core!2228
2025-10-02 08:36:00 +00:00
Mario
8c61f89a14 get_quote_bbcode() > get_quote() 2025-10-02 08:16:39 +00:00
Mario
7cc0cb78a0 inbound support for mastodon quote posts and slightly improved rendering 2025-10-02 07:13:45 +00:00
Mario
6aa945cde1 Merge branch 'cherry-pick-357eabbe' into 'dev'
Update Spanish strings

See merge request hubzilla/core!2229
2025-10-01 09:25:38 +00:00
Mario
375b3f3f67 bump version 2025-10-01 08:55:42 +00:00
Mario
b68b5a60c5 fix issue where loadingPage state was not reset in some situations and return if we retry live update due to incomplete data 2025-10-01 08:55:15 +00:00
Manuel Jiménez Friaza
f4c29d13f4 Update Spanish strings
(cherry picked from commit 357eabbe9e2375a23715b12bcf22fe5b7b4b837a)

Co-authored-by: mjfriaza:4GF~eYj,-iAv <mjfriaza@disroot.org>
2025-09-15 16:42:01 +02:00
Mario
121fb74c6c tagcloud: remove redundant f arg 2025-09-15 07:12:09 +00:00
Mario
4a098cbeaf whitespace 2025-09-15 07:04:37 +00:00
Mario
6123fd2be8 archive widget: point url to module/channel_addr instead of App:$cmd and some cleanup - fix issue #1911 2025-09-15 07:04:00 +00:00
Harald Eilertsen
176a7cb9b5 Comment duplicate keys in xchan_change_key func
PHP arrays can't have duplicate keys, so adding an entry with the same
key again will replace the existing entry with the later one. This patch
comment out the entries that in any case are replaced, so functionally
it should be equivalent to what was before. (But still probably wrong!)
2025-09-12 21:51:24 +02:00
Harald Eilertsen
a7e734b700 Move named inner function out in po2php.php
While PHP seems to be able to handle this construct, PHPStan don't. In
this case there's also no reason for this to be an inner function, so
just move it out to the global scope.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
b31123ae2f Fix missing return from translate_scope function
Also make sure the output is escaped wherever this function is used.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
330c8ca890 Fix ref to undefined var in account.php 2025-09-12 21:51:24 +02:00
Harald Eilertsen
e645ea3bf0 Fix missing return warnings in Module\Request
As the Request module never returns a HTML payload it was changed to
override the Controller::init() method rather than Controlled::get().

The internal private functions were fixed accordingly, and return type
annotations fixed up as well.

Discovered with PHPStan.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
50f439ae8e Fix precompile_smarty3.php
The Smarty class is in the Smarty namespace, and should not be loaded
manually, but through composer. This is taken care of by requiring
`boot.php`. Also make the script slightly more robust as to where it is
invoked from.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
3a102d9dc3 Remove ref to undefined var in Module\Register
The $reg variable is defined in another if-statement further up the
function, but does not make sense in the part where it was referenced.
The code tried to switch to the registered users prefered language
before sending an email to the user, but as this part of the code don't
have a record for the registered user, this makes no sense.

Iow, we leave the currenly selected language alone, and hope for the
best.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
bb4c08caf0 PHPStan: Ignore missing function make_xchan_hash
This function does not exist, but is called from a function that is
never used. For rationale for why this code is kept, see the discussion
here:

https://framagit.org/hubzilla/core/-/merge_requests/2209
2025-09-12 21:51:24 +02:00
Harald Eilertsen
f8795288a1 More misc fixes in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
107b8e67d2 Fix/complete template args in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
5a36a37b9f Fix template language in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
0910ae0e52 Fix db query in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
c6c5a8b5e0 Cleanup verify_email_address
- Add type annotations, and change arg to a string instead of array.
  Only the email address was used anyways.
- Fix indentation
- Improve API doc and remove unnecessary comments.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
da2c57c432 Fix undefined var $hash in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
e7523e7fc5 Remove ref to undefined variables in get_zcard() 2025-09-12 21:51:24 +02:00
Harald Eilertsen
e52d3639de Fix missing returns in plugin.php
Flagged by phpstan
2025-09-12 21:51:24 +02:00
Mario
1a27edf6dd Merge branch 'remove-dead-code-in-handle-tag' into 'dev'
Remove dead code in handle_tag function

See merge request hubzilla/core!2227
2025-09-12 16:35:32 +00:00
Mario
9750543157 Merge branch 'register_account_hook' into 'dev'
uncommented register_account hook

See merge request hubzilla/core!2226
2025-09-12 16:31:43 +00:00
Mario
95dab5c764 Merge branch 'test-include-extensions' into 'dev'
Include extensions in default PHPUnit config

See merge request hubzilla/core!2223
2025-09-12 16:31:10 +00:00
Mario
619df9ca22 fix for issue #1929 and updated wording 2025-09-12 16:24:22 +00:00
Mario
5442bac707 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-09-12 14:50:21 +00:00
Mario
99688cdde5 remove redundant variable and include 2025-09-12 14:49:22 +00:00
Harald Eilertsen
6b7478c5a5 Remove dead code in handle_tag function
Since $profile is only ever set in the other branch of the if/else
construct, this code will never execute.
2025-09-05 23:19:07 +02:00
SK
644e3b790c uncommented register_account hook
Hook is required for notify-admin addon to work.
2025-09-02 19:43:35 +05:30
Harald Eilertsen
c064cfde91 Look for unit tests for extensions as well as core 2025-09-02 08:38:50 +02:00
Harald Eilertsen
2826d030f4 Remove obsolete phpunit configurations
These are not in use, probably outdated, and just confusing.
2025-09-02 08:38:50 +02:00
Mario
1ab1da5816 CI: Tell mysql cli to skip ssl checks
(cherry picked from commit 120292bd6c)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2025-09-02 06:34:44 +00:00
Mario
05800a5ff3 Merge branch 'fix-ci' into 'dev'
CI: Tell mysql cli to skip ssl checks

See merge request hubzilla/core!2224
2025-09-02 06:29:23 +00:00
Harald Eilertsen
120292bd6c CI: Tell mysql cli to skip ssl checks 2025-08-31 11:20:03 +02:00
Mario
aaa863cda7 Merge branch 'dev' 2025-08-15 08:45:45 +00:00
Mario
3c722f9aa7 changelog 2025-08-15 08:45:05 +00:00
Mario
14f28907bc version 10.4.3 2025-08-15 08:38:40 +00:00
Mario
185f53d298 bump version 2025-08-14 17:46:21 +00:00
Mario
3ae42d471a vote: minor refactor tto catch dubble votes early 2025-08-12 09:13:55 +00:00
Mario
0a817f952e mark our own vote seen because it will not be marked seen later 2025-08-11 23:28:59 +00:00
Mario
bc7f8b15a8 dismiss our own votes from select query. they are not flagged with item_hidden because otherwise they would not be delivered to the poll owner. received votes are (and should be) flagged with item_hidden so that they are not being relayed. 2025-08-11 23:13:26 +00:00
Mario
02111ad649 start transition deprecated AS1 item.verb vocabulary to AS2 on demand 2025-08-11 22:36:35 +00:00
Mario
6f00964d47 fix regression in retrieving channel address in wtagblock() and whitespace fixes
(cherry picked from commit eafa1d56c3)

Co-authored-by: Mario <mario@mariovavti.com>
2025-08-08 17:49:10 +00:00
Mario
eafa1d56c3 fix regression in retrieving channel address in wtagblock() and whitespace fixes 2025-08-08 14:03:28 +00:00
Mario
44a0311798 Merge branch 'master' of https://framagit.org/hubzilla/core 2025-08-08 07:51:42 +00:00
Mario
2ac06fef9a version 10.4.2 2025-08-08 07:51:12 +00:00
Mario
5b6a38aa2d changelog 2025-08-08 07:48:14 +00:00
Mario
37b9919905 bump version 2025-08-07 22:53:26 +00:00
Mario
283c018d07 implement item_custom_display hook in mod HQ 2025-08-07 22:51:40 +00:00
Mario
51c79aecac make item_normal() deal with various item types and add missing reactions modal 2025-08-07 22:36:35 +00:00
Mario
9343f00918 improve memory consumption when deleting big threads 2025-08-07 19:05:58 +00:00
Mario
962b4e5b4c fix php error
(cherry picked from commit eeef6cfd00)

Co-authored-by: Mario <mario@mariovavti.com>
2025-08-07 14:57:11 +00:00
Mario
eeef6cfd00 fix php error 2025-08-07 14:55:00 +00:00
Mario
96c7912fa6 update the contact edit header so that both, image and text are linked to the profile 2025-08-02 11:48:50 +00:00
Mario
91f1f8ed7c version 10.4.1 2025-07-31 08:46:43 +00:00
Mario
3f7ed72ece changelogà 2025-07-31 08:43:31 +00:00
Mario
3385c694aa add delay before collapsing 2025-07-31 08:22:01 +00:00
Mario
a922f5ca6c bump version 2025-07-30 19:20:35 +00:00
Mario
88977a406c imagesLoaded() should not be required in updateConvItems() anymore since we call it before updateConvItems() already (famous last words). 2025-07-30 19:19:00 +00:00
Mario
e98f019b16 fix regression in pubstream tag view, use correct prefixes in pub_tagadelic() and some whitespace fixes 2025-07-30 16:22:08 +00:00
Mario
50f5fcb16b always update photo DB entries on move - fixes issue where photos were not found by photo picker after folder rename as reported by chris 2025-07-30 06:45:25 +00:00
Mario
bf35a661bf remove trailing comma 2025-07-29 11:02:43 +00:00
Mario
ecc94cdecd fix a weird rendering issue which was triggered by load events fireing after the timeout was already in action 2025-07-29 09:28:00 +00:00
Mario
e79a70d2b1 var > const and style 2025-07-27 10:24:53 +00:00
Mario
6916a825ee move the freshly created content to the center instead of top and use smooth scrolling 2025-07-27 10:23:23 +00:00
Mario
b5a798f068 fix comment preview and scroll to the just created comment after posting it 2025-07-27 09:52:48 +00:00
Mario
e5c54fadea Merge branch 'update-derived-theme-tutorial' into 'dev'
Update derived theme tutorial

See merge request hubzilla/core!2219
2025-07-27 08:15:15 +00:00
Mario
f2217e9016 Merge branch 'fix-pubstream-tagcloud-tpl' into 'dev'
Fix pubstream tagcloud and category cloud

See merge request hubzilla/core!2218
2025-07-27 08:14:41 +00:00
Saiwal K
4d6bebb846 Fix pubstream tagcloud and category cloud 2025-07-27 08:14:41 +00:00
Harald Eilertsen
2e9b1d25e1 Replace mention of theme_init function
The theme_init function is no longer needed, and the example isn't using
it. So we replace it with a bit more description of the theme info in
the comment, and how that works.
2025-07-24 12:50:50 +02:00
Harald Eilertsen
8604ba016e Update derived theme tutorial
Adds another lesson on customising the theme using styles and overriding
templates.

Also some minor language cleanup and add some introductory text before
lesson 1.
2025-07-24 12:40:13 +02:00
Mario
cc35afa4c9 bump version 2025-07-23 12:07:45 +00:00
Mario
f01c5ad0c1 remove logging 2025-07-23 12:07:21 +00:00
Mario
7b6a8fdba1 fix issue where reply modal would not show anymore after reactions loaded 2025-07-23 12:06:48 +00:00
Mario
2c9f184a09 tagcloud fixes 2025-07-23 08:19:40 +00:00
Mario
6f158f37c9 Merge branch 'improve-derived-themes' into 'dev'
Add 'extends' attribute to theme info

See merge request hubzilla/core!2217
2025-07-23 07:54:30 +00:00
Mario
f88d2ba0c4 Merge branch 'tag-cloud-tpl-fix' into 'dev'
Add tpl for tagcloud and directory keyword cloud

See merge request hubzilla/core!2216
2025-07-23 07:53:10 +00:00
Saiwal K
170f157aae Add tpl for tagcloud and directory keyword cloud 2025-07-23 07:53:09 +00:00
Mario
82817b4532 tagadelic: look up toplevels only
(cherry picked from commit 3eeaca4aab)

Co-authored-by: Mario <mario@mariovavti.com>
2025-07-22 10:34:19 +00:00
Mario
3eeaca4aab tagadelic: look up toplevels only 2025-07-22 10:32:57 +00:00
Mario
a3dd4a4d3d revert cleanup template
(cherry picked from commit c383e6af80)

Co-authored-by: Mario <mario@mariovavti.com>
2025-07-22 10:22:38 +00:00
Mario
c383e6af80 revert cleanup template 2025-07-22 10:21:34 +00:00
Mario
517e14cc38 cleanup template
(cherry picked from commit eb3dfb2488)

Co-authored-by: Mario <mario@mariovavti.com>
2025-07-22 10:17:05 +00:00
Mario
eb3dfb2488 cleanup template 2025-07-22 10:16:09 +00:00
Mario
70e8648d91 the item_wall directive is not required here since we are looking for parent items which we own - remove it since it will make the DB engine use the wrong index in certain cases. also remove duplication of item_type directive when looking up articles
(cherry picked from commit ae8e9bc353)

Co-authored-by: Mario <mario@mariovavti.com>
2025-07-22 09:33:34 +00:00
Mario
ae8e9bc353 the item_wall directive is not required here since we are looking for parent items which we own - remove it since it will make the DB engine use the wrong index in certain cases. also remove duplication of item_type directive when looking up articles 2025-07-22 09:32:20 +00:00
Harald Eilertsen
88227b9155 Rename derived theme tutorial file 2025-07-20 20:33:56 +02:00
Harald Eilertsen
ae77ab7f20 Add derived theme tutorial to help index 2025-07-20 20:28:39 +02:00
Harald Eilertsen
308380fe52 Add 'extends' attribute to theme info
To create a derived (or child) theme, the array held in
`App::$theme_info` must contain a key `extends` that contains the name
of the parent theme as a value.

The derived theme tutorial would suggest adding the key in the
`themename_init()` function, however this does not work. The theme info
is repopulated from the theme info file after the theme init function
has run, and so the `extends` key disappears.

This patch adds `extends` as a first class attribute for themes, so that
it can be specified directly in the theme info in the top file comment
block. It also updates the derived theme tutorial to reflect this
change.
2025-07-20 20:23:25 +02:00
Mario
ee7b982358 Merge branch '10.4RC' 2025-07-15 06:40:43 +00:00
Mario
2740f36259 version 10.4 2025-07-15 06:40:19 +00:00
Mario
ff16810e76 Merge branch 'dev' into 10.4RC 2025-07-15 06:35:47 +00:00
Mario
161cfcd64d update changelog 2025-07-15 06:33:41 +00:00
Mario
d16d1fdcd5 Merge branch 'more-nb-translation-and-fixes' into 'dev'
More translations and fix for Norwegian nb

See merge request hubzilla/core!2214
2025-07-15 06:13:46 +00:00
Harald Eilertsen
06c0652b05 More translations and fix for Norwegian nb
Wiki's and profiles both used the "Create new" button, so don't add what
is being created to the translation :)
2025-07-14 22:23:58 +02:00
Mario
a2fb2e04f3 add support for did:key verificationMethod in checkEddsaSignature() 2025-07-14 14:13:34 +00:00
Mario
b376f810bf strict check and whitespace 2025-07-14 13:56:51 +00:00
Mario
0c2bcda431 some documentation 2025-07-14 13:48:59 +00:00
Mario
22cb0d3c6b use a custom function to build the psr7 request to work around mod rewrite issues with ServerRequest::fromGlobals() 2025-07-14 13:45:23 +00:00
Mario Vavti
b6b4eb4c22 composer update http message signer to version 0.2.3 2025-07-14 15:35:03 +02:00
Mario
da1e0b965b Merge branch 'dev' into 10.4RC 2025-07-13 19:43:01 +00:00
Mario
d566199423 Merge branch 'update-nb-translations' into 'dev'
Update translations for Norsk Bokmål

See merge request hubzilla/core!2213
2025-07-13 19:40:28 +00:00
Mario
35be83c5f6 Merge branch 'fix-permission-context-help' into 'dev'
Fix context help link for permissions

See merge request hubzilla/core!2212
2025-07-13 19:39:21 +00:00
Harald Eilertsen
76eed3c06c Fix context help link for permissions
The target was changed when the new docs was merged.
2025-07-13 16:09:33 +02:00
Harald Eilertsen
d994e1be48 Update translations for Norsk Bokmål 2025-07-13 16:01:06 +02:00
Mario
24316bbb03 Merge branch 'dev' into 10.4RC 2025-07-13 10:32:55 +00:00
Mario
7b5a638e00 update changelog 2025-07-13 10:32:23 +00:00
Mario
fa4c86eabf update install document 2025-07-13 10:03:46 +00:00
Mario
9cf610280c add init_sys_channel utility to create the sys channel in case of headless installation - issue #1909 2025-07-13 09:57:26 +00:00
Mario
052341d24a Merge branch 'dev' into 10.4RC 2025-07-13 09:49:29 +00:00
Mario
a55bba7aa8 fix blog mode if threaded view is disabled 2025-07-13 09:47:38 +00:00
Mario
0244d9423a RC3 2025-07-10 12:02:15 +00:00
Mario
042c98cf2d Merge branch 'dev' into 10.4RC 2025-07-10 12:00:53 +00:00
Mario
2958ea8c89 update changelog 2025-07-10 12:00:32 +00:00
Mario
81a12be654 changelog 2025-07-10 11:59:27 +00:00
Mario
9f99e401bc Merge branch 'fix-markdown-mentions' into 'dev'
Prevent mentions from mangling by markdown parser

See merge request hubzilla/core!2211
2025-07-10 11:43:10 +00:00
Mario
48ef490f50 Merge branch 'dev' into 10.4RC 2025-07-10 11:40:58 +00:00
Mario Vavti
d782229ba0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-07-10 11:37:01 +02:00
Mario Vavti
52291fd371 update macgirvin/http-message-signer to version 2.2 2025-07-10 11:36:38 +02:00
Mario
e0298a4378 add logging and catch exception 2025-07-09 08:00:52 +00:00
Mario
08b7eb52c7 remove unneeded code from test 2025-07-09 08:00:27 +00:00
Mario
43ebf69d09 trim the value 2025-07-08 10:47:44 +00:00
Mario
18ae629f19 remove the check for supported protocols. we can store them all because we check later if we support one of them 2025-07-08 10:46:40 +00:00
Mario
8deedd1979 remove long deprecated crypto functions 2025-07-08 10:01:10 +00:00
Mario Vavti
525594d529 update to phpseclib3 which is now a requirement for the http signer library 2025-07-08 11:35:56 +02:00
Mario Vavti
1162615c52 missing file from http-message-signer 2025-07-07 13:17:55 +02:00
Mario Vavti
c462c928e0 composer update to phpseclib version 3 2025-07-07 13:17:14 +02:00
Mario
fcb0ef9633 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-07-06 21:22:53 +00:00
Mario
8a4273a2f5 for now only attempt RFC9421 verification if we have the request 2025-07-06 21:22:32 +00:00
Mario Vavti
3014ae2071 update macgirvin/http-message-signer to version 2.0 2025-07-06 22:58:09 +02:00
Mario Vavti
d396043faf composer dump-autoload 2025-07-06 22:42:55 +02:00
Mario Vavti
2054359f6c testing and fixes 2025-07-06 22:41:02 +02:00
Mario
9a3735cd37 tests for Activity::get_actor_protocols() 2025-07-06 18:32:08 +00:00
Mario
222b74ec05 extend get_actor_protocols() to also check fep-fb2a actor metadata 2025-07-06 18:06:28 +00:00
Harald Eilertsen
cb491c53f7 Prevent mentions from mangling by markdown parser
Mentioning people whose handles include valid markdown would not survive
markdown to bbcode conversion wihout being mangled. An example that
brought this to my attention was a handle similar to this:

    _someuser_@testsite.example

The underscores would be interpreted as emphasis in markdown, and
converted to:

    [i]someuser[/i]@testsite.example

This patch should fix this, and hopefully any other issue with mentions
being mangled.
2025-06-28 13:35:05 +02:00
Mario
37f0074674 Merge branch 'dev' into 10.4RC 2025-06-26 08:58:56 +00:00
Mario Vavti
e6c8c47721 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-06-26 10:55:31 +02:00
Mario Vavti
0a98a49eeb composer update macgirvin/http-message-signer 2025-06-26 10:54:42 +02:00
Mario
7bd4217dd8 Merge branch 'dev' into 10.4RC 2025-06-26 08:12:28 +00:00
Mario
af5733888c changelog 2025-06-26 08:11:46 +00:00
Mario
c346210735 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-06-26 08:08:31 +00:00
Mario
6028f0490e minor refactor to get rid of the $webpage variable (it does not cut it anymore) and use $item_type instead 2025-06-26 08:08:08 +00:00
Mario Vavti
890a5942d6 Merge branch 'dev' into 10.4RC 2025-06-25 17:43:52 +02:00
Mario Vavti
7782183ae3 changelog 2025-06-25 17:40:55 +02:00
Mario Vavti
7ecbce691d RC2 2025-06-25 17:35:58 +02:00
Mario Vavti
2aeed27b9b emiting a notice from include/auth does not work. emit it from mod login if the login failed. 2025-06-25 17:33:35 +02:00
Mario Vavti
d636e71024 remove code that would never execute and make sure the first account to register is the admin account 2025-06-25 17:26:41 +02:00
Mario
2606517c1d changelog 2025-06-24 10:09:36 +00:00
Mario
0ab94d42f4 bump dev version 2025-06-24 07:58:19 +00:00
Mario
7c32b11605 update strings 2025-06-24 07:55:21 +00:00
Mario
7b6c76abf1 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-06-24 07:54:33 +00:00
Mario
0e31d61868 Merge branch 'some-account-cleanup' into 'dev'
A bit of cleanup for account functions

See merge request hubzilla/core!2210
2025-06-24 07:53:43 +00:00
Harald Eilertsen
66e02c5e3a A bit of cleanup for account functions 2025-06-24 07:53:42 +00:00
Mario
122747ae76 version 10.4RC1 2025-06-24 07:28:50 +00:00
Mario
9a410f57e6 fix php warnings 2025-06-24 07:25:56 +00:00
Mario
2047e9bca7 fix php warning 2025-06-23 20:06:07 +00:00
Mario
aeb54655a0 exit if we have not found anything 2025-06-23 09:24:10 +00:00
Mario
1a3ca49eba apply downstream fix from streams: do not sign (request-target) on response 2025-06-23 09:10:57 +00:00
Mario
579cf86335 rfc9421 verify: parse more fields if applicable 2025-06-23 09:03:05 +00:00
Mario
fcf42eeae0 Revert "rfc9421 verify: parse more fields if applicable"
This reverts commit 721c0b1e5b.
2025-06-23 09:02:08 +00:00
Mario
721c0b1e5b rfc9421 verify: parse more fields if applicable 2025-06-23 08:59:27 +00:00
Mario
82b2f06bdd bump version 2025-06-22 07:36:08 +00:00
Mario
b241e14c06 import App 2025-06-21 20:56:41 +00:00
Mario Vavti
89c17bac50 start verifying RFC9421 HTTP Signatures (hopefully) 2025-06-21 16:39:59 +02:00
Mario
e6bd5ef520 css fix 2025-06-20 19:08:27 +00:00
Mario
7320149fd8 only show the pin if we display the label and fix the test 2025-06-19 08:26:31 +00:00
Mario
7766e5d420 prepend geo links withe a pushpin emoji so that they can be distinguished from regular links 2025-06-19 08:18:25 +00:00
Mario
4a813c150c make sure to set the state on the correct button 2025-06-19 08:08:16 +00:00
Mario
44600c46c6 make sure there is a comment button before attempting to add a class to it 2025-06-18 17:01:26 +00:00
Mario
b5c7fff316 re-add check for sub thread wrapper 2025-06-18 16:49:33 +00:00
Mario
ce618facc8 properly set the comment button and sub-thread-wrapper state if we are loading a conversation in partly expanded mode 2025-06-18 15:55:15 +00:00
Mario Vavti
18016ab36a remove some redundant spaces in bbcode to html conversion and fix tests 2025-06-18 11:55:47 +02:00
Mario
d788233bd7 handle naked geo URIs and add tests 2025-06-18 09:18:11 +00:00
Mario
86ebef7e08 allow geo: uri and be more specific when checking uri schemes also remove zhttp which is not used anymore and ftp which is not supported by most browsers anymore 2025-06-17 09:29:27 +00:00
Mario
37159937d7 bump version 2025-06-14 10:51:48 +00:00
Mario
4d6d3befa0 leave zoom handling to the comment button click handler 2025-06-14 10:51:18 +00:00
Mario
a21785980d Merge branch 'remove-obsolete-funcs' into 'dev'
Remove obsolete functions in account.php

See merge request hubzilla/core!2208
2025-06-14 10:29:14 +00:00
Mario
14fe08240f Merge branch 'fix-album-widgets' into 'dev'
Fix undefined variable in album widgets

See merge request hubzilla/core!2207
2025-06-14 10:28:33 +00:00
Mario
73d50d8294 Merge branch 'remove-xref-module' into 'dev'
Remove unused Xref module

See merge request hubzilla/core!2206
2025-06-14 10:27:50 +00:00
Mario
767eeee6fe invert the verb query part 2025-06-13 09:42:09 +00:00
Mario
abd864a762 css fixes 2025-06-13 09:20:30 +00:00
Mario
25dba4423b bump version 2025-06-13 08:07:53 +00:00
Mario
2046abf26f trick sql to use a better suited index 2025-06-13 08:05:05 +00:00
Mario
ad7871270c add EmojiReact to the countable comment verbs 2025-06-12 11:57:13 +00:00
Mario
66512f4e51 blog mode fixes 2025-06-12 11:51:01 +00:00
Mario
71a06af8a9 consistent naming 2025-06-12 10:47:04 +00:00
Mario
14088b4b2e do not expand all 3 thread levels even if the content is already there. This would be inconsistent behaviour. 2025-06-12 08:02:52 +00:00
Mario
ec2c4fe673 css fixes 2025-06-12 07:02:14 +00:00
Mario
49a065e50b bump version 2025-06-11 19:35:40 +00:00
Mario
391c8d7cba implement indenting of already expanded but flattened items and add dblclick info badge 2025-06-11 19:35:17 +00:00
Mario
76296e72be refactor TLL to zoom in on every expansion and better maintainable code 2025-06-11 11:34:08 +00:00
Mario
d36f806ece more autoexpand iterations fixes 2025-06-10 09:06:48 +00:00
Mario
d3d8c088f3 bump version 2025-06-10 08:46:24 +00:00
Mario
4e01e21230 fix autoexpand iterations 2025-06-10 08:46:01 +00:00
Mario
673790126b dismiss summary if it is equal to content and css fixes 2025-06-09 19:09:32 +00:00
Mario
9eecd0aa3c css fixes 2025-06-09 14:11:20 +00:00
Mario
f8fb1bc3b4 use a more prominent color 2025-06-09 09:30:31 +00:00
Mario
340f5bb791 do not count iterations where we have not found a new thread 2025-06-09 08:11:41 +00:00
Mario
5504c8650e do not call preview twice and not at all if we are in modal action 2025-06-08 21:18:53 +00:00
Mario
9405f2e2d3 bump version 2025-06-08 21:09:51 +00:00
Mario
3de0d304fd fix comment image embed after transition to modal 2025-06-08 21:09:27 +00:00
Harald Eilertsen
0e4924d7c5 Remove obsolete verify_email_addressNOP function 2025-06-08 22:46:26 +02:00
Mario
20377c1ca1 css fixes 2025-06-08 19:05:58 +00:00
Mario
8af9bbb75e slightly darker colors 2025-06-08 18:53:36 +00:00
Mario
34c3a77db4 improved thread lense 2025-06-08 17:07:14 +00:00
Mario
dbc3613af5 more cleanup 2025-06-08 15:13:45 +00:00
Mario
e1d395b6ed more cleanup and introduce the thread lense 2025-06-08 09:06:01 +00:00
Harald Eilertsen
5316ebfe7c Remove obsolete functions in account.php 2025-06-08 09:43:14 +02:00
Harald Eilertsen
13755060d7 Fix undefined variable in album widgets
The Album and Portfolio widgets would reference the undefined
$phototypes array to determine the file extensions of the image sources.

It appears that the extension is not really necessary, but for
completeness I fixed the issue so that the appropriate extension will be
used by for the image source attribute.
2025-06-07 23:09:46 +02:00
Harald Eilertsen
eeb8a124fc Remove unused Xref module
See discussion here:
https://hubzilla.org/item/c611090c-1a5e-5fa5-8836-06f393fd71ef
2025-06-07 22:14:22 +02:00
Mario
5db855abfe it is hard to keep the overview with more than 3 levels 2025-06-07 09:11:12 +00:00
Mario
ab14743146 bump version 2025-06-06 12:04:47 +00:00
Mario
409c062c4f reset indents for possible followup autoexpand 2025-06-06 12:04:32 +00:00
Mario
1b494cdd27 bump version 2025-06-06 11:11:06 +00:00
Mario
f5f853cdfe improved autoexpand 2025-06-06 11:10:36 +00:00
Mario
37aa16a6c0 bump version 2025-06-05 19:43:42 +00:00
Mario
a4ebf93cb8 cleanup, fix iteration counter and bump literations to 10 2025-06-05 19:43:19 +00:00
Mario
358e7c9512 bump version 2025-06-05 16:08:44 +00:00
Mario
11b42a371e revert to previous color generation logic 2025-06-05 16:08:22 +00:00
Mario
61da32dc3f Merge branch 'new-de-docs' into 'dev'
New de docs

See merge request hubzilla/core!2205
2025-06-05 15:50:22 +00:00
Mario
5f26e77785 Merge branch 'more-phpstan-fixes' into 'dev'
More PHPStan fixes

See merge request hubzilla/core!2204
2025-06-05 15:48:17 +00:00
Mario
1d289e619e Merge branch 'crash-in-jcxeddsa2022-sign' into 'dev'
Throw if channel keys missing in JcsEddsa2022::sign

See merge request hubzilla/core!2201
2025-06-05 15:45:47 +00:00
Harald Eilertsen
0c41265613 Throw if channel keys missing in JcsEddsa2022::sign 2025-06-05 15:45:46 +00:00
Mario
b5ad0589cb bump version 2025-06-05 15:44:25 +00:00
Mario
9e87070f86 iterate only 3 levels when autoexpanding, improve color generation to get more random colors 2025-06-05 15:44:01 +00:00
Mario
3da16a4bae bump version 2025-06-05 15:09:23 +00:00
Mario
1ad76ec83f fix other reactions buttons and bring some color to indents 2025-06-05 15:09:03 +00:00
Mario
fa67852278 better center the gt 2025-06-05 08:16:51 +00:00
Mario
d9ebd880be more better center the dash 2025-06-05 08:13:19 +00:00
Mario
9d7c5d2fe2 better center the dash 2025-06-05 08:05:46 +00:00
Mario
8c268d24df version 2025-06-05 08:03:52 +00:00
Mario
f8fb550255 threading: implement manual indent and collapse 2025-06-05 08:03:33 +00:00
Mario
c1aa5a2954 bump version 2025-06-04 19:55:42 +00:00
Mario
342f736eb7 improved autoexpand 2025-06-04 19:55:05 +00:00
Mario
0283c77961 do not prevent default too early 2025-06-04 16:38:30 +00:00
Mario
7740a7501b improved indentation and its logic 2025-06-04 16:33:05 +00:00
Mario
ed97164f01 remove unused code 2025-06-04 14:35:35 +00:00
Mario
6649eca2bf move expand to item menu to get rid of the single click lag 2025-06-04 14:34:44 +00:00
Mario
64ae1eb5e8 add ability to auto-expand a comment reply thread 2025-06-03 08:31:19 +00:00
Mario
d42a89d4b5 disable reactions in pinned widget 2025-06-02 07:55:24 +00:00
Mario
bb05f520c1 fix pinned widget 2025-06-02 07:38:11 +00:00
Mario
f8afa77369 add internal follow and ignore verbs to the list of filtered verbs and add commented out code to display/count only one reaction per author. It appears there can be multiple. We should probably look into how this can happen and if we should prevent it earlier. 2025-06-01 18:48:16 +00:00
Mario
940fd26db7 add the thr_parents if we are in channel single view mode 2025-06-01 10:44:33 +00:00
Mario
fca6ddd35b change the animation so that it will not interfere with bootstrap stuff 2025-06-01 10:14:18 +00:00
Mario
a5ded5884c no need to set animation constant 2025-06-01 04:58:06 +00:00
Mario
d0686796cd it is the fill: both option that woes with dropdown visibility - set it to none 2025-06-01 04:57:05 +00:00
Mario
3ea323bfb0 handle intro notifications via /notify/view so that it will eventually be marked seen 2025-05-31 20:16:24 +00:00
Mario
c826b307c2 fix display issue 2025-05-31 18:43:07 +00:00
Mario
00edbe4393 bump version 2025-05-31 17:07:00 +00:00
Mario
525a45f69c make sure to load the profile when in channel module 2025-05-31 16:56:30 +00:00
Mario
e35d4b6be0 only show load more if total comments > loaded comments 2025-05-30 09:55:26 +00:00
Mario
83c963378e remove more redundant sql (perms for the given IDs MUST be checked at the calling module already) and update documentation 2025-05-29 19:47:53 +00:00
Mario
7705d7a87f this is not required because we already filter by a given set of ids here 2025-05-29 19:31:23 +00:00
Mario
3060126123 bump version 2025-05-29 19:12:27 +00:00
Mario
29f14ff96b only count comments if we are in threaded mode 2025-05-29 19:10:20 +00:00
Mario
8a8219fe72 improved wording 2025-05-29 18:38:11 +00:00
Mario
0aef9b486d fix typo 2025-05-29 17:58:48 +00:00
Mario
d584e4f7d5 fix queries in certain situations returning more results than we need producing unexpected rendering results 2025-05-29 17:58:04 +00:00
Mario
71fbc3ff5c bump version 2025-05-29 14:25:20 +00:00
Mario
3613257cdc pass permission sql to item_reaction_sql() in case we are a visitor and rename the variable 2025-05-29 14:24:53 +00:00
Mario
f61fd2d337 if we are not in threaded mode default comments limit to 1000 2025-05-29 11:55:02 +00:00
Mario
bd8ffcd28d bump version 2025-05-29 10:14:20 +00:00
Mario
20148d23f1 toplevel comments pagination: initial commit 2025-05-29 10:13:32 +00:00
Mario
bdcee46138 do not check for possibly unset var 2025-05-28 12:53:53 +00:00
Mario
bc40c3f7c0 bump version 2025-05-28 09:18:49 +00:00
Mario
7e3d86bc37 more refactor and streamline for re-usability and easier maintenance 2025-05-28 09:15:18 +00:00
PepeCyB
133ac409e3 remove unneeded files 2025-05-27 22:49:16 +02:00
PepeCyB
bda32015b9 new german help-files added 2025-05-27 22:48:54 +02:00
Mario
f0229c9f42 update todo 2025-05-27 09:02:52 +00:00
Mario
7cd44e2112 minor cleanup 2025-05-27 08:31:37 +00:00
Mario
3a3ae2b204 fix a undefined var warning and move some definitions closer to where the value is set for better readability 2025-05-27 08:12:33 +00:00
Mario
4df3c8d2a1 bump version 2025-05-27 08:06:20 +00:00
Mario
8d1fea7ec3 new version of items_by_parent_ids() and item_reaction_sql() with much better performance, streamline rsvp naming convention and some preparatory work for comment lazy loading (unfinshed) 2025-05-27 08:04:36 +00:00
Mario
3535cb3b96 remove the word only. the filter icon should be clear enough. 2025-05-25 17:56:38 +00:00
Mario
48af5b354d bump version 2025-05-25 14:16:47 +00:00
Mario
19df2f596b revert to previous iteration of the parents query function until performance issues will be resolved and adapt the modules accordingly 2025-05-25 14:05:08 +00:00
Harald Eilertsen
51cd6381a6 Ignore PHPStan warning of missing .htpreconfig
The existence of the file is checked in the if-statement wrapping the
include.
2025-05-24 10:52:29 +02:00
Harald Eilertsen
311e0159c9 Fix undefined static function in Zot6Handler
The static function `reply_rekey_request` did not exist, but a function
`rekey_request` that was never called did. Changed the call to use the
latter function instead.

Note: This is completely untested code, and probably needs some
validation. But then it did not work before either.
2025-05-24 10:43:39 +02:00
Harald Eilertsen
63c3f4dc20 Fix missing return in Render\Theme::current
Also made the function halt with a status 500 and log a message if no
theme was found.
2025-05-23 22:33:52 +02:00
Harald Eilertsen
b6e65a76ea Add App::$page_layouts attribute for comanche
Zotlabs\Render\Comanche::register_page_template assigns this variable in
App (for some reason), but it is not declared. As dynamic attributes are
deprecated, and will be removed in PHP 9, this patch fixes the issue by
defining the attribute in the App class.
2025-05-23 20:53:55 +02:00
Mario
d31221e61b use else instead of checking for $ret 2025-05-23 11:54:30 +00:00
Mario
043c1610fd refactor items_by_parent_ids() to accept $thr_parents as an array and stringify it here with the escape flag instead of in the caller modules 2025-05-23 11:35:10 +00:00
Mario
84a4927866 bump version 2025-05-23 10:01:18 +00:00
Mario
2c3ec1ae81 Merge branch 'phpstan-fixes' into 'dev'
Fix a selection of ussues reported by PHPStan

See merge request hubzilla/core!2203
2025-05-23 09:58:59 +00:00
Mario
5655962370 Merge branch 'update-doxygen-config' into 'dev'
Minor doxygen config update

See merge request hubzilla/core!2202
2025-05-23 09:55:15 +00:00
Mario
cd7fab3d37 refactor query in items_by_parent_ids() to prepare for pagination. Until pagination will be implemented we will load the last 100 comments. 2025-05-23 09:51:11 +00:00
Mario
980fedadc0 dba_pdo: return results when using common table expressions (CTE) 2025-05-23 09:47:25 +00:00
Harald Eilertsen
0121e4ed12 Fix undefined variables in Module/Regate.php 2025-05-22 19:03:06 +02:00
Harald Eilertsen
ea6893e3a3 Fix undefined var in Module/Invite.php
The variables $invexpire_n and $invexpire_u was undefined, but
references multiple times in a conditional. Just removed them which
should cause no changed behaviour.
2025-05-22 19:03:06 +02:00
Harald Eilertsen
8a211aff97 Remove unused code in Module/Invite.php
The $feedbk variable was set, but never used in the Module\Invite::get()
function.
2025-05-22 19:03:06 +02:00
Harald Eilertsen
daf8531804 Fix undefined var in Module/Invite.php
Fir ref to undefined $ihave variable in the Module\Invite::get() method.
The var was defined later in the method. Also refactor to fix some other
strange logic in the same area while I was there.

- Moved the logic to cound invites currently in use by a channel to a
  private function. This should probably be moved further to a Regiter
  class once we have these things more in order.
- Changed the logic checking the configuration for how many invites a
  channel can use at the same time to just return 4 (the default)
  instead of going via 'na' and then checking if it's 'na' to then use
  the default value.
- Dropped setting the config to the default if the module is visited by
  an admin. That belongs somewhere else.
2025-05-22 19:03:06 +02:00
Harald Eilertsen
961996a051 Remove duplicate array key in Lib/ThreadItem.php
The key `parent` was set twice in ThreadItem::get_template_data(), once
cast to an intvalue, and later raw from whatever type $item['parent']
held.

Since the value not converted to an int was the one used, this is what
has been kept in this patch, so as to not change existing behaviour.
2025-05-22 19:03:06 +02:00
Harald Eilertsen
0f8500244b Fix undefined variable in Lib/Activity.php
This looks like a simple typo, using camelCase instead of snake case for
the $is_collection_operation variable.

Note:
	However, as it has been undefined, this means it's been treated as
	always false until now, so this may change some behaviour.
2025-05-22 19:03:06 +02:00
Harald Eilertsen
5dcafde617 Fix exclude pattern in phpstan config 2025-05-22 19:03:06 +02:00
Harald Eilertsen
e101e4f511 Minor doxygen config update
- Enable dark mode toggle
- Remove empty footer that broke scrolling
2025-05-22 15:27:35 +02:00
Mario
a5e171a594 Revert "implement thread limit"
This reverts commit be35f612eb.
2025-05-21 11:11:21 +00:00
Mario
be35f612eb implement thread limit 2025-05-21 10:22:37 +00:00
Mario
6d306bc0b3 more return early if we have not got the required data 2025-05-21 09:24:48 +00:00
Mario
813a5b3621 return early if we have not got the required data 2025-05-21 09:23:23 +00:00
Mario
48162fc8d6 fix php warning 2025-05-21 09:13:58 +00:00
Mario
868f9a6b92 bump version 2025-05-20 20:43:10 +00:00
Mario Vavti
e022e59d0a check if function exists - aparently that is not always the case 2025-05-20 22:38:29 +02:00
Mario Vavti
9947f1ec99 add exif to extensions to install 2025-05-20 22:24:25 +02:00
Mario Vavti
6a2748724c guess_image_type(): fix minor issue and add some tests (guessing from getimagesize() and Imagick is not tested) 2025-05-20 22:10:52 +02:00
Mario
457cb74883 Merge branch 'messages-widget-tests' into 'dev'
Add a couple of tests for Widget\Messages

See merge request hubzilla/core!2200
2025-05-20 09:17:05 +00:00
Mario
90b8e08637 since photo_cache images depend on items uese default expire days instead of cache expire days otherwise they might be removed too early (if they have not been removed yet due to cache expire policy) 2025-05-19 22:00:03 +00:00
Mario
572b4a45da fix syntax error 2025-05-19 21:53:49 +00:00
Mario
2e7f806c15 add logging on failure 2025-05-19 21:52:29 +00:00
Mario
4ed8e7b469 refactor guess_image_type() 2025-05-19 21:50:20 +00:00
Harald Eilertsen
1eb3357584 Add a couple of tests for Widget\Messages
Just a couple of basic tests around listing file tags, to make sure the
code runs without any warnings.
2025-05-19 10:24:13 +02:00
Mario
3850cd9641 remove leftover after recent changes 2025-05-19 08:18:47 +00:00
Mario
6f501b37e8 Merge branch 'new-docs' into 'dev'
Replace english docs with pepecyb's docs

See merge request hubzilla/core!2189
2025-05-18 18:42:45 +00:00
Harald Eilertsen
456a741809 Replace english docs with pepecyb's docs 2025-05-18 18:42:45 +00:00
Mario
8a0c9648fe define variable 2025-05-18 16:56:12 +00:00
Mario
4625a8927c Revert "define variable"
This reverts commit a773ca8a24.
2025-05-18 16:55:55 +00:00
Mario
a773ca8a24 define variable 2025-05-18 16:55:20 +00:00
Mario
eb00fe3575 bump version 2025-05-17 18:43:42 +00:00
Mario
1666ca7cb7 actually fix thr_parent arrows 2025-05-17 18:42:42 +00:00
Mario
89aecbbc1c version 2025-05-17 16:21:26 +00:00
Mario
7b8e47b49d revert moving thr_parent retrieval to SQL in favor of a more simple solution (fixes SQL error in postgres and strict mysql) 2025-05-17 16:19:05 +00:00
Mario
cf317aa1a1 revert moving thr_parent retrieval to SQL in favor of a more simple solution (fixes SQL error in postgres and strict mysql)Zotlabs/Lib/ThreadItem.php 2025-05-17 16:18:20 +00:00
Mario
bd1e282499 bump version 2025-05-16 21:03:59 +00:00
Mario
d8a5e8c550 pinned item fixes 2025-05-16 20:43:04 +00:00
Mario
43d0e42425 refactor cache_embeds daemon to be called with uuid (instead of item id) so that it will only be processed once (the queueworker will dismiss duplicates) and add a hook for the photocache addon 2025-05-16 20:22:27 +00:00
Mario
c31b3b6b67 add avif support for php-gd 2025-05-16 07:19:50 +00:00
Mario
18be92ba22 version 2025-05-15 18:58:01 +00:00
Mario
2b38eca986 refactor sql_extra > permission_sql 2025-05-15 18:56:30 +00:00
Mario
4ec895b891 make sure sql_extra is prepared for the c table 2025-05-15 18:40:03 +00:00
Mario
757237cbb4 Revert "make sure sql_extra is prepared for the c table"
This reverts commit 869b047fde.
2025-05-15 18:39:05 +00:00
Mario
869b047fde make sure sql_extra is prepared for the c table 2025-05-15 18:38:42 +00:00
Mario
4bf6752982 implement extra sql for mod channel and display 2025-05-15 16:57:02 +00:00
Mario
5c3f2f9469 first part of cleanups for the conv libs and move thr_parent_uuid retrieval to sql 2025-05-15 12:55:44 +00:00
Mario
6e21be2d94 remove unused var 2025-05-15 11:10:21 +00:00
Mario
3e07eb78fd fix announce source title (addr) not correct 2025-05-15 11:00:18 +00:00
Mario
dceaee691f no need to scroll to toplevels 2025-05-15 07:41:22 +00:00
Mario
7cf380e390 bump version 2025-05-15 07:24:16 +00:00
Mario
9165f766c2 fix offset calculation if element position is relative and use inset box shadow for highlighting items plus some css fixes 2025-05-15 07:23:42 +00:00
Mario
d77d56dfb0 version 2025-05-14 18:54:47 +00:00
Mario
0ae938a4bf another attempt to fix collapsing 2025-05-14 18:54:14 +00:00
Mario
8a0ef4c809 Reapply "fix collapsing"
This reverts commit a3f37e2f1e.
2025-05-14 18:09:46 +00:00
Mario
a3f37e2f1e Revert "fix collapsing"
This reverts commit 948ceb3fac.
2025-05-14 17:57:08 +00:00
Mario
271b9f66ea revert css fixes for messages widget 2025-05-14 16:10:39 +00:00
Mario
4914438479 pinned item template fixes (requires more work) and minor css fixes 2025-05-14 16:07:42 +00:00
Mario
7a01eaa90f version 2025-05-14 11:01:17 +00:00
Mario
948ceb3fac fix collapsing 2025-05-14 11:00:47 +00:00
Mario
d26a3ec22b bump version 2025-05-14 09:41:31 +00:00
Mario
c4a3c7feb7 fix autosave for comments 2025-05-14 09:40:53 +00:00
Mario
6e8481e90e fix notfication issue with update activities 2025-05-14 08:57:47 +00:00
Mario
47d988419f bump version 2025-05-14 08:21:05 +00:00
Mario
a84e6e9747 streamline show more/less handling 2025-05-14 08:19:42 +00:00
Mario
aa9210921d exclude Add/Remove from network nouveau query 2025-05-13 08:49:58 +00:00
Mario
e91f8f3aef bump version 2025-05-13 08:21:20 +00:00
Mario
9b36c39eff remove and deprecate image preload setting - we will now always preload 2025-05-13 08:20:46 +00:00
Mario
a28dd9f2cf remove redundant var 2025-05-13 08:08:27 +00:00
Mario
bf79a2cf4f bump version 2025-05-13 08:05:56 +00:00
Mario
a03ca38409 use box-shadow instead of border to prevent layout moving 2025-05-13 08:05:30 +00:00
Mario
1b246e2ba5 remove redundant item_normal() from item_activity_sql() and use protect_sprintf() on thr_parents 2025-05-13 07:12:20 +00:00
Mario
f905266e4b fix php warning 2025-05-11 19:33:40 +00:00
Mario
e511220022 Merge branch 'remove-direct-access-to-app-observer' into 'dev'
Don't access App::$observer directly in core

See merge request hubzilla/core!2197
2025-05-11 18:08:16 +00:00
Mario
5655807337 fix wrong variable name 2025-05-11 17:56:46 +00:00
Mario
0930539ab4 Merge branch 'lazy' into 'dev'
Implement lazy loading of reactions and sub threads, default to threaded conversation view, some bugfixes and adjusted nomenclature

See merge request hubzilla/core!2198
2025-05-11 17:54:58 +00:00
Mario
b674a1869e undo introduction of new argument in get_template_data(). this can be accomplished more straightforward 2025-05-11 16:01:49 +00:00
Mario
16fafdbbb0 remove redundant query for stored item 2025-05-11 13:39:37 +00:00
Mario
b5acde1420 bump version for merge 2025-05-09 20:34:04 +00:00
Mario
4fa9f30189 cleanup, add some doco an add missing counts of observer event rsvps 2025-05-09 20:24:25 +00:00
Mario
57ae3325e0 allow to switch conv mode per channel 2025-05-09 19:13:49 +00:00
Harald Eilertsen
8141ef9511 Add some API docs for the observer file 2025-05-09 15:23:01 +02:00
Harald Eilertsen
e70870ce4e Move observer helper functions to separate source
The main goal was to move the functions out of the already overcrowded
`boot.php`. While I would ideally have liked to move them properly under
a namespace under `Zotlabs\`, that would break too much existing code at
this point.

Thus leaving it in include and under the global namespace for now.
2025-05-09 15:20:38 +02:00
Harald Eilertsen
7cb8a56b6a Don't access APP:$observer directly in core
Introduce helper functions to access the various fields of the xchan
stored in `App::$observer'. This removes direct access to the attribute
from core, with the aim of allowing further refactoring later.

We can not yet make the `App::$observer` attribute private, though, as
it is also accessed directly by some addons.
2025-05-09 15:15:35 +02:00
Mario
07ca5d54c8 version 2025-05-09 09:43:02 +00:00
Mario
dfde321a3b fix statObj 2025-05-09 09:42:29 +00:00
Mario
aab53c9fc9 provide owner uid for item_normal() in items_by_thr_parent() and set history.pushState when requesting a subthread 2025-05-09 09:35:31 +00:00
Mario
9def0f280f notification fixes 2025-05-09 08:53:47 +00:00
Mario
e71c95a5a5 refactor item_normal() to allow a profile_uid and a prefix as arguments 2025-05-08 12:05:31 +00:00
Mario
1be6c11bad implement moderation of reactions 2025-05-08 11:48:58 +00:00
Mario
030fe8c656 bump version 2025-05-08 10:36:45 +00:00
Mario
8f539e3707 fix announce action label and modal not closing 2025-05-08 10:35:32 +00:00
Mario
918377a67b provide commentable state and minor cleanup 2025-05-08 10:27:57 +00:00
Mario
25e29ec544 fix wrong order of args 2025-05-08 08:39:32 +00:00
Mario
71f80aa4d2 cleanup template 2025-05-07 19:23:21 +00:00
Mario
070d839ad9 version 2025-05-07 19:03:26 +00:00
Mario
ee9b53132e wording, fix comment preview and remove logging 2025-05-07 19:02:53 +00:00
Mario
ca4bb5927e whitespace 2025-05-07 12:36:40 +00:00
Mario
6ed56f9996 sess_data has been changed to mediumtext a while ago via update 2025-05-07 12:33:17 +00:00
Mario
ac5d22d514 refactor doreply() and move reply functionality to modal 2025-05-07 12:31:47 +00:00
Mario
21279b7d4e version 2025-05-06 09:14:17 +00:00
Mario
77c310e393 mark lazy loaded items read and minor cleanup 2025-05-06 09:13:35 +00:00
Mario
c5d75f23e5 fix title and summary converted to bbcode 2025-05-06 06:57:45 +00:00
Mario
a00db63b3e imagesLoaded() can deal with strings 2025-05-06 06:45:58 +00:00
Mario
1d60d38cdc version 2025-05-06 06:41:57 +00:00
Mario
0b42197a99 allow preloading images if dom element is not yet in page 2025-05-06 06:41:26 +00:00
Mario
07da20d00c fix verb and hash for notifications 2025-05-05 07:44:39 +00:00
Mario
d413cf8a30 wrong logic 2025-05-04 20:15:30 +00:00
Mario
1da0ea86f0 more wording 2025-05-04 19:45:57 +00:00
Mario
72f36920ef more on wording 2025-05-04 19:35:14 +00:00
Mario Vavti
7a4d568bfb fix query for postgres 2025-05-04 21:27:41 +02:00
Mario Vavti
0d1c5e26a7 do not add the item-highlight class to any toplevel item 2025-05-04 21:13:36 +02:00
Mario Vavti
ff0a5a0507 mod network fixes 2025-05-04 20:46:49 +02:00
Mario
da780e4e08 this got removed by accident 2025-05-04 16:06:58 +00:00
Mario
0c783773d8 more streamline wording 2025-05-04 15:41:43 +00:00
Mario
5edeb7bd53 remove uuid from mid queries (it is not needed) and slightly alter the query to fetch the parents 2025-05-04 15:40:17 +00:00
Mario
20c8f69efa use profile_uid for mod channel 2025-05-04 13:22:18 +00:00
Mario
b694ed6229 handle blog_mode in conv template 2025-05-04 04:36:12 +00:00
Mario
b4f7daadfb improved blog_mode query 2025-05-03 20:43:26 +00:00
Mario
fb3eae96ab implement blog_mode 2025-05-03 19:04:20 +00:00
Mario
cc91446c18 unseen items: only show announce activities but not the resulting item. also fix a missing operator 2025-05-03 18:03:24 +00:00
Mario
22bda936a5 more streamline wording 2025-05-03 15:58:04 +00:00
Mario
95a2de4da2 Reapply "streamline wording"
This reverts commit ee3fc54be6.
2025-05-03 15:55:13 +00:00
Mario
ee3fc54be6 Revert "streamline wording"
This reverts commit e2c477d775.
2025-05-03 15:52:30 +00:00
Mario
e2c477d775 streamline wording 2025-05-03 15:42:26 +00:00
Mario
6ddd31bfba bump version 2025-05-03 09:42:08 +00:00
Mario
3653f769d9 fix notification button for medium screen size (right aside collapsed) 2025-05-03 09:41:41 +00:00
Mario
261f0e4120 default ordering to created 2025-05-03 09:06:15 +00:00
Mario
6fce724f69 yet another refactor to cover unseen pubstream notifications 2025-05-03 08:32:01 +00:00
Mario
dedab1ad4f this performs way better 2025-05-02 16:48:34 +00:00
Mario
cf1a404945 bump version 2025-05-02 16:24:54 +00:00
Mario
ac4af6f9ef Ãfix marking read of reactions 2025-05-02 16:02:47 +00:00
Mario
69ade6d2cb cleanup 2025-05-02 14:03:45 +00:00
Mario
6db5236bf5 provide thr_parent uuid in the item array and make use of it in various places 2025-05-02 13:58:01 +00:00
Mario
b39fb945f5 move look up of thr_parents to separate function and minor fixes 2025-05-02 13:24:58 +00:00
Mario
3fcd5a0f0f fix display issue 2025-05-02 07:52:41 +00:00
Mario
62635aa803 version 2025-05-01 10:52:32 +00:00
Mario
32717d910c add counts for rsvp activities and some visual shenenigans 2025-05-01 10:52:15 +00:00
Mario
881f540e43 some visual changes 2025-04-30 19:31:31 +00:00
Mario
e5cd6330b3 default to threaded 2025-04-30 14:42:09 +00:00
Mario
e91021f648 rename wrapper class 2025-04-30 09:06:01 +00:00
Mario
1463c1a526 refactor 2025-04-30 08:28:47 +00:00
Mario
e195897dc7 slightly change the way we deal with perms 2025-04-29 21:18:53 +00:00
Mario
b6f0fe7583 refactor with permissions 2025-04-29 09:52:30 +00:00
Mario Vavti
377fe32795 add branch to version string 2025-04-26 22:41:35 +02:00
Mario Vavti
73d444bd8a some refactoring and implement subthread fetching 2025-04-26 22:33:32 +02:00
Mario Vavti
80415f6bd3 remove unused code 2025-04-26 14:33:45 +02:00
Mario Vavti
7ab531025c streamline sql functions 2025-04-26 12:19:04 +02:00
Mario Vavti
763a4f1fbb implement observer activity visibility 2025-04-26 10:46:48 +02:00
Mario Vavti
cde558a43f also remove the parent line from the query 2025-04-25 23:47:04 +02:00
Mario Vavti
bafbbc9d5b revert adding of id - we can not use it 2025-04-25 23:22:06 +02:00
Mario Vavti
ad4eec1145 kind of fix the like response 2025-04-25 23:02:28 +02:00
Mario Vavti
0584094f05 use normal size modal 2025-04-25 22:36:27 +02:00
Mario Vavti
c614f899b7 implement requesting of reactions 2025-04-25 22:35:13 +02:00
Mario Vavti
0940be57fd should compare against item.mid 2025-04-25 16:47:15 +02:00
Mario Vavti
7e148c1e30 the c table must also include item_normal() 2025-04-25 16:16:37 +02:00
Mario
babc3df364 this should not be required anymore 2025-04-25 12:53:47 +00:00
Mario
ba9637e129 lazy load - initial commit 2025-04-25 12:46:30 +00:00
Mario Vavti
a48a72d1cd use a separator 2025-04-24 10:05:00 +02:00
Mario Vavti
1edea291a4 we have update an existing result - do not create another result set for this action 2025-04-24 09:58:37 +02:00
Mario
b7ef3fab3c dreport: do not store dismissed create activities 2025-04-24 07:09:29 +00:00
Mario
afe31160db mod item: deprecate x() and use $_POST instead of $_REQUEST 2025-04-24 06:41:43 +00:00
Mario
4849d50610 add some styling to dreport 2025-04-23 20:17:02 +00:00
Mario
d5f7b620c4 fix regex to catch codeblocks with params like class etc 2025-04-23 19:37:57 +00:00
Mario
6515443957 more deprecate x() 2025-04-23 19:09:12 +00:00
Mario
8b352e4c64 more deprecate x() 2025-04-23 18:41:26 +00:00
Mario
7c59dd9fd7 more deprecate x() 2025-04-23 18:17:23 +00:00
Mario
118a223ee1 fix term.imgurl not stored in item_store_update() 2025-04-23 09:10:58 +00:00
Mario
481113f641 set $plink to null if not provided 2025-04-22 09:30:35 +00:00
Mario
bed929c966 define variable 2025-04-21 19:33:46 +00:00
Mario
10345a5418 more php warnings 2025-04-21 19:28:44 +00:00
Mario
efc9581798 comment out localize_item() in Enotify::submit() and fix some PHP warnings 2025-04-21 19:18:37 +00:00
Mario
005b9919d0 x() to !empty() 2025-04-21 17:25:20 +00:00
Mario
86e88c6bb0 also continue if we have not got a filepath for some reasonà 2025-04-21 15:27:55 +00:00
Mario
7505f7039a define variable 2025-04-21 11:52:34 +00:00
Mario
5a52b6afea define variable 2025-04-21 11:42:24 +00:00
Mario
86f8d8ecdf fix php warnings 2025-04-21 11:39:35 +00:00
Mario
81559e9bcf fix php warnings 2025-04-21 11:30:42 +00:00
Mario
1b458c7d65 missing include 2025-04-21 10:15:51 +00:00
Mario
d2177f27f9 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-04-21 10:09:54 +00:00
Mario
da6db54122 some cleanup for boot.php 2025-04-21 10:09:33 +00:00
Mario Vavti
1e41c83b35 fix test 2025-04-20 21:43:32 +02:00
Mario
8bc079aa3d cleanup Web/Router 2025-04-20 19:23:54 +00:00
Mario
a5a58d73ff cleanup Lib/WebServer 2025-04-20 18:42:26 +00:00
Mario
68967e93d6 wrong class 2025-04-20 16:16:15 +00:00
Mario Vavti
88f1a7d652 whitespace 2025-04-20 18:11:12 +02:00
Mario Vavti
21c2fabae0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-04-20 18:06:03 +02:00
Mario Vavti
a36afc0bb7 rawurlencode the cloud paths - issue #1903 (second part) 2025-04-20 18:04:59 +02:00
Mario Vavti
7855aaf53c set App::$query_string from from server.request_uri instead of server.query_string because the latter will mostly be urldecoded by the server already - issue #1903 (first part) 2025-04-20 18:04:03 +02:00
Mario Vavti
6535475a99 add some padding for breadcrumb 2025-04-20 17:59:40 +02:00
Mario
ddaaac1103 Merge branch 'debian_install_20250415' into 'dev'
debian install script

See merge request hubzilla/core!2196
2025-04-19 05:45:17 +00:00
Mario
295266cb10 Merge branch 'refactor-language-selector' into 'dev'
Move lang_selector function to Lang module and refactor

See merge request hubzilla/core!2195
2025-04-19 05:43:26 +00:00
Harald Eilertsen
e800d176fb Move lang_selector function to Lang module and refactor 2025-04-19 05:43:25 +00:00
Mario Vavti
cace4c6c65 strtotime() accounts with the timezone - set it to UTC for the stored timestamp 2025-04-18 22:38:45 +02:00
Mario Vavti
d7aff9a4dd fix wrong logic 2025-04-18 21:19:38 +02:00
Mario Vavti
a4a7794315 implement until= in message filter 2025-04-18 21:00:33 +02:00
Mario Vavti
c1d87fa65d more doco 2025-04-18 10:27:13 +02:00
Mario Vavti
e69763f86d add more message filter tests 2025-04-18 10:21:16 +02:00
Mario Vavti
5db5a5cfe9 fixes and more test samples 2025-04-17 14:29:27 +02:00
Mario Vavti
24f71dfcf8 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-04-17 11:35:24 +02:00
Mario Vavti
6d62acb446 extend MessageFilter::test_condition() to deal with && and || conditions and add tests 2025-04-17 11:35:06 +02:00
Mario
32ab6344c4 use mb_strlen() instead of strlen() 2025-04-16 18:51:59 +00:00
Mario
60b4c003af $_REQUEST > $_POST 2025-04-16 11:07:03 +00:00
Mario
4c962417ff pÃrevent storing files/folder with filenames exceeding their max name length 2025-04-16 11:03:08 +00:00
Mario
d2aad8a41a stephenhill/base58 seems not maintained anymore and throws a deprecation warning - fix here for now 2025-04-16 08:36:10 +00:00
Mario
fd0f6d4fa8 check if the uuid is mapped before using it 2025-04-16 08:15:30 +00:00
Mario
87d68b175e fix undefined variable warning 2025-04-16 08:08:02 +00:00
Mario
64652c1d6e fix variable name 2025-04-16 07:51:22 +00:00
Mario
9342a92682 deal with link type attachments 2025-04-16 07:44:40 +00:00
Mario
443c5495e9 do not translate network to stream 2025-04-16 07:44:12 +00:00
OJ Randon
80f3892ba0 check if update script for selfHOST was downloaded 2025-04-15 17:39:14 +02:00
OJ Randon
16ee954048 use wget to download composer and checksum 2025-04-15 17:36:47 +02:00
OJ Randon
4e367e1e67 Merge remote-tracking branch 'official/dev' into fix_debianinstall 2025-04-15 17:31:28 +02:00
Mario
7f7763ee0c remove redundant var declaration 2025-04-15 14:38:28 +00:00
Mario
868a8ccfd9 fix more php warnings 2025-04-15 14:37:38 +00:00
Mario
b7b1a5574f fix more php warnings 2025-04-15 14:28:42 +00:00
Mario
aa0c8973fa fix more php warnings 2025-04-15 14:25:48 +00:00
Mario
f6b91f97bf this should be info instead of notice 2025-04-15 14:21:20 +00:00
Mario
d82e7c9f6c fix php warning 2025-04-15 14:20:27 +00:00
Mario
083b2b1bbc add suport for strong bbcode tag 2025-04-15 09:10:45 +00:00
Mario
805bbd1c3e fix color bbcode markup 2025-04-15 09:03:32 +00:00
Mario
077ca1aea5 change photo.filename to type text (some platforms have very long filenames for their profile photos) 2025-04-15 08:41:10 +00:00
Mario
1217ae3b3e remove it 2025-04-15 08:05:22 +00:00
Mario
17777981ac this should not be required because it only affects likes which are already handled before (reaction) 2025-04-15 07:43:11 +00:00
Mario
ddc4bdcebe set default value and add comment 2025-04-14 16:41:39 +00:00
Mario Vavti
126c7f9d62 improved tests 2025-04-14 17:35:35 +02:00
Mario
75d1be092e default to null 2025-04-14 14:34:21 +00:00
Mario Vavti
0d51ff1906 add test for Activity::getUUID() and Avtivity::getMessageID() methods 2025-04-14 13:23:49 +02:00
Mario
679b5098da provide methods to get mid and uuid from activity object, add quirks to retrieve markdown content 2025-04-14 09:24:20 +00:00
Mario
224b32e767 remove borders from some buttons 2025-04-14 07:25:08 +00:00
Mario
1f943474cb boxy: up padding left also for the itrm tools 2025-04-13 18:49:38 +00:00
Mario
6891db1b23 boxy: minor css fix 2025-04-13 13:55:11 +00:00
Mario
a19951528d minor css fix 2025-04-13 09:16:03 +00:00
Mario
a4ea4ecc3b video poster requires a single quote 2025-04-11 20:03:01 +00:00
Mario Vavti
8c182c9d68 version 10.2.3 2025-04-11 21:30:03 +02:00
Mario
384eea79dc changelog
(cherry picked from commit 6068c0e8c2)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-11 19:28:46 +00:00
Mario
c2a09434ca Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-04-11 19:28:01 +00:00
Mario
6068c0e8c2 changelog 2025-04-11 19:27:28 +00:00
Mario Vavti
f8bc755c20 fix bougus merge to master 2025-04-11 21:13:40 +02:00
Mario
fd86ccb4eb Merge branch 'increase-memory-limit-for-ci' into 'dev'
CI: Up the memory limit to allow for coverage reporting

See merge request hubzilla/core!2194
2025-04-11 09:38:16 +00:00
Mario
c36d159997 Merge branch 'fix_debianinstall' into 'dev'
Fix debianinstall

See merge request hubzilla/core!2192
2025-04-11 09:37:29 +00:00
OJ Random
efd61cb43a Fix debianinstall 2025-04-11 09:37:29 +00:00
Mario Vavti
aa38e8360a version 10.2.2 2025-04-11 10:45:43 +02:00
Mario
fdf6680b29 changelog
(cherry picked from commit b79c19c66d)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-11 08:44:37 +00:00
Mario
b79c19c66d changelog 2025-04-11 08:36:28 +00:00
Mario
8999a96ef0 cleanup deprecated forum queries and possibly improved performance 2025-04-11 10:23:46 +02:00
Mario
b5d2236a58 do not return success if Libzot::fetch() did not return anything useful and remove redundant parameter $hub
(cherry picked from commit 3550609d29)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-11 07:48:28 +00:00
Mario
91e59d3c4f make sure we have an encoded activity before we go on building the packet, do not json_encode() a possibly empty item.target
(cherry picked from commit fe8ae2f88e)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-11 07:45:24 +00:00
Mario
a6ff444e19 fix some plink for forum posts and comments
(cherry picked from commit a5a2d80c50)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-11 07:42:50 +00:00
Harald Eilertsen
ee4cc51a05 CI: Up the memory limit to allow for coverage reporting 2025-04-10 21:45:22 +02:00
Mario
29d4edb285 fix an obscure delivering issue which incidentally also fixes a delivering issue that required an ugly hack to work around
(cherry picked from commit 7c79ec9626)

Co-authored-by: Mario <mario@mariovavti.com>
2025-04-10 13:04:41 +00:00
Mario
7c79ec9626 fix an obscure delivering issue which incidentally also fixes a delivering issue that required an ugly hack to work around 2025-04-10 13:03:11 +00:00
Mario
66f793cb83 more fix downstream test for an upstream bug 2025-04-09 16:07:00 +00:00
Mario
6d926f4271 fix downstream test for an upstream bug 2025-04-09 15:47:21 +00:00
Mario Vavti
6ffd3fd9d4 composer update chillerlan/php-qrcode 2025-04-09 15:54:58 +02:00
Mario Vavti
3d204c782b --no-dev! 2025-04-09 15:47:23 +02:00
Mario Vavti
20f8239b44 composer update commerceguys/intl 2025-04-09 15:41:01 +02:00
Mario Vavti
10c2bd83d3 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-04-09 14:22:23 +02:00
Mario Vavti
4b02bd60cb composer update libs 2025-04-09 14:19:48 +02:00
Mario
50ea3afcb0 re-add red-koala.png which has been removed by accident 2025-04-09 10:43:57 +00:00
Mario
982d7540cc wrong ticks 2025-04-09 10:29:23 +00:00
Mario
b9aec78dde rename README > README.md 2025-04-09 10:26:00 +00:00
Mario
f5b1fda6b7 reorganize emojis and allow custom site emojis 2025-04-09 10:21:01 +00:00
Mario
4dfdb2b2e1 bump item.obj and item.target to mediumtext for mysql 2025-04-05 18:48:07 +00:00
Mario
a5a2d80c50 fix some plink for forum posts and comments 2025-04-05 15:55:58 +00:00
Mario
8da7fe8dbe whitespace 2025-04-04 15:44:04 +00:00
Mario
f64c5977f8 move weblink to after embedPhotos 2025-04-04 15:42:17 +00:00
Mario
a16e024b51 cleanup 2025-04-04 15:34:55 +00:00
Mario
860de5e28e bump version 2025-04-04 15:22:46 +00:00
Mario
b38da72535 move jot related functions to jot-header and some cleanup 2025-04-04 15:22:09 +00:00
Mario
2c4f1dcf03 use the syntax which allows image descriptions 2025-04-04 15:20:57 +00:00
Mario
0a1255518f bump version 2025-04-04 10:56:01 +00:00
Mario
a822e94f9b move jot popup handling to template, port photo selector to vanilla javascript and enable it for comments if applicable 2025-04-04 10:51:51 +00:00
Mario
484971c90a use png for hubzilla emoji 2025-04-04 07:15:23 +00:00
Mario
e11035acf4 optimize svg 2025-04-03 18:17:25 +00:00
Mario
3d522b99d8 add hubzilla emoji, make sure the compared term type is an integer 2025-04-03 18:12:23 +00:00
Mario
e62c4e6088 some emoji type tags do not have an id, we will use icon.url instead in those cases 2025-04-03 17:15:22 +00:00
Mario
703ccc2a9a this is required e.g. when relaying emoji reactions otherwise the relevant data will be missing 2025-04-03 12:01:11 +00:00
Mario
b2d09134c1 more smilies() fixes 2025-04-03 11:58:13 +00:00
Mario
de3f491966 make sure object actor is an array if we are going to use it 2025-04-03 11:57:25 +00:00
Mario
322a021765 for consistency use just the name as short name 2025-04-03 10:01:09 +00:00
Mario
d191b66bb8 move custom emoji rendering to smilies() 2025-04-03 09:55:59 +00:00
Mario
5241a159d2 bump version 2025-04-02 10:53:50 +00:00
Mario
fe8ae2f88e make sure we have an encoded activity before we go on building the packet, do not json_encode() a possibly empty item.target 2025-04-02 10:53:13 +00:00
Mario
3550609d29 do not return success if Libzot::fetch() did not return anything useful and remove redundant parameter $hub 2025-04-02 10:49:38 +00:00
OJ Randon
c6df3b0b97 fix stop of mysql 2025-04-02 11:38:22 +02:00
OJ Randon
e6ca21965b check if updates work 2025-04-01 13:39:41 +02:00
OJ Randon
c44c522d7d wording and confirmation that Raspi 5 is working 2025-04-01 01:10:16 +02:00
OJ Randon
f48bf8e366 fix certbot installation 2025-04-01 00:45:59 +02:00
OJ Randon
6e1cdebbf4 use https for selfhost updater (dyn dns) 2025-04-01 00:45:10 +02:00
Mario
eb592bb741 bump version 2025-03-28 20:49:27 +00:00
Mario
db5d67a4e0 cleanup deprecated forum queries and possibly improved performance 2025-03-28 20:46:17 +00:00
Mario
6e390a06e1 remove deprecated emojiReaction 2025-03-28 20:43:08 +00:00
Mario
295d5f06dc lazy load profile images for likes and remove zid function for the profile image src attribute
(cherry picked from commit 30d552255e)

Co-authored-by: Mario <mario@mariovavti.com>
2025-03-28 13:31:47 +00:00
Mario
30d552255e lazy load profile images for likes and remove zid function for the profile image src attribute 2025-03-28 13:29:43 +00:00
Mario
0522bd5593 include unapproved connections in deliverable_abook_xchans(). here is why: if they are at a hub, where an approved connection already exists, they will already receive the message since our defaultult permission allows view_stream. If view_stream is not allowed they will be filtered later in the process. We will however exclude blocked connections (approved or unapproved) already here now. 2025-03-27 12:43:53 +00:00
Mario
a46d837267 minor cleanup 2025-03-27 10:31:07 +00:00
Mario
bee493f628 remove redundant variables and use document.body.clientWidth instead of rounded window.innerWidth 2025-03-26 11:20:11 +00:00
Mario
a4f4a082af fix another js error on small screens and use const instead of let where applicable 2025-03-25 10:38:00 +00:00
Mario
dd9ab07044 restrict access to tool to local channels 2025-03-24 09:11:26 +00:00
Mario
afd811a875 more deprercate jquery 2025-03-23 14:14:19 +00:00
Mario Vavti
122d46b79b use the new version of unparse_url() and fall through to destination if nothing before applied - otherwise remote redirects will fail (e.g. being logged in to a remote server and vewing a linked image with an attached zid at another server) 2025-03-22 18:18:55 +01:00
Mario
36448adad4 minor refactor 2025-03-21 16:58:27 +00:00
Mario
8f93d9aa75 do not check length, it will not be there if the var is null 2025-03-21 11:33:56 +00:00
Mario
76f50d7150 fix some js errors on mobile devices 2025-03-21 11:30:40 +00:00
Mario
80c9880a67 do not include our own activities in unseen forum notifications 2025-03-20 13:39:32 +00:00
Mario
d1f54507f6 Disable browser rotating image based on EXIF metadata. We remove EXIF data for thumbnails but not for the original files. If the preview image has different orientation than the original size it has a strange effect when viewing. 2025-03-20 13:12:45 +00:00
Mario
334852d733 bump version 2025-03-18 08:15:30 +00:00
Mario
362be52be0 version 10.2.1 2025-03-18 08:10:15 +00:00
Mario
20f5e654ad changelog
(cherry picked from commit 34b2bdcf2c)

Co-authored-by: Mario <mario@mariovavti.com>
2025-03-18 08:09:03 +00:00
Mario
34b2bdcf2c changelog 2025-03-18 08:08:14 +00:00
Mario
8c38ee8208 fix sse_bs query 2025-03-18 08:00:37 +00:00
Mario
2c1c12825d we require the HTTP signature to be set in the HTTP_AUTHORIZATION field somewhere down the line (probably in Web/HTTPSig). Make sure it is there.
(cherry picked from commit 5188b9cef5)

Co-authored-by: Mario <mario@mariovavti.com>
2025-03-18 07:58:14 +00:00
Mario
5188b9cef5 we require the HTTP signature to be set in the HTTP_AUTHORIZATION field somewhere down the line (probably in Web/HTTPSig). Make sure it is there. 2025-03-18 07:52:39 +00:00
Mario
8c0b7ce4de Merge branch 'help_davs' into 'dev'
access cloud files under linux using davs

See merge request hubzilla/core!2190
2025-03-17 20:02:25 +00:00
Mario
17d0d6f75d Merge branch 'dedup-head_get_icon' into 'dev'
Remove duped head_get_icon function

See merge request hubzilla/core!2191
2025-03-17 20:00:58 +00:00
Mario
bbcf7e9aa1 Merge branch '10.2RC' 2025-03-17 19:39:51 +00:00
Mario
45a2ebc662 version 10.2 2025-03-17 19:33:32 +00:00
Mario
aece22aee6 Merge branch 'dev' into 10.2RC 2025-03-17 19:32:36 +00:00
Mario
9904eba277 update changelog 2025-03-17 19:32:10 +00:00
Mario
7c0f98a513 Merge branch 'dev' into 10.2RC 2025-03-17 19:30:39 +00:00
Mario
8d25b6eae4 changelog 2025-03-17 19:23:30 +00:00
Mario
9369085835 Merge branch 'dev' into 10.2RC 2025-03-17 19:20:55 +00:00
Harald Eilertsen
059113d2a8 Remove duped head_get_icon function
This function was existing both as a static function in the App class,
and as a standalone global function. While only the standalone function
was used, this patch changes the callsite to use the static function in
the App class instead, and removed the global variant.

Note: While unlikely, this _could_ break some addons or custom themes
_if_ they call the global head_get_icon function themselves. I have not
found any addons or themes that do so.

This patch also fixes an issue where an incorrect url would be produced
if the URL set by App::head_set_icon would start with '://' for some
reason.

Also added doc comments for both App::head_set_icon and
App::head_get_icon.
2025-03-17 20:17:54 +01:00
OJ Random
f60dff788e access cloud files under linux using davs 2025-03-17 19:03:19 +01:00
Mario
9c20b4809a an attempt to fix no notifications for likes on our comments - beause it came up in the support forum. also some minor cleanup 2025-03-17 08:57:15 +00:00
Mario
00b3039b6e Merge branch 'dev' into 10.2RC 2025-03-16 11:16:31 +00:00
Mario
2695094d16 fix fullscreen view 2025-03-16 11:16:04 +00:00
Mario
bcfdb73001 Merge branch 'dev' into 10.2RC 2025-03-14 10:52:17 +00:00
Mario
1650809cd8 update changelog 2025-03-14 10:51:40 +00:00
Mario
991815469f Merge branch 'dev' into 10.2RC 2025-03-14 10:49:50 +00:00
Mario
c5fb8eafac allow to send signed requests from mod zot_probe 2025-03-12 19:15:28 +00:00
Mario
a0c98e070e Merge branch 'dev' into 10.2RC 2025-03-09 16:14:46 +00:00
Mario
7d6202be13 wrong logic 2025-03-09 16:13:47 +00:00
Mario
4ba470318c Merge branch 'dev' into 10.2RC 2025-03-09 10:09:47 +00:00
Mario
e948aaf751 changelog 2025-03-09 10:06:53 +00:00
Mario
3789017ca0 print an ugly error message and the destination if OWA failed for some reason 2025-03-09 10:03:07 +00:00
Mario
48f5acced3 remove leading @ 2025-03-09 10:00:53 +00:00
Mario
13e2d2f654 css fix
(cherry picked from commit 8d45fd36a1)

Co-authored-by: Mario <mario@mariovavti.com>
2025-03-07 09:02:29 +00:00
Mario
8d45fd36a1 css fix 2025-03-07 09:01:48 +00:00
Mario
6ed2301a94 bump version 2025-03-07 08:54:59 +00:00
Mario
a0eb701503 Merge branch 'dev' into 10.2RC 2025-03-07 08:54:06 +00:00
Mario
39f9a38b23 css fix 2025-03-07 08:51:26 +00:00
Mario
590c0ea778 add pdl file for mod rmagic 2025-03-07 08:43:17 +00:00
Mario
f36d8e4bd2 fix fatal error if variable is an empty string 2025-03-07 08:38:33 +00:00
Mario
4e3bec8a35 streamline login pages layout - fix issue #1892 2025-03-07 08:30:43 +00:00
Mario
eec918bf4a escape tags on xchan name and cleanup baseurl/site_url variables which should be the same 2025-03-06 11:42:25 +00:00
Mario
13002af4c3 version 10.2RC1 2025-03-06 10:00:21 +00:00
Mario
40c63a7f12 changelog 2025-03-06 09:57:49 +00:00
Mario
3d0621eb8c remove superfluous file 2025-03-06 09:17:55 +00:00
Mario
030c02dfdc boxy alignment 2025-03-05 17:03:31 +00:00
Mario
00c1509549 update string to match with the autotime string 2025-03-05 16:42:25 +00:00
Mario
8122c40252 bump dev version 2025-03-05 10:22:46 +00:00
Mario
787c63b7ae version 10.2RC and strings 2025-03-05 10:17:39 +00:00
Mario
ee988edc83 make sure attachment is an array
(cherry picked from commit 2b4b409c01)

Co-authored-by: Mario <mario@mariovavti.com>
2025-03-03 08:56:30 +00:00
Mario
a71f5e123a Debianinstall
(cherry picked from commit cf408c3fac)

34e867cf provide a simplified automated installation as we had years ago
266df96c a) php version for max uplaod sizes b) hubzilla is the only option
c4d340d1 fixed installation of addons
b80a8a01 added composer
f1961884 composer: do not download again but install in any case
96710d83 help: default database name and user
ecf35537 fix composer
2d2bf751 main differences to homeinstall script
dcca3cab changed disclaimer
6c65c17f removed set path to convert because it does not have to be changed
ed77bfb5 email verification
93f85913 environments
00dd3bdd Debian 12 again
10223ef7 extra headings
f528a959 wording
18565bb2 sury instead of Debian repo
bc07f0c4 Merge remote-tracking branch 'origin/dev' into dev
38743496 fixed php install and db creation
d08bb5e6 fixed variable for creating db
b1cc4f4f do not care about more then one single webserver installed
8b0ec26a Merge branch core:master into dev
88e3522d Merge branch 'debianinstall' into dev

Co-authored-by: OJ Random <ojrandom@protonmail.com>
2025-03-03 08:41:11 +00:00
Mario
7579749adc Merge branch 'debianinstall' into 'master'
Debianinstall

See merge request hubzilla/core!2179
2025-03-03 08:40:29 +00:00
OJ Random
cf408c3fac Debianinstall 2025-03-03 08:40:29 +00:00
Mario
0c97792ca7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-02-28 20:29:08 +00:00
Mario
84d63b3b67 fix $owner_hash not set correctly when editing and some whitespace fixes 2025-02-28 20:28:49 +00:00
Mario Vavti
63aa50eb8d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-02-26 16:37:38 +01:00
Mario Vavti
7fb13f23fe fix docu 2025-02-26 16:37:22 +01:00
Mario
65156a0e4d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-02-26 15:33:05 +00:00
Mario
e3eebcd95d calculate observer.baseurl from xchan_url since xchan_connurl is only set for zot xchans 2025-02-26 15:32:36 +00:00
Mario Vavti
9eff1a08d4 refactor unparse_url() to allow to return a custom field set only and add tests 2025-02-26 16:26:40 +01:00
Mario
cfcac590c3 refine text 2025-02-26 12:57:38 +00:00
Mario
872415bffe fix an issue where some participants could not post to forums 2025-02-26 12:52:27 +00:00
Mario
a46b781664 slightly improve event object rendering 2025-02-22 14:43:25 +00:00
Mario
b77fac43c8 feedutils: fix php warnings and style 2025-02-21 09:51:59 +00:00
Mario
2b4b409c01 make sure attachment is an array 2025-02-20 11:27:46 +00:00
Mario
67aa547c48 bump version 2025-02-20 11:09:57 +00:00
Mario Vavti
e288f33776 looks like we now require vendor/symfony for production 2025-02-20 12:05:50 +01:00
Mario Vavti
a5aab4c30e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-02-20 11:44:54 +01:00
Mario Vavti
cf7613b3e0 composer --no-dev 2025-02-20 11:44:00 +01:00
Mario
fa01a2b348 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-02-20 10:36:58 +00:00
Mario Vavti
65c8de3410 update to smarty v5 2025-02-20 11:35:33 +01:00
Mario Vavti
d9b262348f update composer libs 2025-02-20 11:29:06 +01:00
Mario
ea9d2a0acf prefer contextHistory over context 2025-02-19 09:46:52 +00:00
Mario
5d55006be8 Merge branch 'replace-epub-thumbnail-code' into 'dev'
Replace Epub thumbnail generation with our own code

See merge request hubzilla/core!2186
2025-02-14 15:06:25 +00:00
Mario
d9ced0c6bf Merge branch 'update-gitignore' into 'dev'
Exclude test results and PHPStan from git

See merge request hubzilla/core!2188
2025-02-14 14:58:26 +00:00
Mario
8d4d1b17c7 Merge branch 'cherry-pick-10e2fbb2' into 'dev'
Update Spanish strings

See merge request hubzilla/core!2187
2025-02-14 14:58:07 +00:00
Mario
453f6a08a3 Merge branch 'highlight_mark_button3' into 'dev'
Highlight_mark_button3

See merge request hubzilla/core!2185
2025-02-14 14:56:17 +00:00
Rocky
b6560e5456 Highlight_mark_button3 2025-02-14 14:56:17 +00:00
Mario
b805f48c32 revert adding of additional sort field which was added for testingg 2025-02-13 18:57:43 +00:00
Harald Eilertsen
33b78a4943 Exclude test results and PHPStan from git 2025-02-13 16:02:35 +01:00
Manuel Jiménez Friaza
48b187ccd8 Update Spanish strings
(cherry picked from commit 10e2fbb22c6369c9ef6cbc6f943ff6878206e9fb)

Co-authored-by: mjfriaza:4GF~eYj,-iAv <mjfriaza@disroot.org>
2025-02-13 14:11:13 +00:00
Mario
f680bba3e6 select navbar by id to avoid conflict with possible additional navbars 2025-02-13 10:18:12 +00:00
Harald Eilertsen
09aabc6b41 Remove dependency on PHP EpubMeta library. 2025-02-12 20:05:42 +01:00
Harald Eilertsen
0dd456c653 Replace the the code to extract epub thumbnails
The PHP Epub Meta library has a dependency that prevents deployment on
32bit architectures. We also don't need all the functionality in that
library, so this patch replaces it with our own simplified code for
fetching the cover embedded in Epub archives.

We also expand the test suite and clean up some minor issues in the
Epubthumbnail class.
2025-02-12 20:05:42 +01:00
Harald Eilertsen
97ba14cbe0 Configue gd for jpeg support in CI
For some reason the gd build did not find libjpeg, even though it was
installed in the image. We will need jpeg support for testing the
thumbnail generation, so this patch adds the required configuration.
2025-02-12 20:01:45 +01:00
Mario Vavti
ee6367a549 bump version 2025-02-11 19:15:15 +01:00
Mario Vavti
fc52d1b44f exclude uplinked items from those queries since they are unlikely to be the originals (sourced items from a channel at the same hub) 2025-02-11 19:14:11 +01:00
Mario Vavti
bfce562a46 start sending contextHistory along with context 2025-02-11 17:52:26 +01:00
Mario Vavti
8d8a7f44e1 bump version 2025-02-01 12:36:54 +01:00
Mario Vavti
6c8da6ce36 version 10.0.8 2025-02-01 12:30:15 +01:00
Mario
e19a050b92 changelog
(cherry picked from commit a13bf6a3fe)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-02-01 11:28:04 +00:00
Mario Vavti
a13bf6a3fe changelog 2025-02-01 12:26:49 +01:00
Mario
0edf761499 Merge branch 'owa-error-messages' into 'dev'
Add error message on missing owa auth headers

See merge request hubzilla/core!2183
2025-02-01 10:53:12 +00:00
Mario
bf76d5981f Merge branch 'testing-add-psr4-namespace' into 'dev'
Add Zotlabs\Tests namespace to autloader in dev

See merge request hubzilla/core!2182
2025-02-01 10:50:44 +00:00
Mario
33fcb43173 Merge branch 'dba_pdo-insert-and-update' into 'dev'
Add an insert and update methods to dba_pdo

See merge request hubzilla/core!2181
2025-02-01 10:49:47 +00:00
Mario
ffae47f523 Merge branch 'highlight_button' into 'dev'
add highlight/mark button

See merge request hubzilla/core!2180
2025-02-01 10:35:03 +00:00
Rocky
c07cdb30fa add highlight/mark button 2025-02-01 10:35:03 +00:00
Mario
546c4fcad2 calling fetch_post_tags() will add duplicate items here
(cherry picked from commit 0a17b83578)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-02-01 00:03:50 +00:00
Mario Vavti
0a17b83578 calling fetch_post_tags() will add duplicate items here 2025-02-01 01:02:06 +01:00
Mario
2782b6d724 possible sql performance improvements
(cherry picked from commit dc076a4c00)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-30 12:10:45 +00:00
Mario Vavti
dc076a4c00 possible sql performance improvements 2025-01-30 13:09:04 +01:00
Harald Eilertsen
a550c7c853 Add error message on missing owa auth headers
If the /owa endpoint received a request with a missing or invalid
Authorization header, it would return an error to the requester, but
without any message describing why it failes.

This patch adds a message to the error response, so that it will be a
bit easier to debug these issues in the future.

The owa spec includes a 'message' field in the error response, but makes
it optional. Any conforming implementations should accept a response
that includes the 'message' field.
2025-01-29 18:41:40 +01:00
Harald Eilertsen
7a3d59bff3 Add Zotlabs\Tests namespace to autloader in dev
This is technically not needed, as we load the required classes in the
bootstrap file (`tests/unit/bootstrap.php`), but it helps editors that
integrate with language servers etc to find the classes so it does not
flag errors everywhere.
2025-01-29 15:56:17 +01:00
Harald Eilertsen
82a3b71a51 Fix broken DbaPdo test on postgresql 2025-01-29 13:24:12 +01:00
Harald Eilertsen
e39b2eb7b9 Add an dba_pdo::update method
This is a convenience funcition to make it easier to update an existing
row in a database table.
2025-01-29 12:42:44 +01:00
Harald Eilertsen
9f8248cc9c Use returning clause on dba_pdo::insert where supported
By using the returning clause when inserting a new record, we get back
the inserted record right away; thus saving us an extra roundtrip to the
database.

Both PostgreSQL and MariaDB supports this clause, but MySQL don't. In
that case we fall back to manually fetching the last inserted row.
2025-01-29 12:42:44 +01:00
Harald Eilertsen
71e4326606 Fetch the server version on dba_pdo::connect.
The server version string is useful to among other things check whether
we are running on a real MySQL system, or MariaDB. Instead of fetching
it every time we need it, cache it in the dba_pdo object when we connect
to the db.
2025-01-29 12:42:44 +01:00
Harald Eilertsen
7eb6f9b11d Only skip DbaPdo returning test on actual MySQL
MySQL does not support the INSERT...RETURNING clause, while MariaDB
does. This patch ensures that the test is not skipped on MariaDB, but
only on an actual MySQL system.
2025-01-29 12:42:44 +01:00
Harald Eilertsen
4625ffa6b4 Fix return value from dba_pdo::q()
According to the documentation, this function should never return null.
Still that's what it did if a non-select query raised a PDOException.
This patch fixes this, so that it so that the function conforms to the
docs.
2025-01-29 12:42:44 +01:00
Harald Eilertsen
3e6a646603 Add an insert method to dba_pdo
A common use case is to insert a record into a database table, but also
instantiate an object from the inserted data. This requires that we know
the value of any default or calculated columns that is filled in by the
database when the row is inserter.

This patch adds a `insert` method to pda_dbo that will insert a row, and
immediately fetch the row back from the database – including the default
and calculated values not specified by the insert itself.
2025-01-29 12:42:36 +01:00
Mario
324b281813 fix php warniing in case tgt_type is not set
(cherry picked from commit 03d1f3383e)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-24 12:16:33 +00:00
Mario Vavti
03d1f3383e fix php warniing in case tgt_type is not set 2025-01-24 13:10:46 +01:00
Mario
69a23c604d return if $furl is empty for some reason
(cherry picked from commit 174469970a)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-24 11:44:34 +00:00
Mario Vavti
174469970a return if $furl is empty for some reason 2025-01-24 12:43:12 +01:00
Mario Vavti
89b254dc1c add target and tgt_type tou sourced rss items if we rewrite them to our own 2025-01-24 00:11:26 +01:00
Mario Vavti
8e51988e96 unescape_tags() on URLs before we start messing with them 2025-01-23 21:24:06 +01:00
Mario Vavti
52e279f443 fix auto save draft not set correctly and use round instead of ceil for cover height calculation 2025-01-23 19:08:58 +01:00
Mario Vavti
4efa853690 tagsinput still requires jquery 2025-01-23 13:08:13 +01:00
Mario Vavti
9b13055dfe version 10.0.7 2025-01-22 13:08:42 +01:00
Mario
06afd8a375 changelog
(cherry picked from commit 27efb887d2)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-22 11:24:32 +00:00
Mario
6f027544d6 make sure to provide uid to drop_item() where applicable and check ownership when imporing feed items
(cherry picked from commit ccd52584a4)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-22 11:22:15 +00:00
Mario Vavti
2d2c9fa519 bump version 2025-01-22 11:50:46 +01:00
Mario Vavti
27efb887d2 changelog 2025-01-22 11:48:51 +01:00
Mario Vavti
ccd52584a4 make sure to provide uid to drop_item() where applicable and check ownership when imporing feed items 2025-01-22 10:43:33 +01:00
Mario Vavti
ab0fdb13d4 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2025-01-17 12:38:22 +01:00
Mario Vavti
2bca44ed25 bump version 2025-01-17 12:38:08 +01:00
Mario Vavti
eab08d0bcb rewrite redbasic javascript without jquery 2025-01-17 12:37:21 +01:00
Mario
d3f00704bd Merge branch 'add-security-policy' into 'dev'
Proposing a security policy.

See merge request hubzilla/core!2164
2025-01-16 12:29:57 +00:00
Harald Eilertsen
1e1a7109a9 Proposing a security policy. 2025-01-16 12:29:57 +00:00
Mario
ebab5ff281 use bin2hex() instead of btoa() to create an id for the toast. btoa() will not work with nonascii chars.
(cherry picked from commit 0165f44063)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-15 12:00:01 +00:00
Mario Vavti
0165f44063 use bin2hex() instead of btoa() to create an id for the toast. btoa() will not work with nonascii chars. 2025-01-15 12:50:45 +01:00
Mario
5fb6e5d6f7 fix regression in notifications filter
(cherry picked from commit 8fc0e41beb)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-06 09:15:59 +00:00
Mario Vavti
8fc0e41beb fix regression in notifications filter 2025-01-06 10:14:54 +01:00
Mario Vavti
3ad63a6e82 bump version 2025-01-05 13:40:29 +01:00
Mario Vavti
5a84ffdcda version 10.0.6 2025-01-05 13:31:28 +01:00
Mario
ad993645be changelog
(cherry picked from commit 392cb020aa)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-05 12:30:32 +00:00
Mario Vavti
392cb020aa changelog 2025-01-05 13:29:21 +01:00
Mario
0701cde239 dismiss entries where primary location data is not complete for some reason
(cherry picked from commit 884b612ffc)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-05 11:56:51 +00:00
Mario
a136c288d5 cleanup outdated doc entries just once after the docs were imported to the db
(cherry picked from commit ae0d138d2a)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-05 11:56:09 +00:00
Mario Vavti
884b612ffc dismiss entries where primary location data is not complete for some reason 2025-01-05 12:40:56 +01:00
Mario Vavti
ae0d138d2a cleanup outdated doc entries just once after the docs were imported to the db 2025-01-05 11:00:48 +01:00
Mario
1624a2620a remove redundant arguments
(cherry picked from commit 48ef4744ac)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2025-01-04 10:20:40 +00:00
Mario Vavti
48ef4744ac remove redundant arguments 2025-01-04 11:19:03 +01:00
Mario Vavti
a17cb75baf bump version 2024-12-29 17:42:53 +01:00
Mario Vavti
f4769d0f04 version 10.0.5 2024-12-29 17:36:28 +01:00
Mario Vavti
c8e30a00e2 Merge branch 'dev' 2024-12-29 17:35:44 +01:00
Mario Vavti
169c971cb1 changelog 2024-12-29 17:35:10 +01:00
Mario Vavti
51745d3652 Merge branch 'dev' 2024-12-29 17:18:04 +01:00
Mario Vavti
3ebbb91ae9 pass uid to drop_item() to ensure we will have permission to actually drop the item 2024-12-29 17:17:22 +01:00
Mario
762d402dea Merge branch 'dev' 2024-12-26 09:00:33 +00:00
Mario
051cef79fc changelog 2024-12-26 09:00:02 +00:00
Mario
b05a440f03 version 10.0.4 2024-12-26 08:58:46 +00:00
Mario
9bb4988eda Merge branch 'dev' 2024-12-26 08:55:36 +00:00
Mario
f66f0e398b missing argument name 2024-12-26 08:54:58 +00:00
Mario
49cb73c8c7 version 10.0.3 2024-12-26 08:04:05 +00:00
Mario
2a00bd9a28 Merge branch 'dev' 2024-12-26 08:03:26 +00:00
Mario
553b3f6faa changelog and bump version 2024-12-26 08:02:29 +00:00
Mario
2980827925 fix another possible loop 2024-12-26 07:55:08 +00:00
Mario
45a78dcbc0 this should fix the infinite loop caused by a regression in Daemon/Expire 2024-12-25 20:53:32 +00:00
Mario
5813b65aed hotfix release version 10.0.2 2024-12-25 12:03:43 +00:00
Mario
f8acd1d3a5 Merge branch 'dev' 2024-12-25 12:02:32 +00:00
Mario
c9ebb23b69 hotfix for loop caused in Daemon/Expire 2024-12-25 12:00:27 +00:00
Mario
bc998eacd0 bump version 2024-12-22 17:40:41 +00:00
Mario
648979467a do not allow a new zid to override an existing remote login - otherwise a prfactored request with an added zid can log us out 2024-12-22 17:39:58 +00:00
Mario
5c0ff6f584 once more improved imagesLoaded() 2024-12-22 17:35:25 +00:00
Mario
632721da4e version 10.0.1 2024-12-22 08:51:48 +00:00
Mario
f3a702e927 Merge branch 'dev' 2024-12-22 08:51:15 +00:00
Mario
58985f2200 update changelog 2024-12-22 08:51:04 +00:00
Mario
c55662510d fetch missing commit from dev 2024-12-22 08:31:04 +00:00
Mario
f01e917fff Merge branch 'dev' 2024-12-22 08:26:26 +00:00
Mario
3940187d19 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-12-22 08:20:24 +00:00
Mario
1215e8a030 Revert "Drop obsolete library LightOpenID"
This reverts commit e516c1352f
2024-12-22 08:19:55 +00:00
Mario
5b6e27233a fix sql error 2024-12-22 08:15:16 +00:00
Mario
b80cba4e68 Merge branch '10.0RC' 2024-12-21 18:49:06 +00:00
Mario
f2b28f5bbb version 10.0 2024-12-21 18:46:40 +00:00
Mario
4aeb4963a4 Merge branch 'dev' into 10.0RC 2024-12-21 18:44:04 +00:00
Mario
de9b10e850 more changelog 2024-12-21 18:43:41 +00:00
Mario
36a1d98c52 changelog 2024-12-21 18:09:56 +00:00
Mario
cf66f245b4 RC2 2024-12-21 12:34:05 +00:00
Mario
b1f2f67a04 better pubs notofication fiy and also fix a javascript error and remove last bit of jquery from notifications 2024-12-21 12:07:31 +00:00
Mario
bd10c1e40a fix anomaly in pubs notification 2024-12-21 11:55:19 +00:00
Mario
e146eaa8f8 bump version 2024-12-21 10:28:07 +00:00
Mario
92e21c4f3d deduplicate the images array by src 2024-12-21 10:27:28 +00:00
Mario
55265c8a3e track processed images 2024-12-20 20:53:47 +00:00
Mario
c3cc624621 bump version 2024-12-20 19:13:21 +00:00
Mario
b466932e37 improved imagesLoaded() and formatting 2024-12-20 19:12:09 +00:00
Mario
a3248e8b3b version 2024-12-20 12:36:00 +00:00
Mario
9ec2db7c97 port scrollToItem() to vanilla js and more fixes 2024-12-20 12:35:29 +00:00
Mario
9bd94287dd improved imagesLoaded() and notifications fixes 2024-12-20 11:47:38 +00:00
Mario
faca95b21c bump version 2024-12-19 23:18:59 +00:00
Mario
79f8b06ede various fixes for the last commit 2024-12-19 23:17:56 +00:00
Mario
a2dde34b1b refactor notifications widget and updateConvItems() to not require jquery 2024-12-19 18:49:07 +00:00
Mario
fb5824417e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-12-19 10:37:44 +00:00
Mario
804b4effa2 changelog 2024-12-19 10:37:19 +00:00
Mario Vavti
4c8e1de4c6 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-12-13 10:09:07 +01:00
Mario
d9c69b747d bump dev version 2024-12-13 09:07:55 +00:00
Mario Vavti
0e4be679e4 composer dump autoload 2024-12-13 09:59:31 +01:00
Mario
14360c4735 version 10.0RC and strings 2024-12-13 08:49:18 +00:00
Mario
2da55d3bd8 remove jquery.timeago.js in favor of a native js implementation 2024-12-12 14:18:55 +00:00
Mario Vavti
e9222d0d9a add test for item_forwardable() 2024-12-10 22:45:56 +01:00
Mario
93f72a53f5 introduce item_forwardable() and check it before we call the notifier to possibly safe some processes - test will follow, also add some other possibly blocking flags to the add item 2024-12-10 10:27:48 +00:00
Mario
93c4bd4692 pubcrawl: support for inbound add/remove activities and minor cleanup 2024-12-10 09:22:17 +00:00
Mario
486c21b519 hq: improved file filtering 2024-12-09 08:42:01 +00:00
Mario
7785487d77 fix delayed post handling in cron, always set item_delayed if we select a create date 2024-12-08 22:46:21 +00:00
Mario
9756023e39 fix expiration 2024-12-07 23:25:59 +00:00
Mario Vavti
bb0a22ee58 add test for relative_time() 2024-12-07 23:49:17 +01:00
Mario
e88ae54bef add more indicators and a new function to return relative time in the past and the future 2024-12-07 20:41:13 +00:00
Mario
d37d181d94 Libzot: remove commented code which duplicates code in Activity::decode_note() 2024-12-07 19:43:17 +00:00
Mario
d59d808883 more cleanup 2024-12-07 19:38:18 +00:00
Mario
b59fe77906 provide a comments disabled indicator and some cleanup 2024-12-07 19:34:30 +00:00
Mario
1941b4f026 only allow disable_comments on thread top 2024-12-07 18:40:56 +00:00
Mario
5c82229e34 Ãfix issue where poll updates were dismissed due to missing edited update, fix wrong array key when retaining item, update dreport push to also push the related item 2024-12-06 23:31:49 +00:00
Mario
66d502d8e1 an attempt to fix some comments on/off anomalies 2024-12-06 19:24:14 +00:00
Mario
66acfc66ce set item_type so that notifier can do the right thing 2024-12-06 11:41:01 +00:00
Mario
2e13640ab4 wrong class 2024-12-05 13:14:07 +00:00
Mario
277b4f7d10 even more fa2bi 2024-12-05 13:08:48 +00:00
Mario
edf2a6db1b we use the chat-quote icon for forums throughout the app. basically because the forum posts a quote of the original post 2024-12-05 13:02:18 +00:00
Mario
8ad000ec70 more fa2bi issues 2024-12-05 12:42:37 +00:00
Mario
563628fef8 another fa2bi issue 2024-12-05 12:33:55 +00:00
Mario
15b6353c1c filtering censored xchans in mod pubstream queries has possible performance issues. we will filter them in process_delivery() instead 2024-12-05 11:27:56 +00:00
Mario
1a86348a6c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-12-02 09:23:16 +00:00
Mario
a80ab5887c also copy the item_restrict field to the add activity and check for this field in the notifier 2024-12-02 09:17:15 +00:00
Mario
475ae7ba13 Merge branch 'fix/chat-icon-fix' into 'dev'
Fixed notification icons in chat

See merge request hubzilla/core!2177
2024-12-02 09:15:32 +00:00
SK
e107298125 Fixed notification icons in chat 2024-12-02 04:32:48 +05:30
Mario
428ffa5e35 save a loop by ordering results by item_wall and more uuid only lookup 2024-11-28 15:34:16 +00:00
Mario
0bffe6e019 sql lookup by uuid should be sufficient by now, remove superfluous require_once() 2024-11-28 15:12:57 +00:00
Mario Vavti
9e2f3dc05f fix more issues reported by phpstan 2024-11-27 10:25:37 +01:00
Mario
9fa18a5557 Merge branch 'phpstan-ignore-some-warnings' into 'dev'
phpstan: Ignore warnings on missing return statement.

See merge request hubzilla/core!2175
2024-11-27 08:18:58 +00:00
Mario
9608ab27c4 Merge branch 'dev' into 'dev'
updated fork-awesome icons to bootstrap

See merge request hubzilla/core!2174
2024-11-27 08:18:09 +00:00
Mario
464b331deb Merge branch 'module-admin-accounts-enhancements' into 'dev'
Fix and refactor module Admin\Accounts part I

See merge request hubzilla/core!2173
2024-11-27 08:15:59 +00:00
Harald Eilertsen
0189d04614 Fix and refactor module Admin\Accounts part I 2024-11-27 08:15:59 +00:00
Mario
cbb3ad1620 make sure to toggle aside if a notification or message is clicked and some whitespace cleanup 2024-11-26 09:57:55 +00:00
Harald Eilertsen
c0f9d55cfb phpstan: Ignore warnings on missing return statement.
While some of these may be fixable without too much hassle, quite a few
of them will possibly require architectural restructuring. We should
revisit these, but let's silence them for now.
2024-11-25 13:11:58 +01:00
Mario
0da51e0f71 fix superfluous slash in some cases 2024-11-25 08:11:33 +00:00
SK
9014a288b0 updated fork-awesome icons to bootstrap 2024-11-22 18:49:13 +05:30
Mario
dcef9f61b5 remove logging 2024-11-22 10:28:21 +00:00
Mario
3d80db0cdc Merge branch 'add-mailer-class' into 'dev'
Add Zotlabs\Lib\Mailer class to replace z_mail function.

See merge request hubzilla/core!2172
2024-11-22 09:59:14 +00:00
Harald Eilertsen
3a2f787f96 Add Zotlabs\Lib\Mailer class to replace z_mail function. 2024-11-22 09:59:14 +00:00
Mario
f7a9b84943 mod cal: if a day is provided default to week view except the date has a ! prepended 2024-11-21 09:36:31 +00:00
Mario
46e6600169 mod cal: provide a possibility to link to a specific month or day by passing a fragment 2024-11-21 09:04:55 +00:00
Mario
243a2a9bdf Update chat.tpl to correct expand and contract icons from forkawesome to bootstrap icons.
(cherry picked from commit c626985448)

Co-authored-by: Saiwal K <sk@utsukta.org>
2024-11-19 21:08:55 +00:00
Mario
91baa52b8b Merge branch 'saiwal-master-patch-76831' into 'master'
Update chat.tpl to correct expand and contract icons from forkawesome to bootstrap icons.

See merge request hubzilla/core!2171
2024-11-19 21:08:32 +00:00
Harald Eilertsen
5338793883 Ubreak tests: update MagicTest for new behaviour of Magic module. 2024-11-19 11:10:49 +01:00
Mario Vavti
9acc73b273 some cleanup for mod magic 2024-11-18 23:15:29 +01:00
Saiwal K
c626985448 Update chat.tpl to correct expand and contract icons from forkawesome to bootstrap icons. 2024-11-17 19:59:31 +00:00
Mario Vavti
5cfb3842f1 more phpstan errors 2024-11-17 20:52:13 +01:00
Mario Vavti
25b089c1a9 fix some errors detected by phpstan 2024-11-17 16:17:05 +01:00
Mario
67a9292aaa Merge branch 'issue-1879-emails-with-plus-addressing-rejected' into 'dev'
Fix #1879: Emails with + in local part was rejected.

See merge request hubzilla/core!2170
2024-11-17 10:26:25 +00:00
Mario
81dda15669 fix undefined variables 2024-11-17 07:58:11 +00:00
Harald Eilertsen
5b7f8d986c Fix #1879: Emails with + in local part was rejected. 2024-11-16 13:45:36 +01:00
Mario
5dee600735 Merge branch 'add-dev-dependecy-phpstan' into 'dev'
Add PHPStan as a developer dependency.

See merge request hubzilla/core!2169
2024-11-14 18:45:29 +00:00
Mario
01da60b385 Merge branch 'various-phpstan-issues' into 'dev'
Several issues discovered by PHPStan

See merge request hubzilla/core!2168
2024-11-14 18:40:15 +00:00
Harald Eilertsen
951800eca6 Several issues discovered by PHPStan 2024-11-14 18:40:15 +00:00
Mario
72c47cd8db version 9.5.2 - merge containers 2024-11-14 17:14:15 +00:00
Mario
e3a8668c32 Merge branch 'dev' into containers 2024-11-14 17:09:22 +00:00
Mario
fd9977eada css fixes 2024-11-14 14:22:18 +00:00
Mario
bd3304ff94 Merge branch 'oops-fix-db-update' into 'dev'
Fix invocation of DB_Update::run.

See merge request hubzilla/core!2167
2024-11-14 13:32:48 +00:00
Mario
586cda5155 fix some conent import issues
(cherry picked from commit c9a8914b07)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-11-14 13:30:07 +00:00
Mario Vavti
c9a8914b07 fix some conent import issues 2024-11-14 12:47:40 +01:00
Mario
b21b9260d9 fix race condition when updating multiple choice polls 2024-11-13 14:01:14 +00:00
Mario
b5c07e4c01 this is not true anymore - check owner perms 2024-11-13 11:08:18 +00:00
Harald Eilertsen
28b5b0cab5 Add PHPStan as a developer dependency.
PHPStan is a static PHP code analyzer that's aimed at finding actual
bugs in the code. Where PHP Code Sniffer is about codeing standards,
PHPStan is about correctness of code.

The provided configuration file (`phpstan.neon.dist`) is configured to
use the _lowest_ level of checks that PHPStan will report on. See
https://phpstan.org/user-guide/rule-levels for information about the
various rule levels.

Run an analysis of the code base like this:

    % ./vendor/bin/phpstan

It will output any found issues to stdout.

You can also run it like this:

    % ./vendor/bin/phpstan --error-format=raw > phpstan.log

This will give you an output file in a format that's suitable for use
with typical editors for mapping errors to source locations.
2024-11-12 09:42:11 +01:00
Mario
39d0a3f1f6 containers: poll testing 2024-11-11 22:25:53 +00:00
Mario
513cd3b99a fix click area in dropdown add/remove reaction
(cherry picked from commit 8268ed1ba7)

Co-authored-by: Mario <mario@mariovavti.com>

(cherry picked from commit ce9d67f7b1)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-11 20:00:36 +00:00
Mario
ce9d67f7b1 fix click area in dropdown add/remove reaction
(cherry picked from commit 8268ed1ba7)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-11 20:00:25 +00:00
Mario
8268ed1ba7 fix click area in dropdown add/remove reaction 2024-11-11 19:53:20 +00:00
Harald Eilertsen
6c1d0851d7 Fix invocation of DB_Update::run.
Thought this should have been part of the change set that turned the
DB_Update routine to a static function instead of a constructor to an
object that is not used.
2024-11-11 17:05:13 +01:00
Mario
3bc0fd5db4 fix undefined var warning 2024-11-11 09:18:56 +00:00
Mario Vavti
4c3f3d1477 Merge branch 'dev' into containers 2024-11-10 23:38:30 +01:00
Mario Vavti
17411a501c containers: testing sourced items 2024-11-10 23:37:45 +01:00
Mario
d446f171c5 Revert "Module\Item: Make $item_id an object property."
This reverts commit 2c17d0b031
2024-11-10 22:36:35 +00:00
Mario Vavti
b24b409a01 Merge branch 'dev' into containers 2024-11-10 19:01:40 +01:00
Mario
3791dfab3a Merge branch 'begin-refactoring-module-item' into 'dev'
Begin refactoring Module\Item

See merge request hubzilla/core!2166
2024-11-10 18:01:06 +00:00
Mario
31a146b23a Merge branch 'oops-ref-to-nonexisting-class' into 'dev'
Remove import of non-existing class in test.

See merge request hubzilla/core!2165
2024-11-10 17:55:27 +00:00
Mario Vavti
e52714ed16 make sure to notify the drop if necessary 2024-11-10 18:53:46 +01:00
Harald Eilertsen
2c17d0b031 Module\Item: Make $item_id an object property.
This also allows us to deduplicate initialization and validation.
2024-11-10 16:43:48 +01:00
Harald Eilertsen
57e69372d3 Module\Item: Move processing of zot and as requests to functions.
These seem to be entirely independent, so moving the body of the if
statements to separate functions should be fine.
2024-11-10 16:43:48 +01:00
Mario Vavti
43acb86aab fix encoding and attribution 2024-11-10 11:49:09 +01:00
Mario Vavti
e339fbcc46 container fixes for photo and file upload 2024-11-10 11:40:56 +01:00
Mario
f05b8bd87d Do not filter deleted hublocs in xchan_query because it will result in empty profile info in conversations if the hubloc was deleted. Deleting a hublocation does not neccesarily delete its content and the author could appear again from another location.
(cherry picked from commit 4e6696b049)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-11-09 20:12:21 +00:00
Mario Vavti
4e6696b049 Do not filter deleted hublocs in xchan_query because it will result in empty profile info in conversations if the hubloc was deleted. Deleting a hublocation does not neccesarily delete its content and the author could appear again from another location. 2024-11-09 21:11:33 +01:00
Harald Eilertsen
fbc79e36e0 Remove import of non-existing class in test.
This one snuck in by mistake. No harm done, as the actual class was
never referenced, but it should still not be there.
2024-11-09 14:38:27 +01:00
Mario Vavti
c9d4b068c2 remove extensiv logging to syslog 2024-11-09 12:49:10 +01:00
Mario Vavti
b6dbbbc82f fix regression propagating deletes 2024-11-09 12:39:24 +01:00
Mario Vavti
954d92c354 Merge branch 'dev' into containers 2024-11-09 11:27:53 +01:00
Mario Vavti
8dbebc2b42 update border color 2024-11-09 11:27:13 +01:00
Mario
14207c68ca Merge branch 'fix-incorrect-module-imports' into 'dev'
Fix incorrect module imports.

See merge request hubzilla/core!2163
2024-11-09 10:26:23 +00:00
Mario
0ed08274f1 Merge branch 'clean-up-some-dependencies' into 'dev'
Clean up deps and upgrade EpubMeta

See merge request hubzilla/core!2162
2024-11-09 10:24:26 +00:00
Mario
2a152e0803 Merge branch 'more-deprecations-in-tests' into 'dev'
Fix some more deprecation warnings in the tests.

See merge request hubzilla/core!2161
2024-11-09 10:18:27 +00:00
Mario Vavti
a0c54c5f04 make sure to store target information when decoding and indicate contained conversations with a colored border for now 2024-11-09 10:55:10 +01:00
Harald Eilertsen
ac8c80ddbe Fix incorrect module imports.
When importing modules with use statements, they always require the
fully qualified module name. Iow, there's no need to prefix them with an
extra backslash.

Ref: https://www.php.net/manual/en/language.namespaces.importing.php
2024-11-09 08:45:45 +01:00
Mario Vavti
ebad9d56c9 port to containers item_store() continued 2024-11-08 22:24:33 +01:00
Mario Vavti
0481901b59 refactor drop_item[s]() for containers 2024-11-08 20:18:20 +01:00
Harald Eilertsen
0534fe6886 Thumbs\Epubthumb: Adapt to new version of EPub meta lib.
Also fixes a few issues and refactor the code a bit.
2024-11-08 16:48:23 +01:00
Harald Eilertsen
6e51571309 Remove epub-meta from library 2024-11-08 16:48:23 +01:00
Harald Eilertsen
fe30b54975 Update php-epub-meta and use composer for dep handling.
Note that we upgrade to the 2.x branch of the dependency, as the 3.x
branch requires PHP version 8.2 or later. There's no reason for us to
move our minimum supported version of PHP just yet.
2024-11-08 16:43:29 +01:00
Harald Eilertsen
b00ae997a5 Remove obsolete and unused symfony/options-resover and process
These actually look like they could be useful, but since unused, let's
drop them for now. They can always be re-added via composer if needed
later.
2024-11-08 16:39:26 +01:00
Harald Eilertsen
b5b7d0cda9 Remove obsolete and unused sticky-kit 2024-11-08 16:39:26 +01:00
Harald Eilertsen
300d461a1a Remove obsolete and unused tiptip library 2024-11-08 16:39:26 +01:00
Harald Eilertsen
e516c1352f Drop obsolete library LightOpenID
We're not using it anyways.
2024-11-08 16:39:26 +01:00
Mario Vavti
4b4cac63fd Merge branch 'dev' into containers 2024-11-08 11:19:42 +01:00
Harald Eilertsen
47f109451d Fix some more deprecation warnings in the tests. 2024-11-07 17:29:54 +01:00
Mario
e466c73407 fix allday not set if a rsource is provided
(cherry picked from commit 17183cc5dc)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-07 14:31:18 +00:00
Mario
17183cc5dc fix allday not set if a rsource is provided 2024-11-07 14:29:52 +00:00
Mario
e5aae2af0f fix allday variable not set when clicking an event
(cherry picked from commit 939e5d9ca5)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-06 16:17:18 +00:00
Mario
939e5d9ca5 fix allday variable not set when clicking an event 2024-11-06 16:16:23 +00:00
Mario
600209e21e bump dev version 2024-11-06 15:48:18 +00:00
Mario
173c4d242d version 9.4.4 2024-11-06 13:06:05 +00:00
Mario
76b8c36f7c changelog
(cherry picked from commit 12c88c06d8)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-06 13:05:18 +00:00
Mario
12c88c06d8 changelog 2024-11-06 13:04:03 +00:00
Mario
f35352090e Update translations for Norwegian Bokmål
(cherry picked from commit 35a05073f2)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-06 12:30:37 +00:00
Mario
e5db47e0d5 Module\Thing: Don't try to escape field that's not present
The `profile_assign` field is only present if the multiple profiles
feature is enabled.


(cherry picked from commit 472484dde0)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-06 12:30:16 +00:00
Mario
6a52e502aa Module\Thing: Don't use $_REQUEST superglobal.
Replaces all occurences with $_POST or $_GET instead.


(cherry picked from commit 5c3bdbd1e0)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-06 12:29:46 +00:00
Mario
6a866fe904 Move Norwegian translations from nb-no to nb
(cherry picked from commit ec02453d37)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-06 12:28:51 +00:00
Mario
229efddbf1 Merge branch 'fix-mariadb-support-for-test-setup' into 'dev'
tests: Update test db setup script for mariadb

See merge request hubzilla/core!2160
2024-11-06 11:50:40 +00:00
Mario
abb67a4565 Merge branch 'make-phpcs-a-bit-more-lax' into 'dev'
Make phpcs a bit more lax...

See merge request hubzilla/core!2159
2024-11-06 11:49:25 +00:00
Mario
2e324d4cef Merge branch 'move-norwegian-locale' into 'dev'
Move and update norwegian locale

See merge request hubzilla/core!2158
2024-11-06 11:48:54 +00:00
Mario
d4d1a7523d Merge branch 'fix-module-thing' into 'dev'
Fix error adding Things when multiple profiles not enabled

See merge request hubzilla/core!2157
2024-11-06 11:47:57 +00:00
Mario
d9d239bf3a only zot6 hublocs have a sitekey so only query such hublocs. This will safe alternative network hublocs from being marked deleted allthough they are intact
(cherry picked from commit 7a3f2c1ba9)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-06 11:16:46 +00:00
Mario
429d15f009 correctly hide modals and remove unneeded toString() conversion since we are not dealing with string objects here
(cherry picked from commit 9f473fc204)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-06 11:16:20 +00:00
Mario
7a3f2c1ba9 only zot6 hublocs have a sitekey so only query such hublocs. This will safe alternative network hublocs from being marked deleted allthough they are intact 2024-11-06 11:12:42 +00:00
Mario
9f473fc204 correctly hide modals and remove unneeded toString() conversion since we are not dealing with string objects here 2024-11-06 09:44:07 +00:00
Harald Eilertsen
35a05073f2 Update translations for Norwegian Bokmål 2024-11-04 10:22:13 +01:00
Harald Eilertsen
472484dde0 Module\Thing: Don't try to escape field that's not present
The `profile_assign` field is only present if the multiple profiles
feature is enabled.
2024-11-03 20:42:59 +01:00
Harald Eilertsen
5c3bdbd1e0 Module\Thing: Don't use $_REQUEST superglobal.
Replaces all occurences with $_POST or $_GET instead.
2024-11-03 20:42:59 +01:00
Harald Eilertsen
ec02453d37 Move Norwegian translations from nb-no to nb 2024-11-03 18:06:42 +01:00
Mario
2b44be58c3 explicit check for channel_address
(cherry picked from commit e20327d267)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-03 11:02:35 +00:00
Mario
c44db397ff Zotlabs\Module\Setup: Fix deprecation.
Using `self` in callables has been deprecated, so change to proper fully
qualified class name.


(cherry picked from commit 8ab3ad6531)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-03 11:02:04 +00:00
Mario
a385fdff37 Zotlabs\Web\HttpMeta: Declare and init properties.
The $ogproperty was not declared, which triggered a warning in PHP 8.2.

Also fixed the initialization of the properties, and removed the now
superfluous constructor.


(cherry picked from commit bf008465ad)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-03 11:01:50 +00:00
Mario
20aacb82c6 tests: Declare private property $output.
Uncovered by PHP 8.2 because dynamic properties are deprecated.


(cherry picked from commit a29a1c768d)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-03 11:01:38 +00:00
Mario
0d17d8dad9 tests: Fix typo in UnitTestCase.
Uncovered by PHP 8.2 because dynamic properties are deprecated.


(cherry picked from commit 90bc987ea7)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-03 11:01:21 +00:00
Mario
2ab0118c13 Fix missing CSRF checks in admin/account_edit
(cherry picked from commit 38c947590e)

342d94c3 tpl: Fix warnings in templates.
bccaeb1e tests: Update Module\TestCase to support POST requests
f627e55b tests: Update account fixtures with fixed account_level.
ee62aff4 Module\Admin\Account_edit: Add missing CSRF checks.

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-03 10:59:41 +00:00
Mario
30419bdbf6 add ocap tokens to all media files and attachments
(cherry picked from commit 2f0a47e583)

Co-authored-by: Mario <mario@mariovavti.com>
2024-11-03 10:59:16 +00:00
Mario Vavti
21b60bf119 Merge branch 'dev' into containers 2024-11-03 11:57:45 +01:00
Mario
5db3f93be9 Merge branch 'php8.2-deprecations' into 'dev'
Fix deprecations uncovered by running tests on PHP 8.2

See merge request hubzilla/core!2156
2024-11-03 10:57:03 +00:00
Mario Vavti
d25314c75b Merge branch 'dev' into containers 2024-11-03 11:45:08 +01:00
Mario
e20327d267 explicit check for channel_address 2024-11-03 10:43:17 +00:00
Harald Eilertsen
8ab3ad6531 Zotlabs\Module\Setup: Fix deprecation.
Using `self` in callables has been deprecated, so change to proper fully
qualified class name.
2024-11-03 08:48:53 +01:00
Harald Eilertsen
bf008465ad Zotlabs\Web\HttpMeta: Declare and init properties.
The $ogproperty was not declared, which triggered a warning in PHP 8.2.

Also fixed the initialization of the properties, and removed the now
superfluous constructor.
2024-11-03 08:42:11 +01:00
Harald Eilertsen
a29a1c768d tests: Declare private property $output.
Uncovered by PHP 8.2 because dynamic properties are deprecated.
2024-11-03 08:39:21 +01:00
Harald Eilertsen
90bc987ea7 tests: Fix typo in UnitTestCase.
Uncovered by PHP 8.2 because dynamic properties are deprecated.
2024-11-03 08:32:01 +01:00
Mario
46fdce4402 Merge branch 'admin-account-edit-csrf-check' into 'dev'
Fix missing CSRF checks in admin/account_edit

See merge request hubzilla/core!2155
2024-11-02 14:42:01 +00:00
Harald Eilertsen
38c947590e Fix missing CSRF checks in admin/account_edit 2024-11-02 14:42:00 +00:00
Mario
c5faa012b5 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-11-02 14:35:42 +00:00
Mario
2f0a47e583 add ocap tokens to all media files and attachments 2024-11-02 14:35:04 +00:00
Mario
c958cc6f90 URL escape zid param in head.tpl
This should fix issue #1877 fully.


(cherry picked from commit 065f85bab1)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-11-01 09:03:21 +00:00
Mario
541a0f6476 Merge branch 'issue-1877-more-fixes' into 'dev'
URL escape zid param in head.tpl

See merge request hubzilla/core!2154
2024-11-01 09:02:37 +00:00
Harald Eilertsen
065f85bab1 URL escape zid param in head.tpl
This should fix issue #1877 fully.
2024-10-31 19:15:52 +01:00
Mario
38ac60e618 make sure the objects published date has the correct time format
(cherry picked from commit 160c40b580)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-31 11:12:54 +00:00
Mario
160c40b580 make sure the objects published date has the correct time format 2024-10-31 11:07:42 +00:00
Mario Vavti
005d4ad351 Merge branch 'dev' into containers 2024-10-30 12:50:08 +01:00
Mario
90a1dad02c Merge branch 'make-db-upgrade-static-method' into 'dev'
Change DB_Upgrade to a static function instead.

See merge request hubzilla/core!2151
2024-10-30 11:47:52 +00:00
Harald Eilertsen
4daba84223 Make phpcs a bit more lax...
Allow spaces for indent, and newlines before braces.
2024-10-30 12:35:08 +01:00
Harald Eilertsen
fc182f1b07 tests: Update test db setup script for mariadb
Mariadb now issues warnings when using the deprecated `mysql` binary. So
we make sure to use the proper name for the binary depending on the
actual DB engine installed.
2024-10-30 12:13:21 +01:00
Mario
23a19ecf1f escape the zid parameter - issue #1877
(cherry picked from commit 0207c02420)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-30 09:18:23 +00:00
Mario
0207c02420 escape the zid parameter - issue #1877 2024-10-30 09:12:26 +00:00
Mario Vavti
68135c28da Merge branch 'dev' into containers 2024-10-30 09:50:17 +01:00
Mario
274bfa9024 Merge branch 'add-missing-test-for-bbcode-cleanup-fix' into 'dev'
tests: Tests for BBCode cleanup fix

See merge request hubzilla/core!2152
2024-10-30 08:27:44 +00:00
Mario Vavti
4bb28a21c4 Merge branch 'dev' into containers 2024-10-27 14:05:25 +01:00
Mario
8b75f50f23 fix en tos page
(cherry picked from commit 0e50b1d10c)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-10-27 12:57:02 +00:00
Mario Vavti
0e50b1d10c fix en tos page 2024-10-27 13:53:31 +01:00
Harald Eilertsen
8f4c3a2f88 Merge branch 'dev' into make-db-upgrade-static-method 2024-10-23 14:56:41 +02:00
Harald Eilertsen
73006ccdf5 tests: Tests for BBCode cleanup fix
Somehow I forgot to include this in the patch that fixed the issue.
2024-10-23 14:31:21 +02:00
Mario Vavti
1006ebbf61 Merge branch 'dev' into containers 2024-10-23 14:19:45 +02:00
Mario
436b1673cf make sure we select only sys channel items and remove dupes checking (this will be checked in item_store() anyway)
(cherry picked from commit e530476e6c)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-23 12:08:03 +00:00
Mario
e530476e6c make sure we select only sys channel items and remove dupes checking (this will be checked in item_store() anyway) 2024-10-23 12:06:32 +00:00
Mario
e0a91bed7a allow to file items from the public stream 2024-10-23 12:04:15 +00:00
Mario Vavti
168ec53686 Merge branch 'dev' into containers 2024-10-19 20:50:48 +02:00
Mario
4d1be3aea5 bring filed items to mod hq 2024-10-19 18:49:47 +00:00
Mario Vavti
e8f816a981 Merge branch 'dev' into containers 2024-10-18 21:36:48 +02:00
Mario
e649ba5b13 remove attach_upgrade() after 7 years it should not be required anymore 2024-10-18 19:32:41 +00:00
Mario
92ce66e766 i guess a couple of weeks have passed by now 2024-10-18 19:20:20 +00:00
Mario
96210f5ecc fix edit button not clickable if below right aside
(cherry picked from commit 1411eafa9b)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-18 19:14:04 +00:00
Mario
1411eafa9b fix edit button not clickable if below right aside 2024-10-18 19:06:35 +00:00
Mario Vavti
20db45c815 Merge branch 'dev' into containers 2024-10-18 20:19:36 +02:00
Mario Vavti
4acdb8fb10 containers: port events 2024-10-18 20:18:55 +02:00
Mario
9e9e8efb2d fix tags rendering in the editor
(cherry picked from commit f4495fd441)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-17 09:04:25 +00:00
Mario
f4495fd441 fix tags rendering in the editor 2024-10-17 09:03:32 +00:00
Harald Eilertsen
e2ae8f0c4d Zotlabs\Lib\DB_Upgrade: Add API documentation. 2024-10-14 23:07:42 +02:00
Harald Eilertsen
074dc440cc Change DB_Upgrade to a static function instead.
No need for this to be an object, since it's never referenced or even
kept after construction. Further all the functionality was in the
constructor anyways.

Also removed some unused properties.
2024-10-14 22:52:13 +02:00
Mario
e9dc4b553b Fix regex to detect URLs in cleanup_bbcode.
This fixes the issue where the text after the URL would be included in
the link if it was immediately followed by a newline.

Example:

    https://example.com
	this is a test.

Would become:

	#^[url=https://example.com_this]https://example.com_this[/url]
	is a test


(cherry picked from commit 687cda3673)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-12 17:08:15 +00:00
Mario Vavti
d7fa6f6709 Merge branch 'dev' into containers 2024-10-12 19:06:35 +02:00
Mario
40a9989be2 Merge branch 'fix-cleanup-bbcode-url-regex' into 'dev'
Fix naked URLs immediately followed by a newline

See merge request hubzilla/core!2150
2024-10-12 17:05:19 +00:00
Harald Eilertsen
d1648927b5 Fix some whitespace issues in zid.php.
No functional change.
2024-10-12 18:23:30 +02:00
Harald Eilertsen
ecde4a3ded Change config used by Markdown tests to reflect actual use.
This makes the configuration used align better with how it is being used
in the mdpost addon. This also reveals some issues that are less than
ideal for Markdown posts. The relevant test cases have been adjusted to
pass with the new config, but have been commented.
2024-10-12 18:19:43 +02:00
Harald Eilertsen
687cda3673 Fix regex to detect URLs in cleanup_bbcode.
This fixes the issue where the text after the URL would be included in
the link if it was immediately followed by a newline.

Example:

    https://example.com
	this is a test.

Would become:

	#^[url=https://example.com_this]https://example.com_this[/url]
	is a test
2024-10-12 18:15:54 +02:00
Mario Vavti
47cdef390a Merge branch 'dev' into containers 2024-10-12 17:17:11 +02:00
Mario
05a5b644bf Merge branch 'remove-repo-handling-from-admin-addons' into 'dev'
Remove addon repo management from admin/addons.

See merge request hubzilla/core!2149
2024-10-12 15:15:40 +00:00
Mario
84556854e8 Merge branch 'drop-unused-html5-library' into 'dev'
Remove HTML5 parser lib deprecated in Hubzilla 5.0

See merge request hubzilla/core!2148
2024-10-12 15:10:02 +00:00
Mario
314443d41e Merge branch 'first-tests-for-module-magic' into 'dev'
tests: Add some tests for the Zotlabs\Magic module.

See merge request hubzilla/core!2147
2024-10-12 15:08:29 +00:00
Mario Vavti
c23a71c936 code consistency 2024-10-12 17:05:35 +02:00
Mario Vavti
12b33a23de containers: port start_delivery_chain() 2024-10-12 16:31:00 +02:00
Mario Vavti
a305c20e08 Merge branch 'dev' into containers 2024-10-12 16:24:58 +02:00
Mario
c70bd08c10 Fix duplicate posts from forum clones
(cherry picked from commit e2cfe245b7)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-10-12 13:59:12 +00:00
Mario Vavti
e2cfe245b7 Fix duplicate posts from forum clones 2024-10-12 15:58:00 +02:00
Mario Vavti
12b24e0e5e containers: port mod impel 2024-10-11 17:16:44 +02:00
Mario Vavti
d5291e9b07 containers: port core modules and attach_store_item() 2024-10-11 17:10:56 +02:00
Mario Vavti
a1818b1a29 document some special handling 2024-10-10 15:10:51 +02:00
Mario Vavti
e8eb283fd8 fix c/p typo 2024-10-10 14:18:23 +02:00
Mario Vavti
96d5370122 update item entity for hubzilla 2024-10-10 14:17:13 +02:00
Mario Vavti
2bcb6a4fed merge dev and resolve conflicts 2024-10-10 13:13:17 +02:00
Mario Vavti
aee396421a revert 2024-10-10 13:09:04 +02:00
Mario Vavti
897568a087 resolve merge conflict 2024-10-10 13:07:48 +02:00
Mario Vavti
69109a558b version 9.4.3 2024-10-10 12:16:33 +02:00
Mario
4aff6d19d6 changelog
(cherry picked from commit a5c1b669b4)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-10-10 10:11:31 +00:00
Mario Vavti
a5c1b669b4 changelog 2024-10-10 12:09:39 +02:00
Mario
3cb5d14037 also discard Add/Remove at the AP side
(cherry picked from commit 2aee659cbd)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-10-10 10:04:17 +00:00
Mario
5f685bcf63 also dismiss add/remove collection activities in fetch_conversation()
(cherry picked from commit 44232677c8)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-10 10:03:51 +00:00
Mario
cb44f7e360 dismiss add/remove collection activities until we support themÃ
(cherry picked from commit 16603ca854)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-10 10:03:32 +00:00
Mario Vavti
2aee659cbd also discard Add/Remove at the AP side 2024-10-10 12:01:46 +02:00
Harald Eilertsen
b117cf9dc7 emove another PHPGit related file. 2024-10-09 23:38:01 +02:00
Mario Vavti
c2ce1d9881 containers: send add in mod like, send remove on delete 2024-10-09 22:43:01 +02:00
Harald Eilertsen
2ed8908127 Remove now unused PHPGit from library. 2024-10-09 21:02:08 +02:00
Harald Eilertsen
6588e272db Remove addon repo management from admin/addons.
This functionality was broken anyways, and needs to be rethought. Addon
reporitories can still be managed from the terminal using the tools in
util/.
2024-10-09 21:00:12 +02:00
Harald Eilertsen
c13645f136 Remove HTML5 parser lib deprecated in Hubzilla 5.0 2024-10-09 18:47:35 +02:00
Mario Vavti
8cee16be1b enable the hooks again 2024-10-09 18:26:15 +02:00
Mario Vavti
45c0091d3d more work on porting containers from streams 2024-10-09 18:17:37 +02:00
Mario
44232677c8 also dismiss add/remove collection activities in fetch_conversation() 2024-10-09 15:41:40 +00:00
Mario
16603ca854 dismiss add/remove collection activities until we support themà 2024-10-09 07:39:13 +00:00
Mario
75184355d0 whitespace and use empty for check 2024-10-06 16:47:15 +00:00
Mario
1988d21e6c start containers 2024-10-06 15:53:39 +00:00
Harald Eilertsen
bccac55cf9 tests: Add some tests for the Zotlabs\Magic module.
Only tests the delegate functionality at the moment.

This patch also includes some minor fixes to the Magic module, triggered
by the tests with empty destination URL's.
2024-10-06 11:47:45 +02:00
Mario
19eeadfe5b port some libs from streams repo 2024-10-06 08:59:36 +00:00
Mario
8f74ee67e3 css fixes
(cherry picked from commit 2693e9e990)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 11:27:56 +00:00
Mario
b0a11537de remove bogus icon id
(cherry picked from commit 04741c761a)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 11:27:40 +00:00
Mario
2693e9e990 css fixes 2024-10-04 11:26:48 +00:00
Mario
04741c761a remove bogus icon id 2024-10-04 11:14:41 +00:00
Mario
4de9cb1142 more fa2bi fixes
(cherry picked from commit 8f890fb6fa)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 11:07:50 +00:00
Mario
8f890fb6fa more fa2bi fixes 2024-10-04 11:06:35 +00:00
Mario
158ddfb009 changelog
(cherry picked from commit 1afb2a4ce8)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 07:09:21 +00:00
Mario
2b4f344181 Version 9.4.2 2024-10-04 07:07:31 +00:00
Mario
1afb2a4ce8 changelog 2024-10-04 07:06:24 +00:00
Mario
2e5f922561 due to popular demand: indicate reacted state via icon color
(cherry picked from commit afbeb58c16)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 06:59:50 +00:00
Mario
a6498a0cfc Reflect change to btn-link in js template
(cherry picked from commit 8ffab25f5d)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 06:59:16 +00:00
Mario
8ffab25f5d Reflect change to btn-link in js template 2024-10-04 06:57:46 +00:00
Mario
1073392398 Fix modal backdrop not removed when like/unlike from the modal
(cherry picked from commit 7d41deebce)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 06:51:15 +00:00
Mario
7d41deebce Fix modal backdrop not removed when like/unlike from the modal 2024-10-04 06:50:06 +00:00
Mario
76064dbb33 Fix missing handle icon in mod pdledit_gui
(cherry picked from commit 7e48caae6b)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-04 06:27:37 +00:00
Mario
7e48caae6b Fix missing handle icon in mod pdledit_gui 2024-10-04 06:26:34 +00:00
Mario
afbeb58c16 due to popular demand: indicate reacted state via icon color 2024-10-03 08:18:59 +00:00
Mario
1ab4f36a1b Merge branch 'master' of https://framagit.org/hubzilla/core 2024-10-03 04:52:40 +00:00
Mario
cea9c88b9e version 9.4.1 2024-10-03 04:52:18 +00:00
Mario
babe118383 Tests: Unbreak help test.
(cherry picked from commit 5b93aa1148)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:27:26 +00:00
Mario
2b140e53cc changelog
(cherry picked from commit 9008760aa6)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-02 20:21:51 +00:00
Mario
9008760aa6 changelog 2024-10-02 20:20:56 +00:00
Mario
fb1514a782 Help: Drop language specifier in URL when redirecting
This finally fixes the help for languages other than english.


(cherry picked from commit 4daa03f025)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:09:36 +00:00
Mario
7679894684 Replace drop shadow in help toc with brighter color.
The drop shadow looked terrible in dark mode. While that could be fixed,
I think it looks better with just using the link hover color and making
the selected item bold.


(cherry picked from commit 8ae9df3bb7)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:08:55 +00:00
Mario
520cf1015c Move some help related styling from redbasic to module css.
(cherry picked from commit 25d9d3ba1b)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:08:33 +00:00
Mario
64bd8eef4b Use html details element for toc on top of help pages.
This allows us to get rid of some more unneccessary JavaScript that just
implements stuff that web browsers now do anyways.


(cherry picked from commit 26ce231951)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:08:04 +00:00
Mario
aa42f6a6b2 Remove link to "Contents" from the help table of contect sidebar.
Changes the element where the jQuery.toc plugin looks for headings to
only include the actual help contents, not the toc itself.


(cherry picked from commit fb9464437e)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:07:31 +00:00
Mario
13345d3cbe deps: Upgrade smarty/smarty to version 4.5.4
This eliminates a potential vulnerability where an template author could
inject arbitrary PHP files to be run via the 'extends' tag.

See:
  - https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w
  - 0be92bc8a6

Impact assessment:

In our case I would consider this a low severity issue as we don't
allow users to dynamically add or edit smarty templates. Templates has
to be updated via merge requests, or by installing a theme. In both
cases a malicious attacker already has easier ways to inject whatever
code they want.

Further, the extend tag is not in use in any of our core templates.


(cherry picked from commit 4dff1a1e5b)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:06:10 +00:00
Mario
888ee16d52 fix german about page title
(cherry picked from commit 1c45030c58)

Co-authored-by: Mario <mario@mariovavti.com>
2024-10-02 20:05:06 +00:00
Mario
0f3e01f343 markdown: Don't link URLs in code blocks.
When passing a content throught the `markdown_to_bb` function
to convert any markdown in the content, any recognized URLs in the
content would be converted to BBCode links as a post processing step
after the main conversion.

After commit a1ccacb825 this did no longer
consider content within code blocks, and would thus convert them as
to BBCode links.

Example: The following content

	[code]
	example url: https://example.com
	[/code]

Would be converted to

	[code]
	example url: [url=https://example.com]https://example.com[/url]
	[/code]

Prior to commit a1ccacb825, code blocks
would be protected, so this would not happen.

This patch removes the post processing step for converting plain URLs to
links completely from this routine. This functionality is in any case
covered in the actual BBCode parser where it belongs.

This will have some other side effects as well, such as images and links
created using Markdown, will not be converted to [zmg] or [zrl] tags
where that would be done automatically before. If you intend to use a
[zrl] or [zmg] tag, you now need to do so explicitly.


(cherry picked from commit 803cd74b48)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2024-10-02 20:04:30 +00:00
Mario
79220ede66 rewrite sql logic to rename photos - there are more DB queries involved now but the previous logic was throwing error in postgresql (while the result was correct anyway)
(cherry picked from commit a5f0253aef)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-10-02 20:03:54 +00:00
Mario
6b98b799c8 Merge branch 'tests-for-activitystreams' into 'dev'
tests: Add a basic test for ActivityStreams

See merge request hubzilla/core!2146
2024-10-02 13:13:42 +00:00
Mario
9f49d313f5 Merge branch 'markdown/dont-link-urls-in-code-blocks' into 'dev'
markdown: Don't link URLs in code blocks.

See merge request hubzilla/core!2145
2024-10-02 13:10:05 +00:00
Mario Vavti
a5f0253aef rewrite sql logic to rename photos - there are more DB queries involved now but the previous logic was throwing error in postgresql (while the result was correct anyway) 2024-10-02 14:45:10 +02:00
Harald Eilertsen
4e6f871bc4 tests: Add a basic test for ActivityStreams
This is just a basic test that parses a specific object, and tests that
all the referenced objects are fetched from the originating servers.
2024-10-02 09:51:22 +02:00
Harald Eilertsen
803cd74b48 markdown: Don't link URLs in code blocks.
When passing a content throught the `markdown_to_bb` function
to convert any markdown in the content, any recognized URLs in the
content would be converted to BBCode links as a post processing step
after the main conversion.

After commit a1ccacb825 this did no longer
consider content within code blocks, and would thus convert them as
to BBCode links.

Example: The following content

	[code]
	example url: https://example.com
	[/code]

Would be converted to

	[code]
	example url: [url=https://example.com]https://example.com[/url]
	[/code]

Prior to commit a1ccacb825, code blocks
would be protected, so this would not happen.

This patch removes the post processing step for converting plain URLs to
links completely from this routine. This functionality is in any case
covered in the actual BBCode parser where it belongs.

This will have some other side effects as well, such as images and links
created using Markdown, will not be converted to [zmg] or [zrl] tags
where that would be done automatically before. If you intend to use a
[zrl] or [zmg] tag, you now need to do so explicitly.
2024-09-30 13:54:50 +02:00
Mario
0bfdb958f5 update symfony/polyfill-php81 2024-09-30 07:13:55 +00:00
Mario
becd4c6ffd update sabre/vobject 2024-09-30 07:12:30 +00:00
Mario
3f411787c1 update spomky-labs/otphp 2024-09-30 07:11:05 +00:00
Mario
5782a674b0 update ramsey/uuid 2024-09-30 07:09:20 +00:00
Mario
fc79e47d88 update scssphp 2024-09-30 07:07:30 +00:00
Mario
1c45030c58 fix german about page title 2024-09-30 06:29:37 +00:00
Mario
18f3887050 Merge branch 'more-help-improvements' into 'dev'
Fix help for other languages than english

See merge request hubzilla/core!2144
2024-09-30 06:22:28 +00:00
Mario
2cc962e53a Merge branch 'security/update/smarty' into 'dev'
deps: Upgrade smarty/smarty to version 4.5.4

See merge request hubzilla/core!2143
2024-09-30 06:20:48 +00:00
Harald Eilertsen
5b93aa1148 Tests: Unbreak help test. 2024-09-29 14:28:17 +02:00
Harald Eilertsen
4daa03f025 Help: Drop language specifier in URL when redirecting
This finally fixes the help for languages other than english.
2024-09-29 14:09:41 +02:00
Harald Eilertsen
8ae9df3bb7 Replace drop shadow in help toc with brighter color.
The drop shadow looked terrible in dark mode. While that could be fixed,
I think it looks better with just using the link hover color and making
the selected item bold.
2024-09-29 14:00:53 +02:00
Harald Eilertsen
25d9d3ba1b Move some help related styling from redbasic to module css. 2024-09-29 14:00:53 +02:00
Harald Eilertsen
26ce231951 Use html details element for toc on top of help pages.
This allows us to get rid of some more unneccessary JavaScript that just
implements stuff that web browsers now do anyways.
2024-09-29 14:00:45 +02:00
Harald Eilertsen
fb9464437e Remove link to "Contents" from the help table of contect sidebar.
Changes the element where the jQuery.toc plugin looks for headings to
only include the actual help contents, not the toc itself.
2024-09-29 13:58:41 +02:00
Harald Eilertsen
4dff1a1e5b deps: Upgrade smarty/smarty to version 4.5.4
This eliminates a potential vulnerability where an template author could
inject arbitrary PHP files to be run via the 'extends' tag.

See:
  - https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w
  - 0be92bc8a6

Impact assessment:

In our case I would consider this a low severity issue as we don't
allow users to dynamically add or edit smarty templates. Templates has
to be updated via merge requests, or by installing a theme. In both
cases a malicious attacker already has easier ways to inject whatever
code they want.

Further, the extend tag is not in use in any of our core templates.
2024-09-28 15:07:23 +02:00
Mario
b498e50f74 adjust post app icon and remove obsolete arguments
(cherry picked from commit 5cbd42bbc4)

Co-authored-by: Mario <mario@mariovavti.com>
2024-09-27 16:51:57 +00:00
Mario
2c05638776 Merge branch 'cherry-pick-d1811ea1' into 'dev'
Update Spanish strings

See merge request hubzilla/core!2142
2024-09-27 16:39:24 +00:00
Mario
5cbd42bbc4 adjust post app icon and remove obsolete arguments 2024-09-27 16:36:25 +00:00
Manuel Jiménez Friaza
ac6720e118 Update Spanish strings
(cherry picked from commit d1811ea1f3f7249023c51104154d680f09df8572)

Co-authored-by: mjfriaza:4GF~eYj,-iAv <mjfriaza@disroot.org>
2024-09-27 15:36:32 +00:00
Mario
8c87b06caa Merge branch '9.4RC' 2024-09-25 19:39:51 +00:00
Mario
339e702beb version 9.4 2024-09-25 19:38:12 +00:00
Mario
8750c5f7bc update changelog
(cherry picked from commit 5281f4dd9b)

Co-authored-by: Mario <mario@mariovavti.com>
2024-09-25 19:36:46 +00:00
Mario
5281f4dd9b update changelog 2024-09-25 19:35:01 +00:00
Mario
c3b4397ea3 update changelog
(cherry picked from commit 424b31b7f0)

Co-authored-by: Mario <mario@mariovavti.com>
2024-09-25 09:48:57 +00:00
Mario
c12ef4fbf4 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-09-25 09:47:21 +00:00
Mario
424b31b7f0 update changelog 2024-09-25 09:46:57 +00:00
Mario
20ee1a5b5b Merge branch 'remove-tests-from-autoload' into 'dev'
Don't autoload test cases using composer.

See merge request hubzilla/core!2141
2024-09-25 08:40:45 +00:00
Harald Eilertsen
2cd779cbe9 Don't autoload test cases using composer.
Introduces a bootstrap file that ensures that the base test case classes
are loaded and available instead.

This reduces the number of warnings when running composer install.
2024-09-24 13:54:42 +02:00
Mario
a3f1189df7 Merge branch 'dev' into 9.4RC 2024-09-24 09:26:12 +00:00
Mario
2bc088e555 mod help: only abort requests without topic if we have not got a search request 2024-09-24 09:24:56 +00:00
Mario
67d8b977b6 version 9.4RC1 2024-09-24 08:59:26 +00:00
Mario
5b1e532791 Merge branch 'dev' into 9.4RC 2024-09-24 08:58:33 +00:00
Mario
0e1bf2cef0 update changelog 2024-09-24 08:58:06 +00:00
Mario
4f129e05e5 notes: make sure we set App::$profile_uid in the module - issue #1865 and minor code cleanup
(cherry picked from commit 3733a80c1d)

Co-authored-by: Mario Vavti <mario@mariovavti.com>
2024-09-22 15:26:52 +00:00
Mario Vavti
3733a80c1d notes: make sure we set App::$profile_uid in the module - issue #1865 and minor code cleanup 2024-09-22 17:24:28 +02:00
Mario Vavti
220571d2a9 bump dev version 2024-09-20 13:04:50 +02:00
Mario Vavti
f6b9a1dd3c version 9.4RC, strings, autoload dump 2024-09-20 12:59:36 +02:00
Mario
393d5020f8 changelog 2024-09-20 11:21:51 +02:00
Mario
06ac41c005 whitespace 2024-09-19 06:59:55 +00:00
Mario
39ee872f49 prefer token if available 2024-09-19 06:59:27 +00:00
Mario
a7c51f5d65 display title only for toplevel items 2024-09-18 19:59:33 +00:00
Mario
5309c032db Adjust fix_attached_permissions() so that if we got a token, we will just add the token to the original ACL instead of rewriting the ACL to theitem ACL - it probably makes much more sense that way 2024-09-18 19:53:07 +00:00
Mario
176298ffeb remove garbage 2024-09-18 15:09:56 +00:00
Mario
fdf19e659e not yet ready for primetime 2024-09-18 15:09:10 +00:00
Mario
e799589781 allow uploading to comments if ocap tokens are enabled 2024-09-18 09:34:10 +00:00
Mario
10acf90d06 refactor get_security_ids() to remove some legacy code from the zot/zot6 transition and re-add scope sql to item_permissions_sql() 2024-09-18 08:48:25 +00:00
Mario
b184533115 fa2bi fixes 2024-09-05 13:26:13 +00:00
Mario
b50e06a9d9 fa2bi fixes 2024-08-28 08:44:32 +00:00
Mario
66901dbe3e fa2bi fixes 2024-08-09 09:55:18 +00:00
Mario
4a7879aad2 fa2bi fixes 2024-08-09 09:08:33 +00:00
Mario
30aa0e3822 fa2bi fixes 2024-08-09 08:56:52 +00:00
Mario
cadc7ee29e bump version 2024-08-08 20:43:51 +00:00
Mario
5a44b8c40c remove fork awesome 2024-08-08 20:42:51 +00:00
Mario
487e68ebd1 fa2bi fix 2024-08-08 20:40:17 +00:00
Mario
6cdbc28d79 missing class 2024-08-08 16:14:08 +00:00
Mario
4113bea104 fa2bi fixes 2024-08-05 10:03:09 +00:00
Mario
294359d7f5 improved content and comment collapse/expand rendering 2024-08-04 13:40:22 +00:00
Mario
8ff870482f add support for inbound locations 2024-08-02 16:56:59 +00:00
Mario
56cb6f1034 streamline location rendering 2024-08-02 16:02:29 +00:00
Mario
7eb23aa8b8 fa2bi fixes 2024-08-02 15:08:27 +00:00
Mario
c793cea2f0 fa2bi: catch some remains 2024-08-02 08:50:50 +00:00
Mario
4e19f1c8be fa2bi: fix directory sort icon 2024-08-02 08:19:08 +00:00
Mario
3d3fcd7334 fa2bi: some sed woodoo on templates and manual fixes in js and php files 2024-08-02 08:06:15 +00:00
Mario
61c03e4b4e fix html2bbcode table and add test 2024-08-02 07:17:54 +00:00
Mario
dd0be272d0 fa2bi continued 2024-07-31 19:24:36 +00:00
Mario
b781739949 fa2bi continued 2024-07-31 13:53:09 +00:00
Mario
2221d8dd12 fa2bi continued 2024-07-30 15:11:08 +00:00
Mario
d67a0b14e3 fa2bi continued 2024-07-30 15:10:47 +00:00
Mario
b838632318 fa2bi continued 2024-07-30 15:10:32 +00:00
Mario
8c38466b75 fa2bi continued 2024-07-30 14:40:33 +00:00
Mario
2919b36e91 streamline calendar icon 2024-07-30 11:39:58 +00:00
Mario
52f7b508af Merge branch 'improve-help-locale-handling' into 'dev'
Improve handling of locale in Help module

See merge request hubzilla/core!2140
2024-07-29 09:59:04 +00:00
Mario
15f6bc93cf minor line height fix 2024-07-29 09:56:15 +00:00
Mario
8c4269d037 fa2bi continued 2024-07-29 09:38:51 +00:00
Mario
7394c97f23 simplified syntax 2024-07-29 07:57:47 +00:00
Mario
33e45d98a3 fa2bi adjustions 2024-07-28 18:49:04 +00:00
Mario
241cc1ad63 storing info and notice messages in the session has some disadvantages if the functions are called via ajax. revert to storing them in xconfig. 2024-07-28 18:44:07 +00:00
Mario
b26db5bde6 fa2bi more fix notifications 2024-07-24 21:04:22 +00:00
Mario
9be799de15 fa2bi fix notifications 2024-07-24 20:09:07 +00:00
Mario
014737fe21 fa2bi fixes 2024-07-24 18:26:50 +00:00
Harald Eilertsen
d3093dce1b Improve translation message for help pages.
Display the target language instead of "your preferred language". Makes
it a bit more explicit.
2024-07-24 11:57:41 +02:00
Harald Eilertsen
61f9ad8274 Add a notice to help pages when defaulting to english. 2024-07-24 11:46:18 +02:00
Harald Eilertsen
7067a0adc2 Move language member to HelpHelperTrait.
Should have been there from the start, was just a miss.
2024-07-24 10:59:03 +02:00
Mario
eb8cab37f3 bi adjustments 2024-07-24 08:01:38 +00:00
Mario
467e0b32b4 fa2bi and a php error in mod appman 2024-07-23 22:08:42 +00:00
Mario
204d91c3c3 this will be a longer journey - we will start to use bootstrap icons now since forkawesome is dead 2024-07-23 18:07:30 +00:00
Harald Eilertsen
1bd52867fb Fallback to english help topic if localized topic is not found. 2024-07-23 18:52:12 +02:00
Harald Eilertsen
898fb4f800 Refactor HelpTest.php.
Move default stubs to a function to make them reusable.
2024-07-23 18:51:22 +02:00
Harald Eilertsen
63a01c0214 Replace $Projectname in help index/toc file. 2024-07-23 18:47:39 +02:00
Mario
39933052a9 do not run set_linkified_perms() if editing an existing post 2024-07-23 14:40:36 +00:00
Mario
719dbf091a some cleanup 2024-07-23 14:17:06 +00:00
Mario
2dad3a8fe5 the tag_deliver permission is not used anymore 2024-07-23 14:00:07 +00:00
Mario
d99ba64206 make sure to failà the tgroup_check() for group posts if they do not have the post_wall permission. 2024-07-23 13:11:24 +00:00
Harald Eilertsen
202b797fe6 Remove language selector from help pages.
It is not in sync with the languages available for the rest of the
Hubzilla UI, so it was confusing and in the way of just supporting
localized help using the same mechanism as the rest of the code.

Also allowed deleting a good chunck of javascript from the help logic.
2024-07-23 13:26:44 +02:00
Harald Eilertsen
9df96fa03b Don't modify address bar when loading help topic.
Modifying the current URL like this causes several problems, and is imo
bad practice.

When requesting a help topic without specifying the language in the URL
(like `help/member/member_guide`) the locale for the current channel is
used to fetch the topic.

On the other hand, if fetching a topic with the language in the URL, the
detected language will be used. Since the channel locale may not match
the locale supported by the help system, weird situations may arise.
I.e. fetching the topic without language in the URL works, but as the
URL has now been rewritten, reloading the page will fail with a 404
status.

Being a bit less clever solves this issue, and leaves the web browser to
behave more as expected by the user.
2024-07-23 12:56:48 +02:00
Harald Eilertsen
7afb01e488 Redirect help to about page when locale but no topic specified in URL 2024-07-23 12:24:42 +02:00
Mario
ae140465d7 only allow repeats if we are the profile owner and minor code simplification 2024-07-23 08:44:18 +00:00
Mario
475cbf6510 more fix logic 2024-07-22 21:32:24 +00:00
Mario
39e5e29ce5 fix logic and add translateable strings 2024-07-22 21:19:28 +00:00
Mario
f4ffef967a undo announce is not yet supported - hide it in the UI until it is 2024-07-22 20:26:14 +00:00
Mario
77a6a21ea2 bump version 2024-07-22 19:25:26 +00:00
Mario
4e35d34226 item buttons redesign - initial checkin 2024-07-22 19:07:19 +00:00
Mario
3708896a65 Merge branch 'dev' into 'dev'
Added util/update_db

See merge request hubzilla/core!2139
2024-07-22 07:03:51 +00:00
Dale Hitchenor
7c3f28f9d2 Added util/update_db 2024-07-22 07:03:51 +00:00
Mario
afc8b88933 Merge branch 'dev' into 'dev'
Added util/update_db

See merge request hubzilla/core!2139
2024-07-22 06:56:17 +00:00
Dale Hitchenor
4668178dee Added util/update_db 2024-07-22 06:56:16 +00:00
Mario
bfec7b6901 Merge branch 'dev' into 'dev'
Added util/update_db

See merge request hubzilla/core!2139
2024-07-22 06:55:43 +00:00
Dale Hitchenor
f026afe11c Added util/update_db 2024-07-22 06:55:43 +00:00
Mario
f388fcaf08 Merge branch 'dev' into 'dev'
Added util/update_db

See merge request hubzilla/core!2139
2024-07-22 06:53:27 +00:00
Dale Hitchenor
9bd2b3ab17 Added util/update_db 2024-07-22 06:53:25 +00:00
Mario
2d0b216a2c version 2024-07-20 18:01:17 +00:00
Mario
c5bca0279c Revert "Revert "sse: reset session after connection aborted""
This reverts commit c71eb401c0
2024-07-20 13:09:05 +00:00
Mario
3fca63a15f Revert "Revert "more work on sse sys messages""
This reverts commit c22f633ae0
2024-07-20 13:08:52 +00:00
Mario
c47900f366 Revert "sse: more work on notifications"
This reverts commit 82f69018a6
2024-07-20 13:08:31 +00:00
Mario
84f64214c3 Revert "sse: add pdl files"
This reverts commit 1055718935
2024-07-20 13:08:04 +00:00
Mario
9cd01e2e13 Revert "sse: add pdl files"
This reverts commit 2461e709d2
2024-07-20 13:07:49 +00:00
Mario
841b4f7d81 Revert "sse: add pdl files"
This reverts commit 6276f36b90
2024-07-20 13:07:32 +00:00
Mario
70212cdb59 Revert "version"
This reverts commit 5f77e9f4ce
2024-07-20 13:07:07 +00:00
Mario
5f77e9f4ce version 2024-07-20 10:17:12 +00:00
Mario
6276f36b90 sse: add pdl files 2024-07-20 10:16:32 +00:00
Mario
2461e709d2 sse: add pdl files 2024-07-20 10:16:24 +00:00
Mario
1055718935 sse: add pdl files 2024-07-20 10:16:13 +00:00
Mario
82f69018a6 sse: more work on notifications 2024-07-20 10:15:44 +00:00
Mario
c22f633ae0 Revert "more work on sse sys messages"
This reverts commit 983fc84f28
2024-07-20 10:00:47 +00:00
Mario
c71eb401c0 Revert "sse: reset session after connection aborted"
This reverts commit 3d03c24f06
2024-07-20 10:00:14 +00:00
Mario
5a1079750e bump version 2024-07-20 07:09:27 +00:00
Mario
3d03c24f06 sse: reset session after connection aborted 2024-07-19 23:14:47 +00:00
Mario
983fc84f28 more work on sse sys messages 2024-07-19 19:35:21 +00:00
Mario
1861eeeb0a more f arg removal 2024-07-19 11:55:21 +00:00
Mario Vavti
663aeca2a7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-07-19 13:54:16 +02:00
Mario Vavti
526730672a use the same url for attachment and body. otherwise we can not deduplicate at the receiving side. 2024-07-19 13:53:58 +02:00
Mario
7f292d4765 remove unused functions and start removing the ominous f argument 2024-07-19 09:12:50 +00:00
Mario
99bff67168 version 9.2.1 2024-07-18 08:55:07 +00:00
Mario
bb3caeb629 Merge branch 'dev' 2024-07-18 08:54:21 +00:00
Mario
65185a70d5 changelog 2024-07-18 08:52:28 +00:00
Mario
6d1f34284b bump version 2024-07-17 14:58:49 +00:00
Mario
2cfdbbd956 sse: revert removing of reset after 30 seconds and save a db lookup if we have just reset 2024-07-17 14:34:46 +00:00
Mario
5f66ad5bc5 fix php warning 2024-07-17 13:22:17 +00:00
Mario
aff11443b4 gd: check if function exists - obviously this can change after the initial install where we check this 2024-07-17 13:17:30 +00:00
Mario
6ced7ecf89 missing pdl for mod import 2024-07-15 10:34:43 +00:00
Mario
2d467a15ba dbesc the workinfo json 2024-07-15 10:29:12 +00:00
Mario
28c8229218 always use ob_end_flush() and reduce code duplication 2024-07-15 10:16:54 +00:00
Mario
0bcecc4baa make sure we always have an object which was not the case when repeating one of our own items 2024-07-15 10:12:02 +00:00
Mario
78e68519e8 do not handle non sys notifications if we are in sys only mode 2024-07-10 08:52:23 +00:00
Mario
d2b06995c7 more work on making sure system notifications appear on page reload 2024-07-10 08:40:51 +00:00
Mario
5cbae0fb81 improve handling of sse especially in relation with page reloads 2024-07-08 20:35:08 +00:00
Mario
2ddc087512 notifications: provide possibility to only display system notofications 2024-07-07 13:24:26 +00:00
Mario
b0fe94b4b3 adjust release date 2024-07-06 11:29:36 +00:00
Mario
45275910e6 Merge branch '9.2RC' 2024-07-06 11:05:22 +00:00
Mario
c04e781926 version 9.2 2024-07-06 11:04:43 +00:00
Mario
09a609ef6b Merge branch 'dev' into 9.2RC 2024-07-06 11:02:56 +00:00
Mario
213ee83a92 update changelog 2024-07-06 10:29:13 +00:00
Mario
db5e524e3c Merge branch 'dev' into 9.2RC 2024-07-04 10:13:28 +00:00
Mario
f882c44fb3 fix wrong logic after last commit 2024-07-04 10:13:08 +00:00
Mario
8f9e9116df revert the strlen check 2024-07-04 09:43:20 +00:00
Mario
04a35dac9a revert the strlen check 2024-07-04 09:41:21 +00:00
Mario
ed03befa02 fix possible php error 2024-07-04 09:31:13 +00:00
Mario
f944f46744 fix possible php error 2024-07-04 09:30:21 +00:00
Mario
3f5c45a567 Merge branch 'dev' into 9.2RC 2024-06-28 18:19:34 +00:00
Mario
464149e22d fail to import more gracefully if a channel has already been imported at some point but was deleted again 2024-06-28 18:18:35 +00:00
Mario
b51ed67efb Merge branch 'dev' into 9.2RC 2024-06-27 20:02:54 +00:00
Mario
30ba0661aa fix php error 2024-06-27 20:01:52 +00:00
Mario
afdc3d6d18 Merge branch 'dev' into 9.2RC 2024-06-27 19:23:20 +00:00
Mario
26cb32612d fix display issue for doubleleft template 2024-06-27 19:23:00 +00:00
Mario
6a710c3cc3 fix version 2024-06-27 08:29:01 +00:00
Mario
7028e07535 adjust right margin of profile images 2024-06-27 08:27:54 +00:00
Mario
6666bdfda9 version 9.3 2024-06-27 07:47:39 +00:00
Mario
3e57f150bc version 9.2RC1, strings and dump composer autoload files 2024-06-27 07:44:05 +00:00
Mario
a50b3181ad make sure we get a scrollbar if everything else breaks and remove some unused css 2024-06-26 10:27:13 +00:00
Mario
de992452ee use the doubleleft template by default for admin pages to work around some display issues. Also notifications, etc. are not really useful there 2024-06-26 10:12:22 +00:00
Mario
4cddc3d0df fix php error 2024-06-26 09:35:53 +00:00
Mario
241d96e9fa bump version 2024-06-25 09:29:08 +00:00
Mario
8ae6e785f3 reflect the censored state in the local xchan and exclude toplevel posts by censored channels in the public stream 2024-06-25 09:27:59 +00:00
Mario
1c34c354cf fix issue where event items were parsed multiple times 2024-06-21 10:18:40 +00:00
Mario
0f02553d12 move template to wiki addon 2024-06-18 09:07:05 +00:00
Mario
3f5cfc8fa2 fix return to blank page after editing post under some circumstances 2024-06-18 07:18:09 +00:00
Mario
0097840e32 Merge branch 'misc-fixes' into 'dev'
Add module test helper expectRedirectTo + api docs

See merge request hubzilla/core!2138
2024-06-17 08:52:01 +00:00
Mario
082b615e50 Merge branch 'add-tests-for-create-identity' into 'dev'
Add tests for create_identity + fixes

See merge request hubzilla/core!2137
2024-06-17 08:48:27 +00:00
Harald Eilertsen
62cbd87e71 Update API docs for Module test case base class. 2024-06-16 08:57:09 +02:00
Harald Eilertsen
72453c49f8 tests: Add helper expectRedirectTo to module test class.
Just a shorthand for manually stubbing `goaway` and setting the
expectations on the test case.
2024-06-16 08:56:43 +02:00
Harald Eilertsen
66ea277045 Refactor is_local_url() and add api doc. 2024-06-16 08:56:20 +02:00
Harald Eilertsen
40a93d92c8 Missing include in QueueWorker. 2024-06-15 13:01:17 +02:00
Harald Eilertsen
7df701b434 Use empty() to check if array entry exist in create_identity. 2024-06-14 20:24:52 +02:00
Harald Eilertsen
d760790643 Add basic test for create_identity function.
Not an exhaustive test for now, but does at least excercise some of the
code.
2024-06-14 16:43:38 +02:00
Harald Eilertsen
1ed8383c33 Allow passing callable as array to hooks. 2024-06-14 16:43:38 +02:00
Harald Eilertsen
d139f2fe87 QueueWorker: Use DbaTransaction class for db transactions.
This makes sure that the system knows whether a transaction is active or
not, and ensures automatic cleanup if the transaction is not closed
before the methods return.

It also allows us to run this code in tests. When run within a test, the
transaction will be ignored, as the entire test is run within an
already existing transaction. Also as each test has their own db
connection, this should not have any ill effects, as there should not be
any way in which different simultaneous connections can interfere with
the db updates.
2024-06-14 12:10:35 +02:00
Harald Eilertsen
20a8da0683 tests: Remove obsolete stubs from Permissions tests
These stubs are no longer needed, as the tests have a db now.
2024-06-14 12:10:35 +02:00
Mario
ff018b975b Merge branch 'fix-rpost-module' into 'dev'
Refactoring and fixed for Module\Rpost

See merge request hubzilla/core!2136
2024-06-13 19:07:05 +00:00
Harald Eilertsen
fcd657040e Module\Rpost: Just a little bit of doc. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
605f982520 Module\Rpost: Redirect to submitted post on success.
This eliminates a open redirect issue where it was possible to craft a
link that when clicked would take the victim to an external site
controlled by an attacker.
2024-06-13 13:34:20 +02:00
Harald Eilertsen
fb1c66fbc9 Fix warnings exposed by tests.
Mainly missing variables for templates, and channel entries.
2024-06-13 13:34:20 +02:00
Harald Eilertsen
d02fa7c268 Module\Rpost: Add return type and visibilty for get. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
5abe14982a tests: More tests for Module\Rpost.
Also refactor the tests a bit to avoid duplicatng code.
2024-06-13 13:34:20 +02:00
Harald Eilertsen
8be9b109fd Module\Rpost: Refactor handling of attachments.
Move to private function for now.
2024-06-13 13:34:20 +02:00
Harald Eilertsen
91147d5c5b Module\Rpost: Reuse value of local_chanel.
We don't need to call it twice (actually trice in the original code).
2024-06-13 13:34:20 +02:00
Harald Eilertsen
08d4bd94fa Module\Rpost: Refactor redirect or login logic. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
76a92ac2e1 tests: Module\Rpost shows login form if not authenticated. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
7c688de9cd tests: Add comment to Tests\Unit\Module\RpostTest. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
93a45be181 tests: Set query string in Module\TestCase::get method. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
d187c0025a tests: Configure system.baseurl for tests. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
4e9432263a Module\Rpost: Remove obsolete local variable $o. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
0d4c3fd215 Module\Rpost: Remove unused local variables. 2024-06-13 13:34:20 +02:00
Harald Eilertsen
62aefadc27 Module\Rpost: Add basic test and fix session access.
Just a basic test to ensure that the module `get()` method behaves
somewhat reasonable when no query params are given.

Had to make a small change to the Rpost module itself. Since the
`$_SESSION` superglobal may not always be set (and is not in the test),
use `isset` instead of `array_key_exists` to check if we have saved
query params in the session.

In general, isset is safer than array_key_exists if there's a chance
that the array itself may not exist.
2024-06-13 13:34:20 +02:00
Mario
6e0d0e3832 docu and remove superfluous break statement after return statement 2024-06-13 10:17:13 +00:00
Mario
798e870e71 Merge branch 'add-config-for-phpcs' into 'dev'
Add config file and rules for PHP Code Sniffer.

See merge request hubzilla/core!2135
2024-06-13 09:38:35 +00:00
Mario
6a63a38e8d Merge branch 'fix-test-warnings' into 'dev'
Fix test warnings

See merge request hubzilla/core!2134
2024-06-13 09:37:21 +00:00
Harald Eilertsen
9199a1ba81 Add config file and rules for PHP Code Sniffer.
The rules are based on the "Generic" ruleset included by PHP Code
Sniffer, with a significant portion of the rules disabled. This is a
tradeoff between getting some useful feedback, and not being overloaded
by noise.

I've tried to encode a coe style that resembles the existing code as
much as possible, but have included some sniffs that requires code
changes to satisfy the style. This is meant as a starting point, and we
can disable or enable more sniffs as we see fit.

PHPCS also has ready rule sets for other common coding standards we may
want to gravitate towards, e.g. PSR-12. Others are available from the
community.

The best way to run PHPCS is to integrate it with your editor, so that
it will display diacnostics inline when saving or modifying the code. It
can also be run from the command line like this:

    ./vendor/bin/phpcs -n [<path-to-file-to-check>]

If no file is specified it will try to check the entire project.

The `-n` means don't bother with warnings (I recommend that to begin
with. Enable the warnings when the errors are taken care of.)
2024-06-12 23:53:20 +02:00
Harald Eilertsen
ac1e20b188 Module\Setup: Don't access static variable as non static. 2024-06-12 15:13:48 +02:00
Harald Eilertsen
ad9fb4d530 Module\Help: Only variables can be passed by reference.
Introduce an intermediate variable when extracting the file type from
the file name. Otherwise we would try to pass a returned value as a
reference.
2024-06-12 15:13:24 +02:00
Harald Eilertsen
ffc2455bea Module\Rbmark: Pass all fields to input field templates. 2024-06-12 15:12:54 +02:00
Harald Eilertsen
0a818191c1 boot/login: Pass all expected args to sub templates. 2024-06-12 15:12:24 +02:00
Harald Eilertsen
c7ec3159ea Module\Rbmark: Specify all fields in the template.
The `field_select` sub template wants five elements in the `field`
array.
2024-06-12 15:12:09 +02:00
Harald Eilertsen
4d5a7ec39f includes/menu: Fix timestamp handling in menu_create.
Referencing undefined array keys are not allowed anymore, so we need to
check whether they exist first.
2024-06-12 15:12:00 +02:00
Harald Eilertsen
13c074f8b8 Module\Setup: Pass all required params for the template.
Non-existing keys in the array passed to the template causes a warning.
Also make optional parts of the template actually optional by skipping
them if the value is empty.
2024-06-12 15:11:27 +02:00
Mario
088a87914f remove not needed namespace 2024-06-11 09:00:43 +00:00
Mario
5110dcb912 remove not required includes and include security.php in boot.php 2024-06-11 08:58:35 +00:00
Mario
64748cf1f1 cleanup unused code 2024-06-11 08:52:10 +00:00
Mario
4ba4b2976e pass the force argument to the xchan_photo daemon 2024-06-11 07:42:43 +00:00
Mario
06183ba01a duplicate array key 2024-06-10 10:00:25 +00:00
Mario
539ae37553 too many args 2024-06-10 09:50:06 +00:00
Mario
8f41d170a5 fix wrong variable 2024-06-10 09:45:33 +00:00
Mario
d9e97a7c1f remove superfluous backslash 2024-06-10 09:35:13 +00:00
Mario
51fe071c5e Ãfix undefined variable 2024-06-10 09:16:21 +00:00
Mario
c5cab3004f remove duplicate array key 2024-06-10 09:09:36 +00:00
Mario
9c62514c1b docu 2024-06-10 08:58:32 +00:00
Mario
0428a97e00 docu 2024-06-10 08:56:59 +00:00
Mario
43a2c21d87 fix updated not supported in wrapper function 2024-06-10 08:40:39 +00:00
Mario
69862bc6df docu and declare return type for t() 2024-06-10 08:26:06 +00:00
Mario
388e7c88df remove superfluous param, fix wrong var and declare types for unparse_url() 2024-06-10 08:22:43 +00:00
Mario
9348bd6ea5 remove unused variable and superfluous backslash 2024-06-10 08:02:32 +00:00
Mario
0c1d0f7498 version 9.0.2 2024-06-07 09:25:15 +00:00
Mario
81ba070e1a update changelog
(cherry picked from commit bd5f77dbeb)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:23:32 +00:00
Mario
a7812657f1 update changelog
(cherry picked from commit d862a6f075)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:23:02 +00:00
Mario
bd5f77dbeb update changelog 2024-06-07 09:21:43 +00:00
Mario
d862a6f075 update changelog 2024-06-07 09:19:50 +00:00
Mario
18725c47a0 move button class to the right dom
(cherry picked from commit 59b8c8ad48)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:12:32 +00:00
Mario
59b8c8ad48 move button class to the right dom 2024-06-07 09:11:09 +00:00
Mario
494ff44a69 adjusting to the wrong direction when exporting ical and do not use Z because timezone is attached 2024-06-05 10:04:16 +00:00
Mario
5efc6bdd2f bump version 2024-06-05 08:09:26 +00:00
Mario
4835758293 Merge branch 'correct-type-annotation-for-config-get' into 'dev'
Correct type annotation in comment for Config::Get.

See merge request hubzilla/core!2127
2024-06-05 08:01:04 +00:00
Harald Eilertsen
d0bb3a7354 Correct type annotation in comment for Config::Get. 2024-06-05 08:01:04 +00:00
Mario
14df925aa6 Merge branch 'disable-mfa-for-dav-and-cdav' into 'dev'
Skip checking MFA status for WebDAV and CardDAV requests.

See merge request hubzilla/core!2131
2024-06-05 07:59:42 +00:00
Harald Eilertsen
350f84913a Skip checking MFA status for WebDAV and CardDAV requests. 2024-06-05 07:59:42 +00:00
Mario
78ab2e33ef Merge branch 'fetch-url-default-timeout' into 'dev'
Fix default timeouts for z_(fetch|post)_url.

See merge request hubzilla/core!2132
2024-06-05 07:55:53 +00:00
Mario
75e1b70584 php warnings/errors
(cherry picked from commit 10d1cbd3ce)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:09:41 +00:00
Mario
1dc73935d9 deal with inReplyTo array
(cherry picked from commit 2145207ad2)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:08:32 +00:00
Mario
7d7b43c5b9 hotfix to mitigate queueworker crash
(cherry picked from commit a4d63ab9a3)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:06:50 +00:00
Mario
a4d63ab9a3 hotfix to mitigate queueworker crash 2024-06-04 09:05:34 +00:00
Harald Eilertsen
c009c5f43a Fix default timeouts for z_(fetch|post)_url.
When fetching the default timouts from config, the result is converted
to an int via `intval()`, the result of that again is compared strictly
to `false`. Since 0 !== false, the default values will never be used,
and 0 (no timeout) is passed to curl.

This cause requests to hang indefinitely (or until they are killed) when
receiving actions that require a lookup or fetch to another site as part
of the request processing. (E.g webfinger, or fetching objects that we
received an announce action for.) This again cause the request never to
return a useful status to the site sending the action, and could cause
them to think the Hubzilla site is dead.

This patch fixes this by comparing the fetched value from config to 0
instead of false, making the defaults work again if the config is not
set (or set to 0).
2024-05-29 22:50:02 +02:00
Mario
9d56bb952e Merge branch 'doc/update-member-tag-and-mention-docs' into 'dev'
Member docs: Update docs on tags and mentions.

See merge request hubzilla/core!2130
2024-05-27 06:25:43 +00:00
Mario
84abf28cec Merge branch 'update-phpunit-10x' into 'dev'
Upgrade test framework to PHPUnit 10.5

See merge request hubzilla/core!2128
2024-05-27 06:17:05 +00:00
Harald Eilertsen
cad82d12d2 Upgrade test framework to PHPUnit 10.5 2024-05-27 06:17:05 +00:00
Harald Eilertsen
1846ed75bf Minor style update for the .abook-self CSS class.
It was hardcoded to a blindingly white, which did not work too well with
the white text in dark mode. Use a proper bootstrap var, so it follows
the prefered color scheme instead.
2024-05-25 12:25:13 +02:00
Harald Eilertsen
0a6bb06f86 Member docs: Update dogs on tags and mentions.
Rewrote it and corrected some outdated information about how to tag
forums etc. Also cleaned up the markup a bit.

Added information and links about which apps and admin addons are
required for given functionality.

Also added some images to help illustrate some subjects.

Uncertain about whether the information on how the autocomplete popup is
populated is correct anymore. Underlined it and added a question mark to
make sure it annoys someone (possibly me) to figure it out.
2024-05-25 12:20:14 +02:00
Mario
a10402a788 Merge branch 'refactor-module-rbmark' into 'dev'
Refactor and cleanup Rbmark module + add tests

See merge request hubzilla/core!2126
2024-05-15 08:28:19 +00:00
Harald Eilertsen
5da0cc138f Refactor and cleanup Rbmark module + add tests 2024-05-15 08:28:19 +00:00
Mario
2145207ad2 deal with inReplyTo array 2024-05-15 07:38:07 +00:00
Mario
f086dfd8ca missing semicolon and code readability 2024-05-14 09:05:02 +00:00
Mario
26cfc29303 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-05-14 09:01:19 +00:00
Mario
10d1cbd3ce php warnings/errors 2024-05-14 09:00:43 +00:00
Mario
1299fdb7be Merge branch 'remove-unused-modules' into 'dev'
Remove unused Toggle_(safesearch|mobile) modules.

See merge request hubzilla/core!2125
2024-05-13 07:42:18 +00:00
Harald Eilertsen
430347a295 Remove unused Toggle_(safesearch|mobile) modules. 2024-05-13 07:42:17 +00:00
Mario
960354b16c make mod regate return to system.workflow_channel_next and show register message field only if registration is set to register_approve 2024-05-08 19:27:48 +00:00
Mario
481e08b904 remove p tags from li. otherwise we will get unwanted new lines in the list. add test. 2024-05-08 15:41:54 +00:00
Mario
76ce4705e2 more fixes for issue #1843 2024-05-08 14:34:44 +00:00
Mario Vavti
7a5bb99d87 make sure the hcard addon markup will be available even if other profile entries are missing 2024-05-08 12:18:00 +02:00
Mario
11d7a4c9f7 Merge branch 'rename-help-helper-trait' into 'dev'
Rename HelpHelper to HelpHelperTrait.

See merge request hubzilla/core!2124
2024-05-07 09:04:45 +00:00
Mario
9dd63db736 add tests 2024-05-07 08:56:25 +00:00
Mario
f74922db39 add bbcode support for the HTML5 del tag 2024-05-07 08:52:05 +00:00
Mario
605aa37ad3 apply li fixes to html2plain 2024-05-03 11:50:29 +00:00
Mario
262cebb568 make parsing of li slightly more robust 2024-05-03 13:38:45 +02:00
Harald Eilertsen
bfa81490c1 Rename HelpHelper to HelpHelperTrait.
PHPCS prefers traits to be suffixed with "Trait", and I think I agree.
2024-05-03 13:00:14 +02:00
Mario
219f0dfeca also deal with ol and ul tags earlier and add test for double nested lists 2024-05-03 12:04:19 +02:00
Mario
3a50a0b715 deal with li tags earlier seems to be more straight forward also add test for li without closing tag 2024-05-03 10:23:36 +02:00
Mario
b25662e183 fix nested lists by parsing li before ul or ol and add a test 2024-05-03 09:39:58 +02:00
Mario
47a86f8771 make sure to always move the recent notification to the top 2024-05-03 06:52:05 +00:00
Mario
07696d4bd1 fix the test - we do not use a title anymore since it does not make much sense in combination of the sub titles 2024-05-02 19:24:13 +00:00
Mario
52e97fe115 some css voodoo for the help menu 2024-05-02 18:36:16 +00:00
Mario
58033f3255 bump version 2024-05-02 17:52:08 +00:00
Mario
ba4773a61e add some deduplication 2024-05-02 17:51:39 +00:00
Mario
977e6a02f4 another css fix 2024-05-02 17:21:53 +00:00
Mario
6a53ddef21 css fix and bump version 2024-05-02 14:50:57 +00:00
Mario
2fb9c0ec0d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-05-02 14:45:26 +00:00
Mario
98c3e2f93f remove jgrowl 2024-05-02 14:44:16 +00:00
Mario
fb4568001d Merge branch 'fix-broken-get_rpost_path' into 'dev'
Libzot: get_rpost_path was broken for URL's with no port.

See merge request hubzilla/core!2123
2024-05-02 14:43:22 +00:00
Mario
5eab32a65b Merge branch 'improve-unit-test-docs' into 'dev'
Improve docs for UnitTestCase class.

See merge request hubzilla/core!2122
2024-05-02 14:16:16 +00:00
Mario
483221e2a8 remove redundant comma 2024-05-02 14:15:31 +00:00
Mario
2e575dee52 css fix 2024-05-02 14:09:09 +00:00
Mario
058c7d6c13 start removing jgrowl 2024-05-02 13:00:45 +00:00
Harald Eilertsen
630cecd740 Libzot: get_rpost_path was broken for URL's with no port. 2024-05-01 20:57:56 +02:00
Harald Eilertsen
4d29cffde5 Improve docs for UnitTestCase class. 2024-05-01 17:03:03 +02:00
Mario
c6116e367a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-04-30 07:01:19 +00:00
Mario
b6e6cecf70 Merge branch 'cherry-pick-60cd7cc8' into 'dev'
Fix some errors in Spanish strings

See merge request hubzilla/core!2121
2024-04-30 07:00:03 +00:00
Mario
ce15852b9a Merge branch 'rework-help-module' into 'dev'
Rework Help module + begin tests for Setup module

See merge request hubzilla/core!2120
2024-04-30 06:59:20 +00:00
Harald Eilertsen
7c34a3676d Rework Help module + begin tests for Setup module 2024-04-30 06:59:19 +00:00
mjfriaza:4GF~eYj,-iAv
1c92c7476b Fix some errors in Spanish strings
(cherry picked from commit 60cd7cc8d09240e1a3f7f7b3bde75115a61ce4de)
2024-04-28 14:26:41 +00:00
Mario
80e124f53e remove logging 2024-04-20 18:57:37 +00:00
Mario
48cec94505 Merge branch 'global-state-and-some-docs' into 'dev'
Reduce some global state and add some docs

See merge request hubzilla/core!2119
2024-04-18 09:55:43 +00:00
Harald Eilertsen
26c1fa07c9 Reduce some global state and add some docs 2024-04-18 09:55:42 +00:00
Mario
78a6774206 Merge branch 'cherry-pick-4e5c6f9b' into 'dev'
Update Spanish

See merge request hubzilla/core!2118
2024-04-18 08:31:52 +00:00
Mario
3b812f2570 comment out deprecated way to find forum items and do not count announce activities 2024-04-17 10:00:40 +00:00
Mario
2e15207d0b fix spacing issues in mod wall_attach and make save_chunk() deal with userfile and file array keys 2024-04-17 07:45:20 +00:00
Mario
716013633e passing an empty filter to deliverable_abook_xchans() will return all deliverable abook xchans - we do not want this in this place. also add some docu 2024-04-17 07:39:22 +00:00
Mario
1ca91c49aa add some docu 2024-04-17 07:36:49 +00:00
Mario
7de629a8c3 update siteinfo 2024-04-05 12:56:51 +00:00
Mario
592359ef49 minor refactor and store import host for possible later use 2024-04-05 11:09:15 +00:00
Mario
a56d727c26 allow to kick off sync process in case it did not start at all. requires import host to be set manually in pconfig for now. 2024-04-05 10:40:16 +00:00
mjfriaza:4GF~eYj,-iAv
0b2781f42e Update Spanish
(cherry picked from commit 4e5c6f9bbaa702d9ccd5606a166c8e65224b8d8f)
2024-03-30 11:39:12 +00:00
Mario
b5223a4efb add pdl for mod home
(cherry picked from commit fe43e0994f)
2024-03-27 10:01:33 +00:00
Mario
fe43e0994f add pdl for mod home 2024-03-27 10:00:18 +00:00
Mario
d71c2c245f reduce default directory result set
(cherry picked from commit f85d2d3423)
2024-03-26 14:59:45 +00:00
Mario
f85d2d3423 reduce default directory result set 2024-03-26 14:48:16 +00:00
Mario
3859c010f0 bump version 2024-03-26 10:06:49 +00:00
Mario
526729c0f1 changelog
(cherry picked from commit 418b1eaf78)
2024-03-26 10:06:05 +00:00
Mario
1cd3369f6a version 9.0.1 2024-03-26 09:53:38 +00:00
Mario
418b1eaf78 changelog 2024-03-26 09:51:09 +00:00
Mario
c26ae553e6 if the updated item contains an open modal, the modal we be replaced with the new data but the backdrop will stay because it is attached to the end of the page -> remove it
(cherry picked from commit e0ac7b7f9f)
2024-03-26 09:28:25 +00:00
Mario
e0ac7b7f9f if the updated item contains an open modal, the modal we be replaced with the new data but the backdrop will stay because it is attached to the end of the page -> remove it 2024-03-26 09:26:18 +00:00
Mario
8d78698d00 deprecated bootstrap namespace in list mode
(cherry picked from commit 80d1e07908)
2024-03-25 21:53:25 +00:00
Mario
d5c189753a wrong dreport link in blog mode
(cherry picked from commit f72f5c7321)
2024-03-25 21:53:06 +00:00
Mario
9861e7a0c4 more bootstrap override
(cherry picked from commit a5d483fb5d)
2024-03-25 21:52:42 +00:00
Mario
6d5fa9205c more remove additional linebreaks after block element plus test
(cherry picked from commit 53354a1930)
2024-03-25 21:52:14 +00:00
Mario
0fee7804fb allow to run additional site specific commands at the end of util/udall
(cherry picked from commit c052b7fa99)
2024-03-25 21:51:49 +00:00
Mario
80d1e07908 deprecated bootstrap namespace in list mode 2024-03-25 21:48:25 +00:00
Mario
f72f5c7321 wrong dreport link in blog mode 2024-03-25 21:42:32 +00:00
Mario
a5d483fb5d more bootstrap override 2024-03-25 20:44:22 +00:00
Mario
26a7cef0d8 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-25 21:43:15 +01:00
Mario
53354a1930 more remove additional linebreaks after block element plus test 2024-03-25 21:42:50 +01:00
Mario
c052b7fa99 allow to run additional site specific commands at the end of util/udall 2024-03-25 19:47:17 +00:00
Mario
9ecd38911e add observer to the permissions query. this should not be necessary but it makes it clear why it should be included in the cache key
(cherry picked from commit 57e32a7912)
2024-03-25 17:32:52 +00:00
Mario
4002dbaa8b Merge branch 'master' of https://framagit.org/hubzilla/core 2024-03-25 17:32:11 +00:00
Mario
57e32a7912 add observer to the permissions query. this should not be necessary but it makes it clear why it should be included in the cache key 2024-03-25 17:31:53 +00:00
Mario
b6a72d6e4e tilt the piin
(cherry picked from commit 637f39f282)
2024-03-25 17:19:32 +00:00
Mario
6e592ed200 add the observer hash to the cache key in categories_widget() 2024-03-25 17:18:26 +00:00
Mario
637f39f282 tilt the piin 2024-03-25 17:15:05 +00:00
Mario
842df8a799 add the observer hash to the cache key in categories_widget() 2024-03-25 16:09:53 +00:00
Mario
6c033fc776 Merge branch 'fix-category-widget-template' into 'dev'
Fix smarty deprecation warning in category widget.

See merge request hubzilla/core!2116

(cherry picked from commit 2ff84ab25a)

b139e5bb Fix smarty deprecation warning in category widget.
2024-03-25 14:21:39 +00:00
Mario
2ff84ab25a Merge branch 'fix-category-widget-template' into 'dev'
Fix smarty deprecation warning in category widget.

See merge request hubzilla/core!2116
2024-03-25 14:21:07 +00:00
Mario
01c6fd03b7 fix typo after get_config -> Confi::Get conversion 2024-03-25 14:15:28 +00:00
Harald Eilertsen
b139e5bb00 Fix smarty deprecation warning in category widget. 2024-03-25 12:26:06 +01:00
Mario
7c4362db53 make sure we preserve linefeeds in the actual content of lists and tables also add tests
(cherry picked from commit 3c0d6339bb)
2024-03-24 17:00:56 +00:00
Mario
3c0d6339bb make sure we preserve linefeeds in the actual content of lists and tables also add tests 2024-03-24 17:50:27 +01:00
Mario
a0cfe22501 Merge branch 'deprecate-include-config-in-core' into 'dev'
Deprecate *_config() functions in core.

See merge request hubzilla/core!2114
2024-03-24 09:58:21 +00:00
Harald Eilertsen
0dc959d9fe Deprecate *_config() functions in core. 2024-03-24 09:58:21 +00:00
Mario
f7bf9ede72 revert default to activity type Article until we have a more stable solution to override it for platforms which do not support it
(cherry picked from commit ecdd9a4d6e)
2024-03-23 11:20:44 +00:00
Mario
ecdd9a4d6e revert default to activity type Article until we have a more stable solution to override it for platforms which do not support it 2024-03-23 11:19:24 +00:00
Mario
1aeb05628b Merge branch '9.0RC' 2024-03-22 08:37:29 +00:00
Mario
b464fae3bf version 9.0 2024-03-22 08:36:38 +00:00
Mario
a34ce0732d Merge branch 'dev' into 9.0RC 2024-03-22 08:36:07 +00:00
Mario
f457b6623d changelog 2024-03-22 08:35:55 +00:00
Mario
01ebd51fb2 Merge branch 'dev' into 9.0RC 2024-03-22 08:27:18 +00:00
Mario
cb25fc031b use the correct tag for ordered lists 2024-03-22 08:23:44 +00:00
Mario
6c6fc82f43 Merge branch 'dev' into 9.0RC 2024-03-22 08:15:20 +00:00
Mario
990017b588 remove some unused variables 2024-03-22 08:14:41 +00:00
Mario
192ab22cda Merge branch 'dev' into 9.0RC 2024-03-21 20:48:33 +00:00
Mario
5e5a0d7c91 remove friendica specific hack that is not needed anymore 2024-03-21 20:48:10 +00:00
Mario
2dc1adf091 Merge branch 'dev' into 9.0RC 2024-03-21 11:37:55 +00:00
Mario
371b8440c3 adjust tests after recent commit 2024-03-21 11:04:03 +00:00
Mario
49509e7347 more whitespace fixes and some docu 2024-03-21 09:47:34 +00:00
Mario
66f5b34c07 possible fix for issue #1843 2024-03-20 21:08:23 +00:00
Mario
6a3d372050 RC3 2024-03-20 19:41:28 +00:00
Mario
c95359024c Merge branch 'dev' into 9.0RC 2024-03-20 19:39:00 +00:00
Mario
edf898d7b7 it appears the smallest size for pt videos is now 720 2024-03-20 19:33:50 +00:00
Mario
ee0060619d css fix 2024-03-20 15:25:38 +00:00
Mario
4f8ede35bd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-20 13:37:11 +00:00
Mario
9d9c102da8 no extra margin under lists 2024-03-20 13:36:55 +00:00
Mario
3de8f5e7de deal with wihitespace issues in tables and lists and add tests 2024-03-20 14:35:43 +01:00
Mario
a18e873d08 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-20 09:31:58 +01:00
Mario
b3c260a145 fix reshares from streams loosing image 2024-03-20 09:31:17 +01:00
Mario
1097bcdaf9 Merge branch 'dev' into 9.0RC 2024-03-19 09:53:33 +00:00
Mario
cfde1be097 Merge branch 'dev' into 'dev'
Recreated hmessage.po for pt-br

See merge request hubzilla/core!2115
2024-03-19 09:51:15 +00:00
Pascal Deklerck
6df4da5313 Recreated hmessage.po for pt-br 2024-03-19 09:51:14 +00:00
Mario
f910de849f Merge branch 'dev' into 9.0RC 2024-03-19 09:46:21 +00:00
Mario
d6eaeba239 changelog
(cherry picked from commit 5c2e10c01e)
2024-03-19 09:45:36 +00:00
Mario
5c2e10c01e changelog 2024-03-19 09:44:18 +00:00
Mario
8754f72e63 fix cover photos not uploaded into folder due to missing source option 2024-03-19 10:39:59 +01:00
Mario
569f243ebd Merge branch 'dev' into 9.0RC 2024-03-18 22:10:16 +00:00
Mario
651a3f8380 docu 2024-03-18 22:09:05 +00:00
Mario
40714ecdd0 changelog 2024-03-18 22:02:09 +00:00
Mario
d4b1bcd641 Merge branch 'dev' into 9.0RC 2024-03-18 09:12:58 +00:00
Mario
acc1834b0d make theme compatible with rc version 2024-03-18 09:12:35 +00:00
Mario
e237cf226a Merge branch 'dev' into 9.0RC 2024-03-18 09:10:34 +00:00
Mario
7c5a0887cc css fix 2024-03-18 09:10:07 +00:00
Mario
0745d0616a Merge branch 'dev' into 9.0RC 2024-03-17 21:34:06 +00:00
Mario
9cbb9a4874 theme min/max version and minor css fix 2024-03-17 21:30:50 +00:00
Mario
14f3b72c82 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-17 22:22:33 +01:00
Mario
b05845f495 cleanup some ancient code and fix check for $path so that it will not pass if theme_include() will not return anything. also add an empty zen.css file for the zen template 2024-03-17 22:21:55 +01:00
Mario
2114779037 Merge branch 'dev' into 9.0RC 2024-03-17 11:01:27 +00:00
Mario
937b6d360e fix hardcoded color attr 2024-03-17 11:00:50 +00:00
Mario
0d30eed4a7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-17 10:53:32 +00:00
Mario
39d4f67417 add Emoji to the AP schema 2024-03-17 10:53:09 +00:00
Mario
68d989c79e slightly adjust text sizing
(cherry picked from commit 9600789d6b)
2024-03-16 19:40:57 +00:00
Mario
9600789d6b slightly adjust text sizing 2024-03-16 19:39:48 +00:00
Mario
ea7559c158 RC2 2024-03-16 16:24:27 +00:00
Mario
baa12b7497 Merge branch 'dev' into 9.0RC 2024-03-16 16:23:32 +00:00
Mario
ac4aa6a9ea css fixes 2024-03-16 16:22:39 +00:00
Mario
732dbfd6f5 maybe git can be removed again now after the streams lib got removed?
(cherry picked from commit 5860abf46f)
2024-03-16 16:01:36 +00:00
Mario
5860abf46f maybe git can be removed again now after the streams lib got removed? 2024-03-16 15:50:58 +00:00
Mario
2874d3e1e1 Merge branch 'dev' into 9.0RC 2024-03-16 15:47:55 +00:00
Mario
42b0205ad0 apply the streams fixes manually until the addition of the streams library is sorted 2024-03-16 15:47:25 +00:00
Mario
36778850ee Merge branch 'dev' into 9.0RC 2024-03-16 12:18:46 +00:00
Mario
19c0e97658 add git again allthough it is not clear why it is required 2024-03-16 12:18:24 +00:00
Mario
fe018d646a more composer weirdness 2024-03-16 12:09:49 +00:00
Mario
24132e56d9 Merge branch 'dev' into 9.0RC 2024-03-16 11:56:44 +00:00
Mario
8fc0210428 Revert "another attmpt to install streams/php-jcs via composer"
This reverts commit 5af3c35778
2024-03-16 11:54:45 +00:00
Mario
64560cbca9 Revert "try installing git"
This reverts commit 0b4e086376
2024-03-16 11:54:07 +00:00
Mario
6e97c97920 Revert "remove streams folder"
This reverts commit 216f3755fc
2024-03-16 11:53:39 +00:00
Mario
916edcb45e Revert "really add streams folder"
This reverts commit f402baffd3
2024-03-16 11:53:16 +00:00
Mario
8873c10364 Merge branch '9.0RC' of https://framagit.org/hubzilla/core into 9.0RC 2024-03-16 11:50:42 +00:00
Mario
77e1220cf9 fix version 2024-03-16 11:50:16 +00:00
Mario
f402baffd3 really add streams folder 2024-03-16 11:48:27 +00:00
Mario
216f3755fc remove streams folder 2024-03-16 11:45:49 +00:00
Mario
d846cefade adjust encrypted content representation and also add it to bb_to_markdown
(cherry picked from commit f3efdbf230)
2024-03-15 22:36:44 +00:00
Mario
f3efdbf230 adjust encrypted content representation and also add it to bb_to_markdown 2024-03-15 22:34:27 +00:00
Mario
826ef11247 bump dev version 2024-03-15 19:05:55 +00:00
Mario
b68ddc4cd3 version, strings and dump composer autoload 2024-03-15 18:58:01 +00:00
Mario
41f909c415 update redbasic screenshot 2024-03-15 17:36:44 +00:00
Mario
0b4e086376 try installing git 2024-03-15 18:25:53 +01:00
Mario
5af3c35778 another attmpt to install streams/php-jcs via composer 2024-03-15 17:14:31 +01:00
Mario
dddcddc453 refactor sodium b2b encryption 2024-03-15 11:30:28 +00:00
Mario
754d90a676 fix overlay z-index 2024-03-14 19:21:01 +00:00
Mario
8b0dce56ad remove some now redundant css 2024-03-14 19:11:25 +00:00
Mario
42696606e3 wrong logic 2024-03-14 16:03:02 +00:00
Mario
b645ede168 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-14 13:35:39 +00:00
Mario
6e12b5ec08 fix shortnames replaced in html tags 2024-03-14 13:35:21 +00:00
Mario
fbf36992be Merge branch 'add-testing-doc' into 'dev'
Add some developer docs for the test system.

See merge request hubzilla/core!2113
2024-03-14 12:42:36 +00:00
Mario
e0de813700 Merge branch 'fix-test-setup-on-mariadb' into 'dev'
Fix test db setup on MySQL/Mariadb + changed default

See merge request hubzilla/core!2112
2024-03-14 12:42:04 +00:00
Harald Eilertsen
39448a0871 Fix test db setup on MySQL/Mariadb + changed default 2024-03-14 12:42:03 +00:00
Mario
4fb37ef6f3 revert adding of zip and bump composer php version to 8.1 2024-03-14 12:40:07 +00:00
Mario
a9d4adaf23 Revert "next try to use the streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151"
This reverts commit 70dfce356b.
2024-03-14 12:30:05 +00:00
Mario
70dfce356b next try to use the streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151 2024-03-14 11:15:20 +00:00
Mario
10fbfa06e9 add fix again after escaping composer hell 2024-03-14 11:06:32 +00:00
Mario
6315757967 Revert "use the streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151"
This reverts commit 81ce67df94.
2024-03-14 11:02:31 +00:00
Mario
9ddd840897 evert "fix deprecation warning"
This reverts commit 898762dd95.
2024-03-14 11:02:10 +00:00
Mario
6c5627ac0e Revert "update lock file"
This reverts commit a93fed5ae2.
2024-03-14 11:01:36 +00:00
Mario
c2d6d376a4 Revert "revert addition of zip"
This reverts commit 55532c7cb1.
2024-03-14 11:01:20 +00:00
Mario
55532c7cb1 revert addition of zip 2024-03-14 10:58:20 +00:00
Mario
a93fed5ae2 update lock file 2024-03-14 10:49:41 +00:00
Mario
ba1b48f177 lets try this 2024-03-14 10:45:09 +00:00
Mario
898762dd95 fix deprecation warning 2024-03-14 10:29:07 +00:00
Mario
81ce67df94 use the streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151 2024-03-14 10:18:51 +00:00
Mario
55097c47c5 Revert "composer update and use the fixed streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151"
This reverts commit 6bf61dfa6b.
2024-03-14 10:13:22 +00:00
Mario
97b82fc77b fix dreport links after recent changes 2024-03-14 09:53:40 +00:00
Mario
b7bda0b87d return false if we have nothing to look at 2024-03-14 09:47:08 +00:00
Mario
6bf61dfa6b composer update and use the fixed streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151 2024-03-14 09:35:09 +00:00
Mario
0e59cfb839 fix code comment 2024-03-13 14:08:56 +01:00
Mario
328ce0a837 fix another regression from last Lib/Config refactor which returned the default falue in case the value was an array. also add a testcase for this situation 2024-03-13 14:05:58 +01:00
Mario
34e24ea5e9 fix modal headerà 2024-03-12 09:11:53 +00:00
Mario
907426af5e deprecated function 2024-03-11 20:42:21 +00:00
Mario
360713c689 add sodium-plus js crypto library 2024-03-10 22:38:21 +00:00
Mario
ee8aba3221 implement sodium-plus library to replace unmaintained sjcl 2024-03-10 22:35:59 +00:00
Harald Eilertsen
ae657754b0 doc: Add some developer docs for the test system.
Not sure if this is too long, or if it would be better to split it into
multiple files. Also, still missing the "How to write your own tests"
section.
2024-03-10 21:41:11 +01:00
Mario
0a730935f5 remove superfluous () 2024-03-10 13:14:10 +01:00
Mario
d285da09fe add the file 2024-03-10 13:12:51 +01:00
Mario
b291f1bad3 move escape_tags() to Lib/Text.php and add test 2024-03-10 13:10:42 +01:00
Mario
e1b660bfa3 we usually use ENT_COMPAT for content, so stick to this 2024-03-10 10:06:15 +00:00
Mario
0036c0cde9 remove logging 2024-03-09 21:00:13 +00:00
Mario
49c1833a46 bump version 2024-03-09 20:58:53 +00:00
Mario
46fa26502b more work on emojis 2024-03-09 20:53:18 +00:00
Mario
ba1e705c61 passing null to mb_strlen() is deprecated 2024-03-08 10:28:48 +00:00
Mario
043e2ff58b check if term is set before processing it 2024-03-08 09:23:31 +00:00
Mario
deba1863f5 fix php warnings 2024-03-08 09:16:27 +00:00
Mario
0e27f010f9 start sending articles instead of notes by default 2024-03-08 08:44:16 +00:00
Mario
45b1be8962 inbound support for custom emojis 2024-03-08 08:42:50 +00:00
Mario
fe9ca30c5e list attachments in the original order 2024-03-07 10:38:08 +00:00
Mario
9e8ba5f6e2 add at the top to maintain original order 2024-03-07 10:16:35 +00:00
Mario
5207e1e774 remove unused include 2024-03-07 09:06:20 +00:00
Mario
c1228d6b6d whitespace 2024-03-07 10:01:46 +01:00
Mario
6262d351b7 fix deprecation warning and add test 2024-03-07 10:00:02 +01:00
Mario
27e57ff7aa fix another php warning 2024-03-06 20:52:36 +00:00
Mario
74fc7508f3 fix php warning 2024-03-06 20:49:01 +00:00
Mario
3eea4f475c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-03-06 21:10:24 +01:00
Mario
37b22fe542 fix unterminated entity reference error when dealing with domxpath and add a test 2024-03-06 21:08:46 +01:00
Mario
b5b8106e7a minor refactor 2024-03-06 16:08:53 +00:00
Mario
b77100ff6d update fullcalendar 2024-03-06 14:20:21 +00:00
Mario
5eb6572277 update composer libs 2024-03-06 13:57:07 +00:00
Mario
69bed9c889 minor mod thing fixes 2024-03-06 13:04:06 +00:00
Mario
3c88c5e66a cleanup context and introduce schema:identifier for future use 2024-03-06 13:02:22 +00:00
Mario
d40d62ac4f bump version 2024-03-05 10:10:23 +00:00
Mario
d23ed6b11f improve things display a little 2024-03-05 09:45:49 +00:00
Mario
1e2a4a57b6 Merge branch 'fix-admin-site-page' into 'dev'
Remove obsolete field for system lang from site admin page.

See merge request hubzilla/core!2111
2024-03-04 21:37:37 +00:00
Mario
7892eeb2d2 Thing > Page 2024-03-04 21:27:53 +00:00
Mario
d7ceb977da basic AS2 support for things 2024-03-04 21:24:21 +00:00
Harald Eilertsen
36d0594b8e Remove obsolete field for system lang from site admin page.
The field was commented out in the module, but still remained in the
template. This patch also removes some processing to discover available
languages whose result were not used.

This should fix https://framagit.org/hubzilla/core/-/issues/1840
2024-03-03 12:30:27 +01:00
Mario
3f32a5239d we are checking for null|array union type later - false would throw an error 2024-03-01 19:17:57 +00:00
Mario
15a7d2d4de Merge branch 'some-bbcode-cleanup' into 'dev'
Add some beginning tests for bbcode, and a bit of refactoring

See merge request hubzilla/core!2110
2024-03-01 16:18:07 +00:00
Harald Eilertsen
80ed2ff89a Add some beginning tests for bbcode, and a bit of refactoring 2024-03-01 16:18:07 +00:00
Mario
37a0343163 Merge branch 'update-doxygen-config' into 'dev'
Update Doxygen config for generating online API docs

See merge request hubzilla/core!2109
2024-03-01 16:14:00 +00:00
Mario
8529e2f14e Merge branch 'dba-transactions' into 'dev'
include/dba: Make Dba driver transaction aware.

See merge request hubzilla/core!2108
2024-03-01 16:11:24 +00:00
Mario
b73401bd7f handle imagick readImageBlob() exception 2024-03-01 16:01:53 +00:00
Mario
af839a0589 AS2 Follow/Ignore 2024-03-01 15:47:40 +00:00
Mario
4bbeb224f6 more cleanup 2024-02-29 21:11:39 +00:00
Mario
8435d9eb13 some cleanup 2024-02-29 17:35:05 +00:00
Mario
d97df1859f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-02-29 17:06:18 +00:00
Mario
46f67eaa1e AS2 Update and implement a first draft of AS2 Profile activities 2024-02-29 17:05:48 +00:00
System user; root
54451851bb changelog
(cherry picked from commit 5d64a9c90f)
2024-02-29 10:19:46 +00:00
System user; root
5b7387459c version 8.8.8 2024-02-29 11:05:01 +01:00
System user; root
5d64a9c90f changelog 2024-02-29 11:03:28 +01:00
System user; root
ffaa985339 streams compatibility 2024-02-29 11:01:30 +01:00
Mario
291e12574a more cleanup 2024-02-28 13:16:47 +00:00
Mario
fc5b5ba021 if we rename a folder in dav we should also move its content 2024-02-28 12:04:46 +00:00
Mario
056c55a963 bump version 2024-02-28 10:20:34 +00:00
Mario
02a0af3eef remove poke and mood from apps 2024-02-28 10:19:57 +00:00
Mario
96e8316633 some cloeanup after last commit 2024-02-28 10:04:22 +00:00
Mario
37878bf0a3 do away with deprecated activity types 2024-02-28 09:18:31 +00:00
Mario
b4f079c4b5 For now we will use standard Create verb for emoji reactions 2024-02-27 10:31:27 +00:00
Harald Eilertsen
18abfb11ef Update Doxygen config for generating online API docs
Enabled implicit brief descriptions (`JAVADOC_AUTOBRIEF`), and markdown
support (`MARKDOWN_SUPPORT`) for doc blocks. This means that we no
longer need to explicitly inclufe a `@brief` tag in the doc block, the
first full sentence will be regarded as the brief documentation if it's
not explicitly given. Also we can use Markdown formatting in the
comments, which is a bit nicer than the native Doxygen tags.

I also disabled the Doxygen_phpvarfilter, but leave it commented out. It
should not be needed anymore unless somebody is using an ancient version
of doxygen. (Don't do that!)

I also changed the heading a bit, removed "The" from "The Hubzilla", and
added a tagline. Feel free to revise to whatever conforms to the project
norms.
2024-02-27 11:08:18 +01:00
Harald Eilertsen
25dbc8a9f6 include/dba: Make Dba driver transaction aware.
This patch introduced database transaction support to the Dba driver via
the DbaTransaction class.

The goal of this is to allow the driver control over the creation and
finalization of database transactions.

Until now code that has needed transaction support has done so directly
by issuing "BEGIN", "ROLLBACK" and "COMMIT" commands to the underlying
database directly.

This has several disadvantages:

  - We do have no control or knowledge of whether any transactions being
	active.

  - Since transactions can not be nested, we run the risk of unrelated
	code trying to create a transaction when one is already active.

  - Code using transactions are not testable, as the test runner wraps
	all tests within a transaction to begin with.

This patch should eliminate all these problems.

A transaction is started by instantiating the DbaTransaction class:

    $my_transaction = new \DbaTransaction();

The transaction will automatically be _rolled back_ if it has not been
committed before the instance is destroyed. (When the variable holding
it goes out of scope, i.e when the containing function returns.)

A transaction is committed like this:

    $my_transaction->commit();

This will immediately commit the changes in the transaction, and the
transaction will be marked as committed, so it will not be attempted to
be rolled back on destruction.

I have chosen to "ignore" the problem of nested transactions by having
the DbaTransaction class _not_ initiate a new transaction if one is
already active. This also makes the rollback and commit actions of the
DbaTransaction class into no-ops.

An alternative would be to simulate nested transactions by using save
points if a transaction is already active. However, I'm unsure about
wether there's any safe way to avoid all potential pitfalls when doing
that.

In any case, nested transactions should preferably be avoided, and
afaict we don't rely on that in any of the existing code. The reason we
need to support it in some way is that it's needed for testing where the
code under test is creating a transaction on it's own. (Since each test
is run within a db transaction to begin with.)

Also, I have taken the liberty to assume a PDO based db driver for this
stuff. I don't think that's going to be a problem, as that's the only
thing supported by the rest of the code in any case.
2024-02-26 15:11:39 +01:00
Mario
c639704f3c more streams compatibility 2024-02-25 21:36:34 +00:00
Mario
3dd7394247 AS2 2024-02-25 19:29:50 +00:00
Mario
b860b730a9 simplify pleroma custom emoji stuff and some cleanup 2024-02-22 10:23:38 +00:00
Mario
17e2877c91 make sure to decode html special chars before sending over the wire and 2024-02-21 10:44:56 +00:00
Mario
b7bc28c333 update test 2024-02-20 15:09:11 +00:00
Mario
fb5a52cbde Merge branch 'bootstrap-new2-v5' into 'dev'
update to Bootstrap 5

See merge request hubzilla/core!2107
2024-02-20 15:08:44 +00:00
Mario
6d125d02d8 introduce get_actor() force flag to omit cache, rework contact refresh, special handling for announce by group, and revert change regarding friendica addressing anomality 2024-02-15 14:27:50 +00:00
Mario
0b18b35f5f require the intl extension for 2024-02-14 21:28:20 +00:00
Mario
9859008271 deal with inReplyTo array + some docu and style 2024-02-14 20:23:02 +00:00
Mario
423c36f67b improved checks in HTTPSig::find_headers() 2024-02-14 18:07:29 +00:00
Rocky
1e0195e439 update to Bootstrap 5 2024-02-14 15:02:31 +01:00
Mario
30271bb32f minor css adjustment 2024-02-14 11:33:31 +00:00
Mario
e2b1670d6c fix round buttons not being round 2024-02-13 21:14:03 +00:00
Mario
2bfdfbe3cc do not feed null to TimeZoneUtil::getTimeZone() 2024-02-13 15:00:41 +00:00
Mario
9a85421a0e we are now using the item uuid for the notification hash if available. since we can have more than one notification per item (e.g. tag and comment) also look for the notification type to make sure we get the right one 2024-02-13 14:05:30 +00:00
Mario
1fa59df6f3 Add test for a paragraph with a mention and some text 2024-02-13 13:01:09 +00:00
Mario
2c93294eea scss: show current color and add some help text 2024-02-13 12:28:11 +00:00
Mario
316829269a bump version 2024-02-13 11:57:55 +00:00
Mario
55236f86e0 move the empty recips check to store(). otherwise it might interfere with zot6 native addressing which is always empty 2024-02-13 11:19:28 +00:00
Mario
060210e930 consider a message arriving to our inbox with no recipients (as seen from friendica) a direct message 2024-02-13 11:00:49 +00:00
Mario
9291622885 fix logic so that direct messages will be allowed in case the send_mail permission is granted even if the send_stream permission is not granted 2024-02-13 10:48:06 +00:00
Mario
07978a061e mb_strlen() will return 2 for some emojis - possibly grapheme_strlen() will be better for this job 2024-02-13 09:22:12 +00:00
Mario
08b2356ed1 add sample scss file 2024-02-12 22:09:07 +00:00
Mario
d17934ed80 scss: more options and some fixes 2024-02-12 22:07:54 +00:00
Mario
94f17f0dae use primary color 2024-02-10 22:22:03 +00:00
Mario
7ccb2a2615 custom sass bootstrap builds for channels and site 2024-02-10 22:04:24 +00:00
Mario
067a66b927 fix some whitespace issues after recent changes 2024-02-09 11:20:46 +00:00
Mario
096fad5e8c another try 2024-02-09 08:02:58 +00:00
Mario
e21e4c7127 let's try this 2024-02-09 07:33:13 +00:00
Mario
5754ea828d move parsing of a tags upà to fix an issue where mentions arriving from masto did not parse correctly, fix typo when restoring temporary linebreaks and remove redundant codeline when converting span tags 2024-02-08 20:22:26 +00:00
Mario
5fbc203367 mark items verified in zot delivery also if either LDSignature or EddsaSignature verified 2024-02-08 19:32:40 +00:00
Mario
08884c44fb whitespace 2024-02-08 19:15:00 +00:00
Mario
bd04ca21a4 Merge branch 'minor-markdown-fixes' into 'dev'
Minor markdown fixes

See merge request hubzilla/core!2098
2024-02-08 19:14:29 +00:00
Harald Eilertsen
19ae8cfdfc Support code blocks with language in markdown and html. 2024-02-08 10:00:12 +01:00
Harald Eilertsen
86e953f495 Fix: Preserve hard linebreaks from markdown and html 2024-02-07 22:34:13 +01:00
Mario
4bc4f5b2a6 update docu and remove redundant pernission check after vonv fetch fixes 2024-02-07 15:56:54 +00:00
Mario
5f2e808497 add uuid to dreport for internal use and and fix issues with conversation fetches 2024-02-07 15:37:20 +00:00
Harald Eilertsen
4f69e02768 Don't concert html nodes with no bbcode equivalent. 2024-02-07 16:02:53 +01:00
Harald Eilertsen
e6ce2885c0 Fix: Keep indentation in html and md code blocks.
Moves the logic for unwrapping broken lines in html (and Markdown) to
the node processing, instead of doing it over the full html content.
This allows us to skip if for code blocks (aka `<code>` elements within
`<pre>` elements).
2024-02-07 15:54:40 +01:00
Harald Eilertsen
ec19ee9d82 Fix convert code blocs from markdown/html to bbcode 2024-02-06 18:39:51 +01:00
Harald Eilertsen
983f063d33 Fix image with alt text for html/md to bbcode 2024-02-06 16:23:39 +01:00
Harald Eilertsen
eb6a143fff Add some tests for markdown to bbcode conversion. 2024-02-06 16:19:30 +01:00
Harald Eilertsen
1881029040 Clean up markdowntest and fix bb to markdown test. 2024-02-06 11:43:32 +01:00
Mario
209651705d fix custom emoji reactions arriving from pleroma 2024-02-04 19:50:31 +00:00
Mario
fab3c92a7c streams collection branch compatibility 2024-02-02 20:23:06 +00:00
Mario
8ad7376865 more fix conv_list template 2024-02-01 17:12:43 +00:00
Mario
c41831aff9 fix conv_list template 2024-02-01 17:05:00 +00:00
Mario
8515aa6966 fix issues related to b64mid to uuid conversion 2024-02-01 16:29:23 +00:00
Mario
691de5bf2e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-02-01 16:00:36 +00:00
Mario
2e155892fe testing JcsEddsa2022 sigs 2024-02-01 16:00:17 +00:00
Mario
6680c2faf3 Merge branch 'add-ci-job-for-mariadb' into 'dev'
CI: Add job for MariaDB 10.6

See merge request hubzilla/core!2097
2024-02-01 14:22:48 +00:00
Mario
decc8f2162 strip a possible fragment 2024-02-01 14:14:53 +00:00
Mario
7d7a0c160f bump version 2024-02-01 13:27:09 +00:00
Mario
e89563eb4c fix edgecase for notices and make mod hq backwards compatible 2024-02-01 13:25:40 +00:00
Mario
dd204ec34f start using uuid for internal reference instead of base64 encoded mid 2024-02-01 11:42:55 +00:00
Mario
b3a5dd8aa8 store seen mids in session instead of cache and increase sess_data column to medium text 2024-01-31 13:29:56 +00:00
Mario
26ee56f39c remove logging 2024-01-29 10:39:15 +00:00
Mario
300b0e27bd bump version 2024-01-29 10:35:48 +00:00
Mario
29489f62cf introduce Activity::init_background_fetch() and refactor zotconvo to implement it 2024-01-29 10:33:13 +00:00
Mario
09465619e5 enable object cash by default, introduce system.cache_expire_days and default to 7, default system.default_expire_days to 30 and system.active_expire_days to 7 2024-01-28 17:03:05 +00:00
Mario
390af7722d fix last commit 2024-01-28 15:03:40 +00:00
Mario
e18157f818 make sure we return an array if there is no cache entry 2024-01-28 11:35:15 +00:00
Mario
5435d2881c Merge branch 'dev' into 'dev'
Added Circle Person Avatar

See merge request hubzilla/core!2096
2024-01-27 20:26:29 +00:00
Mario
2e8f3d1869 Merge branch 'upgrade-ci-to-mysql-8.0' into 'dev'
CI: Upgrade to use MySQL version 8.0

See merge request hubzilla/core!2093
2024-01-27 20:21:13 +00:00
Mario
3ad1cab006 Merge branch 'doc-updates' into 'dev'
Doc updates

See merge request hubzilla/core!2092
2024-01-27 20:20:18 +00:00
Mario
b806a3ccc2 use std functions 2024-01-27 20:18:28 +00:00
Mario
5e780ba089 implement short time object cache to reduce network calls and some cleanup 2024-01-27 16:36:26 +00:00
Mario
c0a7dfe2f6 refactor fetch_and_store_parents() and inroduce the fetchparents daemon 2024-01-25 10:13:10 +00:00
Mario
fe50d78a0f missing hook 2024-01-24 19:34:41 +00:00
Mario
e513950cb5 restructure Libzot::process_delivery() 2024-01-24 16:44:42 +00:00
Mario Vavti
adc6390a22 bump version 2024-01-24 16:41:03 +01:00
Mario Vavti
9449e8bd61 fix issue where if an item is created and deleted again before the notifier has completed the queueworker will dismiss the delete because it looks like a duplicate entry 2024-01-24 16:40:05 +01:00
Mario
f13af0f60b process source xchan in xchan_query() 2024-01-23 08:46:18 +00:00
Harald Eilertsen
acdb773f89 CI: Add job for MariaDB 10.6
Reuse job definition for mysql job, and alias the mariadb service to
mysql so that the job will find it.
2024-01-22 12:44:36 +01:00
Mario
651a288148 set item_uplink to 0 just to be sure (this should not be necessary) 2024-01-22 09:17:55 +00:00
Mario
b0664f7349 store the original announce actor (the one that pushed the item into our stream first) in source_xchan instead of owner_xchan. this way we will preserve the real owner for the thread and not have conflicts when dealing with deletes of comments or likes 2024-01-22 09:09:41 +00:00
Scott M. Stolz
51586037e1 Added Circle Person Avatar
Added an additional avatar to choose from.
2024-01-21 16:11:35 -06:00
Harald Eilertsen
f573c1772a CI: Slight refactoring. 2024-01-21 22:51:42 +01:00
Harald Eilertsen
f08e91e19d CI: Upgrade to use MySQL version 8.0
This is the oldest version we support now.
2024-01-21 17:50:06 +01:00
Harald Eilertsen
8cd9fff26a Add some developer doc for check_account_password hook 2024-01-21 17:43:35 +01:00
Harald Eilertsen
d489a2854e Update admin guide with min supported db versions 2024-01-21 17:42:42 +01:00
Mario Vavti
9cfd1c2318 missing include 2024-01-21 09:52:13 +01:00
Mario
2dd0677d23 Merge branch 'dont-include-db-updates-in-test-coverage' into 'dev'
Don't include db updates in test coverage.

See merge request hubzilla/core!2090
2024-01-19 20:36:04 +00:00
Mario
00d403e729 Merge branch 'improve-validate-email' into 'dev'
Improve validate_email function

See merge request hubzilla/core!2088
2024-01-19 20:35:43 +00:00
Mario
d83e2daf36 Merge branch 'fix-postgres-ci' into 'dev'
tests: Remove id from db fixtures.

See merge request hubzilla/core!2087
2024-01-19 20:33:36 +00:00
Mario
8fe6aede03 bump version 2024-01-19 20:11:35 +00:00
Mario
fa4ab45692 native repeats continued 2024-01-19 20:10:50 +00:00
Mario Vavti
f57fbaa5dd version 8.8.7 2024-01-19 11:07:23 +01:00
Mario Vavti
aba8002170 Fix regression in Activity::actor_store()
(cherry picked from commit 9cc85adf47)
2024-01-19 10:03:58 +00:00
Mario Vavti
9cc85adf47 Fix regression in Activity::actor_store() 2024-01-19 11:02:13 +01:00
Harald Eilertsen
01ed001041 Don't include db updates in test coverage.
We're not likely to add tests for these in any case.
2024-01-16 10:13:24 +01:00
Harald Eilertsen
403539919a Improve the validate_email function
The validate_email function relied on doing an actual domain lookup (on
supported platforms) to validate the domain of the email address. This
does not work too well in testing environments where we may not want to
spam the DNS system, if it at all is available.

Apart from the the function did very little to actually verify that it
was a valid email address.

This patch tries to change that by usng a somewhat stricted regex based
validation. While this may not be perfect, it should be good enough in
the vast majority of cases. For platforms where no validation was
performed with the old version, it will at least be an improvement.

Also, it allows testing without having an external network connection.

Also clarify the doc comment, that it does not actually try to resolve
the email address, just the domain.
2024-01-15 19:52:31 +01:00
Harald Eilertsen
52ea2fa33e Update CI run to archive dbfail.out if test run fails 2024-01-15 19:32:19 +01:00
Harald Eilertsen
ecd4754f6d tests: Enable debug logging during tests
The debug log will be stored in the test/results directory, and archived
as part of the artifacts of the CI run. This should make it easier to
get some debugging info out from the CI runs if they fail.
2024-01-15 19:25:09 +01:00
Harald Eilertsen
f71033b30d tests: Remove id from db fixtures.
It seems that PostgreSQL will not update the autoincrement index of the
table when inserting rows with an id set. Later inserts without an id
set will then fail, because they get assigned an id that already exists.

MySQL seems to handle this just fine.

Why the id column was added in the first place, one may wonder, but
that's how it were.

In any case, this broke the PostgreSQL tests in the gitlab CI
environment. (While it mysteriously worked in my local ddev
environment.) Anyways, the id column is not needed, and things work
better without them.
2024-01-15 19:11:25 +01:00
Mario
885068834f fix more php deprecations 2024-01-14 19:58:36 +00:00
Mario
c4c4ab2f3d fix regression in commit b05b7561 2024-01-14 19:52:05 +00:00
Mario
aec3247952 fix more php deprecations 2024-01-14 19:40:59 +00:00
Mario
b05b756148 Handling HTML entities via mbstring is deprecated 2024-01-14 17:23:57 +00:00
Mario
03819abb22 remove acct from webfinger 2024-01-14 17:23:19 +00:00
Mario
d074e2aba0 fix more php deprecations 2024-01-14 17:22:33 +00:00
Mario
2bbecfe8dd only attempt fetch if zotfinger actually returned something 2024-01-14 10:11:20 +00:00
Mario
e078e13325 make sure we are dealing with an array 2024-01-14 09:40:18 +00:00
Mario
9d3b852d38 fix wrong array key 2024-01-14 08:10:27 +00:00
Mario
fadb0a5bf2 check for assertionMethod 2024-01-13 20:45:32 +00:00
Mario
fa7aa6cedb start checking integrity proofs, remove signature prior to verify, iterate trough the array to find the desired ekey in actor_store() 2024-01-13 20:38:34 +00:00
Mario
6df98f2fad private -> public 2024-01-13 19:10:44 +00:00
Mario
c597017402 fix some deprecation warnings 2024-01-13 17:38:31 +00:00
Mario
9cb95f6065 store epubkey in actor_store 2024-01-13 16:19:53 +00:00
Mario
477b1535a2 start storing epubkeys in libzot 2024-01-13 15:28:20 +00:00
Mario
1d652cfcbd expose epubkey in zotinfo 2024-01-13 15:09:39 +00:00
Mario
28b604c7c7 typo 2024-01-13 13:46:40 +00:00
Mario
8c11be07cd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-01-13 08:51:19 +00:00
Mario
e8dd2c28ff make our jsonld parser happy 2024-01-13 08:50:57 +00:00
Mario Vavti
0bdffc4a2d make our jsonld parser happy 2024-01-13 08:49:14 +01:00
Mario
94b1fe4a8b Merge branch 'cherry-pick-96ae46c5' into 'dev'
Update lostpass_eml.tpl

See merge request hubzilla/core!2086
2024-01-11 17:15:38 +00:00
Mario
11ed445319 Merge branch 'cherry-pick-ddfa613e' into 'dev'
Update Spanish strings

See merge request hubzilla/core!2085
2024-01-11 17:15:21 +00:00
Mario Vavti
400dfb4e6b version 8.8.6 2024-01-11 17:57:51 +01:00
Mario
6b951734ce changelog
(cherry picked from commit 000fcfd1ac)
2024-01-11 16:56:13 +00:00
Mario
000fcfd1ac changelog 2024-01-11 16:55:44 +00:00
Mario
051e2ed6cd provide some more jsonld builtins
(cherry picked from commit aac406a245)
2024-01-11 16:40:16 +00:00
Mario
aac406a245 provide some more jsonld builtins 2024-01-11 16:27:57 +00:00
Mario Vavti
ef2952b5fd libsync: dev branch compatibility 2024-01-11 17:00:47 +01:00
Mario
ffdf54b097 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-01-10 13:34:23 +00:00
Mario
58593d7da6 prepare outbound fep-8b32 (object integrity) but do not enable yet since the additional context seems to break ldsig for some reason, introduce Activity::build_packet() and Activity::ap_context() to reduce code duplication, implement fep-2c59 (webfinger) and some cleanup 2024-01-10 13:33:57 +00:00
mjfriaza:4GF~eYj,-iAv
3d13f36ce2 Update lostpass_eml.tpl
(cherry picked from commit 96ae46c5a4aa614b9aed7b640d69e8cd8210595f)
2024-01-09 12:52:48 +00:00
mjfriaza:4GF~eYj,-iAv
8c843ec6d0 Update Spanish strings
(cherry picked from commit ddfa613e828e8f0a569a2d938d3839f5608bc9c3)
2024-01-09 12:49:55 +00:00
Mario
232c7f5301 Merge branch 'tests/includes/account' into 'dev'
Some test cleanup and tests for check_account_email

See merge request hubzilla/core!2083
2024-01-09 08:05:28 +00:00
Harald Eilertsen
16cd8caef3 tests: Add tests for check_account_email 2024-01-08 14:09:13 +01:00
Harald Eilertsen
43dabee53d tests: Set app config in a known state for each test 2024-01-08 14:09:13 +01:00
Harald Eilertsen
f016760851 tests: Add config fixtures.
Adds fixtures for the config table:
- Disables dns checking globally for the tests.
- Adds a few disallowed email domains and addresses.
2024-01-08 14:09:13 +01:00
Harald Eilertsen
99b5166f21 tests: Clean up unused debug stuff from UnitTestCase 2024-01-08 14:01:02 +01:00
Mario
4aa29db7aa reflect new fields in low level functions 2024-01-07 21:27:12 +00:00
Mario
f5b8b18c8e Merge branch 'tests/remove-behat' into 'dev'
Remove unused acceptance tests and dependencies

See merge request hubzilla/core!2082
2024-01-07 21:00:40 +00:00
Mario
6e5566f9c8 bump version 2024-01-07 20:38:40 +00:00
Mario
ca216ae819 set default value for postgres only 2024-01-07 20:34:47 +00:00
Mario Vavti
4713241444 set a default value 2024-01-07 21:18:20 +01:00
Mario
4917170a0d remove logging 2024-01-07 20:00:29 +00:00
Mario
87775ae37a ekey and xchan_updated updates 2024-01-07 19:58:09 +00:00
Harald Eilertsen
eaa244a2a3 CI: Install pecl extensions after system packages.
The php yaml extension requires libyaml, which has to be installed
first.
2024-01-07 20:39:06 +01:00
Harald Eilertsen
db91d66d1a CI: Install yaml extension from PECL. 2024-01-07 20:35:08 +01:00
Harald Eilertsen
4d64481564 Remove unused acceptance test stuff from source tree. 2024-01-07 20:26:14 +01:00
Harald Eilertsen
0a31fc176c Remove behat as dev dependency.
As the Symphony\Yaml stuff disappeared with behat, we need another way
to load read the yaml files with database fixtures for the integration
tests.

As the php yaml extension is not distributed with PHP by default, this
creates it as another dev dependency!
2024-01-07 20:24:52 +01:00
Harald Eilertsen
659a8c967c Exclude dev dependencies from version control.
This will ignore dependencies only installed as part of the dev setup.
2024-01-07 19:39:49 +01:00
Harald Eilertsen
626887a792 Exclude phpunit cache from version control 2024-01-07 19:25:01 +01:00
Mario
256b66de41 Revert "DB update 1260 - REQUIRES SODIUM PHP EXTENSION!!!"
This reverts commit 5ee4f37b8d
2024-01-07 15:50:50 +00:00
Mario
5ee4f37b8d DB update 1260 - REQUIRES SODIUM PHP EXTENSION!!! 2024-01-07 15:34:25 +00:00
Mario
3dc122db84 fix regression collapsing non conv item content 2024-01-07 10:43:43 +00:00
Mario
99c5a4e2f8 we do not use named params yet 2024-01-06 16:44:17 +00:00
Mario
f922a92ffa install bcmath 2024-01-06 16:37:11 +00:00
Mario
a36de8ba1a Merge branch 'tests/fix-db-and-ci-integration' into 'dev'
tests: Integrate the DB in "unit" tests.

See merge request hubzilla/core!2081
2024-01-06 16:34:39 +00:00
Harald Eilertsen
e3d30763da tests: Integrate the DB in "unit" tests. 2024-01-06 16:34:38 +00:00
Mario
c73518d8ec dump composer autoload 2024-01-06 16:31:42 +00:00
Mario
ed0d2fed66 require bcmath or gmp extension 2024-01-06 16:23:26 +00:00
Mario
960bcb6b53 port test for JcsEddsa2022 from streams 2024-01-06 16:12:25 +00:00
Mario
6252340804 add Bookmark and Category to ap schema and bump ap schema version 2024-01-06 10:03:44 +00:00
Mario
517d67b2e0 add check for sodium on setup 2024-01-05 20:16:13 +00:00
Mario
e95b7ca3a0 require ext-sodium, dump composer autoload and a minor js fix 2024-01-05 19:30:37 +00:00
Mario
c771d7c31a Ãdisplay selected mid in an open state - issue #1425 2024-01-05 12:53:00 +00:00
Mario
ce0e8d7497 update apache rewite rule to fix issue with recent apache versions - issue #1822 2024-01-05 11:06:08 +00:00
Mario
852678e238 port multibase and jcsedssa2022 libs from streams 2024-01-03 19:20:28 +00:00
Mario
16e6eec3fb composer add mmccook/php-json-canonicalization-scheme 2024-01-03 11:09:22 +00:00
Mario
afe8552be6 comÃposer add tephenhill/base58 2024-01-03 11:07:03 +00:00
Mario
cd0e50da24 update symfony/polyfill-php81 2024-01-03 11:00:20 +00:00
Mario
85001c034b update sabre/vobject 2024-01-03 10:58:31 +00:00
Mario
a56f6576e2 update ramsey/uuid 2024-01-03 10:57:15 +00:00
Mario
d3e5d05026 update ezyang/htmlpurifier 2024-01-03 10:56:03 +00:00
Mario
322b619a71 update sabre/dav 2024-01-03 10:53:37 +00:00
Mario
dff906ca69 bump version 2024-01-02 20:50:50 +00:00
Mario
515d1d5e63 postgres does not like binaries to be string while mariadb/mysql does not seem to care - let's see 2024-01-02 20:49:57 +00:00
Mario
bb6ed22594 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-01-01 20:35:28 +00:00
Mario Vavti
d655e1d765 version 8.8.5 2024-01-01 21:30:45 +01:00
Mario Vavti
db70ed006d Merge branch 'dev' 2024-01-01 21:29:53 +01:00
Mario Vavti
ce1dd5c632 changelog 2024-01-01 21:29:15 +01:00
Mario Vavti
9e2a253dda Merge branch 'dev' 2024-01-01 21:21:04 +01:00
Mario
95c645865d Merge branch 'doc-fixes' into 'dev'
docs: Update admin guide requirements

See merge request hubzilla/core!2080
2024-01-01 20:17:52 +00:00
Mario
ceb510bbf5 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2024-01-01 20:04:44 +00:00
Mario
2590e3c99b reveal repeat 2024-01-01 20:04:24 +00:00
Mario Vavti
f2f9cfaf28 Work around possible loop and use Lib/Config in init 2024-01-01 21:01:47 +01:00
Mario Vavti
62db8c3969 fix php errors and deprecation warnings 2023-12-31 09:55:27 +01:00
Mario Vavti
ae3db366e5 deprecate simplepie idna_convert 2023-12-31 09:54:54 +01:00
Harald Eilertsen
57570c144a doc/admin-guide: Update min php version and reqd extensions. 2023-12-26 15:34:50 +01:00
Mario
c3a235242e do not double process quoted strings 2023-12-21 10:19:26 +00:00
Mario
b629eb5657 fix merge conflict 2023-12-20 12:32:15 +00:00
Mario
2e674cd0b3 version 8.8.4 2023-12-20 12:26:28 +00:00
Mario
3330e9a19a Merge branch 'dev' 2023-12-20 12:25:43 +00:00
Mario
c5f6208396 changelog 2023-12-20 12:25:27 +00:00
Mario
c0d93bbcf4 Merge branch 'dev' 2023-12-20 12:20:04 +00:00
Mario
db941e7007 changelog 2023-12-20 12:17:35 +00:00
Mario
4761857157 Revert "changelog"
This reverts commit 3aefe23184.
2023-12-20 12:15:42 +00:00
Mario
3aefe23184 changelog 2023-12-20 12:15:24 +00:00
Mario
6f852814fd move App::$install check to Config::Load() as suggested by Harald 2023-12-20 11:58:33 +01:00
Mario
b15e521b0e Merge branch 'fix-config-deserialization' into 'dev'
Fix deserialization of config values broken by 69266cd6.

See merge request hubzilla/core!2077
2023-12-20 10:27:56 +00:00
Mario
63c401e6d6 Merge branch 'extend-siteinfo' into 'dev'
Add active addons and blocked sites to siteinfo (html)

See merge request hubzilla/core!2079
2023-12-20 10:16:44 +00:00
Harald Eilertsen
e59750e8de Add active addons and blocked sites to siteinfo (html)
This adds information about addons activated on the hub, as well as
which other sites this hub won't federate with in the HTML version of
siteinfo.

Based on suggestions by @rockyiii@huby.infozoo.de.
2023-12-18 15:05:23 +01:00
Harald Eilertsen
9c184ddfd0 Fix deserialization of config values broken by 69266cd6.
This should fix issue #1828.

This patch makes it explicit that we store arrays in the config as json
encoded arrays, while we allow both json encoded and PHP serialized
arrays to be deserialized correctly. Unless it's a brand new install,
the existing data in the database will be PHP serialized.

I've also added a hardening measure in case we fall back to PHP
unserialize, making sure we're not vulnerable to a PHP Object Injection
attack. This means that deserializing arrays containing PHP objects will
no longer work, but afaict we never do that anyways, so I don't think
that should break anything.
2023-12-17 19:30:05 +01:00
Mario
9df6e821d8 use reqiure_once() - second part of issue #1827 2023-12-17 16:47:19 +00:00
Mario
9551dc5ecd fix loop as described in issue #1827 2023-12-17 16:36:13 +00:00
Mario
d372daff60 Revert "check return from Config::Load() and retry on failure plus cleanup"
This reverts commit 69266cd6c6
2023-12-17 11:16:58 +00:00
Mario
f742e6e394 Merge branch 'dev' 2023-12-17 08:53:32 +00:00
Mario
414b2b0e4c changelog 2023-12-17 08:53:14 +00:00
Mario
603c5692ae Merge branch 'dev' 2023-12-17 08:50:39 +00:00
Mario
b35e994d1b Merge branch 'translations-nb_no' into 'dev'
More translations for Norwegian Bokmål (nb_NO)

See merge request hubzilla/core!2075
2023-12-17 08:50:13 +00:00
Mario
abe2ab229a version 8.8.3 2023-12-17 08:43:08 +00:00
Mario
5ad9939bcf Merge branch 'dev' 2023-12-17 08:41:48 +00:00
Mario
ce451128ba changelog 2023-12-17 08:41:21 +00:00
Mario
70470016cc Merge branch 'dev' 2023-12-17 08:35:33 +00:00
Harald Eilertsen
2122ea77e1 More translations for Norwegian Bokmål (nb_NO) 2023-12-16 14:57:01 +01:00
Mario Vavti
69266cd6c6 check return from Config::Load() and retry on failure plus cleanup 2023-12-14 12:32:34 +01:00
Mario Vavti
062d61567e return if we could not fetch the author 2023-12-14 12:06:50 +01:00
Mario Vavti
d6120fc908 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-12-14 12:06:21 +01:00
Mario
91f8e7a07b typo 2023-12-13 14:34:34 +00:00
Mario Vavti
f57d89245c add the app terms before syncing - otherwise the terms will be reset at the other end 2023-12-08 21:44:32 +01:00
Mario Vavti
c307a71f53 Merge branch 'dev' 2023-12-08 18:08:03 +01:00
Mario Vavti
1e4e59bb57 if it is not an array do not attempt count() 2023-12-08 18:02:54 +01:00
Mario
f62d16d274 Merge branch 'dev' 2023-12-06 11:27:54 +00:00
Mario
f175712d4b typo 2023-12-06 11:27:35 +00:00
Mario
5f942d78e6 Merge branch 'dev' 2023-12-06 11:23:21 +00:00
Mario
538c8885ad changelog 2023-12-06 11:23:02 +00:00
Mario
c8158c3d62 vesrion 8.8.2 2023-12-06 11:14:00 +00:00
Mario
1f4762060f Merge branch 'dev' 2023-12-06 11:12:25 +00:00
Mario
81c3682781 more issue #1820 2023-12-06 09:47:13 +00:00
Mario
2e6e1fdd55 css fixes 2023-12-04 09:28:16 +00:00
Mario
1a09cd560b require acl_selectors.php - fix issue #1820 2023-11-30 08:02:33 +00:00
Mario
8c9d2bc6f6 Merge branch 'dev' 2023-11-27 08:48:47 +00:00
Mario
78ad5ca713 changelog 2023-11-27 08:48:23 +00:00
Mario
43c2e71b25 Merge branch 'dev' 2023-11-27 08:45:19 +00:00
Mario
5b9f32fade Merge branch 'dev' into 'dev'
Update doubleleft.css and doubleright.css according to v.8.8 default.css

See merge request hubzilla/core!2074
2023-11-27 08:44:25 +00:00
Mario
76a1a6da34 version 8.8.1 2023-11-27 08:42:09 +00:00
zlaxy
a2b0abc90d Update doubleleft.css and doubleright.css according to v.8.8 default.css 2023-11-27 10:50:31 +03:00
Mario
0fd8e02a88 Merge branch '8.8RC' 2023-11-25 17:12:28 +01:00
Mario
55c4bfb670 version 8.8 2023-11-25 17:11:07 +01:00
Mario
ea1030f8bf Merge branch 'dev' into 8.8RC 2023-11-25 17:06:55 +01:00
Mario
6dd285811a changelog 2023-11-25 17:06:25 +01:00
Mario
ee149ed1eb Merge branch 'dev' into 8.8RC 2023-11-25 17:05:08 +01:00
Mario
c3aa96d423 update changelog 2023-11-24 14:40:58 +01:00
Mario
6e59d95da5 Merge branch 'dev' into 8.8RC 2023-11-23 20:25:13 +00:00
Mario
a396e74a79 like in get_cached_actor() also remove fragment in get_actor() 2023-11-23 13:21:56 +00:00
Mario
80bdb39ae3 case insensitive digest algo 2023-11-22 16:41:44 +00:00
Mario
5cb1a9dcc6 Merge branch 'dev' into 8.8RC 2023-11-22 16:21:58 +00:00
Mario
1cfa81450c remove follow (does not make any sense to add follow link of the logged in channel), add startpage 2023-11-21 08:07:40 +00:00
Mario
1f18fed3a2 add additional observer and channel info to nav if applicable 2023-11-21 08:01:03 +00:00
Mario
33cb429e15 remove unused variable 2023-11-20 21:56:31 +00:00
Mario
cfdbf02e6b the additional parameter has been deprecated there is no need to check the version anymore 2023-11-20 21:52:40 +00:00
Mario
f8c631a3f0 Merge branch 'dev' into 8.8RC 2023-11-20 20:32:46 +00:00
Mario
74911e9f6d revert dreport changes - too chatty 2023-11-20 20:32:14 +00:00
Mario
0f453ae4cf version 8.8RC2 2023-11-20 20:27:35 +00:00
Mario
febebc8d3d more do not provide channel info for templates and code cleanup 2023-11-20 20:21:03 +00:00
Mario
166c45f97f do not provide channel info for templates 2023-11-20 19:22:06 +00:00
Mario
af58364fef only check for privacy mismatch if observer != owner 2023-11-17 07:50:10 +00:00
Mario
eadf83d61b work around a possible privacy mismatch when processing zot requests 2023-11-16 15:57:03 +00:00
Mario
3c20231aad add backlink to profile to profile vcard and adjust switch colors for better visibility 2023-11-15 22:11:20 +00:00
Mario
402bf395d1 bump dev version 2023-11-10 08:25:10 +00:00
Mario
9a45938fe6 run composer dump-auotoload 2023-11-10 08:20:57 +00:00
Mario
d963e4a2c4 version and strings 2023-11-10 08:15:57 +00:00
Mario
1063a67ae2 a possible fix for issue #1816 2023-11-09 21:37:28 +00:00
Mario
602ef883bb version 2023-11-09 21:00:52 +00:00
Mario
aad6042d42 DB Update 1259 2023-11-09 20:09:49 +00:00
Mario
85d8c1a97e some low level work on native repeats 2023-11-09 19:32:29 +00:00
Mario
547e6542ba move color_mode related code to theme_init.php 2023-11-07 10:09:31 +00:00
Mario
f74044f9b0 Merge branch 'owa_improvement' into 'dev'
work with Mastodon-style keyId

See merge request hubzilla/core!2060
2023-11-07 08:46:15 +00:00
Mario
42651707f8 check if required keys are set 2023-11-07 08:40:34 +00:00
Mario
95c13eaf5a remove logging 2023-11-07 08:34:13 +00:00
Mario
c74068ae4d libzot: correctly attribute streams repeats 2023-11-07 08:33:22 +00:00
Mario
ca92dd0299 bbcode: do not overrule default list style 2023-11-07 08:30:27 +00:00
Mario
798f791b6b simplepie: fix fatal error with php 8.2 - issue is filed upstream but probably will not be fixed any time soon 2023-11-07 08:28:42 +00:00
Mario
331622309f if channel is not defined we need to provide an empty array 2023-11-01 15:47:16 +00:00
Mario
4f334525c2 only show tools to creators if they still have perms 2023-11-01 15:38:53 +00:00
Mario Vavti
82e704ec5b remove the directory updates entry if the channel was removed
(cherry picked from commit 67aaa97904)
2023-10-26 14:08:33 +00:00
Mario Vavti
67aaa97904 remove the directory updates entry if the channel was removed 2023-10-26 16:06:15 +02:00
Mario
4f55248a6c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-10-25 13:06:24 +00:00
Mario
61b46f1a3e add stats logging to zotfinger 2023-10-25 13:05:56 +00:00
Mario Vavti
286104a988 slightly less noise when logging normal 2023-10-25 14:45:26 +02:00
Mario Vavti
8ea6ead08a use Activity::get_actor() which will check for the cache record in xconfig before fetching 2023-10-21 21:42:14 +02:00
Mario
bd9cc23681 update logger statements 2023-10-20 09:30:52 +00:00
Mario
f2d7298cf4 check if we have the record in the short time cache before actually fetching it 2023-10-20 09:30:29 +00:00
Mario
da636ca881 css fix 2023-10-20 09:27:53 +00:00
Mario
39bfa30185 css fix 2023-10-19 11:27:50 +00:00
Mario
d7c005a2f1 refactor actor_store() 2023-10-19 06:59:13 +00:00
Mario
763b69bf5b enable reset button in mod rpost 2023-10-12 08:39:18 +00:00
Mario
2f2e353ece use new lang detect library which supports much more languages 2023-10-07 16:00:34 +00:00
Mario Vavti
0092b7c0a4 should be tinyint instead of numeric for mysql 2023-10-06 14:28:59 +02:00
Mario Vavti
9f48109640 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-10-06 14:24:51 +02:00
Mario Vavti
b976adb8aa add missing columns in install script 2023-10-06 14:24:33 +02:00
Mario
fe38c81e07 use the correct variable 2023-10-06 08:50:11 +00:00
Mario
fed9bc7072 use encode_person() instead of plain xchan_url since the function makes some special effort to determine the real actor id 2023-10-06 08:49:36 +00:00
Mario
044e252d19 composer update html to markdown 2023-10-05 11:35:02 +00:00
Mario
6920fb2793 composer update oauth2 server 2023-10-05 11:33:28 +00:00
Mario
3d1171de8d composer update smarty 2023-10-05 10:24:46 +00:00
Mario
6e09754d06 rever iconv in gitlab ci 2023-10-05 10:20:03 +00:00
Mario
32f2de17d4 composer update bootstrap 2023-10-05 10:17:07 +00:00
Mario
600e8081a8 fix regression 2023-10-05 09:29:53 +00:00
Mario
59fd7c3c9a css fix 2023-10-04 19:15:53 +00:00
Mario Vavti
7e70fe1126 bump version 2023-10-04 21:01:30 +02:00
Mario Vavti
5265c774ae move right aside into bottom of left aside if screen width is < 1200px 2023-10-04 21:00:00 +02:00
Mario Vavti
d1421d720c parse the event object in first place and use the body bbcode as backup 2023-10-04 20:11:05 +02:00
Pascal
2bd09d3b30 work with Mastodon-style keyId 2023-10-04 17:00:19 +02:00
Mario
56e54ac820 if the item is sourced and provides an event add it to the calendar 2023-09-28 16:55:49 +00:00
Mario
08d85798ed since the activity filter widget requires the network module we can link to the module directly so that it will work as quicklink widget in other modules 2023-09-27 13:27:35 +00:00
Mario
38c2b36606 ÅÅfix narrow navbar 2023-09-25 20:00:33 +00:00
Mario
01b747287a fix php warnings 2023-09-22 09:24:04 +00:00
Mario
c925e13e5a cleanup and warnings 2023-09-21 14:47:56 +00:00
Mario
1ced89a869 fix javascript error 2023-09-21 09:14:15 +00:00
Mario
a5e32dc3de more deprecate $a 2023-09-21 08:34:02 +00:00
Mario
150174c3bb jsonld: return object instead of json string 2023-09-21 08:33:17 +00:00
Mario
601ee0b40b only show theme switch icon if switching is supported by the theme 2023-09-21 08:31:53 +00:00
Mario
9627c3e7c8 store the actor cache date so we can easily invalidate it after a period of time 2023-09-21 06:14:24 +00:00
Mario
d88c67eba3 deprecate the ancient $a variable 2023-09-20 10:45:33 +00:00
Mario
bb38a90dda use small profile images instead of medium 2023-09-17 13:35:55 +00:00
Mario
c36743f7ee css fixes 2023-09-16 19:17:02 +00:00
Mario
860275f888 typo 2023-09-16 18:37:34 +00:00
Mario
670228ff63 more changelog
(cherry picked from commit 4338e4ef86)
2023-09-16 20:16:59 +02:00
Mario
4338e4ef86 more changelog 2023-09-16 18:16:13 +00:00
Mario
dbc712c53c version 8.6.3 2023-09-16 18:02:22 +00:00
Mario
bb6011ea73 Revert "version 8.6.3"
This reverts commit 1915f34de8
2023-09-16 18:00:42 +00:00
Mario
1915f34de8 version 8.6.3 2023-09-16 17:59:31 +00:00
Mario
675f26fe90 changelog
(cherry picked from commit 491e309911)
2023-09-16 19:58:52 +02:00
Mario
491e309911 changelog 2023-09-16 17:55:59 +00:00
Mario
283d27c5b1 css fix 2023-09-16 11:35:41 +00:00
Mario
24d862c1bc fix regression in jsonld_document_loader()
(cherry picked from commit 3708c1ac8c)
2023-09-16 13:26:38 +02:00
Mario
3708c1ac8c fix regression in jsonld_document_loader() 2023-09-16 10:51:28 +00:00
Mario
df60be423a redbasic: add functions for reference 2023-09-15 13:50:19 +00:00
Mario
a1e583129f more type checking
(cherry picked from commit a06b28b693)
2023-09-15 15:46:15 +02:00
Mario
a06b28b693 more type checking 2023-09-15 13:45:24 +00:00
System user; apache
198070700c only select the required fields to prevent memory exhaustion on big result sets
(cherry picked from commit 3a01aa40d8)
2023-09-15 15:32:38 +02:00
System user; apache
3a01aa40d8 only select the required fields to prevent memory exhaustion on big result sets 2023-09-15 15:28:13 +02:00
Mario
b628af2258 allow themes to manipulate app icons (photos) via a hook 2023-09-15 06:55:27 +00:00
Mario
0cb5d0d63e also look for widgets in view/theme/themename/widget 2023-09-14 12:30:14 +00:00
Mario
526c85e2ca fix minor regression after recent changes 2023-09-14 10:00:24 +00:00
Mario
8a21c8e618 more theme fixes 2023-09-13 20:56:27 +00:00
Mario
8d3d5747d2 more theme fixes 2023-09-13 16:31:38 +00:00
Mario
f1f1406596 revert extra padding 2023-09-13 15:53:40 +00:00
Mario
9e42be9884 theme fixes 2023-09-13 15:51:10 +00:00
Mario
75e75b93cf an attempt to cache seen item mids for the purpose that we can hide seen pubstream items from the notifications - might revert if it turns out that it does not scale 2023-09-10 19:09:55 +00:00
Mario
0e8ecbc9fc theme fixes to make a barebones theme work slightly better 2023-09-10 08:00:18 +00:00
Mario
a88236b36f possible fix for item widget not respecting ACL if added by title - issue #1799 2023-09-09 18:52:30 +00:00
Mario
df06c54bd2 Merge branch 'translations/update-norwegian-bokmål-strings' into 'dev'
Update translations for Norwegian Bokmål.

See merge request hubzilla/core!2059
2023-09-09 18:02:52 +00:00
Mario
f2d88387c9 Merge branch 'redbasic/fix-darktheme-colorbox' into 'dev'
redbasic: Use body background color for colorboxes.

See merge request hubzilla/core!2058
2023-09-09 18:01:00 +00:00
Mario
db4c6bbd3b Merge branch 'cherry-pick-847732bd-2' into 'dev'
Update Spanish strings

See merge request hubzilla/core!2057
2023-09-09 17:59:48 +00:00
Harald Eilertsen
c8e7f79f50 Update translations for Norwegian Bokmål. 2023-09-09 15:41:18 +02:00
Mario
1157dc7dc8 make sure to set the other relevant dates aswell to omit discrepancies if they would be set a splitsecond later when we store the item 2023-09-07 19:55:15 +00:00
Harald Eilertsen
c12833521f Transparent background for colorbox controls icons.
This makes it blend in better when using dark style. I've kept the
actual button/control colours unchanged though.
2023-09-07 20:34:40 +02:00
Harald Eilertsen
5d9346999e redbasic: Use body background color for colorboxes.
Typically (only?) used by the "view source" function.
2023-09-07 13:30:58 +02:00
mjfriaza:4GF~eYj,-iAv
52c0631833 Update Spanish strings
(cherry picked from commit 847732bd8ac4b79f206981af7d90f183ee8ea58a)
2023-09-02 16:37:25 +02:00
Mario
e16aefec2c call init allthough it does not contain anything atm. it will set up things we need later e.g. App::$page["htmlhead"] and php will raise a warning if it does not exist. Also minor cleanup 2023-08-30 08:44:18 +00:00
Mario
053a247cc8 work around sabre caldav php warnings 2023-08-28 08:11:32 +00:00
Mario
1426b7a6dc order by hubloc_id like everywhere else for this reason and do not include deleted hublocs 2023-08-27 20:29:30 +00:00
Mario
ec66949b35 version 8.6.2 2023-08-27 19:06:14 +00:00
Mario
bc9d8d1136 changelog 2023-08-27 19:03:21 +00:00
Mario
542a527d0d changelog 2023-08-27 19:02:55 +00:00
Mario Vavti
5e0c392287 test refactor the previous commit
(cherry picked from commit 0a3094fc9a)
2023-08-27 20:01:01 +02:00
Mario Vavti
05ff94941c allow public stream comments/reactions if item_fetched is set, when fetching parent of a reaction fetch the thr_parent
(cherry picked from commit 816bbad28a)
2023-08-27 20:00:30 +02:00
Mario
a27d75d610 fix notification text for likes in cases where obj.actor is not set
(cherry picked from commit ce4150cd06)
2023-08-27 19:59:24 +02:00
Mario
446e842904 make sure that we allow "0" as pathname
(cherry picked from commit be19b75031)
2023-08-27 19:58:55 +02:00
Mario
ba153e2c18 mising pdl file
(cherry picked from commit 2d5c99f459)
2023-08-27 19:58:07 +02:00
Mario
3342ea6891 fix unable to create folders with name 0
(cherry picked from commit c4af4e3297)
2023-08-27 19:57:01 +02:00
Mario
8c3d5fd295 fix index name mixup
(cherry picked from commit 1acfc05e2d)
2023-08-27 19:56:26 +02:00
Mario
5fc58fb10a missing semicolon
(cherry picked from commit b40c38f58c)
2023-08-27 19:56:10 +02:00
Mario
4e2ae9cd4e remove unused variable
(cherry picked from commit 0ec715d7c9)
2023-08-27 19:55:49 +02:00
DM42.Net Hubzilla Development
4167ca2e5c Fix Typo
(cherry picked from commit 3bd2a91992)
2023-08-27 19:55:23 +02:00
Mario
9b3e9dcf02 fix cached jsonld files fetched via network 2023-08-27 17:53:40 +00:00
Mario
f203fcc92e more performance improvements
(cherry picked from commit 4b1384be83)
2023-08-27 19:50:39 +02:00
Mario
0b20069c20 move trigger out of the loop for better performance and some var -> let 2023-08-27 17:49:52 +00:00
Mario
bad7b778b3 fix php warning 2023-08-27 17:48:10 +00:00
Mario
f89ce93940 ignore internal follow activity
(cherry picked from commit 7200c71673)
2023-08-27 19:45:51 +02:00
Mario
1ddbc8a26d fix admin table highlight by adding the correct classes
(cherry picked from commit c412c01a65)
2023-08-27 19:43:09 +02:00
Mario Vavti
0a3094fc9a test refactor the previous commit 2023-08-21 10:45:12 +02:00
Mario Vavti
816bbad28a allow public stream comments/reactions if item_fetched is set, when fetching parent of a reaction fetch the thr_parent 2023-08-21 10:07:51 +02:00
Mario
ce4150cd06 fix notification text for likes in cases where obj.actor is not set 2023-08-19 08:55:17 +00:00
Mario
be19b75031 make sure that we allow "0" as pathname 2023-08-15 12:05:50 +00:00
Mario
3ddab5966b only try to fetch the icon if we actually got one 2023-08-14 18:13:58 +00:00
Mario
2d5c99f459 mising pdl file 2023-08-14 09:40:51 +00:00
Mario
a5a1bbf5d7 move profile photo fetching to background 2023-08-14 09:21:45 +00:00
Mario
c4af4e3297 fix unable to create folders with name 0 2023-08-14 08:17:47 +00:00
Mario
1acfc05e2d fix index name mixup 2023-08-14 07:58:44 +00:00
Mario
b40c38f58c missing semicolon 2023-08-14 07:38:36 +00:00
Mario
87c41cb9ac Merge branch 'DM42-Manifest-Typo-20230725' into 'dev'
Fix Typo

See merge request hubzilla/core!2055
2023-08-11 09:03:29 +00:00
Mario
0ec715d7c9 remove unused variable 2023-08-09 08:18:27 +00:00
Mario
e6a261a789 now all acl fields are checked. if they are not complete the check will fail 2023-08-09 08:01:18 +00:00
DM42.Net Hubzilla Development
3bd2a91992 Fix Typo 2023-07-25 09:07:32 -04:00
Mario
c721bc672c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-07-21 12:07:57 +00:00
Mario
931b876b44 fix cached jsonld files fetched via network 2023-07-21 12:07:17 +00:00
Mario
87b91e5023 Merge branch 'DM42-20230718-fixjsonldrawfile' into 'dev'
add .jsonld to the list of allowed file suffixes for direct download.  Fixes...

See merge request hubzilla/core!2053
2023-07-21 10:02:41 +00:00
Mario
4b1384be83 more performance improvements 2023-07-21 08:17:45 +00:00
Mario
8da6e6a096 move trigger out of the loop for better performance and some var -> let 2023-07-20 19:20:56 +00:00
Mario
5181e575b4 fix accesslist in two cases 2023-07-20 11:46:40 +00:00
Mario
ca994735be Merge branch 'zotlabs/improve-access-list-type-safety' into 'dev'
Zotlabs: Improve type safety for AccessList class.

See merge request hubzilla/core!2052
2023-07-20 09:05:42 +00:00
Harald Eilertsen
718c303086 Zotlabs: More type safety for AccessList class.
Add more type declarations to class attributes and functions.

This should ensure that only strings and null values can be assigned to
the various access list members. This is still a bit loose, as we should
probably aim for lists of channel or group id's instead of a generic
type like a string.

I'll leave that for later, though.
2023-07-19 20:19:00 +02:00
Mario
7200c71673 ignore internal follow activity 2023-07-19 12:52:41 +00:00
DM42.Net Hubzilla Development
14c97799c6 add .jsonld to the list of allowed file suffixes for direct download. Fixes 404 error when trying to get /library/w3org/security-v1.jsonld and /library/w3org/activitystreams.jsonld 2023-07-18 14:34:10 -04:00
Harald Eilertsen
a06e8bfaee Zotlabs: Improve type safety for AccessList class.
Add type annotations for constructor and set* methods, and throw an
exception if the passed in arrays are missing required keys. This means
that both invalid input types and missing keys will throw and exception
rather than just die with a runtime error.

There's not checks to verify that the contents of the required array
keys are valid or make sense, though. They are just assigned, and
returned as is by the get method when requested.

Also, the set_from_array method is not well tested at the moment.
2023-07-18 20:18:42 +02:00
Mario
7dad60bbd5 version 8.6.1 2023-07-18 13:09:56 +00:00
Mario
a66b4626fb changelog
(cherry picked from commit 330add963d)
2023-07-18 15:08:07 +02:00
Mario
330add963d changelog 2023-07-18 13:04:34 +00:00
Mario
da1ccc620b Merge branch 'DM42-20230717-fixfatalerron304' into 'dev'
Skip logging when DB functions are not yet loaded (logging requires db lookup).

See merge request hubzilla/core!2051
2023-07-18 11:12:11 +00:00
Mario
c412c01a65 fix admin table highlight by adding the correct classes 2023-07-18 11:00:21 +00:00
Mario
74d7fa61d9 fix hcard addon regression
(cherry picked from commit ef6ea4484e)
2023-07-18 12:11:50 +02:00
Mario
ef6ea4484e fix hcard addon regression 2023-07-18 09:57:38 +00:00
DM42.Net Hubzilla Development
ba2d775215 Skip logging when DB functions are not yet loaded (logging requires db lookup). 2023-07-17 20:34:16 -04:00
Mario
f866771854 Merge branch 'tests/cleanup-unit-tests' into 'dev'
Cleanup unit tests

See merge request hubzilla/core!2049
2023-07-17 08:43:08 +00:00
Mario
70b8c57d22 basic per item rtl language support - issue ##1780 2023-07-13 09:47:50 +00:00
Harald Eilertsen
b04e0d0fd4 tests: AccessListTest expand is_private test. 2023-07-12 21:57:27 +02:00
Harald Eilertsen
3f9d5e11d1 tests: AccessListTest move type annotation to code
This cleans up the doc comment. Should probably try to do this
everywhere.
2023-07-12 21:56:09 +02:00
Harald Eilertsen
09fe271b25 tests: AccessListTests nitpicking on doc comment. 2023-07-12 21:39:37 +02:00
Harald Eilertsen
d5c1a49984 tests: AccessListTest collect defaults in one testcase.
Just no need to have them spread around in various other tests cases.
2023-07-12 21:38:10 +02:00
Harald Eilertsen
e80d3653c9 test: Enable and cleanup GetTagsTest.
These tests actually tests both the get_tags() function, and the
handle_tags() function. The latter don't work, and should probably be
split into it's own test cases.

There's also some stubs here that we may want to deal with in another
way.

Also removed meaningless "test" of intval() builtin function. It behaves
as documented, no need for us to test it.
2023-07-12 20:42:37 +02:00
Harald Eilertsen
30b0d0a5cc tests: Cleanup ContainsAttribute test.
Mostly cosmetic to satisfy phpcs + remove explicit require.
2023-07-12 20:42:37 +02:00
Harald Eilertsen
9beceb9b02 tests: Cleanup Autoname test.
Not sure if this test is actually useful, but leave it for now.
2023-07-12 20:42:37 +02:00
Harald Eilertsen
6f13cabfba tests: Don't explicitly require CUT in AntiXSSTest.
Rely on PHPUnit config to load the app and the code under test.
2023-07-12 20:42:37 +02:00
Harald Eilertsen
7bd2de9967 unit-tests: There's no need to test builtin func hex2bin 2023-07-12 20:42:37 +02:00
Harald Eilertsen
b0b0973e2d unit tests: Cosmetic fixes in AntiXSSTest.php
- Start comments with capital letter
- Fix indentation
- Add missing doc comments
2023-07-12 20:42:36 +02:00
Mario
3d866e8975 update date 2023-07-11 19:55:08 +00:00
Mario
63fb8d0392 Merge branch '8.6RC' 2023-07-11 18:57:18 +00:00
Mario
384de0925e version 8.6 2023-07-11 18:56:21 +00:00
Mario
5b5c569c82 RC2 2023-07-05 10:06:57 +00:00
Mario
6f2371ee74 changelog 2023-07-05 10:05:38 +00:00
Mario
d6e7d90197 fix regression after recent changes 2023-07-05 09:29:33 +00:00
Mario
aa73db0fe6 bump dev version 2023-07-04 18:05:37 +00:00
Mario
d85088fc3d version and strings 2023-07-04 18:00:33 +00:00
Mario
7e21aeedcd css fix 2023-07-04 17:51:16 +00:00
Mario
342460fa17 css fixes 2023-07-04 11:19:04 +00:00
Mario
e57211fbd1 also filter deleted hublocs 2023-07-04 09:07:39 +00:00
Mario
d31eb4c89c update fullcalendar 2023-07-04 08:47:22 +00:00
Mario
6753d260e4 do not linkify in nobb and noparse tags - issue #1776 2023-07-04 08:05:00 +00:00
Mario
a3092204a1 fix issue #1771 2023-07-03 18:35:10 +00:00
Mario
10b49af776 fix php warning 2023-07-03 12:42:46 +00:00
Mario
3497ced9f9 Ãfix php warning 2023-07-03 10:49:34 +00:00
Mario
7a0f22b0a7 make sure to return infos from current hub where applicable - fix issue #1770 2023-07-03 10:37:32 +00:00
Mario
4f03272a5f unify code for selecting deliverable abook xchans 2023-07-01 11:03:26 +00:00
Mario
7755936a2e remove unused pseudo abook code 2023-06-29 12:31:32 +00:00
Mario
9f6844ec30 pass $escape to stringify_array_elms() 2023-06-29 11:43:02 +00:00
Mario
c2952aa803 make sure to not allow moderation of poll answers 2023-06-29 11:29:48 +00:00
Mario
8f7383f5c2 text 2023-06-28 12:05:55 +00:00
Mario
750641ef19 implement inline moderation of reactions 2023-06-27 14:53:23 +00:00
Mario
fb48dfc082 bump version 2023-06-24 21:30:39 +00:00
Mario
1de5bce1c1 remove logging 2023-06-24 21:00:24 +00:00
Mario
676603239d Merge branch 'cherry-pick-1baa3489' into 'dev'
Update Spanish translation-2

See merge request hubzilla/core!2048
2023-06-23 12:39:19 +00:00
Mario
4c87f36a8c bump version 2023-06-23 12:37:07 +00:00
Mario
12b2137a04 fix relaying and syncing in Activity::drop(), change wording for moderation request notices and redirect moderation request for reactions to mod moderate 2023-06-23 12:35:41 +00:00
mjfriaza
762e1c9c2b Update Spanish translation-2
(cherry picked from commit 1baa34894f6799cac3d973db8c1205239ad6179b)
2023-06-23 13:44:18 +02:00
Mario
cd26ead043 implement optional moderation of unsolicited comments, minor css fixes and some more work on ocap 2023-06-23 09:13:51 +00:00
Mario
6a560cfec4 always check pageflags otherwise site specific flags will be overwritten when a sync package arrives from a clone that has no flags for this channel - fix issue #1769 2023-06-21 09:20:25 +00:00
Mario
489ba72d5c fix issues in mod oep 2023-06-19 19:47:01 +00:00
Mario Vavti
5df9779669 make sure to use the correct url 2023-06-18 22:27:33 +02:00
Mario
e49d2f6b8f remove deprecated templates 2023-06-18 09:20:57 +00:00
Mario
9550a7a954 more html fix 2023-06-18 09:02:10 +00:00
Mario
d9f855b97e fix bogus html 2023-06-18 09:00:54 +00:00
Mario
e275dae6e3 use function to get actor hublocs 2023-06-18 08:43:05 +00:00
Mario
88ccc2a3b9 bump version 2023-06-17 07:59:16 +00:00
Mario
84487edc05 undefined variable and return null in fetch_local if we did not find anything (we also return null in fetch) 2023-06-16 12:27:08 +00:00
Mario
7177649969 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-06-16 12:16:47 +00:00
Mario
18b7b3f125 deprecate ActivityStreams::fetch() and provide the possibility to fetch local items directly 2023-06-16 12:16:22 +00:00
Mario
89c7e1a8ee Merge branch 'help' into 'dev'
typo in hooklist.bb

See merge request hubzilla/core!2042
2023-06-15 20:41:06 +00:00
Mario
774a9b118e Merge branch 'make-unit-tests-pass' into 'dev'
Make unit tests pass

See merge request hubzilla/core!2041
2023-06-15 20:40:28 +00:00
Mario
327841280b Merge branch 'dev' into 'dev'
Simplified version auf automated install script

See merge request hubzilla/core!2040
2023-06-15 20:36:22 +00:00
OJ Random
1e0a686561 Simplified version auf automated install script 2023-06-15 20:36:20 +00:00
OJ Random
96883100b4 typo in hooklist.bb 2023-06-15 19:19:08 +02:00
Harald Eilertsen
1fcb05ed8c Unit tests: Update Markdown tests to reflect that it works. 2023-06-14 23:02:13 +02:00
Harald Eilertsen
8c85516c57 Unit tests: Book Hubzilla to make app env available in tests.
Not quite unit test clean, but a somewhat pragmatic approach to make the
tests pass as is.
2023-06-14 23:00:44 +02:00
Mario
6989a3eaad fix string replacement if a match is available more than once 2023-06-12 19:05:37 +00:00
Mario
57796a2f96 only remove the owner from delivery if its their post and minor cleanup
(cherry picked from commit 59b217f7ea)
2023-06-12 10:17:17 +02:00
Mario
59b217f7ea only remove the owner from delivery if its their post and minor cleanup 2023-06-12 08:13:42 +00:00
Mario
fb9a193c44 do not add deleted xchans for poco 2023-06-08 16:24:02 +00:00
Mario
2739f1f3f0 remove logging 2023-06-08 15:34:00 +00:00
Mario
0c2cb18578 shuffle queue deliveries for more randomness 2023-06-08 15:33:02 +00:00
Mario
db2c5aae84 bump version 2023-06-02 19:56:50 +00:00
Mario
aa2cec103b Merge branch 'dev' into 'dev'
Update 'full' and 'minimal' layouts to use color_mode functionality

See merge request hubzilla/core!2039
2023-06-02 19:54:59 +00:00
ivan zlax
a532a70ac0 Update 'full' and 'minimal' layouts to use color_mode functionality 2023-06-02 19:54:59 +00:00
Mario
ec6cec8854 even more changelog
(cherry picked from commit 3fb22d27ab)
2023-06-02 21:47:41 +02:00
Mario
3fb22d27ab even more changelog 2023-06-02 19:46:49 +00:00
Mario
1cbaab5889 more changelog
(cherry picked from commit fef19b47c2)
2023-06-02 21:39:27 +02:00
Mario
fef19b47c2 more changelog 2023-06-02 19:38:46 +00:00
Mario
5126613825 update bootstrap to version 5.3 2023-06-02 19:35:23 +00:00
Mario
07097d2fa3 version 8.4.2 2023-06-02 19:27:36 +00:00
Mario
8c9fb32ca0 changelog
(cherry picked from commit 68d921e918)
2023-06-02 21:26:22 +02:00
Mario
68d921e918 changelog 2023-06-02 19:25:49 +00:00
Mario
330b36159d work around hubloc confusion in mod rmagic
(cherry picked from commit 02089f15c4)
2023-06-02 21:18:52 +02:00
Mario
046152e798 improved unseen forums notification
(cherry picked from commit 6a27afa6ac)
2023-06-02 21:18:30 +02:00
Mario
11ca5bb7d5 owa: workaround for friendica when using nginx until this will be fixed at their side and check prrofile uid for features instead of local channel
(cherry picked from commit 423fdc0a96)
2023-06-02 21:16:56 +02:00
Mario
e0838ff8ab fix wrong array key
(cherry picked from commit 11a2419c22)
2023-06-02 21:13:31 +02:00
Mario
11a2419c22 fix wrong array key 2023-06-02 19:10:53 +00:00
Mario
f3420c0adb bump version 2023-06-02 18:30:04 +00:00
Mario
bd84ff4838 update bootstrap to version 5.3 2023-06-02 16:36:57 +00:00
Mario
87689df062 even more adjust text 2023-06-02 15:59:26 +00:00
Mario
1bfbd57ee4 more adjust text 2023-06-02 15:34:06 +00:00
Mario
64d7585282 adjust text 2023-06-02 15:29:24 +00:00
Mario
0ee03a565f remove custom acl from rpost 2023-06-02 12:02:50 +00:00
Mario Vavti
1b0e268416 fix theme_attachments()
(cherry picked from commit 65a472c113)
2023-06-02 13:35:39 +02:00
Mario
0e8d1afcaf Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-06-02 11:34:08 +00:00
Mario
48a33f08e2 ocap initial checkin 2023-06-02 11:33:44 +00:00
Mario Vavti
f9ca956510 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-06-02 13:30:36 +02:00
Mario Vavti
65a472c113 fix theme_attachments() 2023-06-02 13:30:21 +02:00
Mario
4b17ea04a7 add owner and author to item_permissions_sql() 2023-06-01 10:15:35 +00:00
Mario
423fdc0a96 owa: workaround for friendica when using nginx until this will be fixed at their side and check prrofile uid for features instead of local channel 2023-06-01 08:15:33 +00:00
Mario
396b124e84 do not parse x-multicode as bbcode 2023-05-30 09:11:30 +00:00
Mario
6a27afa6ac improved unseen forums notification 2023-05-30 08:59:29 +00:00
Mario
b9812ba06a update composer libs 2023-05-30 08:36:17 +00:00
Mario
bc6aded074 fix a possible privacy mismatch 2023-05-29 18:16:38 +00:00
Mario
904401617a mod magic make a get request instead of post and remove digest header 2023-05-26 10:17:53 +00:00
Mario
02089f15c4 work around hubloc confusion in mod rmagic 2023-05-26 08:19:34 +00:00
Mario
43a18a2569 update description 2023-05-25 09:01:29 +00:00
Mario
4c2dc2bf16 Merge branch 'dev' into 'dev'
double columns templates

See merge request hubzilla/core!2035
2023-05-25 08:53:03 +00:00
ivan zlax
e6eb2a8476 double columns templates 2023-05-25 08:53:03 +00:00
Mario
af5ae163f3 more fixes for where keyId = acct:xxx@yyy.zz 2023-05-25 08:18:16 +00:00
Mario
d00860430f owa fixes for where keyId = acct:xxx@yyy.zz 2023-05-25 08:03:10 +00:00
Mario
af0b4a0fca return hubloc_hash instead of hubloc_id_url for AP and improved check for location 2023-05-24 09:08:32 +00:00
Mario
404189f88c backgound url must be between quotation marks 2023-05-20 17:38:37 +00:00
Mario
1a27fad9b9 backgound url must be between quotation marks 2023-05-20 12:40:28 +00:00
Mario
c2cfe481df version 8.4.1 2023-05-20 09:28:32 +00:00
Mario
3a56fb6ec6 Merge branch 'dev' 2023-05-20 09:27:45 +00:00
Mario
61950decb3 changelog 2023-05-20 09:27:31 +00:00
Mario
1a614ea023 instead of setting the value to 0 just continue so that already existing values will not be overwritten 2023-05-19 13:17:45 +00:00
Mario
a83b6a5e63 instead of setting the value to 0 just continue so that already existing values will not be overwritten 2023-05-19 13:16:53 +00:00
Mario
65d98af24c Merge branch '8.4RC' 2023-05-17 13:28:23 +00:00
Mario
62d35627f3 version 8.4 2023-05-17 13:28:05 +00:00
Mario
84f1ed1587 Merge branch 'dev' into 8.4RC 2023-05-17 13:26:01 +00:00
Mario
31b4fb343d changelog 2023-05-17 13:25:33 +00:00
Mario
3c3f5c60da changelog 2023-05-16 09:26:45 +00:00
Mario
18914f2081 Merge branch 'dev' into 8.4RC 2023-05-15 08:04:02 +00:00
Mario
b50da2d8b7 fix parent_mid and thr_parent not set correctly for response activities 2023-05-15 08:03:27 +00:00
Mario
5bdd699c9d Merge branch 'dev' into 8.4RC 2023-05-13 19:52:52 +00:00
Mario
29e8e6d95c fix parent and parent_mid for likes 2023-05-13 19:51:25 +00:00
Mario Vavti
049fc91615 Merge branch 'dev' into 8.4RC 2023-05-13 21:38:08 +02:00
Mario Vavti
b7c96f2cbd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-05-13 21:37:45 +02:00
Mario Vavti
1e6408df13 fix regression decoding the uuid for responses 2023-05-13 21:37:33 +02:00
Mario
7b90548c1d save a query 2023-05-12 17:45:30 +00:00
Mario
5d330e18ff save a query 2023-05-12 16:29:42 +00:00
Mario
07662ff076 Merge branch 'dev' into 8.4RC 2023-05-12 08:02:19 +00:00
Mario
9252ae1596 css fixes 2023-05-12 08:01:25 +00:00
Mario
0155e9131d remove outdated comments 2023-05-11 12:51:25 +00:00
Mario
247cf40ace bump version 2023-05-10 20:45:33 +00:00
Mario
4a6b450c55 Merge branch 'dev' into 8.4RC 2023-05-10 20:44:43 +00:00
Mario
5b80d57a54 php warning 2023-05-10 20:40:10 +00:00
Mario
8ac4547e73 php warnings 2023-05-10 20:33:38 +00:00
Mario
3658975b69 typo 2023-05-10 20:22:18 +00:00
Mario
abc3545ef9 use act->objprop() in decode_note() 2023-05-10 20:11:54 +00:00
Mario
01f8cb698d check if we have a type and a href 2023-05-10 18:38:43 +00:00
Mario
5e4d0f45fc check if var is set and escape $ sign in ru translation 2023-05-10 16:43:00 +00:00
Mario
efd2f78274 check if var is set and escape $ sign in ru translation 2023-05-10 16:42:12 +00:00
Mario
690ff955fa Merge branch 'dev' into 8.4RC 2023-05-10 16:09:36 +00:00
Mario Vavti
3fb27bdc55 fix query for postgres 2023-05-10 18:04:19 +02:00
Mario
d8306fca6f Merge branch 'dev' into 8.4RC 2023-05-10 12:05:15 +00:00
Mario Vavti
380775540d missing function 2023-05-10 14:03:37 +02:00
Mario Vavti
65e3b0dafd deal with arrays and json 2023-05-10 13:53:03 +02:00
Mario
4ae81d753c Merge branch 'dev' into 8.4RC 2023-05-10 08:16:09 +00:00
Mario
0f01aac823 wording 2023-05-10 08:15:21 +00:00
Mario
ce0a96351e make sure we have a xchan and a hubloc - otherwise re-discover 2023-05-10 08:14:51 +00:00
Mario
93dda6f1fd Merge branch 'dev' into 8.4RC 2023-05-09 09:20:48 +00:00
Mario
5e83db959e more changelog 2023-05-09 09:20:21 +00:00
Mario
74436eb03e Merge branch 'dev' into 8.4RC 2023-05-09 09:08:06 +00:00
Mario
993178fc49 changelog 2023-05-09 09:07:32 +00:00
Mario
1c217cf446 es translation as per manuel 2023-05-09 07:58:41 +00:00
Mario
0bf2be1f9d Merge branch 'owa-compat-friendica' into 'dev'
Owa compatibility for Friendica

See merge request hubzilla/core!2036
2023-05-09 07:50:30 +00:00
Pascal Deklerck
548589be4d Owa compatibility for Friendica 2023-05-09 07:48:52 +00:00
Max Kostikov
697a1b1ed1 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!2037
2023-05-08 12:44:18 +00:00
Max Kostikov
d893c7eb33 Update Russian hstrings.php 2023-05-08 12:42:17 +00:00
Max Kostikov
8957d24752 Update Russian hmessages.po 2023-05-08 12:41:46 +00:00
Mario
677e730235 Merge branch 'dev' into 8.4RC 2023-05-07 14:25:17 +00:00
Mario
4227d973b9 missing class 2023-05-07 14:24:59 +00:00
Mario
06c0af50c3 Merge branch 'dev' into 8.4RC 2023-05-07 12:48:14 +00:00
Mario
4d3a48d1c1 cropper fixup 2023-05-07 12:47:13 +00:00
Mario
f6b66f4cad Merge branch 'dev' into 8.4RC 2023-05-07 12:17:09 +00:00
Mario
a56f9ab4e6 more css and whitespace 2023-05-07 12:16:52 +00:00
Mario
ca913e5077 Merge branch 'dev' into 8.4RC 2023-05-07 12:04:54 +00:00
Mario
b25ebe12c5 more css 2023-05-07 12:03:42 +00:00
Mario
984980b170 version 2023-05-07 11:31:50 +00:00
Mario
be45005dbb css fixes 2023-05-07 11:29:45 +00:00
Mario
b8c9f04989 bump version 2023-05-07 09:04:10 +00:00
Mario
bf2d41eb14 composer autoload 2023-05-07 08:46:28 +00:00
Mario Vavti
158f9afb37 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-05-07 10:42:10 +02:00
Mario Vavti
f884e31d21 composer autoload 2023-05-07 10:41:57 +02:00
Mario
d3a5ff9d68 version and strings 2023-05-07 08:39:59 +00:00
Mario Vavti
7185780d4e h3 adds bottom margin - remove it 2023-05-07 10:30:34 +02:00
Mario Vavti
f995b2822f exclude deleted hublocs 2023-05-07 10:03:27 +02:00
Mario Vavti
d7490ac738 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-05-07 09:52:38 +02:00
Mario Vavti
383d0e17f2 fix directory search 2023-05-07 09:52:27 +02:00
Mario
7c1a3ab36e css fix 2023-05-07 07:11:54 +00:00
Mario
edc8d17031 slightly change online status display 2023-05-06 20:42:04 +00:00
Mario
f3f861234d minor css fix 2023-05-06 20:28:29 +00:00
Mario
93278c00b7 update profile vcard to implement the cover image 2023-05-06 19:41:02 +00:00
Mario
5bbe93d49f minor de strings update 2023-05-05 17:49:08 +00:00
Mario
21cd8d31d7 css fix 2023-05-05 17:46:53 +00:00
Mario
d649b4df28 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-05-05 16:10:12 +00:00
Mario
2bb9550343 slightly more robust get_quote_bbcode() 2023-05-05 16:09:53 +00:00
Mario Vavti
ef0feff4a5 Hidden > Spam 2023-05-05 12:33:39 +02:00
Mario
dfa43b4856 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-05-04 09:28:05 +00:00
Mario
a24a1ca6d7 update 1258 to remove traces of channelreputation 2023-05-04 09:27:31 +00:00
Mario Vavti
2d4b35fbc9 provide possibility to flag via ajax calls to prevent pageloads 2023-05-03 22:42:52 +02:00
Mario Vavti
57e2910477 flag new xtags with the xchan flag 2023-05-03 18:13:47 +02:00
Mario Vavti
ffbaa7e4dc when flagging an entry also flag its xtags and improved keywords query in dirsearch 2023-05-03 15:25:47 +02:00
Mario
df42036100 make sure config.system.trusted_directory_servers is an array 2023-05-03 08:47:21 +00:00
Mario Vavti
ca9491d343 move trusted directory servers to security and implement in backend 2023-04-29 22:43:49 +02:00
Mario
96ae569eaf trusted dir servers frontend 2023-04-29 19:38:34 +00:00
Mario Vavti
fb295d53f1 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-29 20:17:19 +02:00
Mario Vavti
95d07974f4 fix php warning 2023-04-29 20:13:52 +02:00
Mario
39d78064da Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-28 21:50:01 +00:00
Mario
a2bcbb90ed fix regression decoding obj type 2023-04-28 21:44:12 +00:00
Mario
c31b37f570 bootstrap files 2023-04-28 19:23:28 +00:00
Mario
2a1341b910 update bootstrap 2023-04-28 19:02:23 +00:00
Mario Vavti
354e341d69 mastodon says hashtag is a subset of link - issue #1750 2023-04-28 12:50:57 +02:00
Mario Vavti
13946b2b76 fix and document edge case 2023-04-28 10:03:05 +02:00
Mario Vavti
29aa52df6a fix poller after refactor 2023-04-28 09:29:15 +02:00
Mario Vavti
c3267a27d3 fix column name 2023-04-28 09:04:02 +02:00
Mario Vavti
3543e6dd32 slightly refactor dir sync 2023-04-28 08:57:21 +02:00
Mario Vavti
5412ba617d more dir sync testing 2023-04-28 00:58:46 +02:00
Mario Vavti
1f81a2cb1b remove updates entry if a xchan_hash mismatch is encountered 2023-04-27 22:54:45 +02:00
Mario Vavti
5da58d42f6 adjust args in libzotdir update and some dir sync fixes 2023-04-27 22:26:53 +02:00
Mario Vavti
299b6037c9 remove logging 2023-04-27 11:24:26 +02:00
Mario Vavti
1ed8b9dd14 fix php error 2023-04-27 11:17:53 +02:00
Mario Vavti
cf4912cb3d use shorter strings 2023-04-27 11:08:21 +02:00
Mario Vavti
e6ec87f910 update doco and fix safemode 2023-04-27 11:00:43 +02:00
Mario Vavti
f72fb974a9 for flag updates also match site directory and ud host 2023-04-27 07:07:38 +02:00
Mario Vavti
bdb25315b6 initial commit for directory flags federation 2023-04-26 23:01:56 +02:00
Mario
60f0739c3e update 1257 ud_guid > ud_host 2023-04-26 16:28:20 +00:00
Mario
0faab9277f fix update 2023-04-26 16:09:14 +00:00
Mario Vavti
51fce12cd7 update 1256 2023-04-26 17:59:20 +02:00
Mario Vavti
d79290df75 dirsync update column 2023-04-26 17:58:35 +02:00
Mario Vavti
0bf65bcad5 remove rate entry and move ignore button to the right 2023-04-26 13:46:25 +02:00
Mario Vavti
44dbf19e89 wrong variable 2023-04-26 12:59:04 +02:00
Mario Vavti
469a76f1f6 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-26 12:50:56 +02:00
Mario Vavti
f851c272fa enable dir admins to flag or hide entries 2023-04-26 12:50:37 +02:00
Mario
027a9fec61 fix potential security issue as per friendica 2023-04-26 06:28:24 +00:00
Mario
09fde2f839 correctly set some perms when our follow request was accepted 2023-04-25 08:36:20 +00:00
Mario
8a14e4261d check for uuid so that will be also catch items that were posted from alternate locations 2023-04-23 18:44:39 +00:00
Mario
6c9f1de265 remove logging 2023-04-23 18:05:17 +00:00
Mario
3ad0179b62 fix regression when rendering event items 2023-04-23 16:07:57 +00:00
Mario Vavti
81f33da499 improved fetch_conversation() 2023-04-23 13:02:38 +02:00
Mario
80d70e64f5 bump version 2023-04-23 09:26:30 +00:00
Mario
eec4845cd0 add the conversation endpoint and implement paginated fetch for zot requests in mod item 2023-04-23 09:23:39 +00:00
Mario
b99a4ade1a bump version 2023-04-21 10:39:17 +00:00
Mario
84e25e8fd2 Fetch conversations in the background. Otherwise it might sgnificantly delay delivery 2023-04-21 10:34:55 +00:00
Mario
39e14eb95c hotfix: make sure to not pass an empty path to fopen() 2023-04-21 10:33:05 +00:00
Mario
f277d08244 queue and poller testing 2023-04-21 07:45:32 +00:00
Mario
d7c479fa6d % values in format_poll() should be rounded 2023-04-19 11:01:49 +00:00
Mario Vavti
44e5dc7d97 bump version 2023-04-19 11:14:46 +02:00
Mario Vavti
fdd54057a8 also return deleted channels info in webfinger and document why 2023-04-19 11:12:35 +02:00
Mario Vavti
d43485141f use empty for check 2023-04-16 20:12:04 +02:00
Mario Vavti
2350561903 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-16 17:13:00 +02:00
Mario Vavti
5674badccd improved update_directory_entry(), update ud_last even if webfinger failed 2023-04-16 17:12:49 +02:00
Mario
a793f4414d fix php warning 2023-04-16 13:47:48 +00:00
Mario
e99957f99f fix php warning 2023-04-16 11:20:02 +00:00
Mario
ad5bbc463b fix wrong variable 2023-04-16 10:59:26 +00:00
Mario
81993cf2a3 cleanup 2023-04-15 15:15:55 +00:00
Mario
5d40742ee6 fix wrong variable 2023-04-15 07:53:30 +00:00
Mario
1ce050d911 update es strings as per Manuel 2023-04-14 19:02:37 +00:00
Mario
8e7393fc26 update it string as per Giaco 2023-04-14 18:55:45 +00:00
Mario Vavti
ad45205ddf this has been moved to cron for now 2023-04-14 10:45:01 +02:00
Mario Vavti
409e9208ee Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-14 09:21:46 +02:00
Mario Vavti
d8811b499d improved item_expire() 2023-04-14 09:21:33 +02:00
Mario
dd1f9494f1 css fix 2023-04-14 06:04:44 +00:00
Mario Vavti
20f4538db4 update remove_all_xchan_resources() and remove deletion of deprecated conv table 2023-04-13 22:28:08 +02:00
Mario Vavti
d08c8e6edc Revert "zot_info(): improved check for deleted"
This reverts commit f1667dbbe6.
2023-04-13 21:50:13 +02:00
Mario Vavti
f1667dbbe6 zot_info(): improved check for deleted 2023-04-13 21:25:03 +02:00
Mario Vavti
2bab7e2693 prevent duplicate definitions 2023-04-13 18:51:13 +02:00
Mario Vavti
824497b97a fix wrong array key, check for xchan_deleted with empty() which will also catch a possibly already removed xchan (which will be null) and bump version 2023-04-13 11:37:01 +02:00
Mario Vavti
0b7bece8e3 remove pre zot6 compatibility tweaks 2023-04-13 11:01:57 +02:00
Mario Vavti
6ddf1a5786 update zotinfo to use as much info as possible from channel since in some cases the xchan might be history already 2023-04-13 10:45:36 +02:00
Mario Vavti
b9827dfe02 move colon to the variable 2023-04-12 23:11:02 +02:00
Mario Vavti
64f30831ac rename update_modtime() to update() and only bump ud_date if something actually changed 2023-04-12 23:07:19 +02:00
Mario Vavti
bf5722cd25 always call update_modtime() foer now; 2023-04-12 19:07:28 +02:00
Mario Vavti
ae074153c8 remouve updates stuff from import_directory_profile() 2023-04-12 18:40:51 +02:00
Mario Vavti
63d46dbdfb more logging 2023-04-12 18:27:04 +02:00
Mario Vavti
bdf1b23198 reset ud_last if we had contact and some cleanup 2023-04-12 18:24:44 +02:00
Mario Vavti
6f1c261f6b deprecate ud_flags and ud_arr in import_xchan() 2023-04-12 18:01:35 +02:00
Mario Vavti
3233d5485f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-04-12 17:51:09 +02:00
Mario Vavti
aa06400a50 deprecate flags and transaction_id and only return results which are currently updated 2023-04-12 17:50:39 +02:00
Mario
30724bd7c4 update updates if anything changed 2023-04-12 15:35:21 +00:00
Mario Vavti
0d3b389538 fix php warning 2023-04-12 13:35:41 +02:00
Mario Vavti
9f7dbe16fd adjust check 2023-04-12 13:21:26 +02:00
Mario Vavti
432024123a update updates if we are provided an ud_arr or we imported a new xchan 2023-04-12 13:17:23 +02:00
Mario Vavti
261762448e use url instead of addr for updates and clean up local_dir_update() and update_modtime() 2023-04-12 11:36:34 +02:00
Mario Vavti
7ce4175876 initial commit directory sync rewrite - should work but still requires lots of cleanup 2023-04-12 09:29:51 +02:00
Mario
a57739c462 Merge branch 'dev' 2023-04-09 20:01:22 +00:00
Mario
03bdbfa705 set ud_last after successfully probing a channel 2023-04-09 20:00:54 +00:00
Mario
92246ce3a8 Merge branch 'dev' 2023-04-09 19:53:27 +00:00
Mario
cdf74c2e41 Revert "make sure to update ud_last timestamp if we successfully fingered a channel"
This reverts commit f76d9b7908.
2023-04-09 19:52:54 +00:00
Mario
4a72ea6666 Merge branch 'dev' 2023-04-09 19:45:04 +00:00
Mario
f76d9b7908 make sure to update ud_last timestamp if we successfully fingered a channel 2023-04-09 19:44:35 +00:00
Mario
dcfdf3a5d7 Merge branch 'dev' 2023-04-09 19:02:36 +00:00
Mario
4873f61d6c disable thread listener interface by default and minor fixes 2023-04-09 18:51:55 +00:00
Mario
1538107ae4 minor queueworker fixes 2023-04-08 20:25:31 +00:00
Mario
9b93dc5137 split up a potentially long running sql query 2023-04-08 20:18:17 +00:00
Mario Vavti
5ec721b978 likes not synced between clones 2023-03-31 09:31:28 +02:00
Mario
24568c0e2f add some explanation and remove logging 2023-03-30 13:23:16 +00:00
Mario
92a89ca258 version 8.3.1 2023-03-30 13:10:47 +00:00
Mario
ba71c53bc6 ignore deliveries by our own channel which do not origin from the local hub. instead rely on the sync delivery. 2023-03-30 12:08:43 +00:00
Mario Vavti
b3cfeb573a do not add not_here, anon, token and rss contacts to receivers 2023-03-29 21:46:28 +02:00
Mario
9083e99d2a in fact this can be removed
(cherry picked from commit 70ca247c88)
2023-03-24 10:29:09 +01:00
Mario
70ca247c88 in fact this can be removed 2023-03-24 09:22:10 +00:00
Mario
14fc0c735b encode object after we have dealt with deleted items and work around a php error
(cherry picked from commit 70b3c8080e)
2023-03-24 10:05:37 +01:00
Mario
70b3c8080e encode object after we have dealt with deleted items and work around a php error 2023-03-24 09:01:06 +00:00
Mario
2c483c460a initial check in to allow all mentions option 2023-03-23 20:11:18 +00:00
Mario
79405cf1d3 Merge branch 'dev' 2023-03-21 09:20:57 +00:00
Mario
5c755fdd1c PHP 8.1 is the required minimum version 2023-03-21 09:20:22 +00:00
Mario
89285f1408 Merge branch '8.2RC' 2023-03-19 13:55:18 +00:00
Mario
17c0bb2069 version 8.2 2023-03-19 13:54:15 +00:00
Mario
192736f6d7 Merge branch 'dev' into 8.2RC 2023-03-19 13:53:12 +00:00
Mario
ae928b9aff changelog 2023-03-19 13:52:43 +00:00
Mario
4eee8ce770 Merge branch 'dev' into 8.2RC 2023-03-19 13:50:39 +00:00
Mario
723eb6597a simplify 2023-03-19 13:29:35 +00:00
Mario
3dcfdba74b simplify 2023-03-19 13:28:43 +00:00
Mario
5428053663 Merge branch 'dev' into 8.2RC 2023-03-19 09:43:34 +00:00
Mario
d0b41d0b07 more changelog 2023-03-19 09:41:17 +00:00
Mario
a82d861d2c update changelog 2023-03-19 09:25:56 +00:00
Mario
1e184b781b Merge branch 'dev' into 8.2RC 2023-03-19 08:22:29 +00:00
Mario
54b684fdb8 css fixes 2023-03-19 08:22:08 +00:00
Mario
c1ddb89990 Merge branch 'dev' into 8.2RC 2023-03-18 15:47:09 +00:00
Mario
2f5fa4df75 add the download attribute to prevent onbeforeunload 2023-03-18 15:46:30 +00:00
Mario
20735083b3 update bb_parse_b64_crypt() 2023-03-18 14:52:25 +00:00
Mario
7ac7cb129f Merge branch 'dev' into 8.2RC 2023-03-17 09:44:17 +00:00
Mario
f8b2f738bb remove redundant untranslated htconfig templates and add the db_skip_locked_supported config option 2023-03-17 09:30:17 +00:00
Mario
11b9e546a9 Merge branch 'dev' into 8.2RC 2023-03-14 10:43:03 +00:00
Mario
7e4721e4c7 work around friendica img attachment has different href than body which results in duplicate images 2023-03-14 10:35:01 +00:00
Mario
3a3fd38e3a Merge branch 'dev' into 8.2RC 2023-03-12 22:04:37 +00:00
Mario
63a8611579 fix issue #1728 2023-03-12 22:03:47 +00:00
Mario
38a1b79174 fix max_oembed_size check if content length header is an array (e.g. after a redirect with code 301) - fix issue #1727 2023-03-12 20:59:36 +00:00
Mario
0a679e503e make sure to only transform channel wall posts for group actors
(cherry picked from commit 95cbcf30d7)
2023-03-12 19:56:34 +01:00
Mario
e7c529f2c3 Merge branch 'dev' into 8.2RC 2023-03-12 18:44:28 +00:00
Mario
95cbcf30d7 make sure to only transform channel wall posts for group actors 2023-03-12 18:43:50 +00:00
Mario
dfc70021e3 fix version after merge 2023-03-12 09:38:31 +00:00
Mario
9daecca0ad make an format exception for repeated forum posts 2023-03-12 09:34:35 +00:00
Mario
c9d8a4dc1d bump dev version 2023-03-11 20:43:21 +00:00
Mario
5fada6a497 more strings and provide mfa feedback via jgrowl 2023-03-11 20:40:32 +00:00
Mario
ac9c33fb3b check form security token and require password to enable/diable mfa 2023-03-11 20:24:56 +00:00
Mario
641b1c2e1b fix php error 2023-03-11 19:38:37 +00:00
Mario
f031707563 strings and version 2023-03-11 19:37:34 +00:00
Mario
7f0518f693 merge es translations as per manuel 2023-03-11 19:28:17 +00:00
Mario
634d2f02b5 translateable strings 2023-03-11 19:25:27 +00:00
Mario
d7aee292d3 mark items as fetched in other places 2023-03-11 14:47:10 +00:00
Mario
1987517836 only set owner to observer if the item is not fetched otherwise the comment author could end up as owner 2023-03-09 18:31:43 +00:00
Mario
203d9d651f mfa strings update 2023-03-09 15:48:03 +00:00
Mario
8af5788fc1 more mfa cleanup, set the value in session if mfa is enabled and only allow enabling mfa after a test passed 2023-03-08 17:29:56 +00:00
Mario
3de81877c6 more mfa cleanup 2023-03-08 13:15:33 +00:00
Mario
2665b34962 whitespace 2023-03-08 10:21:05 +00:00
Mario
2ffef2be8f minor cleanup 2023-03-08 10:18:32 +00:00
Mario
c2e5610455 tests 2023-03-08 10:11:59 +00:00
Mario
234bb64250 port totp mfa from streams with some adjustions 2023-03-08 10:04:29 +00:00
Mario
d43a56614c position should be fixed 2023-03-04 21:33:50 +00:00
Mario
9f10e7e356 simplify pageloader animation 2023-03-04 17:03:37 +00:00
Mario
dc6075aa3f do not use zrl tag for non zot profiles and remove redundant foreach which was a leftover from zot to zot6 transition days 2023-03-03 19:33:39 +00:00
Mario
972d6917ac add fixme 2023-03-03 14:59:48 +00:00
Mario
ec3ba87f3a Revert "some work on bringing bang tags back for forums"
This reverts commit da034045cc.
2023-03-03 08:49:18 +00:00
Mario
da034045cc some work on bringing bang tags back for forums 2023-03-02 21:15:19 +00:00
Mario
65f001b4b7 provide a fake progress bar for pwa standalone mode 2023-03-02 16:45:10 +00:00
Mario
d81473487f minor cleanup and docu 2023-03-02 12:39:21 +00:00
Mario
06a8d5a4fa bump version 2023-03-02 11:48:52 +00:00
Mario
3653a86ad3 message filter entries are stored encoded - make sure to decode the word before we use it 2023-03-02 11:00:03 +00:00
Mario
c8d913fba7 wrong variable 2023-03-02 10:24:18 +00:00
Mario
b70acd0079 wrong variable 2023-03-02 10:20:43 +00:00
Mario
f167648115 improve mod hq to save some db lookups 2023-03-02 10:14:49 +00:00
Mario
b457c66bf9 do not include deleted hublocs when looking for author 2023-03-02 10:13:54 +00:00
Mario
ca0bd3ed32 fix some php warnings 2023-02-28 09:29:39 +00:00
Mario
7dacc7c268 Revert "fix second part of issue #1731"
This reverts commit 0db2e6b62c.
2023-02-27 20:38:42 +00:00
Mario
0db2e6b62c fix second part of issue #1731 2023-02-27 20:31:16 +00:00
Mario
e412bdbdbe bump version 2023-02-27 09:07:26 +00:00
Mario
f032bcc5f2 Default owner_xchan to $observer (sender) in Activity::store() - this is because in case where an announce holds a relayed activity we drop the announce and process the relayed activity only. In that case actor.id as set in Activity::decode_note() will not be the correct owner. In other cases actor.id and sender should be identical. 2023-02-27 08:42:13 +00:00
Mario
9ab9ac0e2e possible fix for issue #1731 2023-02-27 08:22:35 +00:00
Mario
fd3adf4d11 slightly improve contact search 2023-02-24 21:35:22 +00:00
Mario
c42911bd8d css fixes 2023-02-23 16:19:02 +00:00
Mario
828087ee8c fix syntax for get_compund_property() 2023-02-23 14:54:04 +00:00
Mario
efcda1d37d port some functions from streams 2023-02-23 09:51:37 +00:00
Mario
656400b418 look for owner instead of author - this way we will also catch the via posts 2023-02-22 17:07:53 +00:00
Mario
ca7bd49964 Activity: do not force new thread if the announce is from a group actor 2023-02-22 11:20:32 +00:00
Mario
3527137264 Activity: set xchan_pubforum if we deal with a group actor 2023-02-22 10:47:11 +00:00
Mario
e045a36559 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-02-17 10:18:30 +00:00
Mario
ee8fc701a6 do not try to oembed in notes 2023-02-17 10:18:01 +00:00
Mario Vavti
777fdeb462 realy make sure we will deduplicate even if there is a bogus second primary entry 2023-02-16 16:56:57 +01:00
Mario Vavti
1078b774ae make sure we will deduplicate even if there is a bogus second primary entry 2023-02-16 16:52:29 +01:00
Mario
62a363debc queue fixes 2023-02-16 14:17:05 +00:00
Mario Vavti
7839b931f1 make sure we provide a created timestamp for likes and remove the workaround which returned the wrong date format 2023-02-16 13:12:22 +01:00
Mario
cbf8c4bdb2 more queue updates from streams and remove a hz_syslog 2023-02-16 11:16:44 +00:00
Mario
321cd9f2e0 more restructure for better responsive behaviour 2023-02-15 18:06:16 +00:00
Mario
09a60774d7 we can sign messages which are not from the primary location 2023-02-15 13:33:23 +00:00
Mario
1ca988b177 revisit author_id and fix issue with pinned content 2023-02-15 09:41:48 +00:00
Mario
07fd8cf6cd restructure wall-item-head 2023-02-15 08:51:23 +00:00
Mario
e7fb56447a bump version 2023-02-14 07:35:41 +00:00
Mario
de3e83f0a2 fix mod cal after fullcalendar update 2023-02-14 07:33:05 +00:00
Mario
6c78f7b769 css fixes 2023-02-12 15:05:06 +00:00
Mario
2c459fefce remove deprecated functions 2023-02-12 14:13:59 +00:00
Mario
a1eb39872b implement hq widget author image and notifications updates 2023-02-12 10:43:31 +00:00
Mario
724b8cc6a5 port queue improvements from streams 2023-02-12 10:41:23 +00:00
Mario Vavti
2bfd18e6cd css fixes 2023-02-10 21:08:49 +01:00
Mario
20658f3b4a do not blur 2023-02-09 12:46:23 +00:00
Mario
c945698eb4 work around wierd textcomplete behaviour 2023-02-09 12:37:08 +00:00
Mario
5f89bd75a4 bump version 2023-02-09 01:53:46 +00:00
Mario
09c9b47265 fix more hubloc confusion, implement hq widget author filter and some autocomplete fixes 2023-02-09 01:52:48 +00:00
Mario
ea2b653b9b queueworker: do not wait for locked rows, use skip locked if configured via system.db_skip_locked_supported 2023-02-08 11:03:29 +00:00
Mario
9c3660e2f6 remove superfluous semicolon 2023-02-01 10:02:35 +00:00
Mario
4bcacf858b do not deduplicate notifications because the dupes could be valid and var -> let 2023-01-29 10:06:58 +00:00
Mario
7faa3359f0 fix undefined varable warning 2023-01-28 20:19:51 +00:00
Mario
71f1814477 remove redundant argument 2023-01-28 20:04:18 +00:00
Mario
a3913c5ca4 fix ics import 2023-01-28 16:57:32 +00:00
Mario
ae1cc65b23 do not use transparency for navbar togglers in dark mode 2023-01-28 15:00:11 +00:00
Mario
9a16bf65bd update simplepie 2023-01-27 07:28:21 +00:00
Mario
c3d3dc9d92 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-01-27 07:26:35 +00:00
Mario
e54eb21b71 update smarty 2023-01-27 07:24:50 +00:00
Harald Eilertsen
0140f9fe56 translations: Misc updates for nb_NO.
(cherry picked from commit ec6832687b)
2023-01-27 08:00:26 +01:00
Harald Eilertsen
03243df16a translations: Fix timeago for nb_NO.
(cherry picked from commit 9065a90ac0)
2023-01-27 08:00:07 +01:00
Mario
28dc8443a8 Merge branch 'translations/update-nb-no' into 'dev'
Translations/update nb no

See merge request hubzilla/core!2034
2023-01-27 06:58:45 +00:00
Harald Eilertsen
ec6832687b translations: Misc updates for nb_NO. 2023-01-26 20:07:59 +01:00
Harald Eilertsen
9065a90ac0 translations: Fix timeago for nb_NO. 2023-01-26 20:07:02 +01:00
Mario
94b26e1e66 redbasic: fix regression 2023-01-26 18:35:49 +00:00
Mario
a2fc2e776a bump version 2023-01-26 18:29:21 +00:00
Mario
79b40179b4 redbasic: implement setting for always light navbar icons and some minor fixes 2023-01-26 18:28:40 +00:00
Mario
60c968222f bump version 2023-01-26 10:26:55 +00:00
Mario
e99dc2193f remove unsused variables 2023-01-26 10:23:33 +00:00
Mario
cf1838f76e minor cleanup and prevent duplicate recipients in some places 2023-01-26 10:10:06 +00:00
Mario
0db5016666 remove redundant code 2023-01-26 09:15:46 +00:00
Mario
c4b37ba462 theme fixes 2023-01-26 07:22:21 +00:00
Mario
c3b908dcfc : fixes 2023-01-25 16:35:18 +00:00
Mario
23f93044c1 update forkawesome lib 2023-01-25 15:22:15 +00:00
Mario
32dcc28414 calendar: fixes 2023-01-25 14:05:20 +00:00
Mario
ddae3eaf84 calendar: remove deprecated options 2023-01-25 13:39:50 +00:00
Mario
a9ae17036d update fullcalendar 2023-01-25 13:09:00 +00:00
Mario
08e925758e update fullcalendar library 2023-01-25 13:08:05 +00:00
Mario
213c8a6eec according to spec this should be id instead of href 2023-01-25 13:06:50 +00:00
Mario
ca4ad836a3 revert theme color 2023-01-25 11:00:01 +00:00
Mario
56361fa2fc theme fixes 2023-01-25 10:59:17 +00:00
Mario
fedce4cd74 cleanup 2023-01-24 09:36:27 +00:00
Mario
cac48fc4bf use light colored navbar for light mode - this makes the focus light schema redundant 2023-01-24 09:29:00 +00:00
Mario
1cad844d2d theme fixes 2023-01-22 15:35:55 +00:00
Mario
2d5e09f930 theme fixes 2023-01-20 20:07:37 +00:00
Mario
fbda34935d remove dark schema quirks 2023-01-20 11:19:39 +00:00
Mario
c5ca7f236f bump version 2023-01-20 11:06:05 +00:00
Mario
9dc949b62c native dark theme initial checkin 2023-01-20 11:05:15 +00:00
Mario
40394b94d7 typo :\ 2023-01-17 10:33:31 +00:00
Mario
bae446973f reflect pubstream disable/enable logic change in can_view_public_stream() 2023-01-17 10:29:12 +00:00
Mario
2805520d1b Merge remote-tracking branch 'origin/8.0RC' 2023-01-13 20:01:05 +00:00
Mario
fb7ca18820 version 8.0 2023-01-13 19:56:11 +00:00
Mario
1b00d5657f Merge branch 'dev' into 8.0RC 2023-01-13 19:55:44 +00:00
Mario
cd9f35e78a update changelog 2023-01-13 19:55:18 +00:00
Mario
f9cedab964 update changelog 2023-01-13 09:42:57 +00:00
Mario
9ec516e5a4 Merge branch 'dev' into 8.0RC 2023-01-12 16:12:26 +00:00
Mario
550b6d90a4 missing semicolon 2023-01-12 16:11:42 +00:00
Mario
5cb92b6e21 Merge branch 'dev' into 8.0RC 2023-01-12 11:55:13 +00:00
Mario
8a7b221412 mark old hubloc entries from re-installed hubs deleted if we discover any 2023-01-12 11:28:48 +00:00
Mario
d092e79ebc remove fragment in notifier - it should not be required, when processing multiple choice polls sleep some time before calling the notifier 2023-01-12 11:04:03 +00:00
Mario
2ddb88a34d RC2 2023-01-11 19:57:35 +00:00
Mario
71761c9039 Merge branch 'dev' into 8.0RC 2023-01-11 16:35:21 +00:00
Mario
16555b93bb fix race conditions when processing multiple choice polls 2023-01-11 16:34:23 +00:00
Mario
bd5e834b42 Merge branch 'dev' into 8.0RC 2023-01-08 08:20:05 +00:00
Mario
2eb4f093be update theme requirements 2023-01-08 08:19:37 +00:00
Max Kostikov
d4bf587103 Merge branch 'dev' into 'dev'
Fix Russian translation escaping

See merge request hubzilla/core!2033
2023-01-07 14:06:54 +00:00
Max Kostikov
ae7bd8b644 Fix translation escaping 2023-01-07 14:05:52 +00:00
Max Kostikov
f89cede020 Merge branch 'dev' into 'dev'
Update Russian translations

See merge request hubzilla/core!2032
2023-01-07 13:58:39 +00:00
Max Kostikov
59facf6f00 Update hstrings.php 2023-01-06 11:29:49 +00:00
Max Kostikov
01d93733ae Update hmessages.po 2023-01-06 11:24:03 +00:00
Mario
4c434129a6 Merge branch 'dev' into 8.0RC 2023-01-05 18:25:45 +01:00
Mario
b40499b4c1 revert accidental change in session 2023-01-05 18:25:08 +01:00
Mario
66333aedb7 fix version 2023-01-05 18:23:00 +01:00
Mario
47071c58aa fix affinity slider updates - issue #1714 2023-01-05 18:21:49 +01:00
Mario
79d99688b4 bump version 2023-01-05 11:39:09 +01:00
Mario
edcb0631aa composer dump autoload 2023-01-05 11:35:15 +01:00
Mario
bc361e6469 strings and version 2023-01-05 11:33:50 +01:00
Mario
c95ef1a5c0 pdledit_gui: only show installed modules and widgets 2023-01-05 11:06:19 +01:00
Mario
0c0891f64f bump version 2023-01-05 10:37:40 +01:00
Mario
23828f53bc pubstream: when going to conv from unthreaded mode stay in the module 2023-01-05 10:29:42 +01:00
Mario
f909e129ab Merge branch 'nb-no/update-translations' into 'dev'
Update translations for nb-no (Norsk Bokmål)

See merge request hubzilla/core!2031
2023-01-04 20:34:57 +00:00
Mario
7d4bcc2e8b translateable strings 2023-01-04 20:20:14 +00:00
Mario
2eb4d87621 fix issue #1717 2023-01-04 20:14:11 +00:00
Mario
435888c1a3 bump version 2023-01-04 19:39:11 +00:00
Mario
e69fabcd71 pdledi_gui: sort widgets 2023-01-04 19:33:18 +00:00
Mario
1a283301cf Revert "pdledit_gui: minor cleanup"
This reverts commit 031df70cf8.
2023-01-04 19:29:42 +00:00
Mario
031df70cf8 pdledit_gui: minor cleanup 2023-01-04 19:29:11 +00:00
Mario
3ad36db7dd pdledit_gui: minor cleanup 2023-01-04 19:27:44 +00:00
Mario
e16ea1ae05 pdl editor for addon iitial commit 2023-01-04 14:25:46 +00:00
Mario
941135a0a6 we should look for owner_xchan just like in mod pubstream 2023-01-04 09:01:44 +00:00
Mario
29776ecea2 queueworker: implement auto_queue_worker_sleep setting in frontend 2023-01-03 13:50:22 +00:00
Mario
d2edef5c5a go away if method is not implemented 2023-01-03 13:30:53 +00:00
Mario
da9349ea62 provide inline error messages for mod cloud 2023-01-03 10:59:38 +00:00
Mario
de0d2afc15 fix issues with pubstream tagcloud 2023-01-02 21:56:20 +00:00
Mario Vavti
d8c94c2003 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2023-01-02 20:39:15 +01:00
Mario Vavti
0e71bfe222 add sys channel to receiveres for public items 2023-01-02 20:38:56 +01:00
Mario
0ae402e624 bump version 2023-01-02 18:38:44 +00:00
Mario
b96dc11ddd improve sse loop 2023-01-02 18:37:36 +00:00
Mario Vavti
37b539eaa5 fix wrong variable - issue #1720 2023-01-01 21:25:15 +01:00
Mario Vavti
0741708086 change the logic of building the site only public stream. we will now fetch sys channel items but restrict them to authors of this site only. this fixes a comment permission issue. 2023-01-01 21:21:13 +01:00
Mario
a30cfd8fec filter approvals 2022-12-27 16:08:08 +00:00
Mario
633cd11c5b move mod queueworker to /admin 2022-12-27 10:44:54 +00:00
Mario
3101c6540a add workerq to the install schemas 2022-12-27 10:33:29 +00:00
Mario
d2d6be73b8 fix subquery in hq widget and order by hubloc_id desc in handle_tag() to make sure we get the most recent entry when using privacy tags 2022-12-26 09:08:54 +00:00
Mario
a46e2c1e6d only display details if there are any 2022-12-22 13:35:46 +00:00
Mario
2b0404fefc queueworker: add some more details 2022-12-22 13:29:34 +00:00
Mario
7ef9462286 bring back item-highlight 2022-12-22 12:22:32 +00:00
Mario Vavti
c6e7a7eaee comment out unused code 2022-12-22 12:42:44 +01:00
Mario
999e142370 minor cleanup 2022-12-22 10:09:35 +00:00
Mario
a7ad117a83 there is no point in wrapping single queries into a transaction 2022-12-22 10:02:31 +00:00
Mario
1ba44fc117 update 2022-12-21 17:15:34 +00:00
Mario
ca5610ebf1 bump version 2022-12-21 17:13:09 +00:00
Mario
e5c70a1304 queueworker: adjust process query to be complient with mariadb < 10.6 and add process timeout exceptions for long running processes 2022-12-21 17:11:33 +00:00
Mario
7dd2308534 pooll fixes 2022-12-20 20:16:06 +00:00
Mario Vavti
62eee07b6e make sure to include only zot6 hublocs in this query. including other networks could lead to unexpected results 2022-12-20 14:06:14 +01:00
Mario
f6d9406063 streamline ap followers only privacy warning with current handling. also fixes possible php error.
(cherry picked from commit 34125177e8)
2022-12-19 10:05:02 +01:00
Mario
34125177e8 streamline ap followers only privacy warning with current handling. also fixes possible php error. 2022-12-19 09:04:24 +00:00
Mario
d977b5d662 bump version 2022-12-18 10:24:44 +00:00
Mario
e36677b757 queueworker: cleanup and implement auto sleep interval (hidden config for now) 2022-12-18 10:19:06 +00:00
Mario
4d54755057 queueworker: fix maxworkers check and cleanup 2022-12-15 16:53:17 +00:00
Mario
91917c98e4 bump version 2022-12-15 09:19:56 +00:00
Mario
2f687de477 queueworker testing and more logging to syslog 2022-12-15 09:18:58 +00:00
Mario Vavti
5446062b95 bump version 2022-12-12 23:28:26 +01:00
Mario Vavti
c9e170dfcc queueworker: introduce new interval config queueworker.queue_interval - defaults to 500000 microseconds. No config UI yet. 2022-12-12 23:26:45 +01:00
Mario
e3a19469eb bring back poll and delivery interval 2022-12-12 09:03:49 +00:00
Mario
45f8e43be4 debug from php log 2022-12-11 20:46:02 +00:00
Mario
7ef0b05ce6 fix typo 2022-12-11 20:24:22 +00:00
Mario
c5a0ec4e93 css fixes 2022-12-11 19:19:47 +00:00
Mario
1c17768dc5 minor fixes 2022-12-11 10:40:02 +00:00
Mario
86e1dd4673 remove debug logging 2022-12-10 17:06:54 +00:00
Mario
0ee41c3341 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-12-10 17:04:18 +00:00
Mario
e1c2835173 add option to set worker sleep based on load average, remove redundand code and add return to some daemons 2022-12-10 17:03:57 +00:00
Max Kostikov
5c6d3753ef Fix Redis session PHP warnings 2022-12-09 15:53:01 +00:00
Mario
6e881bcef2 exclude not tagable xchan networks handle_tag()
(cherry picked from commit 4f9a933108)
2022-12-08 21:41:56 +01:00
Mario
4f9a933108 exclude not tagable xchan networks handle_tag() 2022-12-08 20:40:37 +00:00
Mario
9f8585914c sse_bs: respect the site firehose setting 2022-12-07 14:07:31 +00:00
Mario
3ba27b9752 add mark to html2bbcode parser 2022-12-07 11:01:28 +00:00
Mario
abae5de4d8 when uploading a image file, embed it in the item. otherwise attach it 2022-12-07 10:50:26 +00:00
Mario
6952c5a3f5 $visitor is a string 2022-12-06 11:15:53 +00:00
Mario
0184d2c292 typo 2022-12-04 10:43:57 +00:00
Mario
7a40561aaa wording 2022-12-04 10:36:30 +00:00
Mario
79e6c9590a the logic for public stream has changed - adjust help text and externals, disable lockfile check in cron daemon 2022-12-04 10:27:02 +00:00
Mario
12a963cc40 version 7.8.7 2022-12-03 09:01:18 +00:00
Mario
f89975fd0e changelog 7.8.7
(cherry picked from commit b4dffe5946)
2022-12-03 09:59:06 +01:00
Mario
b4dffe5946 changelog 7.8.7 2022-12-03 08:57:56 +00:00
Mario
539b69d507 look for iconfig at the right place, fix mod sharedwithme, comment out unused configs 2022-12-03 08:53:53 +00:00
Harald Eilertsen
9927363f39 Update translations for nb-no (Norsk Bokmål) 2022-12-03 00:30:16 +01:00
Mario
1a4f59cd70 bump version 2022-12-02 19:32:47 +00:00
Mario
25727a24a5 fix typos 2022-12-02 19:29:46 +00:00
Mario
2fd2dc964b Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-12-02 19:28:52 +00:00
Mario
935b032f15 db update 1254 2022-12-02 19:22:50 +00:00
Mario
2bb58843ab move queueworker to core and bump version 2022-12-02 19:22:19 +00:00
Mario
00512579f3 fix regression when adding feed contacts
(cherry picked from commit 5216c5b232)
2022-12-02 18:47:40 +01:00
Mario
6f09796142 Merge branch 'fix-category-widget-urls' into 'dev'
Fix Category widget URLs

See merge request hubzilla/core!2030
2022-12-02 17:46:42 +00:00
Mario
697a74f37e fix regression: new event not created
(cherry picked from commit d16b6c3838)
2022-12-02 18:06:20 +01:00
Mario
d16b6c3838 fix regression: new event not created 2022-12-02 15:18:01 +00:00
Mario
e4461f2e61 adjust the query to work with postgres 2022-11-30 11:20:10 +00:00
Mario
baf1b8b02d fetch the unseen count in a subquery instead of a separate query and rename array key 2022-11-30 10:36:55 +00:00
Mario
3ce1373ae0 provide a pdl file for mod invite and set the profile 2022-11-30 09:18:57 +00:00
Mario
4002531b92 fix issue where site_firehose setting was always false 2022-11-29 10:00:07 +00:00
Mario
004d0f074d disable context help until its content will be updated - it is not helpful otherwise 2022-11-27 12:20:04 +00:00
Mario
e87887c328 re-install: make sure to fetch the latest hubloc in api_auth otherwise authentication might fail 2022-11-27 09:40:23 +00:00
Harald Eilertsen
2de2c8e207 Fix Category widget URLs
The category widget template expects a URL without any query params, as
it appends `/?cat=<selected category>` to the base URL passed to it.

The Widget code tried to preserve any query param passed to it except
for the `cat` query param. When passed to the template, this caused the
invalid URLs to be generated.

Example input url:

    https://example.com/channel/user?f=&tag=pasta

The URL generated for the "Dinner" category would then be:

    https://example.com/channel/user&tag=pasta&tag=pasta/?cat=Dinner

Which is troublesome in more than one way, and cause at least some
search bots to go wild by sending requests with increasingly long URLs.

This patch will simply discard the existing query params in the URL, so
with the same input url, the generated URL for the "Dinner" category
will now be:

    https://example.com/channel/user/?cat=Dinner

This is comparable to what the Category Cloud and Tag Cloud widgets
already do.
2022-11-26 15:45:37 +01:00
Mario
c76f19f19a bump version 2022-11-26 08:39:59 +00:00
Mario
a050e8c8f5 should compare against abook_updated to make sure we do not always poll broken feeds 2022-11-26 08:37:45 +00:00
Mario
ae1fad5de7 basically every incoming item should have a uuid by now 2022-11-25 18:44:33 +00:00
Mario
68ca8951a8 mark unseen items seen after a certain amount of time (default 90 days) 2022-11-25 18:37:22 +00:00
Mario Vavti
1e4718eae1 do not always trigger a sse event if pubs notification are off or the app is not installed for the channel 2022-11-24 16:42:09 +01:00
Mario Vavti
680cf25f37 de-duplicate by mid. there is no combined index for uid and uuid hence the query could be slow if an uid has a lot of items. the workaround for hubzilla < 4.0 is not required anymore 2022-11-24 16:08:57 +01:00
Mario Vavti
7ec6df495f slight restructure 2022-11-24 16:05:19 +01:00
Mario
aeda31fda7 fix warnings 2022-11-24 09:52:50 +00:00
Mario
5248aa3065 css fix 2022-11-24 09:42:35 +00:00
Mario
67767c5853 Merge branch 'redbasic/dark-theme-fixes' into 'dev'
redbasic: Dark scheme fixes

See merge request hubzilla/core!2029
2022-11-23 18:43:42 +00:00
Mario
6de1aec683 the blue dots were slightly too bold. 2022-11-22 21:10:11 +00:00
Harald Eilertsen
221d3cdf6a redbasic: Dark theme fixes
- Make rows in admin tables readable while hovering over them.
2022-11-22 15:31:54 +01:00
Harald Eilertsen
1ff12c5520 redbasic: Dark scheme fixes
- Changed background of category tags to make them readable.
- Changed background on "view source" dialog to make it readable.
2022-11-22 09:46:41 +01:00
Mario
41376ec2cd fix issue in tag_deliver() and silence some more warnings 2022-11-20 20:31:59 +00:00
Mario
bf335ecaf3 hq widget: use distinct classes for seen and unseen thread items count 2022-11-18 13:32:14 +00:00
Mario
424bc73f58 bump version 2022-11-18 10:45:42 +00:00
Mario
59e6989cbc hq widget: implement thread unseen items count 2022-11-18 10:43:33 +00:00
Mario
0e6b27c9f4 if a feed fails, do not update connected timestamp. attempt to poll feeds only once a day if we could not fetch it last time we tried 2022-11-17 11:50:13 +00:00
Mario
0e157e4e8b remove logging 2022-11-17 09:11:34 +00:00
Mario
805074a0f9 externals: fix warnings 2022-11-17 09:09:02 +00:00
Mario
5216c5b232 fix regression when adding feed contacts 2022-11-17 08:57:09 +00:00
Mario
8633162f0c bump versionà 2022-11-15 21:22:39 +00:00
Mario
c392a77b46 performance: just count the first 99 unseen items and display 99+ if there are more than 99 2022-11-15 21:22:10 +00:00
Mario
08c2c9bc22 possible fix for issue #1698 2022-11-15 19:29:29 +00:00
Mario
f64bd590a8 bump version 2022-11-14 05:51:32 +00:00
Mario
131ffcf582 changelog 7.8.6 2022-11-14 05:49:33 +00:00
Mario
b17a0aef17 fix typo and version 7.8.6 2022-11-14 05:47:16 +00:00
Mario
8a21783fa5 bump version 2022-11-13 19:45:36 +00:00
Mario
53152e2ef5 version 7.8.5 2022-11-13 19:44:08 +00:00
Mario
ca6ba92d82 Merge branch 'dev' 2022-11-13 19:43:12 +00:00
Mario
04516b787a update changelog 2022-11-13 19:42:07 +00:00
Mario
6e124a4d72 changelog 2022-11-13 19:40:03 +00:00
Mario
6da65c7ddc cast the type to update if it is an edit 2022-11-13 17:13:33 +00:00
Mario
9eb332f032 allow to look for pubstream items if we do not own one but make sure the permissons are checked correctly 2022-11-10 17:57:26 +00:00
Mario
30ddee65a4 fix wrong array key and undefined array key 2022-11-10 10:48:24 +00:00
Mario
63dc8d7fc4 fix undefined variable 2022-11-10 10:37:41 +00:00
Mario
a1a287bac7 fix typo in variable name 2022-11-10 10:34:05 +00:00
Mario
e9b786d5e8 Ãwrong array key 2022-11-09 13:05:48 +00:00
Mario
ad9fb411f6 address issue #1705 2022-11-09 11:52:55 +00:00
Mario
1ff982983e items_fetch(): check if set and if there is a value 2022-11-09 11:34:03 +00:00
Mario
8c6c43d762 items_fetch(): check if set and if there is a value 2022-11-09 11:33:10 +00:00
Mario
6baf197842 version 7.8.4 2022-11-09 09:38:09 +00:00
Mario
42e5a50e4f changelog and version 2022-11-09 09:33:18 +00:00
Mario
b713c9a491 fix new uuid created when editing post 2022-11-09 09:27:33 +00:00
Mario
64ade742d9 whitespace 2022-11-07 19:55:30 +00:00
Mario
1870c3c876 whitespace 2022-11-07 19:55:13 +00:00
Mario
23b272aafd merge conflict 2022-11-07 19:53:03 +00:00
Mario
057db41758 bump version 2022-11-07 19:50:55 +00:00
Mario
839c5a8e41 fix regression where automatically created directories were not public and pinned/featured state of apps was not displayed correctly 2022-11-07 19:41:22 +00:00
Mario
36b8b6bf6c Merge branch 'dev' 2022-11-06 08:27:18 +00:00
Mario
40d74fa779 fix case and german translation string 2022-11-06 08:27:00 +00:00
11477 changed files with 823213 additions and 369853 deletions

156
.debianinstall/README.md Normal file
View File

@@ -0,0 +1,156 @@
# How to use
## Disclaimers
- **This script does work with a fresh install of Debian 12 only**.
- Do not use if you have already installed and configured a webserver or sql server that was not installed by this script.
### Keep it Simple and Stupid
The script keeps everything as simple as possible (KISS):
- Apache as webserver (there is no choice to use another webserver like nginx)
- default PHP version of Debian
- one single Hubzilla intance only
- re-running the script does no harm
### When to use other Scripts
Use the scripts under [homeinstall](https://framagit.org/hubzilla/core/-/tree/master/.homeinstall)
if you look for more choices. The main differences are:
- Apache or nginx as webserver
- install multiple instances (domains) that run side by side on the server
- adds apache vhosts (instead of using the standard doc root /var/www/html)
- install PHP from https://packages.sury.org/php/ (instead of using the Debian repository)
- graphical installer whiptail
- The script stops (fails) if it finds results of a previous installation. (The [debian-setup.sh](https://framagit.org/ojrandom/core/-/tree/dev/.debianinstall) will just jump over it.)
- If something fails the script tries to clean up everything that was installed up to the point of failure. (That might cause trouble if certbot registered a certificate already.)
- The script under [homeinstall](https://framagit.org/hubzilla/core/-/tree/master/.homeinstall) seems to be an older version of the scripts used for Streams, i.e. [autoinstall](https://codeberg.org/streams/streams/src/branch/dev/contrib/autoinstall) and [easyinstall](https://codeberg.org/streams/streams/src/branch/dev/contrib/easyinstall)
## Preconditions
Hardware
+ internet connection and router at home
+ computer connected to your router (a Raspberry 4 will do for very small Hubs)
Software
+ fresh installation of Debian 12 (bookworm) or Raspberry Pi OS
+ router with open ports 80 and 443 for your web server
You can of course run the script on a VPS or any distant server as long as the above software requirements are satisfied.
## How to run the script
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
+ Log on to your fresh Debian
- apt-get install git
- mkdir -p /var/www
- cd /var/www
- git clone https://framagit.org/hubzilla/core.git html
- cd html/.debianinstall
- cp config.txt.template config.txt
- nano config.txt
- read the comments carefully
- enter your values: db pass, domain
- (optionally) Enter your values for dyn DNS
- ./debian-setup.sh as root
- ... wait, wait, wait until the script is finished
+ Open your domain with a browser and step throught the initial configuration of your hubzilla instance.
- default database name = hubzilla
- default dababase user = hubzilla
## Optional - Switch verification of email on/off
Do this just before you register the first user without email verification.
In a terminal
su -
cd /var/www/html
Check the current setting
util/config system verify_email
Switch the verification off
util/config system verify_email 0
Check if updates from the repository do work
util/udall
## What the script will do for you...
+ install everything required by your hubzilla instance, basically a web server (Apache), PHP, a database (MySQL), certbot,...
+ create a database
+ run certbot to have everything for a secure connection (httpS)
+ create a script for daily maintenance
- renew certfificate (letsencrypt)
- update of your hubzilla instance for core and addons (git)
- update of Debian
- restart
+ create cron jobs for
- DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes
- Master.php for your hubzilla instance every 10 minutes
- daily maintenance script every day at 05:30
The script is known to work without adjustments with
+ Hardware
- standard PC with Debian 12 (bookworm)
- Raspberry 5 with Raspberry Pi OS, Debian 12
- for tesing purposes: under localhost inside a virtual machine, [KVM](https://wiki.debian.org/KVM)
+ DynDNS
- selfHOST.de
- freedns.afraid.org
# Step-by-Step - some Details
## Preparations
## Configure your Router
Your webserver has to be visible in the internet.
Open the ports 80 and 443 on your router for your Debian. Make sure your web server is marked as "exposed host".
## Preparations Dynamic IP Address
Follow the instructions in .debianinstall/config.txt.
In short...
Your Hubzilla server must be reachable by a domain that you can type in your browser
cooldomain.org
You can use subdomains as well
my.cooldomain.org
There are two ways to get a domain...
### Method 1: Buy a Domain
...for example buy at selfHOST.de
The cost is 1,50 € per month (2019).
### Method 2: Register a free subdomain
...for example register at freedns.afraid.org
## Note on Rasperry
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
sudo raspi-config
to boot the Rapsi to the client console.

View File

@@ -0,0 +1,110 @@
###############################################
### MANDATORY - database password #############
#
# Please give your database password
# It is better to not use blanks inside the password.
# Example: db_pass=pass_word_with_no_blanks_in_it
db_pass=
###############################################
### MANDATORY - let's encrypt #################
#
# Zot requires encrypted communication via secure HTTP (HTTPS).
# This script automates installation of an SSL certificate from
# Let's Encrypt (https://letsencrypt.org)
#
# Please give the domain name of your hub/instance
#
# Example: my.cooldomain.org
# Example: cooldomain.org
#
# You might use "localhost" for a LOCAL TEST installation.
# This is usefull if you want to debug the server inside a VM.
#
# Example: localhost
#
# Email is optional if you use "localhost".
#
#
le_domain=
le_email=
###############################################
### OPTIONAL - selfHOST - dynamic IP address ##
#
# 1. Register a domain at selfhost.de
# - choose offer "DOMAIN dynamisch" 1,50€/mon at 04/2019
# 2. Get your configuration for dynamic IP update
# - Log in at selfhost.de
# - go to "DynDNS Accounte"
# - klick "Details" of your (freshly) registered domain
# - You will find the configuration there
# - Benutzername (user name) > use this for "selfhost_user="
# - Passwort (pass word) > use this for "selfhost_pass="
#
#
selfhost_user=
selfhost_pass=
###############################################
### OPTIONAL - FreeDNS - dynamic IP address ###
#
# Please give the alpha-numeric-key of freedns
#
# Get a free subdomain from freedns and use it for your dynamic ip address
# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html
#
# - Register for a Free domain at http://freedns.afraid.org/signup/
# - WATCH THIS: Make sure you choose a domain with as less subdomains as
# possible. Why? Let's encrpyt issues a limited count of certificates each
# day. Possible other users of this domain will try to issue a certificate
# at the same day.
# - Logon to FreeDNS (where you just registered)
# - Goto http://freedns.afraid.org/dynamic/
# - Right click on "Direct Link" and copy the URL and paste it somewhere.
# - You should notice a large and unique alpha-numeric key in the URL
#
# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key
#
# Provided your url from freedns is
#
# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
# Then you have to provide
#
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
#
freedns_key=
###############################################
### OPTIONAL - do not mess with things below ##
# (...if you are not certain)
#
# Usually you are done here
# Everything below is OPTIONAL
#
###############################################
#
# Database for your hub/instance
# If left empty, both your database and user will be named after your zot instance (hubzilla, zap or misty)
# Use custom name, at least fo the database, if you plan to run more than one hub/instance on the same server
#
db_name=hubzilla
db_user=hubzilla
#
#
# Password for package mysql-server
# Example: mysqlpass=aberhallo
# Example: mysqlpass="aber hallo has blanks in it"
#
mysqlpass=$db_pass
# Password for package phpmyadmin
# Example: phpmyadminpass=aberhallo
# Example: phpmyadminpass="aber hallo has blanks in it"
phpmyadminpass=$db_pass

View File

@@ -0,0 +1,543 @@
#!/bin/bash
#
# How to use
# ----------
#
# This file automates the installation of hubzilla: https://framagit.org/hubzilla/core
# under Debian Linux "bookworm"
#
# 1) Copy the file "config.txt.template" to "config.txt"
# Follow the instuctions there
#
# 2) Switch to user "root" by typing "su -"
#
# 3) Run with "./debian-setup.sh"
# If this fails check if you can execute the script.
# - To make it executable type "chmod +x debian-setup.sh"
# - or run "bash debian-setup.sh"
#
#
# What does this script do basically?
# -----------------------------------
#
# This file automates the installation of a Hubzilla instance under Debian Linux
# - install
# * apache webserver,
# * php,
# * mariadb,
# * adminer,
# * addons
# - configure cron
# * "Master.php" for regular background processes of your hubzilla instance
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
# - run letsencrypt to create, register and use a certifacte for https
#
#
# Credits
# -------
#
# The script is derived from the easyinstall script of the Streams repository, which is based on
# - Tom Wiedenhöfts (OJ Random) script homeinstall (for Hubzilla, ZAP,...) that was based on
# - Thomas Willinghams script "debian-setup.sh" which he used to install the red#matrix.
function check_sanity {
# Do some sanity checking.
print_info "Sanity check..."
if [ $(/usr/bin/id -u) != "0" ]
then
die 'Must be run by root user'
fi
if [ -f /etc/lsb-release ]
then
die "Distribution is not supported"
fi
if [ ! -f /etc/debian_version ]
then
die "Debian is supported only"
fi
if ! grep -q 'Linux 12' /etc/issue
then
die "Linux 12 (bookworm) is supported only"x
fi
}
function check_config {
print_info "config check..."
# Check for required parameters
if [ -z "$db_pass" ]
then
die "db_pass not set in $configfile"
fi
if [ -z "$le_domain" ]
then
die "le_domain not set in $configfile"
fi
}
function die {
echo "ERROR: $1" > /dev/null 1>&2
exit 1
}
function update_upgrade {
print_info "updated and upgrade..."
# Run through the apt-get update/upgrade first. This should be done before
# we try to install any package
apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove
print_info "updated and upgraded linux"
}
function nocheck_install {
# export DEBIAN_FRONTEND=noninteractive ... answers from the package configuration database
# - q ... without progress information
# - y ... answer interactive questions with "yes"
# DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2
# DEBIAN_FRONTEND=noninteractive apt-get --install-suggests -q -y install $1
DEBIAN_FRONTEND=noninteractive apt-get -q -y install $1
print_info "installed $1"
}
function print_info {
echo -n -e '\e[1;34m'
echo -n $1
echo -e '\e[0m'
}
function print_warn {
echo -n -e '\e[1;31m'
echo -n $1
echo -e '\e[0m'
}
function stop_zotserver {
print_info "stopping apache..."
systemctl stop apache2
print_info "stopping mysql db..."
systemctl stop mariadb
}
function install_apache {
print_info "installing apache..."
nocheck_install "apache2 apache2-utils"
a2enmod rewrite
systemctl restart apache2
}
function install_imagemagick {
print_info "installing imagemagick..."
nocheck_install "imagemagick"
}
function install_curl {
print_info "installing curl..."
nocheck_install "curl"
}
function install_wget {
print_info "installing wget..."
nocheck_install "wget"
}
function install_sendmail {
print_info "installing sendmail..."
nocheck_install "sendmail sendmail-bin"
}
function install_php {
# openssl and mbstring are included in libapache2-mod-php
print_info "installing php..."
nocheck_install "libapache2-mod-php php php-pear php-curl php-gd php-mbstring php-xml php-zip php-intl php-bcmath"
phpversion=$(php -v|grep --only-matching --perl-regexp "(PHP )\d+\.\\d+\.\\d+"|cut -c 5-7)
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/$phpversion/apache2/php.ini
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/$phpversion/apache2/php.ini
}
function install_composer {
print_info "We check if Composer is already downloaded"
if [ ! -f /usr/local/bin/composer ]
then
EXPECTED_CHECKSUM="`wget -qO- https://composer.github.io/installer.sig`"
wget https://getcomposer.org/installer -O composer-setup.php
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
die 'ERROR: Invalid installer checksum'
fi
php composer-setup.php --quiet
RESULT=$?
composer --version
rm composer-setup.php
# exit $RESULT
# We install Composer globally
mv composer.phar /usr/local/bin/composer
print_info "Composer was successfully downloaded."
else
print_info "Composer is already downloaded on this system."
fi
cd $install_path
export COMPOSER_ALLOW_SUPERUSER=1;
/usr/local/bin/composer install --no-dev --quiet
/usr/local/bin/composer show
export COMPOSER_ALLOW_SUPERUSER=0;
}
function install_mysql {
print_info "installing mysql..."
if [ -z "$mysqlpass" ]
then
die "mysqlpass not set in $configfile"
fi
if type mysql ; then
echo "Yes, mysql is installed"
else
echo "mariadb-server"
nocheck_install "mariadb-server"
systemctl status mariadb
systemctl start mariadb
mysql --user=root <<_EOF_
UPDATE mysql.user SET Password=PASSWORD('${mysqlpass}') WHERE User='root';
DELETE FROM mysql.user WHERE User='';
DROP DATABASE IF EXISTS test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;
_EOF_
fi
}
function install_adminer {
print_info "installing adminer..."
nocheck_install "adminer"
if [ ! -f /etc/adminer/adminer.conf ]
then
echo "Alias /adminer /usr/share/adminer/adminer" > /etc/adminer/adminer.conf
ln -s /etc/adminer/adminer.conf /etc/apache2/conf-available/adminer.conf
else
print_info "file /etc/adminer/adminer.conf exists already"
fi
a2enmod rewrite
if [ ! -f /etc/apache2/apache2.conf ]
then
die "could not find file /etc/apache2/apache2.conf"
fi
sed -i \
"s/AllowOverride None/AllowOverride all/" \
/etc/apache2/apache2.conf
a2enconf adminer
systemctl restart mariadb
systemctl reload apache2
}
function create_zotserver_db {
print_info "creating zotserver database..."
if [ -z "$db_name" ]
then
die "db_name not set in $configfile"
fi
if [ -z "$db_user" ]
then
die "db_user not set in $configfile"
fi
if [ -z "$db_pass" ]
then
die "db_pass not set in $configfile"
fi
systemctl restart mariadb
# Make sure we don't write over an already existing database if we install more than one Zot hub/instance
if [ -z $(mysql -h localhost -u root -p$mysqlpass -e "SHOW DATABASES;" | grep $db_name) ]
then
Q1="CREATE DATABASE IF NOT EXISTS $db_name;"
Q2="GRANT USAGE ON *.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
Q3="GRANT ALL PRIVILEGES ON $db_name.* to $db_user@localhost identified by '$db_pass';"
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
mysql -uroot -p$mysqlpass -e "$SQL"
else
echo "database $db_name does exist already"
Q1="CREATE DATABASE IF NOT EXISTS $db_name;"
Q2="GRANT USAGE ON *.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
Q3="GRANT ALL PRIVILEGES ON $db_name.* to $db_user@localhost identified by '$db_pass';"
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
mysql -uroot -p$mysqlpass -e "$SQL"
fi
}
function run_freedns {
print_info "run freedns (dynamic IP)..."
if [ -z "$freedns_key" ]
then
print_info "freedns was not started because 'freedns_key' is empty in $configfile"
else
if [ -n "$selfhost_user" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
wget --no-check-certificate -O - http://freedns.afraid.org/dynamic/update.php?$freedns_key
fi
}
function install_run_selfhost {
print_info "install and start selfhost (dynamic IP)..."
if [ -z "$selfhost_user" ]
then
print_info "selfHOST was not started because 'selfhost_user' is empty in $configfile"
else
if [ -n "$freedns_key" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
if [ -z "$selfhost_pass" ]
then
die "selfHOST was not started because 'selfhost_pass' is empty in $configfile"
fi
if [ ! -d $selfhostdir ]
then
mkdir $selfhostdir
fi
# the old way
# https://carol.selfhost.de/update?username=123456&password=supersafe
#
# the prefered way
if [ ! -f $selfhostdir/$selfhostscript ]
then
wget --output-document=$selfhostdir/$selfhostscript https://jonaspasche.de/selfhost-updater
if [ ! -s $selfhostdir/$selfhostscript ]
then
die "Failed to download selfHOST file for dynDNS"
fi
echo "router" > $selfhostdir/device
echo "$selfhost_user" > $selfhostdir/user
echo "$selfhost_pass" > $selfhostdir/pass
print_info "Wrote file to update dynamic IP. File: $selfhostdir/$selfhostscript"
fi
print_info "executing $selfhostdir/$selfhostscript update..."
bash $selfhostdir/$selfhostscript update
fi
}
function ping_domain {
print_info "ping domain $domain..."
# Is the domain resolved? Try to ping 6 times à 10 seconds
COUNTER=0
for i in {1..6}
do
print_info "loop $i for ping -c 1 $domain ..."
if ping -c 4 -W 1 $le_domain
then
print_info "$le_domain resolved"
break
else
if [ $i -gt 5 ]
then
die "Failed to: ping -c 1 $domain not resolved"
fi
fi
sleep 10
done
sleep 5
}
function configure_cron_freedns {
print_info "configure cron for freedns..."
if [ -z "$freedns_key" ]
then
print_info "freedns is not configured because freedns_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 30 minutes
if [ -z "`grep 'freedns.afraid.org' /etc/crontab`" ]
then
echo "@reboot root http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
echo "*/30 * * * * root wget --no-check-certificate -O - http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for freedns was configured already"
fi
fi
}
function configure_cron_selfhost {
print_info "configure cron for selfhost..."
if [ -z "$selfhost_user" ]
then
print_info "selfhost is not configured because selfhost_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 5 minutes
if [ -z "`grep 'selfhost-updater.sh' /etc/crontab`" ]
then
echo "@reboot root bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
echo "*/5 * * * * root /bin/bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for selfhost was configured already"
fi
fi
}
function install_letsencrypt {
print_info "installing let's encrypt ..."
# check if user gave domain
if [ -z "$le_domain" ]
then
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
fi
if [ -z "$le_email" ]
then
die "Failed to install let's encrypt: 'le_email' is empty in $configfile"
fi
nocheck_install "certbot python3-certbot-apache"
print_info "run certbot ..."
certbot --apache -w $install_path -d $le_domain -m $le_email --agree-tos --non-interactive --redirect --hsts --uir
service apache2 restart
}
function check_https {
print_info "checking httpS > testing ..."
url_https=https://$le_domain
wget_output=$(wget -nv --spider --max-redirect 0 $url_https)
if [ $? -ne 0 ]
then
print_warn "check not ok"
else
print_info "check ok"
fi
}
function install_zotserver {
print_info "installing addons..."
cd $install_path
util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
mkdir -p "store/[data]/smarty3"
# chmod -R 777 store
touch .htconfig.php
# The next run of $cron_job (daily-update script) will correct the permissions of the next line
chmod ou+w .htconfig.php
cd /var/www/
chown -R www-data:www-data $install_path
chown root:www-data $install_path/
chown root:www-data $install_path/.htaccess
chmod 0644 $install_path/.htaccess
print_info "installed addons"
}
function configure_cron_daily {
print_info "configuring cron..."
# every 10 min for poller.php
if [ -z "`grep 'php Zotlabs/Daemon/Master.php' /etc/crontab`" ]
then
echo "*/10 * * * * www-data cd $install_path; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30
# - stop apache/nginx and mysql-server
# - renew the certificate of letsencrypt
# - update repository core and addon
# - update and upgrade linux
# - reboot is done by "shutdown -h now" because "reboot" hangs sometimes depending on the system
echo "#!/bin/sh" > /var/www/$cron_job
echo "#" >> /var/www/$cron_job
echo "echo \" \"" >> /var/www/$cron_job
echo "echo \"+++ \$(date) +++\"" >> /var/www/$cron_job
echo "echo \" \"" >> /var/www/$cron_job
echo "echo \"\$(date) - stopping apache and mysql...\"" >> /var/www/$cron_job
echo "service apache2 stop" >> /var/www/$cron_job
echo "systemctl stop mysql.service # to avoid inconsistencies" >> /var/www/$cron_job
echo "#" >> /var/www/$cron_job
echo "echo \"\$(date) - renew certificate...\"" >> /var/www/$cron_job
echo "certbot renew --noninteractive" >> /var/www/$cron_job
echo "#" >> /var/www/$cron_job
echo "echo \"\$(date) - db size...\"" >> /var/www/$cron_job
echo "du -h /var/lib/mysql/ | grep mysql/" >> /var/www/$cron_job
echo "#" >> /var/www/$cron_job
echo "# update of $le_domain Zot hub/instance" >> /var/www/$cron_job
echo "echo \"\$(date) - updating core and addons...\"" >> /var/www/$cron_job
echo "echo \"reaching git repository for $le_domain $zotserver hub/instance...\"" >> /var/www/$cron_job
echo "(cd $install_path ; util/udall)" >> /var/www/$cron_job
echo "chown -R www-data:www-data $install_path # make all accessible for the webserver" >> /var/www/$cron_job
echo "chown root:www-data $install_path/.htaccess" >> /var/www/$cron_job
echo "chmod 0644 $install_path/.htaccess # www-data can read but not write it" >> /var/www/$cron_job
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$cron_job
echo "apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove # update linux and upgrade" >> /var/www/$cron_job
echo "echo \"\$(date) - Update finished. Rebooting...\"" >> /var/www/$cron_job
echo "#" >> /var/www/$cron_job
echo "shutdown -r now" >> /var/www/$cron_job
chmod a+x /var/www/$cron_job
# If global cron job does not exist we add it to /etc/crontab
if grep -q $cron_job /etc/crontab
then
echo "cron job already in /etc/crontab"
else
echo "30 05 * * * root /bin/bash /var/www/$cron_job >> /var/www/daily-updates.log 2>&1" >> /etc/crontab
echo "0 0 1 * * root rm /var/www/daily-updates.log" >> /etc/crontab
fi
# This is active after either "reboot" or cron reload"
systemctl restart cron
print_info "configured cron for updates/upgrades"
}
########################################################################
# START OF PROGRAM
########################################################################
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
check_sanity
print_info "We're installing a $zotserver instance"
install_path="$(dirname "$(pwd)")"
# Read config file edited by user
configfile=config.txt
source $configfile
selfhostdir=/etc/selfhost
selfhostscript=selfhost-updater.sh
cron_job="cron_job.sh"
#set -x # activate debugging from here
zotserver=hubzilla
check_config
stop_zotserver
update_upgrade
install_curl
install_wget
install_sendmail
install_apache
install_imagemagick
install_php
install_composer
install_mysql
install_adminer
create_zotserver_db
run_freedns
install_run_selfhost
ping_domain
configure_cron_freedns
configure_cron_selfhost
if [ "$le_domain" != "localhost" ]
then
install_letsencrypt
check_https
else
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
fi
install_zotserver
configure_cron_daily
#set +x # stop debugging from here

31
.gitignore vendored
View File

@@ -48,7 +48,10 @@ doc/html/
.zotshrc
# external repositories for themes/addons
extend/
# files generated by phpunit
# exclude test results and cache
tests/.cache
tests/.phpunit*
tests/results/
## exclude IDE files
@@ -65,7 +68,6 @@ nbproject/
# PHPStorm
.idea/
## composer
# locally installed composer binary
composer.phar
@@ -78,5 +80,30 @@ composer.phar
vendor/**/tests/
vendor/**/Test/
vendor/sabre/*/examples/
# Exclude dev dependencies
vendor/bin/pdepend
vendor/bin/php-parse
vendor/bin/phpcbf
vendor/bin/phpcs
vendor/bin/phpmd
vendor/bin/phpstan*
vendor/bin/phpunit
vendor/composer/pcre/
vendor/composer/xdebug-handler/
vendor/dms/
vendor/doctrine/
vendor/myclabs/
vendor/nikic/
vendor/pdepend/
vendor/phar-io/
vendor/php-mock/
vendor/phpmd/
vendor/phpstan
vendor/phpunit/
vendor/psr/container/
vendor/sebastian/
vendor/squizlabs/
vendor/theseer/
# /info is a directory containing site-specific HTML documents
/info/

View File

@@ -1,11 +1,5 @@
# Select image from https://hub.docker.com/_/php/
#image: php:7.3
# Use a prepared Hubzilla image to optimise pipeline duration
# image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
image: php:8.0
stages:
- pretest
- test
- deploy
@@ -24,6 +18,7 @@ variables:
# Ignore a Composer warning
COMPOSER_ALLOW_SUPERUSER: 1
# Configure MySQL/MariaDB service (https://hub.docker.com/_/mysql/, https://hub.docker.com/_/mariadb/)
DB_HOST: mysql
MYSQL_DATABASE: hello_world_test
MYSQL_ROOT_PASSWORD: mysql
# Configure PostgreSQL service (https://hub.docker.com/_/postgres/)
@@ -31,61 +26,55 @@ variables:
POSTGRES_USER: ci-user
POSTGRES_PASSWORD: ci-pass
before_script:
# pecl and composer do not work with PHP production restrictions (from Hubzilla Docker image)
- if [ -f /usr/local/etc/php/conf.d/z_prod.ini ]; then mv /usr/local/etc/php/conf.d/z_prod.ini /usr/local/etc/php/conf.d/z_prod.ini.off; fi
# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- apt-get update
- apt-get install zip unzip libjpeg-dev libpng-dev -yqq
- docker-php-ext-enable xdebug
- docker-php-ext-install gd
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dev libraries from composer
- php ./composer.phar install --no-progress
# php.ini settings
- echo 'xdebug.mode=coverage' >> /usr/local/etc/php/php.ini
# hidden job definition with template for PHP
.job_template_php: &job_definition_php
stage: test
script:
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
# hidden job definition with template for MySQL/MariaDB
#.job_template_mysql: &job_definition_mysql
# stage: test
# script:
# - echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
.job_template_mysql: &job_definition_mysql
stage: test
variables:
HZ_TEST_DB_HOST: $DB_HOST
HZ_TEST_DB_TYPE: mysql
HZ_TEST_DB_USER: root
HZ_TEST_DB_PASS: $MYSQL_ROOT_PASSWORD
HZ_TEST_DB_DATABASE: $MYSQL_DATABASE
script:
# Import hubzilla's DB schema
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
# Show databases and relations/tables of hubzilla's database
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
# Run the actual tests
- touch dbfail.out
- vendor/bin/phpunit -d memory_limit=256M --configuration tests/phpunit.xml --no-progress --stop-on-error --coverage-text --colors=never --log-junit tests/results/junit.xml || exit_code=$?
- if [ $exit_code -ne 0 ]; then echo "Test barfed!"; cat dbfail.out; exit $exit_code; fi
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
# hidden job definition with template for PostgreSQL
#.job_template_postgres: &job_definition_postgres
# stage: test
# services:
# - postgres:latest
# script:
# - export PGPASSWORD=$POSTGRES_PASSWORD
# - psql --version
# - psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();"
# Import hubzilla's DB schema
# - psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql
# Show databases and relations/tables of hubzilla's database
#- psql -h "postgres" -U "$POSTGRES_USER" -l
#- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\dt;"
# Run the actual tests
# - vendor/bin/phpunit --configuration tests/phpunit-pgsql.xml --testdox
.job_template_postgres: &job_definition_postgres
stage: test
variables:
HZ_TEST_DB_HOST: postgres
HZ_TEST_DB_TYPE: postgres
HZ_TEST_DB_USER: $POSTGRES_USER
HZ_TEST_DB_PASS: $POSTGRES_PASSWORD
HZ_TEST_DB_DATABASE: $POSTGRES_DB
script:
- export PGPASSWORD=$POSTGRES_PASSWORD
- psql --version
- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();"
# Import hubzilla's DB schema
- psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql
# Show databases and relations/tables of hubzilla's database
- psql -h "postgres" -U "$POSTGRES_USER" -l
- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\dt;"
# Run the actual tests
- touch dbfail.out
- vendor/bin/phpunit -d memory_limit=256M --configuration tests/phpunit.xml --no-progress --stop-on-error --coverage-text --colors=never --log-junit tests/results/junit.xml || exit_code=$?
- if [ $exit_code -ne 0 ]; then echo "Test barfed!"; cat dbfail.out; exit $exit_code; fi
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
# hidden job definition with artifacts config template
.artifacts_template:
artifacts: &artifacts_template
.artifacts_template: &artifacts_template
artifacts:
expire_in: 1 week
# Gitlab should show the results, but has problems parsing PHPUnit's junit file.
reports:
@@ -95,55 +84,57 @@ before_script:
paths:
- tests/results/
default:
image: php:8.2
before_script:
# Install & enable Xdebug for code coverage reports
- apt-get update
- apt-get install -yqq libicu-dev libjpeg-dev libpng-dev libpq-dev libyaml-dev libgmp-dev libzip-dev mariadb-client postgresql-client unzip zip
- pecl install xdebug yaml
- docker-php-ext-enable xdebug yaml
- docker-php-ext-configure gd --with-jpeg=/usr/include/
- docker-php-ext-install gd gmp intl pdo_mysql pdo_pgsql zip exif
# PHP8.0
php8.0:
<<: *job_definition_php
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dev libraries from composer
- php ./composer.phar install --no-progress
# php.ini settings
- echo 'xdebug.mode=coverage' >> /usr/local/etc/php/php.ini
# PHP8.0 with MySQL 5.7
#php8.0_mysql5.7:
# <<: *job_definition_mysql
# services:
# - mysql:5.7
check_templates:
stage: pretest
script:
- touch .htconfig.php
- php util/precompile_smarty3.php
phpstan:
stage: pretest
script:
- touch .htconfig.php
- vendor/bin/phpstan --memory-limit=512M
# PHP8.0 with MySQL 8 (latest)
#php8.0_mysql8:
# <<: *job_definition_mysql
# services:
# - name: mysql:8
# command: ["--default-authentication-plugin=mysql_native_password"]
# PHP8.2 with MySQL 8.0
php8.2_mysql8.0.22:
services:
- mysql:8.0
<<: *job_definition_mysql
<<: *artifacts_template
# PHP8.2 with MariaDB 10.6
php8.2_mariadb10.6:
services:
- name: mariadb:10.6
alias: mysql
<<: *job_definition_mysql
<<: *artifacts_template
# PHP8.0 with MariaDB 10.2
#php8.0_mariadb10.2:
# <<: *job_definition_mysql
# services:
# - name: mariadb:10.2
# alias: mysql
# PHP8.0 with MariaDB 10.3 (latest)
#php8.0_mariadb10.3:
# <<: *job_definition_mysql
# image: php:8.0
#image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
# services:
# - name: mariadb:10.3
# alias: mysql
# PHP7.3 with PostgreSQL latest (11)
#php7.3_postgres11:
# <<: *job_definition_postgres
# artifacts: *artifacts_template
# PHP7.3 with PostgreSQL latest (11)
#php7.3_postgres11:
# <<: *job_definition_postgres
# image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
# artifacts: *artifacts_template
# PHP8.2 with PostgreSQL 14
php8.2_postgres14:
services:
- postgres:14-alpine
<<: *job_definition_postgres
<<: *artifacts_template
# Generate Doxygen API Documentation and deploy it as GitLab pages

View File

@@ -25,10 +25,10 @@ AddType audio/ogg .oga
# in CGI mode.
RewriteCond %{REQUEST_URI} ^/\.well\-known/.*
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
RewriteRule ^(.*)$ index.php?q=$1 "[E=REMOTE_USER:%{HTTP:Authorization},L,QSA,B= ?]"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
RewriteRule ^(.*)$ index.php?q=$1 "[E=REMOTE_USER:%{HTTP:Authorization},L,QSA,B= ?]"
</IfModule>

82
.phpcs.xml Normal file
View File

@@ -0,0 +1,82 @@
<?xml version="1.0"?>
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="PHP_CodeSniffer"
xsi:noNamespaceSchemaLocation="phpcs.xsd"
>
<description>PHP CodeSniffer config for Hubzilla</description>
<file>app</file>
<file>boot.php</file>
<file>include</file>
<file>index.php</file>
<file>install</file>
<file>library</file>
<file>tests</file>
<file>util</file>
<file>view</file>
<file>Zotlabs</file>
<rule ref="Generic">
<exclude name="Generic.Arrays.ArrayIndent"/>
<exclude name="Generic.Arrays.DisallowLongArraySyntax"/>
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Generic.Files.EndFileNoNewline"/>
<exclude name="Generic.Files.LowercasedFilename"/>
<exclude name="Generic.Formatting.MultipleStatementAlignment"/>
<exclude name="Generic.Formatting.SpaceAfterNot"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing"/>
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<exclude name="Generic.NamingConventions.CamelCapsFunctionName"/>
<exclude name="Generic.PHP.ClosingPHPTag"/>
<exclude name="Generic.PHP.RequireStrictTypes"/>
<exclude name="Generic.PHP.UpperCaseConstant"/>
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<exclude name="Generic.WhiteSpace.ScopeIndent"/>
<exclude name="Generic.Commenting.DocComment.ContentAfterOpen"/>
<exclude name="Generic.Commenting.DocComment.ContentBeforeClose"/>
<exclude name="Generic.Commenting.DocComment.LongNotCapital"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Generic.Commenting.DocComment.NonParamGroup"/>
<exclude name="Generic.Commenting.DocComment.ParamNotFirst"/>
<exclude name="Generic.Commenting.DocComment.ShortNotCapital"/>
<exclude name="Generic.Commenting.DocComment.SpacingAfter"/>
<exclude name="Generic.Commenting.DocComment.SpacingBeforeShort"/>
<exclude name="Generic.Commenting.DocComment.TagValueIndent"/>
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
<exclude name="Generic.Files.OneClassPerFile.MultipleFound"/>
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound"/>
<exclude name="Generic.Formatting.SpaceAfterCast.NoSpace"/>
<exclude name="Generic.Classes.OpeningBraceSameLine.BraceOnNewLine" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine" />
</rule>
<!--
Warn about lines longer than 100 columns, lines longer than 150
columns will flag an error.
-->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="100" />
<property name="absoluteLineLimit" value="150" />
</properties>
</rule>
<!--
Mark deprecated functions.
-->
<rule ref="Generic.PHP.DeprecatedFunctions">
<properties>
<property name="forbiddenFunctions" type="array" extend="true">
<element key="load_config" value="Zotlabs\Lib\Config::Load" />
<element key="get_config" value="Zotlabs\Lib\Config::Get" />
<element key="set_config" value="Zotlabs\Lib\Config::Set" />
<element key="del_config" value="Zotlabs\Lib\Config::Delete" />
</property>
</properties>
</rule>
</ruleset>

1182
CHANGELOG

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +0,0 @@
"air" is a branch name for revision of Account-Invite-Register at the Hubzilla project
Invite:
* Rewritten and now language template driven
* Selectable templates for the invite mails
* Invitor may add personal notes in the mailtext
+ Invite codes are bound to the recipients email address
* Invite mod never more creates accounts
* new db scheme for table register
* existing register table will be migrated to the new schema even when detected at runtime
* Bugfix: creating invite codes when admin only calls Invite w/o any further action
* account library revision also together with invite mod
* Depending on config: Users may send invitations also
* Invitations expires, controlled by the invitor
* Changed and new configs:
* * invitation_only As usual before
* * invitation_also Beside other registration policies, invitations may be used also
* * invitation_max_per_day defaults 50, may be changed in adminUI admin>site
* * invitation_max_per_user defaults 4
* Requirements:
* * Addon language has to be installed
Register:
* Register panel (form) and js interaction changed
* Unused registrations expire
* Depending on config, anonymous registrations (w/o email) are supported
* :... dont't panic, that may let grow security
* Even anonymous users have to confirm their registration
* Registrations may be enabled / disabled time driven for each day in the week (dudy)
* Unsoliced registration floods may be blocked
* Limited registrations from one single source ip
* Using one additional log file, to easy interfare with f2b
Account:
* An user account always becomes created only if all depending conditions are satisfied
* AdminUI for site configuration, accounts and registrations enhancements
* Still untouched, but accountUI needs enhanced async control in case for mass delete
with deep level of recursion cascade of the dependencies (channels etc). An open TODO
since years for instances with many much users and channels.
History:
2020.03 Hubzilla Prod version 4.6 (master branch) of hubzilla/core was the base for AIR
that was assigned Version 4.6.2 at sn/core
2021.02 Hubzilla Prod version 5.2.1 (master branch) of hubzilla/core was new base for AIR
that was assigned version 5.2.2 at sn/core (air.5)
plus adjustment of hubzilla 5.2.2 (master) to sn/core (air.5) version 5.2.9

31
SECURITY.md Normal file
View File

@@ -0,0 +1,31 @@
# Hubzilla Security Policy
The [Hubzilla] Project takes security, privacy and user control over personal data seriously. We ask that any security issues be disclosed to us in a responsible manner to allow us time to remediate the issues, and site administrators time to upgrade before information about the issue is made public.
This document outlines security procedures and policies for the Hubzilla project. It covers the following components:
* The Hubzilla core repository: https://framagit.org/hubzilla/core
* The official addon repository: https://framagit.org/hubzilla/addons
* The official themes repository: https://framagit.org/hubzilla/themes
* The official widgets repository: https://framagit.org/hubzilla/widgets
## Coordinated Disclosure Guidelines
We are committed to working with security researchers to verify, reproduce, and respond to legitimate reported vulnerabilities. You can help us by following these simple guidelines:
* Submit suspected vulnerabilities by email to `security@hubzilla.org`, or as a confidential issue in the relevant repository listed above.
* Provide clear instructions on how to reproduce the issue, and if possible, a minimal Proof of Concept (PoC) exploit.
* We will acknowledge your submission as soon as we can, and will keep you updated as it is being processed. We may ask for more information, or clarifications about the issue or the steps to reproduce it during this time.
* We will assign a CVE to the issue once it is confirmed.
* We will do our best to fix the issue as soon as we can after it has been confirmed. We request that information about the vulnerability or details about how to exploit it is not disclosed to other parties until after the fix is released and some time has passed, to allow site administrators to upgrade. We will normally make the CVE public one month after a fix has been released. (This grace period can differ based on severity, and can be negotiated.)
* Please perform all tests against a local instance of the software, and refrain from running any Denial of Service or automated testing tools against public hubs or the project managers (and their partners') infrastructure.
* If the issue belongs to a third party module that we depend on, we may help with reporting it upstream if the submitter wants us to.
## Comments on this Policy
We welcome comments and suggestions for improving this policy. You can reach us at:
* Our ticketing system: https://framagit.org/hubzilla/core/-/issues
* By sending us an email at `security@hubzilla.org`.
[Hubzilla]: https://hubzilla.org

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Access;
/**
* @brief AccessList class which represents individual content ACLs.
*
@@ -17,29 +18,48 @@ class AccessList {
* @brief Allow contacts
* @var string
*/
private $allow_cid;
private ?string $allow_cid;
/**
* @brief Allow groups
* @var string
*/
private $allow_gid;
private ?string $allow_gid;
/**
* @brief Deny contacts
* @var string
*/
private $deny_cid;
private ?string $deny_cid;
/**
* @brief Deny groups
* @var string
*/
private $deny_gid;
private ?string $deny_gid;
/**
* @brief Indicates if we are using the default constructor values or
* values that have been set explicitly.
* @var boolean
*/
private $explicit;
private bool $explicit;
/**
* @brief Keys required by the constructor if the channel array is given.
*/
private const REQUIRED_KEYS_CONSTRUCTOR = [
'channel_allow_cid',
'channel_allow_gid',
'channel_deny_cid',
'channel_deny_gid'
];
/**
* @brief Keys required by the set method.
*/
private const REQUIRED_KEYS_SET = [
'allow_cid',
'allow_gid',
'deny_cid',
'deny_gid'
];
/**
* @brief Constructor for AccessList class.
@@ -53,8 +73,9 @@ class AccessList {
* * \e string \b channel_deny_cid => string of denied cids
* * \e string \b channel_deny_gid => string of denied gids
*/
function __construct($channel) {
function __construct(array $channel) {
if ($channel) {
$this->validate_input_array($channel, self::REQUIRED_KEYS_CONSTRUCTOR);
$this->allow_cid = $channel['channel_allow_cid'];
$this->allow_gid = $channel['channel_allow_gid'];
$this->deny_cid = $channel['channel_deny_cid'];
@@ -70,13 +91,24 @@ class AccessList {
$this->explicit = false;
}
private function validate_input_array(array $arr, array $required_keys) : void {
$missing_keys = array_diff($required_keys, array_keys($arr));
if (!empty($missing_keys)) {
throw new \Exception(
'Invalid AccessList object: Expected array with keys: '
. implode(', ', $missing_keys)
);
}
}
/**
* @brief Get if we are using the default constructor values
* or values that have been set explicitly.
*
* @return boolean
*/
function get_explicit() {
function get_explicit() : bool {
return $this->explicit;
}
@@ -94,7 +126,9 @@ class AccessList {
* * \e string \b deny_gid => string of denied gids
* @param boolean $explicit (optional) default true
*/
function set($arr, $explicit = true) {
function set(array $arr, bool $explicit = true) : void {
$this->validate_input_array($arr, self::REQUIRED_KEYS_SET);
$this->allow_cid = $arr['allow_cid'];
$this->allow_gid = $arr['allow_gid'];
$this->deny_cid = $arr['deny_cid'];
@@ -112,7 +146,7 @@ class AccessList {
* * \e string \b deny_cid => string of denied cids
* * \e string \b deny_gid => string of denied gids
*/
function get() {
function get() : array {
return [
'allow_cid' => $this->allow_cid,
'allow_gid' => $this->allow_gid,
@@ -138,7 +172,7 @@ class AccessList {
* * \e array|string \b group_deny => array with gids or comma-seperated string
* @param boolean $explicit (optional) default true
*/
function set_from_array($arr, $explicit = true) {
function set_from_array(array $arr, bool $explicit = true) : void {
$arr['contact_allow'] = $arr['contact_allow'] ?? [];
$arr['group_allow'] = $arr['group_allow'] ?? [];
$arr['contact_deny'] = $arr['contact_deny'] ?? [];
@@ -161,7 +195,7 @@ class AccessList {
*
* @return boolean Return true if any of allow_* deny_* values is set.
*/
function is_private() {
function is_private() : bool {
return (($this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid) ? true : false);
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Access;
use Zotlabs\Lib\Config;
/**
* @brief PermissionRoles class.
*
@@ -36,7 +38,6 @@ class PermissionRoles {
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['post_comments'] = PERMS_AUTHED;
$ret['limits']['post_mail'] = PERMS_AUTHED;
$ret['limits']['post_like'] = PERMS_AUTHED;
$ret['limits']['chat'] = PERMS_AUTHED;
break;
@@ -247,7 +248,7 @@ class PermissionRoles {
break;
}
$x = get_config('system','role_perms');
$x = Config::Get('system','role_perms');
// let system settings over-ride any or all
if($x && is_array($x) && array_key_exists($role,$x))

View File

@@ -212,6 +212,7 @@ class Permissions {
* @return array Associative array with
* * \e array \b perms Permission array
* * \e int \b automatic 0 or 1
* * \e srtring \b role
*/
static public function connect_perms($channel_id) {
@@ -230,70 +231,6 @@ class Permissions {
}
}
// look up the permission role to see if it specified auto-connect
// and if there was no permcat or a default permcat, set the perms
// from the role
/*
$role = get_pconfig($channel_id, 'system', 'permissions_role');
if ($role) {
$xx = PermissionRoles::role_perms($role);
if ($xx['perms_auto'])
$automatic = 1;
if ((!$my_perms) && ($xx['perms_connect'])) {
$default_perms = $xx['perms_connect'];
$my_perms = Permissions::FilledPerms($default_perms);
}
}
*/
// If we reached this point without having any permission information,
// it is likely a custom permissions role. First see if there are any
// automatic permissions.
/*
if (!$my_perms) {
$m = Permissions::FilledAutoperms($channel_id);
if ($m) {
$automatic = 1;
$my_perms = $m;
}
}
*/
// If we reached this point with no permissions, the channel is using
// custom perms but they are not automatic. They will be stored in abconfig with
// the channel's channel_hash (the 'self' connection).
/*
if (!$my_perms) {
$r = q("select channel_hash from channel where channel_id = %d",
intval($channel_id)
);
if ($r) {
$x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'",
intval($channel_id),
dbesc($r[0]['channel_hash'])
);
if ($x) {
foreach ($x as $xv) {
$my_perms[$xv['k']] = intval($xv['v']);
}
}
}
}
*/
return (['perms' => $my_perms, 'automatic' => $automatic, 'role' => $pc]);
}
/*
static public function serialise($p) {
$n = [];
if ($p) {
foreach ($p as $k => $v) {
if (intval($v)) {
$n[] = $k;
}
}
}
return implode(',', $n);
}
*/
}

View File

@@ -0,0 +1,776 @@
<?php
namespace Zotlabs\ActivityStreams;
use Zotlabs\Lib\BaseObject;
class ASObject extends BaseObject
{
public $id;
public $type;
public $attachment;
public $attributedTo;
public $audience;
public $content;
public $context;
public $name;
public $endTime;
public $generator;
public $icon;
public $image;
public $inReplyTo;
public $location;
public $preview;
public $published;
public $replies;
public $startTime;
public $summary;
public $tag;
public $updated;
public $url;
public $to;
public $bto;
public $cc;
public $bcc;
public $mediaType;
public $duration;
public $source;
// Extension properties
public $signature;
public $proof;
public $sensitive;
public $replyTo;
public $wall;
public $isContainedConversation;
public $expires;
public $canReply;
public $canSearch;
public $directMessage;
public $commentPolicy;
/**
* @return mixed
*/
public function getDirectMessage()
{
return $this->directMessage;
}
/**
* @param mixed $directMessage
* @return ASObject
*/
public function setDirectMessage($directMessage)
{
$this->directMessage = $directMessage;
return $this;
}
/**
* @return mixed
*/
public function getSignature()
{
return $this->signature;
}
/**
* @param mixed $signature
* @return ASObject
*/
public function setSignature($signature)
{
$this->signature = $signature;
return $this;
}
/**
* @return mixed
*/
public function getProof()
{
return $this->proof;
}
/**
* @param mixed $proof
* @return ASObject
*/
public function setProof($proof)
{
$this->proof = $proof;
return $this;
}
/**
* @return mixed
*/
public function getSensitive()
{
return $this->sensitive;
}
/**
* @param mixed $sensitive
* @return ASObject
*/
public function setSensitive($sensitive)
{
$this->sensitive = $sensitive;
return $this;
}
/**
* @return mixed
*/
public function getReplyTo()
{
return $this->replyTo;
}
/**
* @param mixed $replyTo
* @return ASObject
*/
public function setReplyTo($replyTo)
{
$this->replyTo = $replyTo;
return $this;
}
/**
* @return mixed
*/
public function getWall()
{
return $this->wall;
}
/**
* @param mixed $wall
* @return ASObject
*/
public function setWall($wall)
{
$this->wall = $wall;
return $this;
}
/**
* @return mixed
*/
public function getIsContainedConversation()
{
return $this->isContainedConversation;
}
/**
* @param mixed $isContainedConversation
* @return ASObject
*/
public function setIsContainedConversation($isContainedConversation)
{
$this->isContainedConversation = $isContainedConversation;
return $this;
}
/**
* @return mixed
*/
public function getExpires()
{
return $this->expires;
}
/**
* @param mixed $expires
* @return ASObject
*/
public function setExpires($expires)
{
$this->expires = $expires;
return $this;
}
/**
* @return mixed
*/
public function getCanReply()
{
return $this->canReply;
}
/**
* @param mixed $canReply
* @return ASObject
*/
public function setCanReply($canReply)
{
$this->canReply = $canReply;
return $this;
}
/**
* @return mixed
*/
public function getCanSearch()
{
return $this->canSearch;
}
/**
* @param mixed $canSearch
* @return ASObject
*/
public function setCanSearch($canSearch)
{
$this->canSearch = $canSearch;
return $this;
}
/**
* @return mixed
*/
public function getCommentPolicy()
{
return $this->commentPolicy;
}
/**
* @param mixed $commentPolicy
* @return ASObject
*/
public function setCommentPolicy($commentPolicy)
{
$this->commentPolicy = $commentPolicy;
return $this;
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
* @return ASObject
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
* @return ASObject
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return mixed
*/
public function getAttachment()
{
return $this->attachment;
}
/**
* @param mixed $attachment
* @return ASObject
*/
public function setAttachment($attachment)
{
$this->attachment = $attachment;
return $this;
}
/**
* @return mixed
*/
public function getAttributedTo()
{
return $this->attributedTo;
}
/**
* @param mixed $attributedTo
* @return ASObject
*/
public function setAttributedTo($attributedTo)
{
$this->attributedTo = $attributedTo;
return $this;
}
/**
* @return mixed
*/
public function getAudience()
{
return $this->audience;
}
/**
* @param mixed $audience
* @return ASObject
*/
public function setAudience($audience)
{
$this->audience = $audience;
return $this;
}
/**
* @return mixed
*/
public function getContent()
{
return $this->content;
}
/**
* @param mixed $content
* @return ASObject
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* @return mixed
*/
public function getContext()
{
return $this->context;
}
/**
* @param mixed $context
* @return ASObject
*/
public function setContext($context)
{
$this->context = $context;
return $this;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
* @return ASObject
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return mixed
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* @param mixed $endTime
* @return ASObject
*/
public function setEndTime($endTime)
{
$this->endTime = $endTime;
return $this;
}
/**
* @return mixed
*/
public function getGenerator()
{
return $this->generator;
}
/**
* @param mixed $generator
* @return ASObject
*/
public function setGenerator($generator)
{
$this->generator = $generator;
return $this;
}
/**
* @return mixed
*/
public function getIcon()
{
return $this->icon;
}
/**
* @param mixed $icon
* @return ASObject
*/
public function setIcon($icon)
{
$this->icon = $icon;
return $this;
}
/**
* @return mixed
*/
public function getImage()
{
return $this->image;
}
/**
* @param mixed $image
* @return ASObject
*/
public function setImage($image)
{
$this->image = $image;
return $this;
}
/**
* @return mixed
*/
public function getInReplyTo()
{
return $this->inReplyTo;
}
/**
* @param mixed $inReplyTo
* @return ASObject
*/
public function setInReplyTo($inReplyTo)
{
$this->inReplyTo = $inReplyTo;
return $this;
}
/**
* @return mixed
*/
public function getLocation()
{
return $this->location;
}
/**
* @param mixed $location
* @return ASObject
*/
public function setLocation($location)
{
$this->location = $location;
return $this;
}
/**
* @return mixed
*/
public function getPreview()
{
return $this->preview;
}
/**
* @param mixed $preview
* @return ASObject
*/
public function setPreview($preview)
{
$this->preview = $preview;
return $this;
}
/**
* @return mixed
*/
public function getPublished()
{
return $this->published;
}
/**
* @param mixed $published
* @return ASObject
*/
public function setPublished($published)
{
$this->published = $published;
return $this;
}
/**
* @return mixed
*/
public function getReplies()
{
return $this->replies;
}
/**
* @param mixed $replies
* @return ASObject
*/
public function setReplies($replies)
{
$this->replies = $replies;
return $this;
}
/**
* @return mixed
*/
public function getStartTime()
{
return $this->startTime;
}
/**
* @param mixed $startTime
* @return ASObject
*/
public function setStartTime($startTime)
{
$this->startTime = $startTime;
return $this;
}
/**
* @return mixed
*/
public function getSummary()
{
return $this->summary;
}
/**
* @param mixed $summary
* @return ASObject
*/
public function setSummary($summary)
{
$this->summary = $summary;
return $this;
}
/**
* @return mixed
*/
public function getTag()
{
return $this->tag;
}
/**
* @param mixed $tag
* @return ASObject
*/
public function setTag($tag)
{
$this->tag = $tag;
return $this;
}
/**
* @return mixed
*/
public function getUpdated()
{
return $this->updated;
}
/**
* @param mixed $updated
* @return ASObject
*/
public function setUpdated($updated)
{
$this->updated = $updated;
return $this;
}
/**
* @return mixed
*/
public function getUrl()
{
return $this->url;
}
/**
* @param mixed $url
* @return ASObject
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* @return mixed
*/
public function getTo()
{
return $this->to;
}
/**
* @param mixed $to
* @return ASObject
*/
public function setTo($to)
{
$this->to = $to;
return $this;
}
/**
* @return mixed
*/
public function getBto()
{
return $this->bto;
}
/**
* @param mixed $bto
* @return ASObject
*/
public function setBto($bto)
{
$this->bto = $bto;
return $this;
}
/**
* @return mixed
*/
public function getCc()
{
return $this->cc;
}
/**
* @param mixed $cc
* @return ASObject
*/
public function setCc($cc)
{
$this->cc = $cc;
return $this;
}
/**
* @return mixed
*/
public function getBcc()
{
return $this->bcc;
}
/**
* @param mixed $bcc
* @return ASObject
*/
public function setBcc($bcc)
{
$this->bcc = $bcc;
return $this;
}
/**
* @return mixed
*/
public function getMediaType()
{
return $this->mediaType;
}
/**
* @param mixed $mediaType
* @return ASObject
*/
public function setMediaType($mediaType)
{
$this->mediaType = $mediaType;
return $this;
}
/**
* @return mixed
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param mixed $duration
* @return ASObject
*/
public function setDuration($duration)
{
$this->duration = $duration;
return $this;
}
/**
* @return mixed
*/
public function getSource()
{
return $this->source;
}
/**
* @param mixed $source
* @return ASObject
*/
public function setSource($source)
{
$this->source = $source;
return $this;
}
}

View File

@@ -0,0 +1,122 @@
<?php
namespace Zotlabs\ActivityStreams;
class Activity extends ASObject
{
public $actor;
public $object;
public $target;
public $result;
public $origin;
public $instrument;
/**
* @return mixed
*/
public function getActor()
{
return $this->actor;
}
/**
* @param mixed $actor
* @return Activity
*/
public function setActor($actor)
{
$this->actor = $actor;
return $this;
}
/**
* @return mixed
*/
public function getObject()
{
return $this->object;
}
/**
* @param mixed $object
* @return Activity
*/
public function setObject($object)
{
$this->object = $object;
return $this;
}
/**
* @return mixed
*/
public function getTarget()
{
return $this->target;
}
/**
* @param mixed $target
* @return Activity
*/
public function setTarget($target)
{
$this->target = $target;
return $this;
}
/**
* @return mixed
*/
public function getResult()
{
return $this->result;
}
/**
* @param mixed $result
* @return Activity
*/
public function setResult($result)
{
$this->result = $result;
return $this;
}
/**
* @return mixed
*/
public function getOrigin()
{
return $this->origin;
}
/**
* @param mixed $origin
* @return Activity
*/
public function setOrigin($origin)
{
$this->origin = $origin;
return $this;
}
/**
* @return mixed
*/
public function getInstrument()
{
return $this->instrument;
}
/**
* @param mixed $instrument
* @return Activity
*/
public function setInstrument($instrument)
{
$this->instrument = $instrument;
return $this;
}
}

View File

@@ -0,0 +1,428 @@
<?php
namespace Zotlabs\ActivityStreams;
class Actor extends ASObject
{
public $inbox;
public $outbox;
public $followers;
public $following;
public $permissions; /* extension property */
public $endpoints;
public $publicKey;
public $preferredUsername;
public $alsoKnownAs;
// Extension properties
public $movedTo;
public $copiedTo;
public $discoverable;
public $manuallyApprovesFollowers;
public $webfinger;
public $canSearch;
public $indexable;
public $assertionMethod;
public $gateways;
public $openwebauth;
public $authredirect;
/**
* @return mixed
*/
public function getAlsoKnownAs()
{
return $this->alsoKnownAs;
}
/**
* @param mixed $alsoKnownAs
* @return Actor
*/
public function setAlsoKnownAs($alsoKnownAs)
{
$this->alsoKnownAs = $alsoKnownAs;
return $this;
}
/**
* @return mixed
*/
public function getMovedTo()
{
return $this->movedTo;
}
/**
* @return mixed
*/
public function getCopiedTo()
{
return $this->copiedTo;
}
/**
* @param mixed $copiedTo
* @return Actor
*/
public function setCopiedTo($copiedTo)
{
$this->copiedTo = $copiedTo;
return $this;
}
/**
* @param mixed $movedTo
* @return Actor
*/
public function setMovedTo($movedTo)
{
$this->movedTo = $movedTo;
return $this;
}
/**
* @return mixed
*/
public function getDiscoverable()
{
return $this->discoverable;
}
/**
* @param mixed $discoverable
* @return Actor
*/
public function setDiscoverable($discoverable)
{
$this->discoverable = $discoverable;
return $this;
}
/**
* @return mixed
*/
public function getManuallyApprovesFollowers()
{
return $this->manuallyApprovesFollowers;
}
/**
* @param mixed $manuallyApprovesFollowers
* @return Actor
*/
public function setManuallyApprovesFollowers($manuallyApprovesFollowers)
{
$this->manuallyApprovesFollowers = $manuallyApprovesFollowers;
return $this;
}
/**
* @return mixed
*/
public function getPreferredUsername()
{
return $this->preferredUsername;
}
/**
* @param mixed $preferredUsername
* @return Actor
*/
public function setPreferredUsername($preferredUsername)
{
$this->preferredUsername = $preferredUsername;
return $this;
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
* @return Actor
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
* @return Actor
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return mixed
*/
public function getInbox()
{
return $this->inbox;
}
/**
* @param mixed $inbox
* @return Actor
*/
public function setInbox($inbox)
{
$this->inbox = $inbox;
return $this;
}
/**
* @return mixed
*/
public function getOutbox()
{
return $this->outbox;
}
/**
* @param mixed $outbox
* @return Actor
*/
public function setOutbox($outbox)
{
$this->outbox = $outbox;
return $this;
}
/**
* @return mixed
*/
public function getFollowers()
{
return $this->followers;
}
/**
* @param mixed $followers
* @return Actor
*/
public function setFollowers($followers)
{
$this->followers = $followers;
return $this;
}
/**
* @return mixed
*/
public function getFollowing()
{
return $this->following;
}
/**
* @param mixed $following
* @return Actor
*/
public function setFollowing($following)
{
$this->following = $following;
return $this;
}
/**
* @return mixed
*/
public function getEndpoints()
{
return $this->endpoints;
}
/**
* @param mixed $endpoints
* @return Actor
*/
public function setEndpoints($endpoints)
{
$this->endpoints = $endpoints;
return $this;
}
/**
* @return mixed
*/
public function getPublicKey()
{
return $this->publicKey;
}
/**
* @param mixed $publicKey
* @return Actor
*/
public function setPublicKey($publicKey)
{
$this->publicKey = $publicKey;
return $this;
}
/**
* @return mixed
*/
public function getWebfinger()
{
return $this->webfinger;
}
/**
* @param mixed $webfinger
* @return Actor
*/
public function setWebfinger($webfinger)
{
$this->webfinger = $webfinger;
return $this;
}
/**
* @return mixed
*/
public function getCanSearch()
{
return $this->canSearch;
}
/**
* @param mixed $canSearch
* @return Actor
*/
public function setCanSearch($canSearch)
{
$this->canSearch = $canSearch;
return $this;
}
/**
* @return mixed
*/
public function getIndexable()
{
return $this->indexable;
}
/**
* @param mixed $indexable
* @return Actor
*/
public function setIndexable($indexable)
{
$this->indexable = $indexable;
return $this;
}
/**
* @return mixed
*/
public function getAssertionMethod()
{
return $this->assertionMethod;
}
/**
* @param mixed $assertionMethod
* @return Actor
*/
public function setAssertionMethod($assertionMethod)
{
$this->assertionMethod = $assertionMethod;
return $this;
}
/**
* @return mixed
*/
public function getGateways()
{
return $this->gateways;
}
/**
* @param mixed $gateways
* @return Actor
*/
public function setGateways($gateways)
{
$this->gateways = $gateways;
return $this;
}
/**
* @return mixed
*/
public function getPermissions()
{
return $this->permissions;
}
/**
* @param mixed $permissions
* @return Actor
*/
public function setPermissions($permissions)
{
$this->permissions = $permissions;
return $this;
}
/**
* @return mixed
*/
public function getOpenwebauth()
{
return $this->openwebauth;
}
/**
* @param mixed $openwebauth
* @return Actor
*/
public function setOpenwebauth($openwebauth)
{
$this->openwebauth = $openwebauth;
return $this;
}
/**
* @return mixed
*/
public function getAuthredirect()
{
return $this->authredirect;
}
/**
* @param mixed $authredirect
* @return Actor
*/
public function setAuthredirect($authredirect)
{
$this->authredirect = $authredirect;
return $this;
}
}

View File

@@ -0,0 +1,87 @@
<?php
namespace Zotlabs\ActivityStreams;
class AssertionMethod extends ASObject
{
public $id;
public $type;
public $controller;
public $publicKeyMultibase;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
* @return AssertionMethod
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
* @return AssertionMethod
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return mixed
*/
public function getController()
{
return $this->controller;
}
/**
* @param mixed $controller
* @return AssertionMethod
*/
public function setController($controller)
{
$this->controller = $controller;
return $this;
}
/**
* @return mixed
*/
public function getPublicKeyMultibase()
{
return $this->publicKeyMultibase;
}
/**
* @param mixed $publicKeyMultibase
* @return AssertionMethod
*/
public function setPublicKeyMultibase($publicKeyMultibase)
{
$this->publicKeyMultibase = $publicKeyMultibase;
return $this;
}
}

View File

@@ -0,0 +1,124 @@
<?php
namespace Zotlabs\ActivityStreams;
class Collection extends ASObject
{
public int $totalItems;
public string $current;
public string $first;
public string $last;
public array $items;
public mixed $collectionOf;
/**
* @return int
*/
public function getTotalItems(): int
{
return $this->totalItems;
}
/**
* @param mixed $totalItems
* @return Collection
*/
public function setTotalItems(mixed $totalItems): static
{
$this->totalItems = $totalItems;
return $this;
}
/**
* @return string
*/
public function getCurrent(): string
{
return $this->current;
}
/**
* @param mixed $current
* @return Collection
*/
public function setCurrent(mixed $current): static
{
$this->current = $current;
return $this;
}
/**
* @return string
*/
public function getFirst(): string
{
return $this->first;
}
/**
* @param mixed $first
* @return Collection
*/
public function setFirst(mixed $first): static
{
$this->first = $first;
return $this;
}
/**
* @return string
*/
public function getLast(): string
{
return $this->last;
}
/**
* @param mixed $last
* @return Collection
*/
public function setLast(mixed $last): static
{
$this->last = $last;
return $this;
}
/**
* @return array
*/
public function getItems(): array
{
return $this->items;
}
/**
* @param mixed $items
* @return Collection
*/
public function setItems(mixed $items): static
{
$this->items = $items;
return $this;
}
/**
* @return mixed
*/
public function getCollectionOf(): mixed
{
return $this->collectionOf;
}
/**
* @param mixed $collectionOf
* @return Collection
*/
public function setCollectionOf(mixed $collectionOf): static
{
$this->collectionOf = $collectionOf;
return $this;
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace Zotlabs\ActivityStreams;
class CollectionPage extends Collection
{
public $partOf;
public $next;
public $prev;
// startIndex only applies for OrderedCollectionPage. See
// https://www.w3.org/ns/activitystreams#OrderedCollectionPage
// It is provided here to avoid multiple inheritance
public $startIndex;
/**
* @return mixed
*/
public function getPartOf()
{
return $this->partOf;
}
/**
* @param mixed $partOf
* @return CollectionPage
*/
public function setPartOf($partOf)
{
$this->partOf = $partOf;
return $this;
}
/**
* @return mixed
*/
public function getNext()
{
return $this->next;
}
/**
* @param mixed $next
* @return CollectionPage
*/
public function setNext($next)
{
$this->next = $next;
return $this;
}
/**
* @return mixed
*/
public function getPrev()
{
return $this->prev;
}
/**
* @param mixed $prev
* @return CollectionPage
*/
public function setPrev($prev)
{
$this->prev = $prev;
return $this;
}
}

View File

@@ -0,0 +1,104 @@
<?php
namespace Zotlabs\ActivityStreams;
class IntransitiveActivity extends ASObject
{
public $actor;
public $target;
public $result;
public $origin;
public $instrument;
/**
* @return mixed
*/
public function getActor()
{
return $this->actor;
}
/**
* @param mixed $actor
* @return IntransitiveActivity
*/
public function setActor($actor)
{
$this->actor = $actor;
return $this;
}
/**
* @return mixed
*/
public function getTarget()
{
return $this->target;
}
/**
* @param mixed $target
* @return IntransitiveActivity
*/
public function setTarget($target)
{
$this->target = $target;
return $this;
}
/**
* @return mixed
*/
public function getResult()
{
return $this->result;
}
/**
* @param mixed $result
* @return IntransitiveActivity
*/
public function setResult($result)
{
$this->result = $result;
return $this;
}
/**
* @return mixed
*/
public function getOrigin()
{
return $this->origin;
}
/**
* @param mixed $origin
* @return IntransitiveActivity
*/
public function setOrigin($origin)
{
$this->origin = $origin;
return $this;
}
/**
* @return mixed
*/
public function getInstrument()
{
return $this->instrument;
}
/**
* @param mixed $instrument
* @return IntransitiveActivity
*/
public function setInstrument($instrument)
{
$this->instrument = $instrument;
return $this;
}
}

View File

@@ -0,0 +1,183 @@
<?php
namespace Zotlabs\ActivityStreams;
use Zotlabs\Lib\BaseObject;
class Link extends BaseObject
{
public $type;
public $href;
public $rel;
public $mediaType;
public $name;
public $hreflang;
public $height;
public $width;
public $preview;
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
* @return Link
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return mixed
*/
public function getHref()
{
return $this->href;
}
/**
* @param mixed $href
* @return Link
*/
public function setHref($href)
{
$this->href = $href;
return $this;
}
/**
* @return mixed
*/
public function getRel()
{
return $this->rel;
}
/**
* @param mixed $rel
* @return Link
*/
public function setRel($rel)
{
$this->rel = $rel;
return $this;
}
/**
* @return mixed
*/
public function getMediaType()
{
return $this->mediaType;
}
/**
* @param mixed $mediaType
* @return Link
*/
public function setMediaType($mediaType)
{
$this->mediaType = $mediaType;
return $this;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
* @return Link
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return mixed
*/
public function getHreflang()
{
return $this->hreflang;
}
/**
* @param mixed $hreflang
* @return Link
*/
public function setHreflang($hreflang)
{
$this->hreflang = $hreflang;
return $this;
}
/**
* @return mixed
*/
public function getHeight()
{
return $this->height;
}
/**
* @param mixed $height
* @return Link
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* @return mixed
*/
public function getWidth()
{
return $this->width;
}
/**
* @param mixed $width
* @return Link
*/
public function setWidth($width)
{
$this->width = $width;
return $this;
}
/**
* @return mixed
*/
public function getPreview()
{
return $this->preview;
}
/**
* @param mixed $preview
* @return Link
*/
public function setPreview($preview)
{
$this->preview = $preview;
return $this;
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Zotlabs\ActivityStreams;
class OrderedCollection extends Collection
{
}

View File

@@ -0,0 +1,92 @@
<?php
namespace Zotlabs\ActivityStreams;
/**
* According to the specification, OrderedCollectionPage extends
* both OrderedCollection and CollectionPage, but PHP is still a bit awkward
* when it comes to multiple inheritance. Rather than try and do this with
* traits, we'll just include the CollectionPage elements here - as this only
* consists of three properties.
*/
class OrderedCollectionPage extends OrderedCollection
{
public $partOf;
public $next;
public $prev;
public $startIndex;
/**
* @return mixed
*/
public function getPartOf()
{
return $this->partOf;
}
/**
* @param mixed $partOf
* @return OrderedCollectionPage
*/
public function setPartOf($partOf)
{
$this->partOf = $partOf;
return $this;
}
/**
* @return mixed
*/
public function getNext()
{
return $this->next;
}
/**
* @param mixed $next
* @return OrderedCollectionPage
*/
public function setNext($next)
{
$this->next = $next;
return $this;
}
/**
* @return mixed
*/
public function getPrev()
{
return $this->prev;
}
/**
* @param mixed $prev
* @return OrderedCollectionPage
*/
public function setPrev($prev)
{
$this->prev = $prev;
return $this;
}
/**
* @return mixed
*/
public function getStartIndex()
{
return $this->startIndex;
}
/**
* @param mixed $startIndex
* @return OrderedCollectionPage
*/
public function setStartIndex($startIndex)
{
$this->startIndex = $startIndex;
return $this;
}
}

View File

@@ -0,0 +1,125 @@
<?php
namespace Zotlabs\ActivityStreams;
class Place extends ASObject
{
public $accuracy;
public $altitude;
public $latitude;
public $longitude;
public $radius;
public $units;
/**
* @return mixed
*/
public function getAccuracy()
{
return $this->accuracy;
}
/**
* @param mixed $accuracy
* @return Place
*/
public function setAccuracy($accuracy)
{
$this->accuracy = $accuracy;
return $this;
}
/**
* @return mixed
*/
public function getAltitude()
{
return $this->altitude;
}
/**
* @param mixed $altitude
* @return Place
*/
public function setAltitude($altitude)
{
$this->altitude = $altitude;
return $this;
}
/**
* @return mixed
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param mixed $latitude
* @return Place
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
return $this;
}
/**
* @return mixed
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param mixed $longitude
* @return Place
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
return $this;
}
/**
* @return mixed
*/
public function getRadius()
{
return $this->radius;
}
/**
* @param mixed $radius
* @return Place
*/
public function setRadius($radius)
{
$this->radius = $radius;
return $this;
}
/**
* @return mixed
*/
public function getUnits()
{
return $this->units;
}
/**
* @param mixed $units
* @return Place
*/
public function setUnits($units)
{
$this->units = $units;
return $this;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Zotlabs\ActivityStreams;
class Profile extends ASObject
{
public $describes;
/**
* @return mixed
*/
public function getDescribes()
{
return $this->describes;
}
/**
* @param mixed $describes
* @return Profile
*/
public function setDescribes($describes)
{
$this->describes = $describes;
return $this;
}
}

View File

@@ -0,0 +1,68 @@
<?php
namespace Zotlabs\ActivityStreams;
class PublicKey extends ASObject
{
public $owner;
public $signatureAlgorithm;
public $publicKeyPem;
/**
* @return mixed
*/
public function getOwner()
{
return $this->owner;
}
/**
* @param mixed $owner
* @return PublicKey
*/
public function setOwner($owner)
{
$this->owner = $owner;
return $this;
}
/**
* @return mixed
*/
public function getSignatureAlgorithm()
{
return $this->signatureAlgorithm;
}
/**
* @param mixed $signatureAlgorithm
* @return PublicKey
*/
public function setSignatureAlgorithm($signatureAlgorithm)
{
$this->signatureAlgorithm = $signatureAlgorithm;
return $this;
}
/**
* @return mixed
*/
public function getPublicKeyPem()
{
return $this->publicKeyPem;
}
/**
* @param mixed $publicKeyPem
* @return PublicKey
*/
public function setPublicKeyPem($publicKeyPem)
{
$this->publicKeyPem = $publicKeyPem;
return $this;
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace Zotlabs\ActivityStreams;
class Question extends ASObject
{
public $oneOf;
public $anyOf;
public $closed;
/**
* @return mixed
*/
public function getOneOf()
{
return $this->oneOf;
}
/**
* @param mixed $oneOf
* @return Question
*/
public function setOneOf($oneOf)
{
$this->oneOf = $oneOf;
return $this;
}
/**
* @return mixed
*/
public function getAnyOf()
{
return $this->anyOf;
}
/**
* @param mixed $anyOf
* @return Question
*/
public function setAnyOf($anyOf)
{
$this->anyOf = $anyOf;
return $this;
}
/**
* @return mixed
*/
public function getClosed()
{
return $this->closed;
}
/**
* @param mixed $closed
* @return Question
*/
public function setClosed($closed)
{
$this->closed = $closed;
return $this;
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace Zotlabs\ActivityStreams;
class Relationship extends ASObject
{
public $subject;
public $object;
public $relationship;
/**
* @return mixed
*/
public function getSubject()
{
return $this->subject;
}
/**
* @param mixed $subject
* @return Relationship
*/
public function setSubject($subject)
{
$this->subject = $subject;
return $this;
}
/**
* @return mixed
*/
public function getObject()
{
return $this->object;
}
/**
* @param mixed $object
* @return Relationship
*/
public function setObject($object)
{
$this->object = $object;
return $this;
}
/**
* @return mixed
*/
public function getRelationship()
{
return $this->relationship;
}
/**
* @param mixed $relationship
* @return Relationship
*/
public function setRelationship($relationship)
{
$this->relationship = $relationship;
return $this;
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace Zotlabs\ActivityStreams;
class Signature extends ASObject
{
public $nonce;
public $creator;
public $signatureValue;
/**
* @return mixed
*/
public function getCreator()
{
return $this->creator;
}
/**
* @param mixed $creator
* @return Signature
*/
public function setCreator($creator)
{
$this->creator = $creator;
return $this;
}
/**
* @return mixed
*/
public function getSignatureValue()
{
return $this->signatureValue;
}
/**
* @param mixed $signatureValue
* @return Signature
*/
public function setSignatureValue($signatureValue)
{
$this->signatureValue = $signatureValue;
return $this;
}
/**
* @return mixed
*/
public function getNonce()
{
return $this->nonce;
}
/**
* @param mixed $nonce
* @return Signature
*/
public function setNonce($nonce)
{
$this->nonce = $nonce;
return $this;
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace Zotlabs\ActivityStreams;
class Tombstone extends ASObject
{
public $formerType;
public $deleted;
/**
* @return mixed
*/
public function getFormerType()
{
return $this->formerType;
}
/**
* @param mixed $formerType
* @return Tombstone
*/
public function setFormerType($formerType)
{
$this->formerType = $formerType;
return $this;
}
/**
* @return mixed
*/
public function getDeleted()
{
return $this->deleted;
}
/**
* @param mixed $deleted
* @return Tombstone
*/
public function setDeleted($deleted)
{
$this->deleted = $deleted;
return $this;
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Zotlabs\ActivityStreams;
class UnhandledElementException extends \Exception
{
}

View File

@@ -7,6 +7,7 @@ class Addon {
static public function run($argc, $argv) {
call_hooks('daemon_addon', $argv);
return;
}

View File

@@ -6,21 +6,28 @@ class Cache_embeds {
static public function run($argc,$argv) {
if(! $argc == 2)
if(!$argc == 2) {
return;
}
$c = q("select body from item where id = %d ",
dbesc(intval($argv[1]))
$c = q("select uid, aid, body, item_private from item where uuid = '%s'",
dbesc($argv[1])
);
if(! $c)
if(!$c) {
return;
}
$item = $c[0];
// bbcode conversion by default processes embeds that aren't already cached.
// Ignore the returned html output.
// Ignore the returned html output.
bbcode($item['body']);
// photocache addon hook to prefetch one copy of public item images for the sys channel
call_hooks('cache_prefetch_hook', $item);
return;
}
}

View File

@@ -3,6 +3,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Cache;
use Zotlabs\Lib\Config;
class Cache_query {
@@ -11,26 +12,31 @@ class Cache_query {
if(! $argc == 3)
return;
$r = null;
$key = $argv[1];
$pid = get_config('procid', $key, false);
$pid = Config::Get('procid', $key, false);
if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
logger($key . ': procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
$pid = getmypid();
set_config('procid', $key, $pid);
Config::Set('procid', $key, $pid);
array_shift($argv);
array_shift($argv);
$arr = json_decode(base64_decode($argv[0]), true);
$r = call_user_func_array('q', $arr);
if($r)
Cache::set($key, serialize($r));
del_config('procid', $key);
if(is_array($r)) {
Cache::set($key, serialize($r));
}
Config::Delete('procid', $key);
return;
}
}

View File

@@ -24,7 +24,7 @@ class Channel_purge {
);
if ($r) {
foreach ($r as $rv) {
drop_item($rv['id'], false);
drop_item($rv['id'], uid: $channel_id);
}
}
} while ($r);

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
require_once('include/hubloc.php');
class Checksites {
@@ -19,7 +21,7 @@ class Checksites {
if ($site_id)
$sql_options = " and site_url = '" . dbesc($argv[1]) . "' ";
$days = intval(get_config('system', 'sitecheckdays'));
$days = intval(Config::Get('system', 'sitecheckdays'));
if ($days < 1)
$days = 30;

View File

@@ -9,6 +9,7 @@ class Cli_suggest {
static public function run($argc,$argv) {
update_suggestions();
return;
}
}

View File

@@ -38,7 +38,13 @@ class Content_importer {
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512');
$x = z_fetch_url($hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page,false,$redirects,[ 'headers' => $headers ]);
$redirects = 0;
$x = z_fetch_url(
$hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page,
false,
$redirects,
[ 'headers' => $headers ]
);
// logger('item fetch: ' . print_r($x,true));
@@ -47,9 +53,9 @@ class Content_importer {
killme();
}
$j = json_decode($x['body'],true);
$j = json_decode($x['body'], true);
if(! is_array($j['item']) || ! count($j['item'])) {
if($j && empty($j['item'])) {
PConfig::Set($channel['channel_id'], 'import', 'content_completed', 1);
return;
}

View File

@@ -5,6 +5,8 @@ namespace Zotlabs\Daemon;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
use Zotlabs\Lib\ASCache;
use Zotlabs\Lib\Config;
class Convo {
@@ -12,47 +14,80 @@ class Convo {
logger('convo invoked: ' . print_r($argv, true));
if ($argc != 4) {
if ($argc < 4) {
return;
}
$id = $argv[1];
$channel_id = intval($argv[2]);
$contact_hash = $argv[3];
$channel = channelx_by_n($channel_id);
if (!$channel) {
$channels = explode(',', $argv[1]);
if (!$channels) {
return;
}
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_xchan = '%s' LIMIT 1",
intval($channel_id),
dbesc($contact_hash)
);
if (!$r) {
$observer_hash = $argv[2];
if (!$observer_hash) {
return;
}
$contact = array_shift($r);
$mid = $argv[3];
if (!$mid) {
return;
}
$obj = new ASCollection($id, $channel);
$force = $argv[4] ?? false;
$interval = Config::Get('queueworker', 'queue_interval', 500000);
$messages = $obj->get();
foreach ($channels as $channel_id) {
$channel = channelx_by_n($channel_id);
$obj = new ASCollection($mid, $channel);
$messages = $obj->get();
if (!$messages) {
continue;
}
if ($messages) {
foreach ($messages as $message) {
$network_fetch = false;
if (is_string($message)) {
$message = Activity::fetch($message, $channel);
$cached = ASCache::Get($message);
if ($cached) {
// logger('convo_cached: ' . $message);
$data = $cached;
}
else {
// logger('convo_fetching: ' . $message);
$network_fetch = true;
$data = Activity::fetch($message, $channel);
if ($data) {
ASCache::Set($message, $data);
}
}
}
// set client flag because comments will probably just be objects and not full blown activities
// and that lets us use implied_create
$AS = new ActivityStreams($message);
else {
$data = $message;
}
if (!$network_fetch) {
// Add some delay so that the DB will not be overwhelmed
// Fetched from network will already have a slight delay
usleep($interval);
}
$AS = new ActivityStreams($data);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
Activity::store($channel, $contact['abook_xchan'], $AS, $item);
$item['item_fetched'] = true;
Activity::store($channel, $observer_hash, $AS, $item, false, $force);
}
}
}
return;
}
}

View File

@@ -2,13 +2,17 @@
namespace Zotlabs\Daemon;
use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\ObjCache;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\Libzotdir;
class Cron {
static public function run($argc, $argv) {
$maxsysload = intval(get_config('system', 'maxloadavg'));
$maxsysload = intval(Config::Get('system', 'maxloadavg'));
if ($maxsysload < 1)
$maxsysload = 50;
if (function_exists('sys_getloadavg')) {
@@ -19,10 +23,11 @@ class Cron {
}
}
/*
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
$lockfile = 'store/[data]/cron';
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (!get_config('system', 'override_cron_lockfile'))) {
&& (!Config::Get('system', 'override_cron_lockfile'))) {
logger("cron: Already running");
return;
}
@@ -30,9 +35,21 @@ class Cron {
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
$x = '';
file_put_contents($lockfile, $x);
*/
logger('cron: start');
// If this is a directory server, request a sync with an upstream
// directory at least once a day, up to once every poll interval.
// Pull remote changes and push local changes.
// potential issue: how do we keep from creating an endless update loop?
$dirmode = Config::Get('system', 'directory_mode');
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
Libzotdir::sync_directories($dirmode);
}
// run queue delivery process in the background
Master::Summon(array('Queue'));
@@ -50,23 +67,25 @@ class Cron {
require_once('include/account.php');
remove_expired_registrations();
$interval = get_config('system', 'delivery_interval', 3);
$interval = Config::Get('queueworker', 'queue_interval', 500000);
// expire any expired items
$r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
$r = q("select id, uid, item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
and item_deleted = 0 ",
db_utcnow()
);
if ($r) {
require_once('include/items.php');
foreach ($r as $rr) {
drop_item($rr['id'], false, (($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
// pass uid of the message for permission check as we are running as a daemon process with no session.
drop_item($rr['id'], (($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL), uid: intval($rr['uid']));
if ($rr['item_wall']) {
// The notifier isn't normally invoked unless item_drop is interactive.
Master::Summon(['Notifier', 'drop', $rr['id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
if ($interval) {
usleep($interval);
}
}
}
}
@@ -75,7 +94,7 @@ class Cron {
// delete expired access tokens
$r = q("select atoken_id from atoken where atoken_expires > '%s' and atoken_expires < %s",
dbesc(NULL_DATE),
dbesc(DBA::$dba->get_null_date()),
db_utcnow()
);
if ($r) {
@@ -96,8 +115,10 @@ class Cron {
if ($r) {
foreach ($r as $rr) {
Master::Summon(array('Directory', $rr['channel_id'], 'force'));
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
if ($interval) {
usleep($interval);
}
}
}
@@ -106,14 +127,15 @@ class Cron {
$r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
intval(PHOTO_CACHE),
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
db_quoteinterval(Config::Get('system', 'default_expire_days', 30) . ' DAY')
);
if ($r) {
q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
intval(PHOTO_CACHE),
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
db_quoteinterval(Config::Get('system', 'default_expire_days', 30) . ' DAY')
);
foreach ($r as $rr) {
$file = dbunescbin($rr['content']);
if (is_file($file)) {
@@ -128,50 +150,41 @@ class Cron {
// (time travel posts). Restrict to items that have come of age in the last
// couple of days to limit the query to something reasonable.
$r = q("select id from item where item_delayed = 1 and created <= %s and created > '%s' ",
$r = q("select * from item where item_delayed = 1 and created <= %s and created > '%s' ",
db_utcnow(),
dbesc(datetime_convert('UTC', 'UTC', 'now - 2 days'))
);
if ($r) {
foreach ($r as $rr) {
$x = q("update item set item_delayed = 0 where id = %d",
intval($rr['id'])
);
if ($x) {
$z = q("select * from item where id = %d",
intval($rr['id'])
);
if ($z) {
xchan_query($z);
$sync_item = fetch_post_tags($z);
Libsync::build_sync_packet($sync_item[0]['uid'],
[
'item' => [encode_item($sync_item[0], true)]
]
);
xchan_query($r);
$items = fetch_post_tags($r);
foreach ($items as $item) {
$item['item_delayed'] = 0;
$post = item_store_update($item);
if($post['success']) {
Master::Summon(['Notifier', 'wall-new', $post['item_id']]);
if (!empty($post['approval_id'])) {
Master::Summon(['Notifier', 'wall-new', $post['approval_id']]);
}
Master::Summon(array('Notifier', 'wall-new', $rr['id']));
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
}
require_once('include/attach.php');
attach_upgrade();
if ($interval) {
usleep($interval);
}
}
}
// once daily run birthday_updates and then expire in background
// FIXME: add birthday updates, both locally and for xprof for use
// by directory servers
$d1 = intval(get_config('system', 'last_expire_day'));
$d1 = intval(Config::Get('system', 'last_expire_day'));
$d2 = intval(datetime_convert('UTC', 'UTC', 'now', 'd'));
// Allow somebody to staggger daily activities if they have more than one site on their server,
// or if it happens at an inconvenient (busy) hour.
$h1 = intval(get_config('system', 'cron_hour'));
$h1 = intval(Config::Get('system', 'cron_hour'));
$h2 = intval(datetime_convert('UTC', 'UTC', 'now', 'G'));
@@ -203,10 +216,10 @@ class Cron {
}
// pull in some public posts
// pull in some public posts if allowed
$disable_discover_tab = get_config('system', 'disable_discover_tab') || get_config('system', 'disable_discover_tab') === false;
if (!$disable_discover_tab)
$disable_externals = Config::Get('system', 'disable_discover_tab') || Config::Get('system', 'disable_discover_tab') === false || Config::Get('system', 'site_firehose');
if (!$disable_externals)
Master::Summon(['Externals']);
$restart = false;
@@ -225,10 +238,77 @@ class Cron {
if (!$restart)
Master::Summon(array('Cronhooks'));
set_config('system', 'lastcron', datetime_convert());
// move as obj cache to fs
if (!Config::Get('system', 'as_objects_moved')) {
$results = dbq("select iconfig.*, item.mid from iconfig left join item on iid = item.id where cat = 'activitypub' and k = 'rawmsg' limit 300");
if ($results) {
foreach ($results as $result) {
if (is_string($result['v'])) {
if (str_starts_with($result['v'], '{')) {
$result['v'] = json_decode($result['v'], true);
}
elseif (str_starts_with($result['v'], 'json:')) {
$result['v'] = json_unserialize($result['v']);
}
elseif (preg_match('|^a:[0-9]+:{.*}$|s', $result['v'])) {
$result['v'] = unserialize($result['v'], ['allowed_classes' => false]);
}
}
if (is_array($result['v'])) {
ObjCache::Set($result['mid'], $result['v']);
}
q("delete from iconfig where id = %d",
intval($result['id'])
);
}
}
else {
Config::Set('system', 'as_objects_moved', 1);
}
}
// move diaspora obj cache to fs
if (!Config::Get('system', 'diaspora_objects_moved')) {
$results = dbq("select iconfig.*, item.mid from iconfig left join item on iid = item.id where cat = 'diaspora' and k = 'fields' limit 300");
if ($results) {
foreach ($results as $result) {
if (is_string($result['v'])) {
if (str_starts_with($result['v'], '{')) {
$result['v'] = json_decode($result['v'], true);
}
elseif (str_starts_with($result['v'], 'json:')) {
$result['v'] = json_unserialize($result['v']);
}
elseif (preg_match('|^a:[0-9]+:{.*}$|s', $result['v'])) {
$result['v'] = unserialize($result['v'], ['allowed_classes' => false]);
}
}
if (is_array($result['v'])) {
ObjCache::Set($result['mid'], $result['v'], 'diaspora');
}
q("delete from iconfig where id = %d",
intval($result['id'])
);
}
}
else {
Config::Set('system', 'diaspora_objects_moved', 1);
}
}
Config::Set('system', 'lastcron', datetime_convert());
//All done - clear the lockfile
@unlink($lockfile);
//@unlink($lockfile);
return;
}

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzotdir;
class Cron_daily {
@@ -49,10 +50,26 @@ class Cron_daily {
dbesc('sse_id.%')
);
// Clean up emdedded content cache
// Mark items seen after X days (default 90)
$r = dbq("select channel_id from channel where channel_removed = 0");
if ($r) {
foreach ($r as $rr) {
$mark_seen_days = get_pconfig($rr['channel_id'], 'system', 'mark_seen_days', 90);
q("UPDATE item SET item_unseen = 0 WHERE
uid = %d AND item_unseen = 1
AND created < %s - INTERVAL %s",
intval($rr['channel_id']),
db_utcnow(),
db_quoteinterval($mark_seen_days . ' DAY')
);
}
}
// Clean up cache
q("DELETE FROM cache WHERE updated < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
db_quoteinterval(Config::Get('system', 'cache_expire_days', 7) . ' DAY')
);
//update statistics in config
@@ -66,7 +83,7 @@ class Cron_daily {
// expire old delivery reports
$keep_reports = intval(get_config('system', 'expire_delivery_reports'));
$keep_reports = intval(Config::Get('system', 'expire_delivery_reports'));
if ($keep_reports === 0)
$keep_reports = 10;
@@ -78,17 +95,6 @@ class Cron_daily {
// expire any expired accounts
downgrade_accounts();
// If this is a directory server, request a sync with an upstream
// directory at least once a day, up to once every poll interval.
// Pull remote changes and push local changes.
// potential issue: how do we keep from creating an endless update loop?
$dirmode = get_config('system', 'directory_mode');
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
Libzotdir::sync_directories($dirmode);
}
Master::Summon(array('Expire'));
Master::Summon(array('Cli_suggest'));
@@ -98,10 +104,12 @@ class Cron_daily {
$date = datetime_convert();
call_hooks('cron_daily', $date);
set_config('system', 'last_expire_day', intval(datetime_convert('UTC', 'UTC', 'now', 'd')));
Config::Set('system', 'last_expire_day', intval(datetime_convert('UTC', 'UTC', 'now', 'd')));
/**
* End Cron Daily
*/
return;
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
class Cron_weekly {
static public function run($argc, $argv) {
@@ -22,12 +24,12 @@ class Cron_weekly {
mark_orphan_hubsxchans();
// Find channels that were removed in the last three weeks, but
// Find channels that were removed in the last three weeks, but
// haven't been finally cleaned up. These should be older than 10
// days to ensure that "purgeall" messages have gone out or bounced
// or timed out.
// days to ensure that "purgeall" messages have gone out or bounced
// or timed out.
$r = q("select channel_id from channel where channel_removed = 1 and
$r = q("select channel_id from channel where channel_removed = 1 and
channel_deleted > %s - INTERVAL %s and channel_deleted < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('21 DAY'),
db_utcnow(), db_quoteinterval('10 DAY')
@@ -44,7 +46,7 @@ class Cron_weekly {
db_utcnow(), db_quoteinterval('14 DAY')
);
$dirmode = intval(get_config('system', 'directory_mode'));
$dirmode = intval(Config::Get('system', 'directory_mode'));
if ($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())), true));
}
@@ -59,5 +61,6 @@ class Cron_weekly {
* End Cron Weekly
*/
return;
}
}
}

View File

@@ -28,6 +28,8 @@ class Deliver {
}
return;
}
}

View File

@@ -12,8 +12,12 @@ class Deliver_hooks {
$r = q("select * from item where id = '%d'",
intval($argv[1])
);
if ($r)
if ($r) {
call_hooks('notifier_normal', $r[0]);
}
return;
}
}

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libzotdir;
use Zotlabs\Lib\Queue;
@@ -25,7 +26,7 @@ class Directory {
logger('directory update', LOGGER_DEBUG);
$dirmode = get_config('system', 'directory_mode');
$dirmode = Config::Get('system', 'directory_mode');
if ($dirmode === false)
$dirmode = DIRECTORY_MODE_NORMAL;
@@ -97,5 +98,7 @@ class Directory {
if ($pushall) {
Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
}
return;
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
require_once('include/items.php');
class Expire {
@@ -10,42 +12,41 @@ class Expire {
cli_startup();
$pid = get_config('procid', 'expire', false);
$pid = Config::Get('procid', 'expire', false);
if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
logger('procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
$pid = getmypid();
set_config('procid', 'expire', $pid);
Config::Set('procid', 'expire', $pid);
// perform final cleanup on previously delete items
$r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
$r = q("select id, uid from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('10 DAY')
);
if ($r) {
foreach ($r as $rr) {
drop_item($rr['id'], false, DROPITEM_PHASE2);
drop_item($rr['id'], DROPITEM_PHASE2, uid: $rr['uid']);
}
}
// physically remove anything that has been deleted for more than two months
/** @FIXME - this is a wretchedly inefficient query */
q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('36 DAY')
);
if (intval(get_config('system', 'optimize_items')))
if (intval(Config::Get('system', 'optimize_items')))
q("optimize table item");
logger('expire: start with pid ' . $pid, LOGGER_DEBUG);
$site_expire = intval(get_config('system', 'default_expire_days'));
$commented_days = intval(get_config('system', 'active_expire_days'));
$site_expire = intval(Config::Get('system', 'default_expire_days', 30));
$commented_days = intval(Config::Get('system', 'active_expire_days', 7));
logger('site_expire: ' . $site_expire);
@@ -59,8 +60,8 @@ class Expire {
continue;
// service class default (if non-zero) over-rides the site default
$service_class_expire = service_class_fetch($rr['channel_id'], 'expire_days');
if (intval($service_class_expire))
$channel_expire = $service_class_expire;
else
@@ -85,8 +86,7 @@ class Expire {
// this should probably just fetch the channel_expire_days from the sys channel,
// but there's no convenient way to set it.
$expire_days = get_config('system', 'sys_expire_days');
$expire_days = Config::Get('system', 'sys_expire_days');
if ($expire_days === false)
$expire_days = 30;
@@ -96,12 +96,15 @@ class Expire {
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
if ($expire_days)
if ($expire_days) {
item_expire($x['channel_id'], $expire_days, $commented_days);
}
logger('Expire: sys: done', LOGGER_DEBUG);
}
del_config('procid', 'expire');
Config::Delete('procid', 'expire');
return;
}
}

View File

@@ -19,6 +19,7 @@ class Externals {
$importer = get_sys_channel();
$total = 0;
$attempts = 0;
$url = '';
logger('externals: startup', LOGGER_DEBUG);
@@ -67,13 +68,14 @@ class Externals {
datetime_convert('UTC', 'UTC', 'now - 30 days')
);
$contact = $r[0];
if ($contact) {
if ($r) {
$contact = $r[0];
$url = $contact['hubloc_id_url'];
}
}
$attempts++;
if (!$url) {
continue;
}
@@ -85,7 +87,6 @@ class Externals {
$blacklisted = true;
}
$attempts++;
// make sure we can eventually break out if somebody blacklists all known sites
@@ -143,7 +144,8 @@ class Externals {
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
Activity::store($importer, $contact['abook_xchan'], $AS, $item);
$item['item_fetched'] = true;
Activity::store($importer, $contact['hubloc_hash'], $AS, $item);
$total++;
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Activity;
class Fetchparents {
static public function run($argc, $argv) {
logger('Fetchparents invoked: ' . print_r($argv, true));
if ($argc < 4) {
return;
}
$channels = explode(',', $argv[1]);
if (!$channels) {
return;
}
$observer_hash = $argv[2];
if (!$observer_hash) {
return;
}
$mid = $argv[3];
if (!$mid) {
return;
}
$force = $argv[4] ?? false;
foreach ($channels as $channel_id) {
$channel = channelx_by_n($channel_id);
Activity::fetch_and_store_parents($channel, $observer_hash, $mid, null, $force);
}
Activity::init_background_fetch($observer_hash);
return;
}
}

View File

@@ -38,7 +38,13 @@ class File_importer {
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),true,'sha512');
// TODO: implement total count
$x = z_fetch_url($hz_server . '/api/z/1.0/file/export_page?f=records=1&page=' . $page, false, $redirects, [ 'headers' => $headers ]);
$redirects = 0;
$x = z_fetch_url(
$hz_server . '/api/z/1.0/file/export_page?f=records=1&page=' . $page,
false,
$redirects,
[ 'headers' => $headers ]
);
// logger('file fetch: ' . print_r($x,true));
if(! $x['success']) {

View File

@@ -11,14 +11,35 @@ class Importdoc {
self::update_docs_dir('doc/*');
$sys = get_sys_channel();
// remove old files that weren't updated (indicates they were most likely deleted).
$i = q("select id from item where uid = %d and item_type = 5 and edited < %s - INTERVAL %s",
intval($sys['channel_id']),
db_utcnow(),
db_quoteinterval('14 DAY')
);
if ($i) {
foreach ($i as $iv) {
drop_item($iv['id'], uid: $sys['channel_id']);
}
}
return;
}
static public function update_docs_dir($s) {
$f = basename($s);
$d = dirname($s);
if ($s === 'doc/html')
if ($s === 'doc/html') {
return;
}
$files = glob("$d/$f");
if ($files) {
foreach ($files as $fi) {
if ($fi === 'doc/html') {

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\QueueWorker;
if (array_search(__file__, get_included_files()) === 0) {
require_once('include/cli_startup.php');
array_shift($argv);
@@ -9,6 +11,7 @@ if (array_search(__file__, get_included_files()) === 0) {
if ($argc)
Master::Release($argc, $argv);
return;
}
@@ -16,6 +19,10 @@ if (array_search(__file__, get_included_files()) === 0) {
class Master {
static public function Summon($arr) {
QueueWorker::Summon($arr);
return;
/*
$hookinfo = [
'argv' => $arr
];
@@ -30,13 +37,17 @@ class Master {
return;
}
$phpbin = get_config('system', 'phpbin', 'php');
$phpbin = Config::Get('system', 'phpbin', 'php');
proc_run($phpbin, 'Zotlabs/Daemon/Master.php', $arr);
*/
}
static public function Release($argc, $argv) {
cli_startup();
QueueWorker::Release($argv);
return;
/*
$hookinfo = [
'argv' => $argv
];
@@ -54,5 +65,6 @@ class Master {
logger('Master: release: ' . json_encode($argv), LOGGER_ALL, LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc, $argv);
*/
}
}

View File

@@ -2,10 +2,12 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\IConfig;
use Zotlabs\Lib\ObjCache;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Queue;
use Zotlabs\Lib\LDSignatures;
require_once('include/html2plain.php');
require_once('include/conversation.php');
@@ -79,10 +81,7 @@ class Notifier {
static public $encoded_item = null;
static public $channel = null;
static public $private = false;
// $fragment can contain additional info to omit de-duplication in the queueworker.
// E.g. if an item is updated many times in a row from different sources (multiple vote updates) the
// update source mid or a timestamp or random string can be added.
static public $fragment = null;
static public function run($argc, $argv) {
@@ -107,7 +106,6 @@ class Notifier {
self::$encoded_item = null;
self::$channel = null;
self::$private = false;
self::$fragment = null;
$sys = get_sys_channel();
$normal_mode = true;
@@ -233,8 +231,6 @@ class Notifier {
// Fetch the target item
self::$fragment = $argv[3] ?? '';
$r = q("SELECT * FROM item WHERE id = %d AND parent != 0",
intval($item_id)
);
@@ -247,11 +243,6 @@ class Notifier {
$target_item = $r[0];
if (in_array($target_item['author']['xchan_network'], ['rss', 'anon', 'token'])) {
logger('notifier: target item author is not a fetchable actor', LOGGER_DEBUG);
return;
}
if (intval($target_item['item_deleted'])) {
logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
}
@@ -274,23 +265,8 @@ class Notifier {
}
// Check for non published items, but allow an exclusion for transmitting hidden file activities
if (intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) ||
intval($target_item['item_blocked']) ||
(intval($target_item['item_hidden']) && ($target_item['obj_type'] !== ACTIVITY_OBJ_FILE))) {
logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
return;
}
// follow/unfollow is for internal use only
if (in_array($target_item['verb'], [ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW])) {
logger('not fowarding follow/unfollow note activity');
return;
}
if (strpos($target_item['postopts'], 'nodeliver') !== false) {
logger('notifier: target item is undeliverable', LOGGER_DEBUG);
if (!item_forwardable($target_item)) {
logger('notifier: target item not forwardable', LOGGER_DEBUG);
return;
}
@@ -306,6 +282,11 @@ class Notifier {
return;
}
if (in_array($target_item['verb'], [ACTIVITY_SHARE])) {
// Provide correct representation across the wire. Internally this is treated as a comment.
$target_item['parent_mid'] = $target_item['thr_parent'] = $target_item['mid'];
}
if ($target_item['mid'] === $target_item['parent_mid']) {
$parent_item = $target_item;
$top_level_post = true;
@@ -337,20 +318,24 @@ class Notifier {
return;
}
$m = get_iconfig($target_item, 'activitypub', 'signed_data');
$m = ObjCache::Get($target_item['mid']);
if (!$m) {
$m = IConfig::Get($target_item, 'activitypub', 'rawmsg');
}
// Re-use existing signature unless the activity type changed to a Tombstone, which won't verify.
if ($m && (!intval($target_item['item_deleted']))) {
self::$encoded_item = json_decode($m, true);
self::$encoded_item = $m;
}
else {
$activity = Activity::encode_activity($target_item);
self::$encoded_item = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1',
z_root() . ZOT_APSCHEMA_REV
]], Activity::encode_activity($target_item)
);
self::$encoded_item['signature'] = LDSignatures::sign(self::$encoded_item, self::$channel);
if (!$activity) {
return;
}
self::$encoded_item = Activity::build_packet($activity, self::$channel, false);
}
logger('target_item: ' . print_r($target_item, true), LOGGER_DEBUG);
@@ -367,6 +352,10 @@ class Notifier {
$relay_to_owner = (!$top_level_post && intval($target_item['item_origin']) && comment_local_origin($target_item));
if (self::$channel['channel_hash'] === $target_item['owner_xchan']) {
$relay_to_owner = false;
}
// $cmd === 'relay' indicates the owner is sending it to the original recipients
// don't allow the item in the relay command to relay to owner under any circumstances, it will loop
@@ -397,7 +386,7 @@ class Notifier {
logger('normal (downstream) distribution', LOGGER_DEBUG);
}
if ($parent_item && $parent_item['item_private'] !== $target_item['item_private']) {
if (($parent_item && $parent_item['item_private'] !== $target_item['item_private']) || (intval($target_item['item_restrict']) & 1)) {
logger('conversation privacy mismatch - downstream delivery prevented');
return;
}
@@ -415,9 +404,7 @@ class Notifier {
self::$private = false;
self::$recipients = collect_recipients($parent_item, self::$private);
// FIXME add any additional recipients such as mentions, etc.
if ($top_level_post) {
if ($top_level_post && intval($target_item['item_wall'])) {
// remove clones who will receive the post via sync
self::$recipients = array_values(array_diff(self::$recipients, [$target_item['owner_xchan']]));
}
@@ -509,6 +496,7 @@ class Notifier {
// public posts won't make it to the local public stream unless there's a recipient on this site.
// This code block sees if it's a public post and localhost is missing, and if so adds an entry for the local sys channel to the $hubs list
/* sys channel is now added in collect recipients
if (!self::$private) {
$found_localhost = false;
if ($hubs) {
@@ -529,6 +517,7 @@ class Notifier {
}
}
}
*/
if (!$hubs) {
logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE);
@@ -597,8 +586,6 @@ class Notifier {
foreach ($dhubs as $hub) {
logger('notifier_hub: ' . $hub['hubloc_url'], LOGGER_DEBUG);
if ($hub['hubloc_network'] !== 'zot6') {
$narr = [
'channel' => self::$channel,
@@ -677,7 +664,7 @@ class Notifier {
);
// only create delivery reports for normal undeleted items
if (is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) {
if (is_array($target_item) && (!$target_item['item_deleted']) && (!Config::Get('system', 'disable_dreport'))) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",
dbesc($target_item['mid']),
@@ -699,7 +686,7 @@ class Notifier {
// This wastes a process if there are no delivery hooks configured, so check this before launching the new process
$x = q("select * from hook where hook = 'notifier_normal'");
if ($x) {
Master::Summon(['Deliver_hooks', $target_item['id'], self::$fragment]);
Master::Summon(['Deliver_hooks', $target_item['id']]);
}
}
@@ -707,7 +694,7 @@ class Notifier {
do_delivery(self::$deliveries);
}
if ($dead_hosts && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) {
if ($dead_hosts && is_array($target_item) && (!$target_item['item_deleted']) && (!Config::Get('system', 'disable_dreport'))) {
foreach ($dead_hosts as $deceased_host) {
$r = q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",

View File

@@ -9,67 +9,55 @@ class Onedirsync {
static public function run($argc, $argv) {
logger('onedirsync: start ' . intval($argv[1]));
if (($argc > 1) && (intval($argv[1])))
$update_id = intval($argv[1]);
if (!$update_id) {
logger('onedirsync: no update');
if ($argc < 2 || is_int($argv[1]) === false) {
logger('onedirsync: no update id');
return;
}
$r = q("select * from updates where ud_id = %d limit 1",
logger('onedirsync: start ' . intval($argv[1]));
$update_id = intval($argv[1]);
if (!$update_id) {
logger('onedirsync: no update id');
return;
}
$r = q("select * from updates where ud_id = %d",
intval($update_id)
);
if (!$r)
return;
if (($r[0]['ud_flags'] & UPDATE_FLAGS_UPDATED) || (!$r[0]['ud_addr']))
return;
// Have we probed this channel more recently than the other directory server
// (where we received this update from) ?
// If we have, we don't need to do anything except mark any older entries updated
$x = q("select * from updates where ud_addr = '%s' and ud_date > '%s' and ( ud_flags & %d )>0 order by ud_date desc limit 1",
dbesc($r[0]['ud_addr']),
dbesc($r[0]['ud_date']),
intval(UPDATE_FLAGS_UPDATED)
);
if ($x) {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 and ud_date != '%s'",
intval(UPDATE_FLAGS_UPDATED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED),
dbesc($x[0]['ud_date'])
);
if (!$r) {
logger('onedirsync: update id not found');
return;
}
// ignore doing an update if this ud_addr refers to a known dead hubloc
$h = q("select * from hubloc where hubloc_addr = '%s'",
$h = q("select * from hubloc where hubloc_id_url = '%s' order by hubloc_id desc",
dbesc($r[0]['ud_addr']),
);
$h = Libzot::zot_record_preferred($h);
if (($h) && (($h['hubloc_status'] & HUBLOC_OFFLINE) || $h['hubloc_deleted'] || $h['hubloc_error'])) {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_DELETED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED)
);
return;
// 2023-04-12: Try to update anyway since the info is not always correct
// This might change after all directory servers run the new code.
// q("update updates set ud_flags = 9 where ud_hash = '%s' and ud_flags != 9",
// dbesc($r[0]['ud_hash'])
//);
// return;
}
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
if ($h && $h['hubloc_network'] !== 'zot6')
if ($h && $h['hubloc_network'] !== 'zot6') {
return;
}
Libzotdir::update_directory_entry($r[0]);

View File

@@ -2,9 +2,11 @@
namespace Zotlabs\Daemon;
use DBA;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzot;
require_once('include/socgraph.php');
@@ -14,10 +16,14 @@ class Onepoll {
static public function run($argc, $argv) {
if ($argc < 2 || is_int($argv[1]) === false) {
logger('onepoll: no contact');
return;
}
logger('onepoll: start');
if (($argc > 1) && (intval($argv[1])))
$contact_id = intval($argv[1]);
$contact_id = intval($argv[1]);
if (!$contact_id) {
logger('onepoll: no contact');
@@ -25,19 +31,15 @@ class Onepoll {
}
$sql_extra = '';
$allow_feeds = get_config('system', 'feed_contacts');
$allow_feeds = Config::Get('system', 'feed_contacts');
if(!$allow_feeds) {
$sql_extra = ' and abook_feed = 0 ';
}
$contacts = q("SELECT abook.*, xchan.*, account.*
FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
where abook_id = %d $sql_extra
and abook_pending = 0 and abook_archived = 0 and abook_blocked = 0 and abook_ignored = 0
AND (( account_flags = %d ) OR ( account_flags = %d )) limit 1",
intval($contact_id),
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED)
$contacts = q("SELECT abook.*, xchan.* FROM abook
LEFT JOIN xchan ON xchan_hash = abook_xchan
WHERE abook_id = %d",
$contact_id
);
if (!$contacts) {
@@ -56,7 +58,7 @@ class Onepoll {
logger("onepoll: poll: ($contact_id) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= DBA::$dba->get_null_date()))
? datetime_convert('UTC', 'UTC', 'now - 7 days')
: datetime_convert('UTC', 'UTC', $contact['abook_updated'] . ' - 2 days')
);
@@ -64,12 +66,21 @@ class Onepoll {
if ($contact['xchan_network'] === 'rss') {
logger('onepoll: processing feed ' . $contact['xchan_name'], LOGGER_DEBUG);
$alive = handle_feed($importer['channel_id'], $contact_id, $contact['xchan_hash']);
if ($alive) {
q("update abook set abook_connected = '%s' where abook_id = %d",
if (!$alive) {
q("update abook set abook_updated = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
return;
}
q("update abook set abook_updated = '%s', abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
return;
}
@@ -120,7 +131,7 @@ class Onepoll {
if ($fetch_feed) {
$max = intval(get_config('system', 'max_imported_posts', 30));
$max = intval(Config::Get('system', 'max_imported_posts', 30));
if (intval($max)) {
$cl = Activity::get_actor_collections($contact['abook_xchan']);
@@ -163,6 +174,7 @@ class Onepoll {
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
$item['item_fetched'] = true;
Activity::store($importer, $contact['abook_xchan'], $AS, $item);
}
}

View File

@@ -2,11 +2,14 @@
namespace Zotlabs\Daemon;
use DBA;
use Zotlabs\Lib\Config;
class Poller {
static public function run($argc, $argv) {
$maxsysload = intval(get_config('system', 'maxloadavg'));
$maxsysload = intval(Config::Get('system', 'maxloadavg'));
if ($maxsysload < 1)
$maxsysload = 50;
if (function_exists('sys_getloadavg')) {
@@ -17,21 +20,7 @@ class Poller {
}
}
$interval = intval(get_config('system', 'poll_interval'));
if (!$interval)
$interval = ((get_config('system', 'delivery_interval') === false) ? 3 : intval(get_config('system', 'delivery_interval')));
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
$lockfile = 'store/[data]/poller';
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (!get_config('system', 'override_poll_lockfile'))) {
logger("poller: Already running");
return;
}
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
$x = '';
file_put_contents($lockfile, $x);
$interval = Config::Get('queueworker', 'queue_interval', 500000);
logger('poller: start');
@@ -57,12 +46,17 @@ class Poller {
reload_plugins();
// Only poll from those with suitable relationships
$abandon_days = intval(get_config('system', 'account_abandon_days', 0));
$abandon_days = intval(Config::Get('system', 'account_abandon_days', 0));
$abandon_sql = (($abandon_days)
? sprintf(" AND account_lastlog > %s - INTERVAL %s ", db_utcnow(), db_quoteinterval(intval($abandon_days) . ' DAY'))
: ''
);
$allow_feeds = Config::Get('system', 'feed_contacts');
if(!$allow_feeds) {
$sql_extra .= ' and abook_feed = 0 ';
}
$randfunc = db_getfunc('RAND');
$contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed,
@@ -72,7 +66,7 @@ class Poller {
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
LEFT JOIN account on abook_account = account_id
where abook_self = 0
where abook_self = 0 and abook_pending = 0 and abook_archived = 0 and abook_blocked = 0 and abook_ignored = 0
$sql_extra
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
intval(ACCOUNT_OK),
@@ -90,16 +84,27 @@ class Poller {
if (intval($contact['abook_feed'])) {
$min = service_class_fetch($contact['abook_channel'], 'minimum_feedcheck_minutes');
if (!$min)
$min = intval(get_config('system', 'minimum_feedcheck_minutes'));
$min = intval(Config::Get('system', 'minimum_feedcheck_minutes'));
if (!$min)
$min = 60;
$x = datetime_convert('UTC', 'UTC', "now - $min minutes");
if ($c < $x) {
Master::Summon(['Onepoll', $contact['abook_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
if ($t !== $c) {
// if the last fetch failed only attempt fetch once a day
$min = 60 * 24;
}
$x = datetime_convert('UTC', 'UTC', "now - $min minutes");
if ($t < $x) {
Master::Summon(['Onepoll', $contact['abook_id']]);
if ($interval) {
usleep($interval);
}
}
continue;
}
if ($contact['xchan_network'] !== 'zot6')
@@ -113,7 +118,7 @@ class Poller {
// if we've never connected with them, start the mark for death countdown from now
if ($c <= NULL_DATE) {
if ($c <= DBA::$dba->get_null_date()) {
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
@@ -158,41 +163,42 @@ class Poller {
continue;
Master::Summon(['Onepoll', $contact['abook_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
if ($interval) {
usleep($interval);
}
}
}
$dirmode = intval(get_config('system', 'directory_mode'));
$dirmode = intval(Config::Get('system', 'directory_mode'));
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$r = q("SELECT u.ud_addr, u.ud_id, u.ud_last FROM updates AS u INNER JOIN (SELECT ud_addr, max(ud_id) AS ud_id FROM updates WHERE ( ud_flags & %d ) = 0 AND ud_addr != '' AND ( ud_last <= '%s' OR ud_last > %s - INTERVAL %s ) GROUP BY ud_addr) AS s ON s.ud_id = u.ud_id ",
intval(UPDATE_FLAGS_UPDATED),
dbesc(NULL_DATE),
db_utcnow(), db_quoteinterval('7 DAY')
$r = q("SELECT * FROM updates WHERE ud_update = 1 AND (ud_last = '%s' OR ud_last > %s - INTERVAL %s)",
dbesc(DBA::$dba->get_null_date()),
db_utcnow(),
db_quoteinterval('7 DAY')
);
if ($r) {
foreach ($r as $rr) {
// If they didn't respond when we attempted before, back off to once a day
// After 7 days we won't bother anymore
if ($rr['ud_last'] > NULL_DATE)
if ($rr['ud_last'] > DBA::$dba->get_null_date())
if ($rr['ud_last'] > datetime_convert('UTC', 'UTC', 'now - 1 day'))
continue;
Master::Summon(['Onedirsync', $rr['ud_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
if ($interval) {
usleep($interval);
}
}
}
}
set_config('system', 'lastpoll', datetime_convert());
//All done - clear the lockfile
@unlink($lockfile);
Config::Set('system', 'lastpoll', datetime_convert());
return;
}

View File

@@ -7,77 +7,59 @@ use Zotlabs\Lib\Queue as LibQueue;
class Queue {
static public function run($argc, $argv) {
require_once('include/items.php');
require_once('include/bbcode.php');
if ($argc > 1)
$queue_id = $argv[1];
else
$queue_id = EMPTY_STR;
$queue_id = ($argc > 1) ? $argv[1] : '';
logger('queue: start');
// delete all queue items more than 3 days old
// but first mark these sites dead if we haven't heard from them in a month
$r = q("select outq_posturl from outq where outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
$oldqItems = q("select outq_posturl, outq_hash from outq where outq_created < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('3 DAY')
);
if ($r) {
foreach ($r as $rr) {
$h = parse_url($rr['outq_posturl']);
$desturl = $h['scheme'] . '://' . $h['host'] . (isset($h['port']) ? ':' . $h['port'] : '');
if ($oldqItems) {
foreach ($oldqItems as $qItem) {
$h = parse_url($qItem['outq_posturl']);
$site_url = $h['scheme'] . '://' . $h['host'] . ((!empty($h['port'])) ? ':' . $h['port'] : '');
q("update site set site_dead = 1 where site_dead = 0 and site_url = '%s' and site_update < %s - INTERVAL %s",
dbesc($desturl),
db_utcnow(), db_quoteinterval('1 MONTH')
dbesc($site_url),
db_utcnow(),
db_quoteinterval('1 MONTH')
);
}
$old_hashes = ids_to_querystr($oldqItems, 'outq_hash', true);
logger('Removing ' . count($oldqItems) . ' old queue entries');
dbq("DELETE FROM outq WHERE outq_hash IN ($old_hashes)");
}
q("DELETE FROM outq WHERE outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
);
$deliveries = [];
if ($queue_id) {
$r = q("SELECT * FROM outq WHERE outq_hash = '%s' LIMIT 1",
$qItems = q("SELECT * FROM outq WHERE outq_hash = '%s' LIMIT 1",
dbesc($queue_id)
);
logger('queue deliver: ' . $qItems[0]['outq_hash'] . ' to ' . $qItems[0]['outq_posturl'], LOGGER_DEBUG);
LibQueue::deliver($qItems[0]);
}
else {
// For the first 12 hours we'll try to deliver every 15 minutes
// After that, we'll only attempt delivery once per hour.
// This currently only handles the default queue drivers ('zot' or '') which we will group by posturl
// so that we don't start off a thousand deliveries for a couple of dead hubs.
// The zot driver will deliver everything destined for a single hub once contact is made (*if* contact is made).
// Other drivers will have to do something different here and may need their own query.
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// "every 15 minutes" category. We probably need to prioritise them when inserted into the queue
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
$sqlrandfunc = db_getfunc('rand');
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
$qItems = q("SELECT outq_hash FROM outq WHERE outq_scheduled < %s ",
db_utcnow()
);
while ($r) {
foreach ($r as $rv) {
LibQueue::deliver($rv);
}
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
db_utcnow()
);
}
}
if (!$r)
return;
foreach ($r as $rv) {
LibQueue::deliver($rv);
}
if ($qItems) {
foreach ($qItems as $qItem) {
$deliveries[] = $qItem['outq_hash'];
}
shuffle($deliveries);
do_delivery($deliveries, true);
}
}
}
}

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Config;
class Thumbnail {
@@ -19,9 +20,9 @@ class Thumbnail {
$attach = $c[0];
$preview_style = intval(get_config('system', 'thumbnail_security', 0));
$preview_width = intval(get_config('system', 'thumbnail_width', 300));
$preview_height = intval(get_config('system', 'thumbnail_height', 300));
$preview_style = intval(Config::Get('system', 'thumbnail_security', 0));
$preview_width = intval(Config::Get('system', 'thumbnail_width', 300));
$preview_height = intval(Config::Get('system', 'thumbnail_height', 300));
$p = [
'attach' => $attach,
@@ -73,5 +74,7 @@ class Thumbnail {
|| (filectime(dbunescbin($attach['content']) . 'thumb') < (time() - 60)))) {
$default_controller->Thumb($attach, $preview_style, $preview_width, $preview_height);
}
return;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/** @file */
namespace Zotlabs\Daemon;
class Xchan_photo {
static public function run($argc, $argv) {
if ($argc < 3) {
return;
}
$url = hex2bin($argv[1]);
$xchan = hex2bin($argv[2]);
$force = $argv[3];
$photos = import_xchan_photo($url, $xchan, false, $force);
if ($photos) {
$result = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'",
dbescdate(datetime_convert()),
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc($photos[3]),
dbesc($xchan)
);
if (! $result) {
logger("xchan photo update failed for $url");
}
}
return;
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
class Zotconvo {
static public function run($argc, $argv) {
logger('Zotconvo invoked: ' . print_r($argv, true));
if ($argc < 3) {
return;
}
$channels = explode(',', $argv[1]);
if (!$channels) {
return;
}
$mid = $argv[2];
if (!$mid) {
return;
}
$force = $argv[3] ?? false;
foreach ($channels as $channel_id) {
$channel = channelx_by_n($channel_id);
Libzot::fetch_conversation($channel, $mid, $force);
}
return;
}
}

352
Zotlabs/Entity/Account.php Normal file
View File

@@ -0,0 +1,352 @@
<?php
namespace Zotlabs\Entity;
use Zotlabs\Lib\BaseObject;
class Account extends BaseObject
{
public $account_id;
public $account_parent;
public $account_default_channel;
public $account_salt;
public $account_password;
public $account_email;
public $account_external;
public $account_language;
public $account_created;
public $account_lastlog;
public $account_flags;
public $account_roles;
public $account_reset;
public $account_expires;
public $account_expire_notified;
public $account_service_class;
public $account_level;
public $account_password_change;
/**
* @return mixed
*/
public function getId()
{
return $this->account_id;
}
/**
* @param mixed $account_id
* @return Account
*/
public function setId($account_id)
{
$this->account_id = $account_id;
return $this;
}
/**
* @return mixed
*/
public function getParent()
{
return $this->account_parent;
}
/**
* @param mixed $account_parent
* @return Account
*/
public function setParent($account_parent)
{
$this->account_parent = $account_parent;
return $this;
}
/**
* @return mixed
*/
public function getDefaultChannel()
{
return $this->account_default_channel;
}
/**
* @param mixed $account_default_channel
* @return Account
*/
public function setDefaultChannel($account_default_channel)
{
$this->account_default_channel = $account_default_channel;
return $this;
}
/**
* @return mixed
*/
public function getSalt()
{
return $this->account_salt;
}
/**
* @param mixed $account_salt
* @return Account
*/
public function setSalt($account_salt)
{
$this->account_salt = $account_salt;
return $this;
}
/**
* @return mixed
*/
public function getPassword()
{
return $this->account_password;
}
/**
* @param mixed $account_password
* @return Account
*/
public function setPassword($account_password)
{
$this->account_password = $account_password;
return $this;
}
/**
* @return mixed
*/
public function getEmail()
{
return $this->account_email;
}
/**
* @param mixed $account_email
* @return Account
*/
public function setEmail($account_email)
{
$this->account_email = $account_email;
return $this;
}
/**
* @return mixed
*/
public function getExternal()
{
return $this->account_external;
}
/**
* @param mixed $account_external
* @return Account
*/
public function setExternal($account_external)
{
$this->account_external = $account_external;
return $this;
}
/**
* @return mixed
*/
public function getLanguage()
{
return $this->account_language;
}
/**
* @param mixed $account_language
* @return Account
*/
public function setLanguage($account_language)
{
$this->account_language = $account_language;
return $this;
}
/**
* @return mixed
*/
public function getCreated()
{
return $this->account_created;
}
/**
* @param mixed $account_created
* @return Account
*/
public function setCreated($account_created)
{
$this->account_created = $account_created;
return $this;
}
/**
* @return mixed
*/
public function getLastlog()
{
return $this->account_lastlog;
}
/**
* @param mixed $account_lastlog
* @return Account
*/
public function setLastlog($account_lastlog)
{
$this->account_lastlog = $account_lastlog;
return $this;
}
/**
* @return mixed
*/
public function getFlags()
{
return $this->account_flags;
}
/**
* @param mixed $account_flags
* @return Account
*/
public function setFlags($account_flags)
{
$this->account_flags = $account_flags;
return $this;
}
/**
* @return mixed
*/
public function getRoles()
{
return $this->account_roles;
}
/**
* @param mixed $account_roles
* @return Account
*/
public function setRoles($account_roles)
{
$this->account_roles = $account_roles;
return $this;
}
/**
* @return mixed
*/
public function getReset()
{
return $this->account_reset;
}
/**
* @param mixed $account_reset
* @return Account
*/
public function setReset($account_reset)
{
$this->account_reset = $account_reset;
return $this;
}
/**
* @return mixed
*/
public function getExpires()
{
return $this->account_expires;
}
/**
* @param mixed $account_expires
* @return Account
*/
public function setExpires($account_expires)
{
$this->account_expires = $account_expires;
return $this;
}
/**
* @return mixed
*/
public function getExpireNotified()
{
return $this->account_expire_notified;
}
/**
* @param mixed $account_expire_notified
* @return Account
*/
public function setExpireNotified($account_expire_notified)
{
$this->account_expire_notified = $account_expire_notified;
return $this;
}
/**
* @return mixed
*/
public function getServiceClass()
{
return $this->account_service_class;
}
/**
* @param mixed $account_service_class
* @return Account
*/
public function setServiceClass($account_service_class)
{
$this->account_service_class = $account_service_class;
return $this;
}
/**
* @return mixed
*/
public function getLevel()
{
return $this->account_level;
}
/**
* @param mixed $account_level
* @return Account
*/
public function setLevel($account_level)
{
$this->account_level = $account_level;
return $this;
}
/**
* @return mixed
*/
public function getPasswordChange()
{
return $this->account_password_change;
}
/**
* @param mixed $account_password_change
* @return Account
*/
public function setPasswordChange($account_password_change)
{
$this->account_password_change = $account_password_change;
return $this;
}
}

714
Zotlabs/Entity/Channel.php Normal file
View File

@@ -0,0 +1,714 @@
<?php
namespace Zotlabs\Entity;
use Zotlabs\Lib\BaseObject;
class Channel extends BaseObject
{
public $channel_id;
public $channel_account_id;
public $channel_primary;
public $channel_name;
public $channel_parent;
public $channel_address;
public $channel_guid;
public $channel_guid_sig;
public $channel_hash;
public $channel_timezone;
public $channel_location;
public $channel_theme;
public $channel_startpage;
public $channel_pubkey;
public $channel_prvkey;
public $channel_epubkey;
public $channel_eprvkey;
public $channel_notifyflags;
public $channel_pageflags;
public $channel_dirdate;
public $channel_lastpost;
public $channel_deleted;
public $channel_active;
public $channel_max_anon_mail;
public $channel_max_friend_req;
public $channel_expire_days;
public $channel_passwd_reset;
public $channel_default_group;
public $channel_allow_cid;
public $channel_allow_gid;
public $channel_deny_cid;
public $channel_deny_gid;
public $channel_removed;
public $channel_system;
public $channel_moved;
public $channel_password;
public $channel_salt;
/**
* @return mixed
*/
public function getId()
{
return $this->channel_id;
}
/**
* @param mixed $channel_id
* @return Channel
*/
public function setId($channel_id)
{
$this->channel_id = $channel_id;
return $this;
}
/**
* @return mixed
*/
public function getAccountId()
{
return $this->channel_account_id;
}
/**
* @param mixed $channel_account_id
* @return Channel
*/
public function setAccountId($channel_account_id)
{
$this->channel_account_id = $channel_account_id;
return $this;
}
/**
* @return mixed
*/
public function getPrimary()
{
return $this->channel_primary;
}
/**
* @param mixed $channel_primary
* @return Channel
*/
public function setPrimary($channel_primary)
{
$this->channel_primary = $channel_primary;
return $this;
}
/**
* @return mixed
*/
public function getName()
{
return $this->channel_name;
}
/**
* @param mixed $channel_name
* @return Channel
*/
public function setName($channel_name)
{
$this->channel_name = $channel_name;
return $this;
}
/**
* @return mixed
*/
public function getParent()
{
return $this->channel_parent;
}
/**
* @param mixed $channel_parent
* @return Channel
*/
public function setParent($channel_parent)
{
$this->channel_parent = $channel_parent;
return $this;
}
/**
* @return mixed
*/
public function getAddress()
{
return $this->channel_address;
}
/**
* @param mixed $channel_address
* @return Channel
*/
public function setAddress($channel_address)
{
$this->channel_address = $channel_address;
return $this;
}
/**
* @return mixed
*/
public function getGuid()
{
return $this->channel_guid;
}
/**
* @param mixed $channel_guid
* @return Channel
*/
public function setGuid($channel_guid)
{
$this->channel_guid = $channel_guid;
return $this;
}
/**
* @return mixed
*/
public function getGuidSig()
{
return $this->channel_guid_sig;
}
/**
* @param mixed $channel_guid_sig
* @return Channel
*/
public function setGuidSig($channel_guid_sig)
{
$this->channel_guid_sig = $channel_guid_sig;
return $this;
}
/**
* @return mixed
*/
public function getHash()
{
return $this->channel_hash;
}
/**
* @param mixed $channel_hash
* @return Channel
*/
public function setHash($channel_hash)
{
$this->channel_hash = $channel_hash;
return $this;
}
/**
* @return mixed
*/
public function getTimezone()
{
return $this->channel_timezone;
}
/**
* @param mixed $channel_timezone
* @return Channel
*/
public function setTimezone($channel_timezone)
{
$this->channel_timezone = $channel_timezone;
return $this;
}
/**
* @return mixed
*/
public function getLocation()
{
return $this->channel_location;
}
/**
* @param mixed $channel_location
* @return Channel
*/
public function setLocation($channel_location)
{
$this->channel_location = $channel_location;
return $this;
}
/**
* @return mixed
*/
public function getTheme()
{
return $this->channel_theme;
}
/**
* @param mixed $channel_theme
* @return Channel
*/
public function setTheme($channel_theme)
{
$this->channel_theme = $channel_theme;
return $this;
}
/**
* @return mixed
*/
public function getStartpage()
{
return $this->channel_startpage;
}
/**
* @param mixed $channel_startpage
* @return Channel
*/
public function setStartpage($channel_startpage)
{
$this->channel_startpage = $channel_startpage;
return $this;
}
/**
* @return mixed
*/
public function getPubkey()
{
return $this->channel_pubkey;
}
/**
* @param mixed $channel_pubkey
* @return Channel
*/
public function setPubkey($channel_pubkey)
{
$this->channel_pubkey = $channel_pubkey;
return $this;
}
/**
* @return mixed
*/
public function getPrvkey()
{
return $this->channel_prvkey;
}
/**
* @param mixed $channel_prvkey
* @return Channel
*/
public function setPrvkey($channel_prvkey)
{
$this->channel_prvkey = $channel_prvkey;
return $this;
}
/**
* @return mixed
*/
public function getEpubkey()
{
return $this->channel_epubkey;
}
/**
* @param mixed $channel_epubkey
* @return Channel
*/
public function setEpubkey($channel_epubkey)
{
$this->channel_epubkey = $channel_epubkey;
return $this;
}
/**
* @return mixed
*/
public function getEprvkey()
{
return $this->channel_eprvkey;
}
/**
* @param mixed $channel_eprvkey
* @return Channel
*/
public function setEprvkey($channel_eprvkey)
{
$this->channel_eprvkey = $channel_eprvkey;
return $this;
}
/**
* @return mixed
*/
public function getNotifyflags()
{
return $this->channel_notifyflags;
}
/**
* @param mixed $channel_notifyflags
* @return Channel
*/
public function setNotifyflags($channel_notifyflags)
{
$this->channel_notifyflags = $channel_notifyflags;
return $this;
}
/**
* @return mixed
*/
public function getPageflags()
{
return $this->channel_pageflags;
}
/**
* @param mixed $channel_pageflags
* @return Channel
*/
public function setPageflags($channel_pageflags)
{
$this->channel_pageflags = $channel_pageflags;
return $this;
}
/**
* @return mixed
*/
public function getDirdate()
{
return $this->channel_dirdate;
}
/**
* @param mixed $channel_dirdate
* @return Channel
*/
public function setDirdate($channel_dirdate)
{
$this->channel_dirdate = $channel_dirdate;
return $this;
}
/**
* @return mixed
*/
public function getLastpost()
{
return $this->channel_lastpost;
}
/**
* @param mixed $channel_lastpost
* @return Channel
*/
public function setLastpost($channel_lastpost)
{
$this->channel_lastpost = $channel_lastpost;
return $this;
}
/**
* @return mixed
*/
public function getDeleted()
{
return $this->channel_deleted;
}
/**
* @param mixed $channel_deleted
* @return Channel
*/
public function setDeleted($channel_deleted)
{
$this->channel_deleted = $channel_deleted;
return $this;
}
/**
* @return mixed
*/
public function getActive()
{
return $this->channel_active;
}
/**
* @param mixed $channel_active
* @return Channel
*/
public function setActive($channel_active)
{
$this->channel_active = $channel_active;
return $this;
}
/**
* @return mixed
*/
public function getMaxAnonMail()
{
return $this->channel_max_anon_mail;
}
/**
* @param mixed $channel_max_anon_mail
* @return Channel
*/
public function setMaxAnonMail($channel_max_anon_mail)
{
$this->channel_max_anon_mail = $channel_max_anon_mail;
return $this;
}
/**
* @return mixed
*/
public function getMaxFriendReq()
{
return $this->channel_max_friend_req;
}
/**
* @param mixed $channel_max_friend_req
* @return Channel
*/
public function setMaxFriendReq($channel_max_friend_req)
{
$this->channel_max_friend_req = $channel_max_friend_req;
return $this;
}
/**
* @return mixed
*/
public function getExpireDays()
{
return $this->channel_expire_days;
}
/**
* @param mixed $channel_expire_days
* @return Channel
*/
public function setExpireDays($channel_expire_days)
{
$this->channel_expire_days = $channel_expire_days;
return $this;
}
/**
* @return mixed
*/
public function getPasswdReset()
{
return $this->channel_passwd_reset;
}
/**
* @param mixed $channel_passwd_reset
* @return Channel
*/
public function setPasswdReset($channel_passwd_reset)
{
$this->channel_passwd_reset = $channel_passwd_reset;
return $this;
}
/**
* @return mixed
*/
public function getDefaultGroup()
{
return $this->channel_default_group;
}
/**
* @param mixed $channel_default_group
* @return Channel
*/
public function setDefaultGroup($channel_default_group)
{
$this->channel_default_group = $channel_default_group;
return $this;
}
/**
* @return mixed
*/
public function getAllowCid()
{
return $this->channel_allow_cid;
}
/**
* @param mixed $channel_allow_cid
* @return Channel
*/
public function setAllowCid($channel_allow_cid)
{
$this->channel_allow_cid = $channel_allow_cid;
return $this;
}
/**
* @return mixed
*/
public function getAllowGid()
{
return $this->channel_allow_gid;
}
/**
* @param mixed $channel_allow_gid
* @return Channel
*/
public function setAllowGid($channel_allow_gid)
{
$this->channel_allow_gid = $channel_allow_gid;
return $this;
}
/**
* @return mixed
*/
public function getDenyCid()
{
return $this->channel_deny_cid;
}
/**
* @param mixed $channel_deny_cid
* @return Channel
*/
public function setDenyCid($channel_deny_cid)
{
$this->channel_deny_cid = $channel_deny_cid;
return $this;
}
/**
* @return mixed
*/
public function getDenyGid()
{
return $this->channel_deny_gid;
}
/**
* @param mixed $channel_deny_gid
* @return Channel
*/
public function setDenyGid($channel_deny_gid)
{
$this->channel_deny_gid = $channel_deny_gid;
return $this;
}
/**
* @return mixed
*/
public function getRemoved()
{
return $this->channel_removed;
}
/**
* @param mixed $channel_removed
* @return Channel
*/
public function setRemoved($channel_removed)
{
$this->channel_removed = $channel_removed;
return $this;
}
/**
* @return mixed
*/
public function getSystem()
{
return $this->channel_system;
}
/**
* @param mixed $channel_system
* @return Channel
*/
public function setSystem($channel_system)
{
$this->channel_system = $channel_system;
return $this;
}
/**
* @return mixed
*/
public function getMoved()
{
return $this->channel_moved;
}
/**
* @param mixed $channel_moved
* @return Channel
*/
public function setMoved($channel_moved)
{
$this->channel_moved = $channel_moved;
return $this;
}
/**
* @return mixed
*/
public function getPassword()
{
return $this->channel_password;
}
/**
* @param mixed $channel_password
* @return Channel
*/
public function setPassword($channel_password)
{
$this->channel_password = $channel_password;
return $this;
}
/**
* @return mixed
*/
public function getSalt()
{
return $this->channel_salt;
}
/**
* @param mixed $channel_salt
* @return Channel
*/
public function setSalt($channel_salt)
{
$this->channel_salt = $channel_salt;
return $this;
}
}

1498
Zotlabs/Entity/Item.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,57 @@
<?php
/*
* SPDX-FileCopyrightText: 2025 The Hubzilla Community
* SPDX-FileContributor: redmatrix
* SPDX-FileContributor: Klaus Weidenbach
* SPDX-FileContributor: zotlabs
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Extend;
use App;
/**
* @brief Hook class.
* A class for hooking into Hubzilla.
*
* Hooks are functions that Hubzilla will invoke at certain points in the code
* during execution. An addon can register a callback handler that will be
* called whenever the specified hook is invoked. A callback handler is a
* function that takes a reference to an array containing the callback
* arguments as it's only argument.
*
* @see call_hooks
* @see load_hooks
*/
class Hook {
/**
* Register a callback handler for a hook.
*
* A callback handler is a function that takes a reference to an array
* containing the callback arguments as it's only argument.
*
* The contents and meaning of the array depends on the hook invoked. By
* modifying the contents of the array the hook can pass data back to the
* caller.
*
* Once the `Hook::register` function has been called, the callback may be
* invoked.
*
* @param string $hook The name of the hook to register a handler for.
* @param string $file The source file of the callback handler.
* @param string|array $function
* The function name of the callback handler, as a
* string or an array.
* @param int $version Hook interface version, allways 1.
* @param int $priority The priority of the callback handler, higher
* numbers takes precedence.
*
* @return true if the handler was already registered, otherwise the result
* from inserting the hook in the database.
*/
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
if(is_array($function)) {
$function = serialize($function);
@@ -45,6 +87,14 @@ class Hook {
return $r;
}
/**
* Register an array of hook callback handlers.
*
* All of the handlers must be in the same source file.
*
* @param string $file The source file of the callback handlers.
* @param array $arr An array of `hookname => functionname` pairs.
*/
static public function register_array($file,$arr) {
if($arr) {
foreach($arr as $k => $v) {
@@ -54,6 +104,20 @@ class Hook {
}
/**
* Unregister a hook callback handler.
*
* @param string $hook The name of the hook to register a callback handler for.
* @param string $file The source file of the hook callback handler.
* @param string|array $function
* The function name of the callback handler, as a
* string or an array.
* @param int $version Hook interface version, allways 1.
* @param int $priority The priority of the callback handler, higher
* numbers takes precedence.
*
* @return The result of the database delete operation.
*/
static public function unregister($hook,$file,$function,$version = 1,$priority = 0) {
if(is_array($function)) {
$function = serialize($function);
@@ -70,11 +134,13 @@ class Hook {
}
/**
* @brief Unregister all hooks with this file component.
* Unregister all hooks handlers from a given source file.
*
* Useful for addon upgrades where you want to clean out old interfaces.
*
* @param string $file
* @param string $file The source file where the hook handlers were defined.
*
* @return The result from the database delete operation.
*/
static public function unregister_by_file($file) {
$r = q("DELETE FROM hook WHERE file = '%s' ",
@@ -85,25 +151,20 @@ class Hook {
}
/**
* @brief Inserts a hook into a page request.
* Inserts a hook into a page request.
*
* Insert a short-lived hook into the running page request.
* Hooks are normally persistent so that they can be called
* across asynchronous processes such as delivery and poll
* processes.
* Insert a short-lived hook into the running page request. Hooks are
* normally persistent so that they can be called across asynchronous
* processes such as delivery and poll processes.
*
* insert_hook lets you attach a hook callback immediately
* which will not persist beyond the life of this page request
* or the current process.
* This function lets you attach a hook callback immediately which will not
* persist beyond the life of this page request or the current process.
*
* @param string $hook
* name of hook to attach callback
* @param string $fn
* function name of callback handler
* @param int $version
* hook interface version, 0 uses two callback params, 1 uses one callback param
* @param int $priority
* currently not implemented in this function, would require the hook array to be resorted
* @param string $hook Name of hook to attach callback.
* @param string|array $fn Name of callback handler as a string or array.
* @param int $version Hook interface version, allways 1.
* @param int $priority Currently not implemented in this function,
* would require the hook array to be resorted.
*/
static public function insert($hook, $fn, $version = 0, $priority = 0) {
if(is_array($fn)) {
@@ -119,4 +180,4 @@ class Hook {
App::$hooks[$hook][] = array('', $fn, $priority, $version);
}
}
}

View File

@@ -1,22 +1,106 @@
<?php
/*
* SPDX-FileCopyrightText: 2018 The Hubzilla Community
* SPDX-FileContributor: Zotlabs
* SPDX-FileContributor: Mario <mario@mariovavti.com>
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Extend;
use Zotlabs\Lib\Config;
/**
* Class for managing routes.
*
* Routes connect a URL path to a module that will handle requests to that
* path.
*
* For example by registering a route like this:
*
* ```php
* Route::register(
* __DIR__ . '/Mod_Myroute.php',
* 'myroute'
* );
* ```
*
* Hubzilla will direct requests to the '/myroute' URL path to the 'Myroute'
* controller located in the '/Mod_Myroute.php' file in the same directory as
* the file this code was called from.
*
* Routes are stored persistently, so this function will typically be called from
* the `<addon>_load()` function if called from an addon. Accordingly, the route must
* be unregistered when no longer needed, like this:
*
* ```php
* Route::unregister(
* __DIR__ . '/Mod_Myroute.php',
* 'myroute'
* );
* ```
*
* This will typically be called from the `<addon>_unload()` function in an addon.
*/
class Route {
static function register($file,$modname) {
/**
* Register a new route.
*
* Example:
* ```php
* Route::register(
* __DIR__ . '/Mod_Myroute.php',
* 'myroute'
* );
* ```
*
* The route is stored persistently, and must be unregistered when no longer needed.
*
* @param string $file The file containing the controller for handling requests to this route.
* @param string $modname The name of the module (URL path).
*
* @see {@link Zotlabs::Extend::Route.unregister() unregister()}
* @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()}
*/
public static function register(string $file, string $modname): void {
$rt = self::get();
foreach ($rt as $r) {
if ($r[0] === $file && $r[1] === $modname) {
return;
}
}
$rt[] = [ $file, $modname ];
self::set($rt);
}
static function unregister($file,$modname) {
/**
* Unregister a route.
*
* Example:
* ```php
* Route::unregister(
* __DIR__ . '/Mod_Myroute.php',
* 'myroute'
* );
* ```
*
* @param string $file The file containing the controller for handling requests to this route.
* @param string $modname The name of the module (URL path).
*
* @see {@link Zotlabs::Extend::Route.register() register()}
* @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()}
*/
public static function unregister(string $file, string $modname): void {
$rt = self::get();
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file && $r[1] !== $modname) {
if(!($r[0] === $file && $r[1] === $modname)) {
$n[] = $r;
}
}
@@ -24,7 +108,23 @@ class Route {
}
}
static function unregister_by_file($file) {
/**
* Unregister all routes by source file.
*
* Removes all persistently stored routes with hanclers in the
* given source file.
*
* Example:
* ```php
* Route::unregister_by_file(__DIR__ . '/Mod_Myroute.php');
* ```
*
* @param string $file The file containing the controllers to remove.
*
* @see {@link Zotlabs::Extend::Route.register() register()}
* @see {@link Zotlabs::Extend::Route.unregister() unregister()}
*/
public static function unregister_by_file(string $file): void {
$rt = self::get();
if($rt) {
$n = [];
@@ -37,12 +137,19 @@ class Route {
}
}
static function get() {
return get_config('system','routes',[]);
/**
* Get an array of all defined routes.
*
* @return An array of routes, where each entry is an array
* containing two elements, the file, and the module
* name.
*/
public static function get(): array {
return Config::Get('system','routes',[]);
}
static function set($r) {
return set_config('system','routes',$r);
private static function set(array $r): mixed {
return Config::Set('system','routes',$r);
}
}

View File

@@ -2,11 +2,19 @@
namespace Zotlabs\Extend;
use Zotlabs\Lib\Config;
class Widget {
static function register($file,$widget) {
$rt = self::get();
foreach ($rt as $r) {
if ($r[0] === $file && $r[1] === $widget) {
return;
}
}
$rt[] = [ $file, $widget ];
self::set($rt);
}
@@ -16,7 +24,7 @@ class Widget {
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file && $r[1] !== $widget) {
if(!($r[0] === $file && $r[1] === $widget)) {
$n[] = $r;
}
}
@@ -38,10 +46,10 @@ class Widget {
}
static function get() {
return get_config('system','widgets',[]);
return Config::Get('system','widgets',[]);
}
static function set($r) {
return set_config('system','widgets',$r);
return Config::Set('system','widgets',$r);
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Identity;
use Zotlabs\Lib\Config;
class OAuth2Server extends \OAuth2\Server {
public function __construct(OAuth2Storage $storage, $config = null) {
@@ -24,8 +26,8 @@ class OAuth2Server extends \OAuth2\Server {
$keyStorage = new \OAuth2\Storage\Memory( [
'keys' => [
'public_key' => get_config('system', 'pubkey'),
'private_key' => get_config('system', 'prvkey')
'public_key' => Config::Get('system', 'pubkey'),
'private_key' => Config::Get('system', 'prvkey')
]
]);

69
Zotlabs/Lib/ASCache.php Normal file
View File

@@ -0,0 +1,69 @@
<?php /** @file */
namespace Zotlabs\Lib;
/**
* A wrapper for the cache api
*/
class ASCache {
public static function isEnabled()
{
return Config::Get('system', 'as_object_cache_enabled', true);
}
public static function getAge(): string
{
return Config::Get('system', 'as_object_cache_time', '10 MINUTE');
}
public static function Get(string $key): array
{
if (!self::isEnabled()) {
return [];
}
$ret = Cache::get($key, self::getAge());
if ($ret) {
return json_unserialize($ret);
}
return [];
}
public static function Set(string $key, array $obj): void
{
if (!self::isEnabled()) {
return;
}
if (!self::isCacheable($obj)) {
return;
}
Cache::set($key, json_serialize($obj));
}
public static function isCacheable(array $obj): bool
{
$to = [];
$cc = [];
if (isset($obj['to'])) {
$to = is_array($obj['to']) ? $obj['to'] : [$obj['to']];
}
if (isset($obj['cc'])) {
$cc = is_array($obj['cc']) ? $obj['cc'] : [$obj['cc']];
}
$receivers = array_merge($to, $cc);
if ($receivers && !in_array(ACTIVITY_PUBLIC_INBOX, $receivers)) {
return false;
}
return true;
}
}

View File

@@ -31,7 +31,19 @@ class ASCollection {
}
if (is_string($obj)) {
$data = Activity::fetch($obj, $channel);
$cached = ASCache::Get($obj);
if ($cached) {
// logger('cached: ' . $obj);
$data = $cached;
}
else {
// logger('fetching: ' . $obj);
$data = Activity::fetch($obj, $channel);
if ($data) {
ASCache::Set($obj, $data);
}
}
$this->history[] = $obj;
}
@@ -83,6 +95,8 @@ class ASCollection {
return false;
}
$data = null;
if (is_array($this->nextpage)) {
$data = $this->nextpage;
}
@@ -92,7 +106,20 @@ class ASCollection {
// recursion detected
return false;
}
$data = Activity::fetch($this->nextpage, $this->channel);
$cached = ASCache::Get($this->nextpage);
if ($cached) {
// logger('cached: ' . $this->nextpage);
$data = $cached;
}
else {
$data = Activity::fetch($this->nextpage, $this->channel);
if ($data) {
// logger('fetching: ' . $this->nextpage);
ASCache::Set($this->nextpage, $data);
}
}
$this->history[] = $this->nextpage;
}

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,7 @@ class ActivityStreams {
public $meta = null;
public $valid = false;
public $deleted = false;
public $portable_id = null;
public $id = '';
public $parent_id = '';
public $type = '';
@@ -23,10 +24,11 @@ class ActivityStreams {
public $origin = null;
public $owner = null;
public $signer = null;
public $ldsig = null;
public $sig = null;
public $sigok = false;
public $recips = null;
public $raw_recips = null;
public $saved_recips = null;
/**
* @brief Constructor for ActivityStreams.
@@ -35,12 +37,13 @@ class ActivityStreams {
*
* @param string $string
*/
function __construct($string) {
function __construct($string, $portable_id = null) {
if(!$string)
return;
$this->raw = $string;
$this->portable_id = $portable_id;
if (is_array($string)) {
$this->data = $string;
@@ -86,7 +89,16 @@ class ActivityStreams {
// Attempt to assemble an Activity from what we were given.
if ($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->id = $this->get_property_obj('id');
if (!$this->id) {
logger('Data with mmissing id: ' . print_r($this->data, true));
return;
}
// cache for future use
ASCache::Set($this->id, $this->data);
$this->type = $this->get_primary_type();
$this->actor = $this->get_actor('actor', '', '');
$this->obj = $this->get_compound_property('object');
@@ -94,11 +106,19 @@ class ActivityStreams {
$this->origin = $this->get_compound_property('origin');
$this->recips = $this->collect_recips();
$this->ldsig = $this->get_compound_property('signature');
if ($this->ldsig) {
$this->signer = $this->get_actor('creator', $this->ldsig);
if ($this->signer && is_array($this->signer) && array_key_exists('publicKey', $this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data, $this->signer['publicKey']['publicKeyPem']);
$this->sig = $this->get_compound_property('proof');
if ($this->sig) {
$this->checkEddsaSignature(); // will set signer and sigok if everything works out
}
// Try LDSignatures if edsig failed
if (!$this->sigok) {
$this->sig = $this->get_compound_property('signature');
if ($this->sig) {
$this->signer = $this->get_actor('creator', $this->sig);
if ($this->signer && is_array($this->signer) && array_key_exists('publicKey', $this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data, $this->signer['publicKey']['publicKeyPem']);
}
}
}
@@ -110,25 +130,34 @@ class ActivityStreams {
}
}
// fetch recursive or embedded activities
// Fetch recursive or embedded activities
if ($this->obj && is_array($this->obj) && array_key_exists('object', $this->obj)) {
$this->obj['object'] = $this->get_compound_property($this->obj['object']);
$this->obj['object'] = $this->get_compound_property('object', $this->obj);
}
if ($this->obj && is_array($this->obj) && isset($this->obj['actor']))
// Enumerate and store actors in referenced objects
if ($this->obj && is_array($this->obj) && isset($this->obj['actor'])) {
$this->obj['actor'] = $this->get_actor('actor', $this->obj);
if ($this->tgt && is_array($this->tgt) && isset($this->tgt['actor']))
$this->tgt['actor'] = $this->get_actor('actor', $this->tgt);
$this->parent_id = $this->get_property_obj('inReplyTo');
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
$this->parent_id = $this->obj['inReplyTo'];
}
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['id'])) {
if ($this->tgt && is_array($this->tgt) && isset($this->tgt['actor'])) {
$this->tgt['actor'] = $this->get_actor('actor', $this->tgt);
}
// Determine if this is a followup or response activity
$this->parent_id = ((is_array($this->get_property_obj('inReplyTo'))) ? $this->get_property_obj('inReplyTo')['id'] : $this->get_property_obj('inReplyTo'));
if (!$this->parent_id && isset($this->obj['inReplyTo'])) {
$this->parent_id = ((is_array($this->obj['inReplyTo'])) ? $this->obj['inReplyTo']['id'] : $this->obj['inReplyTo']);
}
if (!$this->parent_id && isset($this->obj['id'])) {
$this->parent_id = $this->obj['id'];
}
}
}
@@ -145,36 +174,59 @@ class ActivityStreams {
$this->saved_recips = $arr;
}
/**
* @brief get single property from Activity object
*
* @param string $property
* @param mixed $default return value if property or object not set
* or object is a string id which could not be fetched.
* @return mixed
*/
public function objprop(string $property, mixed $default = false): mixed {
$x = $this->get_property_obj($property, $this->obj);
return (isset($x)) ? $x : $default;
}
/**
* @brief Collects all recipients.
*
* @param string $base
* @param mixed $base
* @param string $namespace (optional) default empty
* @return array
*/
function collect_recips($base = '', $namespace = '') {
$x = [];
public function collect_recips(mixed $base = '', string $namespace = ''): array {
$result = [];
$tmp = [];
$fields = ['to', 'cc', 'bto', 'bcc', 'audience'];
foreach ($fields as $f) {
$y = $this->get_compound_property($f, $base, $namespace);
if ($y) {
if (!is_array($this->raw_recips)) {
$this->raw_recips = [];
}
if (!is_array($y)) {
$y = [$y];
}
$this->raw_recips[$f] = $y;
$x = array_merge($x, $y);
foreach ($fields as $field) {
// don't expand these yet
$values = $this->get_property_obj($field, $base, $namespace);
if ($values) {
$values = force_array($values);
$tmp[$field] = $values;
$result = array_values(array_unique(array_merge($result, $values)));
}
// Merge the object recipients if they exist.
$values = $this->objprop($field);
if ($values) {
$values = force_array($values);
$tmp[$field] = ((isset($tmp[$field])) ? array_merge($tmp[$field], $values) : $values);
$result = array_values(array_unique(array_merge($result, $values)));
}
// remove duplicates
if (isset($tmp[$field])) {
$tmp[$field] = array_values(array_unique($tmp[$field]));
}
}
// not yet ready for prime time
// $x = $this->expand($x,$base,$namespace);
return $x;
$this->raw_recips = $tmp;
// not yet ready for prime time
// $result = $this->expand($result,$base,$namespace);
return $result;
}
function expand($arr, $base = '', $namespace = '') {
$ret = [];
@@ -278,12 +330,27 @@ class ActivityStreams {
* @return NULL|mixed
*/
function fetch_property($url) {
return self::fetch($url);
}
function fetch_property($url, $channel = null) {
$x = null;
static function fetch($url, $channel = null) {
return Activity::fetch($url, $channel);
if (str_starts_with($url, z_root() . '/item/')) {
$x = Activity::fetch_local($url, $this->portable_id ?? '');
logger('local: ' . print_r($x,true));
}
if (!$x) {
$x = Activity::fetch($url, $channel);
if ($x === null && strpos($url, '/channel/')) {
// look for other nomadic channels which might be alive
$zf = Zotfinger::exec($url, $channel);
if ($zf) {
$url = $zf['signature']['signer'];
$x = Activity::fetch($url, $channel);
}
}
}
return $x;
}
static function is_an_actor($s) {
@@ -294,7 +361,7 @@ class ActivityStreams {
if (!$s) {
return false;
}
return (in_array($s, ['Like', 'Dislike', 'Flag', 'Block', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject', 'emojiReaction', 'EmojiReaction', 'EmojiReact']));
return (in_array($s, ['Announce', 'Like', 'Dislike', 'Flag', 'Block', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject', 'emojiReaction', 'EmojiReaction', 'EmojiReact']));
}
/**
@@ -310,7 +377,7 @@ class ActivityStreams {
$x = $this->get_property_obj($property, $base, $namespace);
if ($this->is_url($x)) {
$y = Activity::get_cached_actor($x);
$y = Activity::get_actor($x);
if ($y) {
return $y;
}
@@ -341,13 +408,26 @@ class ActivityStreams {
*/
function get_compound_property($property, $base = '', $namespace = '', $first = false) {
$x = $this->get_property_obj($property, $base, $namespace);
if ($this->is_url($x)) {
$y = $this->fetch_property($x);
$cached = ASCache::Get($x);
if ($cached) {
// logger('AS cached: ' . $x);
$y = $cached;
}
else {
// logger('AS fetching: ' . $x);
$y = $this->fetch_property($x);
if ($y) {
ASCache::Set($x, $y);
}
}
if (is_array($y)) {
$x = $y;
}
}
// verify and unpack JSalmon signature if present
if (is_array($x) && array_key_exists('signed', $x)) {
@@ -447,4 +527,69 @@ class ActivityStreams {
}
public function checkEddsaSignature() {
$publicKey = null;
$signer = $this->get_property_obj('verificationMethod', $this->sig);
if ($signer && str_starts_with($signer, 'did:key:')) {
$publicKey = str_replace('did:key:', '', $signer);
$this->signer = ['id' => $signer];
if (strpos($publicKey, '#') !== false) {
$publicKey = substr($publicKey,0, strpos($publicKey, '#'));
}
}
else {
$parseUrl = parse_url($signer);
if (isset($parseUrl['fragment'])) {
if (str_starts_with($parseUrl['fragment'], 'z6Mk')) {
$publicKey = $parseUrl['fragment'];
}
unset($parseUrl['fragment']);
}
if (isset($parseUrl['query'])) {
unset($parseUrl['query']);
}
$url = unparse_url($parseUrl);
$this->signer = ['id' => $url];
$hublocs = Activity::get_actor_hublocs($url);
$hasStoredKey = false;
if ($hublocs) {
foreach ($hublocs as $hubloc) {
if ($publicKey && $hubloc['xchan_epubkey'] === $publicKey) {
$hasStoredKey = true;
break;
}
}
}
if (!$hasStoredKey) {
$this->signer = Activity::get_actor($url);
if (isset($this->signer['assertionMethod'])) {
if (!isset($this->signer['assertionMethod'][0])) {
$this->signer['assertionMethod'] = [$this->signer['assertionMethod']];
}
foreach($this->signer['assertionMethod'] as $am) {
if ($url === $am['controller'] &&
$am['type'] === 'Multikey' &&
str_starts_with($am['publicKeyMultibase'], 'z6Mk')
) {
$publicKey = $am['publicKeyMultibase'];
}
}
}
}
}
if ($publicKey) {
$this->sigok = (new JcsEddsa2022)->verify($this->data, $publicKey);
}
}
}

View File

@@ -3,6 +3,7 @@
namespace Zotlabs\Lib;
use App;
use Zotlabs\Lib\Config;
require_once('include/plugin.php');
require_once('include/channel.php');
@@ -65,7 +66,7 @@ class Apps {
}
static public function get_base_apps() {
$x = get_config('system','base_apps',[
$x = Config::Get('system','base_apps',[
'Connections',
'Contact Roles',
'Network',
@@ -301,7 +302,7 @@ class Apps {
break;
default:
if($config)
$unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
$unset = ((Config::Get('system', $require[0]) == $require[1]) ? false : true);
else
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
if($unset)
@@ -340,7 +341,7 @@ class Apps {
'Suggest Channels' => t('Suggest Channels'),
'Login' => t('Login'),
'Channel Manager' => t('Channel Manager'),
'Network' => t('Stream'),
'Network' => t('Network'),
'Settings' => t('Settings'),
'Files' => t('Files'),
'Webpages' => t('Webpages'),
@@ -352,8 +353,6 @@ class Apps {
'Directory' => t('Directory'),
'Help' => t('Help'),
'Mail' => t('Mail'),
'Mood' => t('Mood'),
'Poke' => t('Poke'),
'Chat' => t('Chat'),
'Search' => t('Search'),
'Probe' => t('Probe'),
@@ -419,11 +418,28 @@ class Apps {
static public function app_render($papp, $mode = 'view') {
$installed = false;
if(! $papp)
if(!$papp) {
return;
}
if(! $papp['photo'])
/**
* @hooks app_render_before
* Hook to manipulate the papp array before rendering
*/
$hookinfo = [
'name' => $papp['name'],
'photo' => $papp['photo']
];
call_hooks('app_render_manipulate_photo', $hookinfo);
// We will only allow to manipulate the photo
$papp['photo'] = $hookinfo['photo'];
if(!$papp['photo']) {
$papp['photo'] = 'icon:gear';
}
self::translate_system_apps($papp);
@@ -508,7 +524,7 @@ class Apps {
break;
default:
if($config)
$unset = ((get_config('system', $require[0]) === $require[1]) ? false : true);
$unset = ((Config::Get('system', $require[0]) === $require[1]) ? false : true);
else
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
if($unset)
@@ -605,8 +621,8 @@ class Apps {
'$deleted' => $papp['deleted'] ?? false,
'$feature' => ((isset($papp['embed']) || $mode == 'edit') ? false : true),
'$pin' => ((isset($papp['embed']) || $mode == 'edit') ? false : true),
'$featured' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$featured' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_featured_app') !== false) ? true : false),
'$pinned' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_pinned_app') !== false) ? true : false),
'$mode' => $mode,
'$add' => t('Add to app-tray'),
'$remove' => t('Remove from app-tray'),
@@ -945,7 +961,7 @@ class Apps {
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$x = (($uid) ? get_pconfig($uid,'system',$conf) : get_config('system',$conf));
$x = (($uid) ? get_pconfig($uid,'system',$conf) : Config::Get('system',$conf));
if(($x) && (! is_array($x))) {
$y = explode(',',$x);
$y = array_map('trim',$y);
@@ -1012,12 +1028,7 @@ class Apps {
if(! $syslist)
return;
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
break;
}
}
$position = array_find_key($syslist, fn ($v) => $v['guid'] === $guid);
if(! $position)
return;
@@ -1066,12 +1077,7 @@ class Apps {
if(! $syslist)
return;
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
break;
}
}
$position = array_find_key($syslist, fn ($v) => $v['guid'] === $guid);
if($position >= count($syslist) - 1)
return;

View File

@@ -0,0 +1,80 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\ActivityStreams\UnhandledElementException;
class BaseObject
{
public $string;
public $ldContext;
/**
* @param $input
* @param $strict
* @throws UnhandledElementException if $strict
*/
public function __construct($input = null, $strict = false)
{
if (isset($input)) {
if (is_string($input)) {
$this->string = $input;
}
elseif(is_array($input)) {
foreach ($input as $key => $value) {
$key = ($key === '@context') ? 'ldContext' : $key;
if ($strict && !property_exists($this, $key)) {
throw new UnhandledElementException("Unhandled element: $key");
}
$this->{$key} = $value;
}
}
}
return $this;
}
public function getDataType($element, $object = null)
{
$object = $object ?? $this;
$type = gettype($object[$element]);
if ($type === 'array' && array_is_list($object[$element])) {
return 'list';
}
return $type;
}
public function toArray()
{
if ($this->string) {
return $this->string;
}
$returnValue = [];
foreach ((array) $this as $key => $value) {
if (isset($value)) {
$key = ($key === 'ldContext') ? '@context' : $key;
$returnValue[$key] = (($value instanceof BaseObject) ? $value->toArray() : $value);
}
}
return $returnValue;
}
/**
* @return mixed
*/
public function getLdContext()
{
return $this->ldContext;
}
/**
* @param mixed $ldContext
* @return BaseObject
*/
public function setLdContext($ldContext)
{
$this->ldContext = $ldContext;
return $this;
}
}

View File

@@ -2,53 +2,56 @@
namespace Zotlabs\Lib;
/**
* cache api
*/
use Zotlabs\Lib\Config;
/**
* cache api
*/
class Cache {
/**
* @brief Returns cached content
*
*
* @param string $key
* @param string $age in SQL format, default is '30 DAY'
* @return string
*/
public static function get($key, $age = '') {
$hash = hash('whirlpool',$key);
public static function get($key, $age = '') {
// $hash = hash('whirlpool',$key);
$hash = uuid_from_url($key);
$r = q("SELECT v FROM cache WHERE k = '%s' AND updated > %s - INTERVAL %s LIMIT 1",
dbesc($hash),
db_utcnow(),
db_quoteinterval(($age ? $age : get_config('system','object_cache_days', '30') . ' DAY'))
db_quoteinterval(($age ? $age : Config::Get('system','object_cache_days', '30') . ' DAY'))
);
if ($r)
return $r[0]['v'];
return null;
}
public static function set($key,$value) {
// $hash = hash('whirlpool',$key);
$hash = uuid_from_url($key);
$hash = hash('whirlpool',$key);
$r = q("SELECT * FROM cache WHERE k = '%s' limit 1",
$r = q("SELECT * FROM cache WHERE k = '%s' LIMIT 1",
dbesc($hash)
);
if($r) {
q("UPDATE cache SET v = '%s', updated = '%s' WHERE k = '%s'",
dbesc($value),
dbesc(datetime_convert()),
dbesc($hash));
dbesc($hash)
);
}
else {
q("INSERT INTO cache ( k, v, updated) VALUES ('%s','%s','%s')",
q("INSERT INTO cache (k, v, updated) VALUES ('%s', '%s', '%s')",
dbesc($hash),
dbesc($value),
dbesc(datetime_convert()));
dbesc(datetime_convert())
);
}
}
}

View File

@@ -181,7 +181,7 @@ class Chatroom {
}
function leave($observer_xchan, $room_id, $client) {
public static function leave($observer_xchan, $room_id, $client) {
if(! $room_id || ! $observer_xchan)
return;

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Lib;
use App;
class Config {
@@ -14,20 +15,41 @@ class Config {
* @param string $family
* The category of the configuration value
*/
static public function Load($family) {
if(! array_key_exists($family, \App::$config))
\App::$config[$family] = array();
public static function Load($family, $recursionCounter = 0) {
if (! array_key_exists($family, App::$config)) {
App::$config[$family] = [];
}
if(! array_key_exists('config_loaded', \App::$config[$family])) {
// We typically continue when presented with minor DB issues,
// but loading the site configuration is more important.
// Check for query returning false and give it approx 30 seconds
// to recover if there's a problem. This is intended to fix a
// rare issue on Galera where temporary sync issues were causing
// the site encryption keys to be regenerated, which was causing
// communication issues for members.
// This code probably belongs at the database layer, but we don't
// necessarily want to shut the site down for problematic queries
// caused by bad data. That could be used in a denial of service
// attack. Those do need to be (and they are) logged.
if (! array_key_exists('config_loaded', App::$config[$family])) {
$r = q("SELECT * FROM config WHERE cat = '%s'", dbesc($family));
if($r !== false) {
if($r) {
foreach($r as $rr) {
$k = $rr['k'];
\App::$config[$family][$k] = $rr['v'];
}
if ($r === false && !App::$install) {
sleep(3);
$recursionCounter ++;
if ($recursionCounter > 10) {
system_unavailable();
}
\App::$config[$family]['config_loaded'] = true;
self::Load($family, $recursionCounter);
}
elseif (is_array($r)) {
foreach ($r as $rr) {
$k = $rr['k'];
App::$config[$family][$k] = $rr['v'];
}
App::$config[$family]['config_loaded'] = true;
}
}
}
@@ -46,19 +68,19 @@ class Config {
* @return mixed
* Return the set value, or false if the database update failed
*/
static public function Set($family, $key, $value) {
public static function Set($family, $key, $value) {
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_array($value)) ? 'json:' . json_encode($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
if(self::Get($family, $key) === false || (! self::get_from_storage($family, $key))) {
if (self::Get($family, $key) === false || (! self::get_from_storage($family, $key))) {
$ret = q("INSERT INTO config ( cat, k, v ) VALUES ( '%s', '%s', '%s' ) ",
dbesc($family),
dbesc($key),
dbesc($dbvalue)
);
if($ret) {
\App::$config[$family][$key] = $value;
if ($ret) {
App::$config[$family][$key] = $value;
$ret = $value;
}
return $ret;
@@ -70,8 +92,8 @@ class Config {
dbesc($key)
);
if($ret) {
\App::$config[$family][$key] = $value;
if ($ret) {
App::$config[$family][$key] = $value;
$ret = $value;
}
@@ -93,21 +115,37 @@ class Config {
* The category of the configuration value
* @param string $key
* The configuration key to query
* @param string $default (optional) default false
* @param mixed $default (optional) default false
* @return mixed Return value or false on error or if not set
*/
static public function Get($family, $key, $default = false) {
if((! array_key_exists($family, \App::$config)) || (! array_key_exists('config_loaded', \App::$config[$family])))
self::Load($family);
public static function Get($family, $key, $default = false) {
if(array_key_exists('config_loaded', \App::$config[$family])) {
if(! array_key_exists($key, \App::$config[$family])) {
if ((! array_key_exists($family, App::$config)) || (! array_key_exists('config_loaded', App::$config[$family]))) {
self::Load($family);
}
if (array_key_exists('config_loaded', App::$config[$family])) {
if (! array_key_exists($key, App::$config[$family])) {
return $default;
}
return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key]))
? unserialize(\App::$config[$family][$key])
: \App::$config[$family][$key]
);
$value = App::$config[$family][$key];
if (! is_array($value)) {
if (str_starts_with($value, 'json:')) {
return json_unserialize($value);
} else if (preg_match('|^a:[0-9]+:{.*}$|s', $value)) {
// Unserialize in inherently unsafe. Try to mitigate by not
// allowing unserializing objects. Only kept for backwards
// compatibility. JSON serialization should be prefered.
return unserialize($value, array('allowed_classes' => false));
} else {
return $value;
}
}
else {
return $value;
}
}
return $default;
@@ -125,12 +163,13 @@ class Config {
* The configuration key to delete
* @return mixed
*/
static public function Delete($family, $key) {
public static function Delete($family, $key) {
$ret = false;
if(array_key_exists($family, \App::$config) && array_key_exists($key, \App::$config[$family]))
unset(\App::$config[$family][$key]);
if (array_key_exists($family, App::$config) && array_key_exists($key, App::$config[$family])) {
unset(App::$config[$family][$key]);
}
$ret = q("DELETE FROM config WHERE cat = '%s' AND k = '%s'",
dbesc($family),
@@ -153,7 +192,7 @@ class Config {
* The configuration key to query
* @return mixed
*/
static private function get_from_storage($family,$key) {
private static function get_from_storage($family, $key) {
$ret = q("SELECT * FROM config WHERE cat = '%s' AND k = '%s' LIMIT 1",
dbesc($family),
dbesc($key)
@@ -161,5 +200,4 @@ class Config {
return $ret;
}
}

View File

@@ -5,8 +5,7 @@ namespace Zotlabs\Lib;
use App;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Config;
class Connect {
@@ -25,10 +24,16 @@ class Connect {
$uid = $channel['channel_id'];
if (strpos($url,'@') === false && strpos($url,'/') === false) {
// If we get just a channel name and it is not an URL turn it into a local webbie
if (!str_contains($url, '@') && strpos($url,'/') === false) {
$url = $url . '@' . App::get_hostname();
}
// Remove a possible leading @
if (str_starts_with($url, '@')) {
$url = ltrim($url, '@');
}
$result = [ 'success' => false, 'message' => '' ];
$my_perms = false;
@@ -69,7 +74,8 @@ class Connect {
$xchan_hash = '';
$sql_options = (($protocol) ? " and xchan_network = '" . dbesc($protocol) . "' " : '');
$r = q("SELECT * FROM xchan LEFT JOIN hubloc ON xchan_hash = hubloc_hash WHERE ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s') $sql_options ORDER BY hubloc_id DESC",
// We need both, the xchan and the hubloc here hence use JOIN instead of LEFT JOIN
$r = q("SELECT * FROM xchan JOIN hubloc ON xchan_hash = hubloc_hash WHERE ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s') $sql_options ORDER BY hubloc_id DESC",
dbesc($url),
dbesc($url),
dbesc($url)
@@ -95,7 +101,7 @@ class Connect {
$wf = discover_by_webbie($url,$protocol);
if (! $wf) {
$feeds = get_config('system','feed_contacts');
$feeds = Config::Get('system','feed_contacts');
if (($feeds) && (in_array($protocol, [ '', 'feed', 'rss' ]))) {
$d = discover_by_url($url);
@@ -109,10 +115,12 @@ class Connect {
if ($wf || $d) {
$xchan_hash = (($wf) ? $wf : $url);
// something was discovered - find the record which was just created.
$r = q("select * from xchan where ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s' ) $sql_options",
dbesc($wf ?? $url),
dbesc($xchan_hash),
dbesc($url),
dbesc($url)
);

View File

@@ -3,6 +3,7 @@
namespace Zotlabs\Lib;
use Exception;
use Zotlabs\Lib\Config;
class Crypto {
@@ -44,7 +45,7 @@ class Crypto {
'encrypt_key' => false
];
$conf = get_config('system', 'openssl_conf_file');
$conf = Config::Get('system', 'openssl_conf_file');
if ($conf) {
$openssl_options['config'] = $conf;

View File

@@ -1,21 +1,39 @@
<?php
/**
* A class to handle database schema upgrades.
*
* SPDX-FileCopyrightText: 2024 Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use Zotlabs\Lib\Config;
/**
* Upgrade the database schema if necessary.
*
* Compares the currently active database schema version with the version
* required for this version of Hubzilla, and performs the upgrade if needed.
*
* If the difference consists of more than one revision of the schema, each of
* the intermediate upgrades are performed in turn.
*/
class DB_Upgrade {
public $config_name = '';
public $func_prefix = '';
/**
* Check the installed and required schema versions and perform the upgrade
* if necessary.
*
* @param int $db_version The required DB schema version.
*/
public static function run(int $db_revision): void {
function __construct($db_revision) {
$this->config_name = 'db_version';
$this->func_prefix = '_';
$build = get_config('system', 'db_version', 0);
$build = Config::Get('system', 'db_version', 0);
if(! intval($build))
$build = set_config('system', 'db_version', $db_revision);
$build = Config::Set('system', 'db_version', $db_revision);
if($build == $db_revision) {
// Nothing to be done.
@@ -27,7 +45,7 @@ class DB_Upgrade {
logger('Critical: check_config unable to determine database schema version');
return;
}
$current = intval($db_revision);
if($stored < $current) {
@@ -38,7 +56,7 @@ class DB_Upgrade {
for($x = $stored + 1; $x <= $current; $x ++) {
$s = '_' . $x;
$cls = '\\Zotlabs\Update\\' . $s ;
if(! class_exists($cls)) {
if(! class_exists($cls)) {
return;
}
@@ -52,10 +70,10 @@ class DB_Upgrade {
Config::Load('database');
if(get_config('database', $s))
if(Config::Get('database', $s))
break;
set_config('database',$s, '1');
Config::Set('database',$s, '1');
$c = new $cls();
@@ -65,10 +83,10 @@ class DB_Upgrade {
$source = t('Source code of failed update: ') . "\n\n" . @file_get_contents('Zotlabs/Update/' . $s . '.php');
// Prevent sending hundreds of thousands of emails by creating
// a lockfile.
// a lockfile.
$lockfile = 'store/[data]/mailsent';
@@ -77,7 +95,7 @@ class DB_Upgrade {
@unlink($lockfile);
//send the administrator an e-mail
file_put_contents($lockfile, $x);
$r = q("select account_language from account where account_email = '%s' limit 1",
dbesc(\App::$config['system']['admin_email'])
);
@@ -86,7 +104,7 @@ class DB_Upgrade {
[
'toEmail' => \App::$config['system']['admin_email'],
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
[
'$sitename' => \App::$config['system']['sitename'],
'$siteurl' => z_root(),
@@ -104,11 +122,11 @@ class DB_Upgrade {
pop_lang();
}
else {
set_config('database',$s, 'success');
Config::Set('database',$s, 'success');
}
}
}
set_config('system', 'db_version', $db_revision);
Config::Set('system', 'db_version', $db_revision);
}
}
}
}

View File

@@ -1,28 +1,33 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Lib\Config;
class DReport {
private $location;
private $sender;
private $recipient;
private $name;
private $message_id;
private $message_uuid;
private $status;
private $date;
function __construct($location,$sender,$recipient,$message_id,$status = 'deliver') {
$this->location = $location;
$this->sender = $sender;
$this->recipient = $recipient;
$this->name = EMPTY_STR;
$this->message_id = $message_id;
$this->status = $status;
$this->date = datetime_convert();
function __construct($location, $sender, $recipient, $message_id, $message_uuid = '', $status = 'deliver') {
$this->location = $location;
$this->sender = $sender;
$this->recipient = $recipient;
$this->name = EMPTY_STR;
$this->message_id = $message_id;
$this->message_uuid = $message_uuid;
$this->status = $status;
$this->date = datetime_convert();
}
function update($status) {
$this->status = $status;
$this->date = datetime_convert();
$this->status = $status;
$this->date = datetime_convert();
}
function set_name($name) {
@@ -30,29 +35,31 @@ class DReport {
}
function addto_update($status) {
$this->status = $this->status . ' ' . $status;
$this->status = $this->status . ', ' . $status;
}
function set($arr) {
$this->location = $arr['location'];
$this->sender = $arr['sender'];
$this->recipient = $arr['recipient'];
$this->name = $arr['name'];
$this->message_id = $arr['message_id'];
$this->status = $arr['status'];
$this->date = $arr['date'];
$this->location = $arr['location'];
$this->sender = $arr['sender'];
$this->recipient = $arr['recipient'];
$this->name = $arr['name'];
$this->message_id = $arr['message_id'];
$this->message_uuid = $arr['message_uuid'] ?? '';
$this->status = $arr['status'];
$this->date = $arr['date'];
}
function get() {
return array(
'location' => $this->location,
'sender' => $this->sender,
'recipient' => $this->recipient,
'name' => $this->name,
'message_id' => $this->message_id,
'status' => $this->status,
'date' => $this->date
'location' => $this->location,
'sender' => $this->sender,
'recipient' => $this->recipient,
'name' => $this->name,
'message_id' => $this->message_id,
'message_uuid' => $this->message_uuid,
'status' => $this->status,
'date' => $this->date
);
}
@@ -65,7 +72,7 @@ class DReport {
static function is_storable($dr) {
if(get_config('system', 'disable_dreport'))
if(Config::Get('system', 'disable_dreport'))
return false;
/**
@@ -82,8 +89,14 @@ class DReport {
if(array_key_exists('reject',$dr) && intval($dr['reject']))
return false;
if(! ($dr['sender']))
if (!$dr['sender']) {
return false;
}
// do not store dismissed create activities
if ($dr['status'] === 'not a collection activity') {
return false;
}
// Is the sender one of our channels?
@@ -94,19 +107,6 @@ class DReport {
if(! $c)
return false;
// legacy zot recipients add a space and their name to the xchan. remove it if true.
$legacy_recipient = strpos($dr['recipient'], ' ');
if($legacy_recipient !== false) {
$legacy_recipient_parts = explode(' ', $dr['recipient'], 2);
$rxchan = $legacy_recipient_parts[0];
}
else {
$rxchan = $dr['recipient'];
}
// is the recipient one of our connections, or do we want to store every report?
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
@@ -117,7 +117,7 @@ class DReport {
// So if a remote site says they can't find us, that's no big surprise
// and just creates a lot of extra report noise
if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient not found'))
if(($dr['location'] !== z_root()) && ($dr['sender'] === $dr['recipient']) && ($dr['status'] === 'recipient not found'))
return false;
// If you have a private post with a recipient list, every single site is going to report
@@ -126,14 +126,14 @@ class DReport {
// have a channel on that site.
$r = q("select hubloc_id from hubloc where hubloc_hash = '%s' and hubloc_url = '%s'",
dbesc($rxchan),
dbesc($dr['recipient']),
dbesc($dr['location'])
);
if((! $r) && ($dr['status'] === 'recipient_not_found'))
return false;
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($rxchan),
dbesc($dr['recipient']),
intval($c[0]['channel_id'])
);
if($r)

43
Zotlabs/Lib/DbStats.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
/*
* SPDX-FileCopyrightText: 2026 The Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use DBA;
/**
* Abstract class to obtain statistics from the database.
*
* This class should not be instantiated on it's own, but you can get
* a concrete class for the configured database type of this site by
* calling the `DbStats::getStats()` function.
*/
abstract class DbStats {
/**
* Get an object for getting statistics from the database.
*
* @return DbStats The concrete class for obtaining the statistics from
* this instances database.
*/
public static function getStats(): DbStats {
return DBA::$dba->is_postgres()
? new PostgresDbStats()
: new MySQLDbStats();
}
/**
* Return the number of queries recorded by the database.
*
* @return int Number of queries.
*/
public abstract function getQueries(): int;
// Prevent instantiation of this class
private function __construct() {}
}

View File

@@ -6,6 +6,7 @@ namespace Zotlabs\Lib;
* @brief File with functions and a class for generating system and email notifications.
*/
use Zotlabs\Lib\Config;
class Enotify {
@@ -61,7 +62,7 @@ class Enotify {
$product = t('$projectname'); // PLATFORM_NAME;
$siteurl = z_root();
$thanks = t('Thank You,');
$sitename = get_config('system','sitename');
$sitename = Config::Get('system','sitename');
$site_admin = sprintf( t('%s Administrator'), $sitename);
$opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname());
$opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings');
@@ -73,15 +74,15 @@ class Enotify {
// Do not translate 'noreply' as it must be a legal 7-bit email address
$reply_email = get_config('system', 'reply_address');
$reply_email = Config::Get('system', 'reply_address');
if(! $reply_email)
$reply_email = 'noreply' . '@' . $hostname;
$sender_email = get_config('system', 'from_email');
$sender_email = Config::Get('system', 'from_email');
if(! $sender_email)
$sender_email = 'Administrator' . '@' . $hostname;
$sender_name = get_config('system', 'from_email_name');
$sender_name = Config::Get('system', 'from_email_name');
if(! $sender_name)
$sender_name = \Zotlabs\Lib\System::get_site_name();
@@ -94,8 +95,8 @@ class Enotify {
if (array_key_exists('verb', $params['item'])) {
// localize_item() alters the original item so make a copy first
$i = $params['item'];
logger('calling localize');
localize_item($i);
// logger('calling localize');
// localize_item($i);
$title = $i['title'];
$body = $i['body'];
$private = (($i['item_private']) || intval($i['item_obscured']));
@@ -130,9 +131,9 @@ class Enotify {
logger('notification: mail');
$subject = sprintf( t('[$Projectname:Notify] New direct message received at %s'), $sitename);
$preamble = sprintf( t('%1$s sent you a new direct message at %2$s'), $sender['xchan_name'], $sitename);
$preamble = sprintf( t('%1$s sent you a new private message at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s sent you %2$s.'), '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a direct message') . '[/zrl]');
$sitelink = t('Please visit %s to view and/or reply to your direct messages.');
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
$tsitelink = sprintf( $sitelink, $siteurl . '/hq/' . gen_link_id($params['item']['mid']));
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/hq/' . gen_link_id($params['item']['mid']) . '">' . $sitename . '</a>');
$itemlink = $siteurl . '/hq/' . gen_link_id($params['item']['mid']);
@@ -145,11 +146,11 @@ class Enotify {
$itemlink = $params['link'];
$action = t('commented on');
$action = (($moderated) ? t('requested to post in') : t('posted in'));
if(array_key_exists('item',$params)) {
if(in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
if(in_array($params['item']['verb'], ['Like', 'Dislike', ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_SHARE])) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
logger('notification: not a visible activity. Ignoring.');
@@ -157,11 +158,14 @@ class Enotify {
return;
}
if(activity_match($params['verb'], ACTIVITY_LIKE))
$action = t('liked');
if(activity_match($params['verb'], ['Like', ACTIVITY_LIKE]))
$action = (($moderated) ? t('requested to like') : t('liked'));
if(activity_match($params['verb'], ACTIVITY_DISLIKE))
$action = t('disliked');
if(activity_match($params['verb'], ['Dislike', ACTIVITY_DISLIKE]))
$action = (($moderated) ? t('requested to dislike') : t('disliked'));
if(activity_match($params['verb'], [ACTIVITY_SHARE]))
$action = (($moderated) ? t('requested to repeat') : t('repeated'));
}
@@ -209,28 +213,36 @@ class Enotify {
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
// "a post"
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'),
$dest_str = sprintf(
t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$item_post_type);
$item_post_type
);
// "George Bull's post"
if($p)
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
if($p) {
$dest_str = sprintf(
t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$p[0]['author']['xchan_name'],
$item_post_type);
$parent_item['author']['xchan_name'],
$item_post_type
);
}
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
if ($parent_item['owner']['xchan_hash'] === $recip['channel_hash'] && intval($parent_item['item_wall'])) {
$dest_str = sprintf(
t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$item_post_type);
$item_post_type
);
}
// Some mail softwares relies on subject field for threading.
// So, we cannot have different subjects for notifications of the same thread.
@@ -259,7 +271,7 @@ class Enotify {
$itemlink = $params['link'];
if (array_key_exists('item',$params) && (activity_match($params['item']['verb'], ACTIVITY_LIKE) || activity_match($params['item']['verb'], ACTIVITY_DISLIKE))) {
if (array_key_exists('item',$params) && (activity_match($params['item']['verb'], ['Like', 'Dislike', ACTIVITY_LIKE, ACTIVITY_DISLIKE, 'Announce']))) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE) || !feature_enabled($recip['channel_id'], 'dislike')) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
@@ -304,19 +316,29 @@ class Enotify {
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
$parent_id = $p[0]['id'];
$parent_item = $p[0];
$verb = ((activity_match($params['item']['verb'], ACTIVITY_DISLIKE)) ? t('disliked') : t('liked'));
//$verb = ((activity_match($params['item']['verb'], ACTIVITY_DISLIKE)) ? t('disliked') : t('liked'));
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
if(activity_match($params['item']['verb'], ['Like', ACTIVITY_LIKE]))
$verb = (($moderated) ? t('requested to like') : t('liked'));
if(activity_match($params['item']['verb'], ['Dislike', ACTIVITY_DISLIKE]))
$verb = (($moderated) ? t('requested to dislike') : t('disliked'));
if(activity_match($params['item']['verb'], [ACTIVITY_SHARE]))
$verb = (($moderated) ? t('requested to repeat') : t('repeated'));
// "your post"
if($p[0]['owner']['xchan_name'] === $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
if ($parent_item['author']['xchan_hash'] === $recip['channel_hash']) {
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$verb,
$itemlink,
$item_post_type
);
}
else {
pop_lang();
return;
@@ -395,6 +417,7 @@ class Enotify {
}
elseif (isset($params['type']) && $params['type'] === NOTIFY_TAGSHARE) {
$itemlink = $params['link'];
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s tagged your post at %2$s'),$sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') ,
@@ -404,12 +427,11 @@ class Enotify {
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
elseif (isset($params['type']) && $params['type'] === NOTIFY_INTRO) {
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$preamble = sprintf( t('You\'ve received a new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a new connection request[/zrl] from %2$s.'),
$siteurl . '/connections/ifpending',
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
@@ -422,6 +444,7 @@ class Enotify {
}
elseif (isset($params['type']) && $params['type'] === NOTIFY_SUGGEST) {
$itemlink = $params['link'];
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'),
@@ -436,7 +459,6 @@ class Enotify {
$sitelink = t('Please visit %s to approve or reject the suggestion.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
elseif (isset($params['type']) && $params['type'] === NOTIFY_CONFIRM) {
@@ -476,6 +498,8 @@ class Enotify {
require_once('include/html2bbcode.php');
/*
do {
$dups = false;
$hash = random_string();
@@ -484,10 +508,17 @@ class Enotify {
if ($r)
$dups = true;
} while ($dups === true);
*/
$hash = ((in_array($params['verb'], ['Create', 'Update', 'Invite'])) ? $params['item']['uuid'] : $params['item']['thr_parent_uuid']);
if (!$hash) {
$hash = new_uuid();
}
$datarray = [];
$datarray['hash'] = $hash;
$datarray['hash'] = $hash;
$datarray['sender_hash'] = $sender['xchan_hash'];
$datarray['xname'] = $sender['xchan_name'];
$datarray['url'] = $sender['xchan_url'];
@@ -498,7 +529,7 @@ class Enotify {
$datarray['link'] = $itemlink;
$datarray['parent'] = $parent_mid;
$datarray['parent_item'] = $parent_item;
$datarray['ntype'] = $params['type'] ?? '';
$datarray['ntype'] = $params['type'] ?? 0;
$datarray['verb'] = $params['verb'] ?? '';
$datarray['otype'] = $params['otype'] ?? '';
$datarray['abort'] = false;
@@ -546,8 +577,10 @@ class Enotify {
dbesc($datarray['otype'])
);
$r = q("select id from notify where hash = '%s' and uid = %d limit 1",
dbesc($hash),
$r = q("select id from notify where hash = '%s' and link = '%s' and ntype = %d and uid = %d limit 1",
dbesc($datarray['hash']),
dbesc($itemlink),
intval($datarray['ntype']),
intval($recip['channel_id'])
);
if ($r) {
@@ -579,7 +612,7 @@ class Enotify {
// send email notification if notification preferences permit
require_once('bbcode.php');
require_once('include/bbcode.php');
if ((intval($recip['channel_notifyflags']) & intval($params['type'])) || $params['type'] == NOTIFY_SYSTEM) {
logger('notification: sending notification email');
@@ -824,22 +857,10 @@ class Enotify {
}
else {
$itemem_text = (($item['item_thread_top'])
? (($item['obj_type'] === 'Question') ? t('created a new poll') : t('created a new post'))
: (($item['obj_type'] === 'Answer') ? sprintf( t('voted on %s\'s poll'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]') : sprintf( t('commented on %s\'s post'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]'))
? (($item['obj_type'] === 'Question') ? t('started a poll') : t('started a conversation'))
: (($item['obj_type'] === 'Answer') ? sprintf( t('voted on %s\'s poll'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]') : sprintf( t('posted in %s\'s conversation'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]'))
);
if($item['verb'] === ACTIVITY_SHARE) {
$itemem_text = sprintf( t('repeated %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if($item['verb'] === ACTIVITY_LIKE) {
$itemem_text = sprintf( t('liked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if($item['verb'] === ACTIVITY_DISLIKE) {
$itemem_text = sprintf( t('disliked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if(in_array($item['obj_type'], ['Document', 'Video', 'Audio', 'Image'])) {
$itemem_text = t('shared a file with you');
}
@@ -849,18 +870,12 @@ class Enotify {
if($item['edited'] > $item['created']) {
$edit = true;
if($item['item_thread_top']) {
$itemem_text = sprintf( t('edited a post dated %s'), relative_date($item['created']));
}
else {
$itemem_text = sprintf( t('edited a comment dated %s'), relative_date($item['created']));
}
$itemem_text = sprintf( t('edited a message dated %s'), relative_date($item['created']));
}
// convert this logic into a json array just like the system notifications
$who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
$body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($body) {
$body = htmlentities($body, ENT_QUOTES, 'UTF-8', false);
@@ -868,19 +883,20 @@ class Enotify {
$x = array(
'notify_link' => $item['llink'],
'name' => $item[$who]['xchan_name'],
'addr' => $item[$who]['xchan_addr'] ?? $item[$who]['xchan_url'],
'url' => $item[$who]['xchan_url'],
'photo' => $item[$who]['xchan_photo_s'],
'name' => $item['author']['xchan_name'],
'addr' => $item['author']['xchan_addr'] ? $item['author']['xchan_addr'] : $item['author']['xchan_url'],
'url' => $item['author']['xchan_url'],
'photo' => $item['author']['xchan_photo_s'],
'when' => (($edit) ? datetime_convert('UTC', date_default_timezone_get(), $item['edited']) : datetime_convert('UTC', date_default_timezone_get(), $item['created'])),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
'b64mid' => (($item['mid']) ? gen_link_id($item['mid']) : ''),
// 'b64mid' => (($item['mid']) ? gen_link_id($item['mid']) : ''),
'b64mid' => ((in_array($item['verb'] , ['Like', 'Dislike', 'Announce']) && !empty($item['thr_parent_uuid'])) ? $item['thr_parent_uuid'] : $item['uuid'] ?? ''),
//'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? gen_link_id($item['thr_parent']) : gen_link_id($item['mid'])),
'thread_top' => (($item['item_thread_top']) ? true : false),
'message' => bbcode(escape_tags($itemem_text)),
'body' => $body,
// these are for the superblock addon
'hash' => $item[$who]['xchan_hash'],
'hash' => $item['author']['xchan_hash'],
'uid' => $item['uid'],
'display' => true
);
@@ -894,33 +910,27 @@ class Enotify {
}
static public function format_notify($tt) {
$message = trim(strip_tags(bbcode($tt['msg'])));
if(strpos($message, $tt['xname']) === 0)
$message = substr($message, strlen($tt['xname']) + 1);
$mid = basename($tt['link']);
$b64mid = gen_link_id($mid);
$x = [
'notify_link' => (($tt['ntype'] === NOTIFY_MAIL) ? $tt['link'] : z_root() . '/notify/view/' . $tt['id']),
'notify_link' => (($tt['ntype'] === NOTIFY_INTRO) ? z_root() . '/notify/view/' . $tt['id'] : $tt['link']),
'name' => $tt['xname'],
'url' => $tt['url'],
'photo' => $tt['photo'],
'when' => datetime_convert('UTC', date_default_timezone_get(), $tt['created']),
'hclass' => (($tt['seen']) ? 'notify-seen' : 'notify-unseen'),
'b64mid' => (($tt['otype'] == 'item') ? $b64mid : ''),
'b64mid' => (($tt['otype'] == 'item') ? $tt['hash'] : ''),
'notify_id' => (($tt['otype'] == 'item') ? $tt['id'] : ''),
'message' => $message
];
return $x;
}
static public function format_intros($rr) {
return [
'notify_link' => z_root() . '/connections#' . $rr['abook_id'],
'name' => $rr['xchan_name'],

View File

@@ -13,7 +13,8 @@ class IConfig {
static public function Get(&$item, $family, $key, $default = false) {
$is_item = false;
$iid = null;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
@@ -22,32 +23,57 @@ class IConfig {
if(array_key_exists('item_id',$item))
$iid = $item['item_id'];
else
$iid = $item['id'];
$iid = $item['id'] ?? 0;
}
elseif(intval($item))
$iid = $item;
if(! $iid)
if (!$iid)
return $default;
if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) {
foreach($item['iconfig'] as $c) {
if($c['iid'] == $iid && $c['cat'] == $family && $c['k'] == $key)
if (isset($c['iid']) && $c['iid'] == $iid && isset($c['cat']) && $c['cat'] == $family && isset($c['k']) && $c['k'] == $key) {
if (is_string($c['v'])) {
if (str_starts_with($c['v'], 'json:')) {
$c['v'] = json_unserialize($c['v']);
} else if (preg_match('|^a:[0-9]+:{.*}$|s', $c['v'])) {
// Unserialize in inherently unsafe. Try to mitigate by not
// allowing unserializing objects. Only kept for backwards
// compatibility. JSON serialization should be prefered.
$c['v'] = unserialize($c['v'], ['allowed_classes' => false]);
}
}
return $c['v'];
}
}
}
$r = q("select * from iconfig where iid = %d and cat = '%s' and k = '%s' limit 1",
intval($iid),
dbesc($family),
dbesc($key)
);
if($r) {
$r[0]['v'] = ((preg_match('|^a:[0-9]+:{.*}$|s',$r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
if($is_item)
if (str_starts_with($r[0]['v'], 'json:')) {
$r[0]['v'] = json_unserialize($r[0]['v']);
} else if (preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) {
// Unserialize in inherently unsafe. Try to mitigate by not
// allowing unserializing objects. Only kept for backwards
// compatibility. JSON serialization should be prefered.
$r[0]['v'] = unserialize($r[0]['v'], ['allowed_classes' => false]);
}
if ($is_item) {
$item['iconfig'][] = $r[0];
}
return $r[0]['v'];
}
return $default;
}
@@ -63,15 +89,15 @@ class IConfig {
* $value - value of meta variable
* $sharing - boolean (default false); if true the meta information is propagated with the item
* to other sites/channels, mostly useful when $item is an array and has not yet been stored/delivered.
* If the meta information is added after delivery and you wish it to be shared, it may be necessary to
* alter the item edited timestamp and invoke the delivery process on the updated item. The edited
* If the meta information is added after delivery and you wish it to be shared, it may be necessary to
* alter the item edited timestamp and invoke the delivery process on the updated item. The edited
* timestamp needs to be altered in order to trigger an item_store_update() at the receiving end.
*/
static public function Set(&$item, $family, $key, $value, $sharing = false) {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_array($value)) ? json_serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$is_item = false;
@@ -162,4 +188,4 @@ class IConfig {
}
}
}

View File

@@ -25,18 +25,18 @@ class Img_filesize {
static function getLocalFileSize($url) {
$fname = basename($url);
$resolution = 0;
if(strpos($fname,'.') !== false)
$fname = substr($fname,0,strpos($fname,'.'));
if(substr($fname,-2,1) == '-') {
$resolution = intval(substr($fname,-1,1));
$fname = substr($fname,0,-2);
}
$r = q("SELECT filesize FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($fname),
intval($resolution)
@@ -116,7 +116,6 @@ function getRemoteFileSize($url)
curl_exec($ch);
curl_getinfo($ch);
curl_close($ch);
return $size;
}
}

View File

@@ -52,7 +52,7 @@ class JSalmon {
. base64url_encode($x['alg'],true);
$key = HTTPSig::get_key(EMPTY_STR,'zot6',base64url_decode($x['sigs']['key_id']));
logger('key: ' . print_r($key,true));
logger('key: ' . print_r($key,true), LOGGER_DATA);
if($key['portable_id'] && $key['public_key']) {
if(Crypto::verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) {
logger('verified');

View File

@@ -0,0 +1,109 @@
<?php
namespace Zotlabs\Lib;
use Root23\JsonCanonicalizer\JsonCanonicalizer;
use StephenHill\Base58;
class JcsEddsa2022 {
/**
* Sign arbitrary data with the keys of the provided channel.
*
* @param $data The data to be signed.
* @param array $channel A channel as an array of key/value pairs.
*
* @return An array with the following fields:
* - `type`: The type of signature, always `DataIntegrityProof`.
* - `cryptosuite`: The cryptographic algorithm used, always `eddsa-jcs-2022`.
* - `created`: The UTC date and timestamp when the signature was created.
* - `verificationMethod`: The channel URL and the public key separated by a `#`.
* - `proofPurpose`: The purpose of the signature, always `assertionMethod`.
* - `proofValue`: The signature itself.
*
* @throws JcsEddsa2022SignatureException if the channel is missing, or
* don't have valid keys.
*/
public function sign($data, $channel): array {
if (!is_array($channel) || !isset($channel['channel_epubkey'], $channel['channel_eprvkey'])) {
throw new JcsEddsa2022SignException('Invalid or missing channel provided.');
}
$base58 = new Base58();
$pubkey = (new Multibase())->publicKey($channel['channel_epubkey']);
$options = [
'type' => 'DataIntegrityProof',
'cryptosuite' => 'eddsa-jcs-2022',
'created' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME),
'verificationMethod' => channel_url($channel) . '#' . $pubkey,
'proofPurpose' => 'assertionMethod',
];
$optionsHash = $this->hash($this->signableOptions($options), true);
$dataHash = $this->hash($this->signableData($data), true);
$options['proofValue'] = 'z' . $base58->encode(sodium_crypto_sign_detached($optionsHash . $dataHash,
sodium_base642bin($channel['channel_eprvkey'], SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING)));
return $options;
}
public function verify($data, $publicKey) {
$base58 = new Base58();
$encodedSignature = $data['proof']['proofValue'] ?? '';
if (!str_starts_with($encodedSignature,'z')) {
return false;
}
$encodedSignature = substr($encodedSignature, 1);
$optionsHash = $this->hash($this->signableOptions($data['proof']), true);
$dataHash = $this->hash($this->signableData($data),true);
try {
$result = sodium_crypto_sign_verify_detached($base58->decode($encodedSignature), $optionsHash . $dataHash,
(new Multibase())->decode($publicKey, true));
}
catch (\Exception $e) {
logger('verify exception:' . $e->getMessage());
}
logger('SignatureVerify (eddsa-jcs-2022) ' . (($result) ? 'true' : 'false'));
return $result;
}
public function signableData($data) {
$signableData = [];
if ($data) {
foreach ($data as $k => $v) {
if (!in_array($k, ['proof', 'signature'])) {
$signableData[$k] = $v;
}
}
}
return $signableData;
}
public function signableOptions($options) {
$signableOptions = [];
if ($options) {
foreach ($options as $k => $v) {
if ($k !== 'proofValue') {
$signableOptions[$k] = $v;
}
}
}
return $signableOptions;
}
public function hash($obj, $binary = false) {
return hash('sha256', $this->canonicalize($obj), $binary);
}
public function canonicalize($data) {
$canonicalizer = new JsonCanonicalizer();
return $canonicalizer->canonicalize($data);
}
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* SPDX-FileCopyrightText: 2025 The Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use Exception;
class JcsEddsa2022SignException extends Exception
{
}

View File

@@ -2,8 +2,8 @@
namespace Zotlabs\Lib;
use phpseclib\Crypt\RSA;
use phpseclib\Math\BigInteger;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Math\BigInteger;
/**
* Keyutils
@@ -16,41 +16,42 @@ class Keyutils {
* @param string $e exponent
* @return string
*/
public static function meToPem($m, $e) {
$rsa = new RSA();
$rsa->loadKey([
public static function meToPem(string $m, string $e): string
{
$parsedKey = PublicKeyLoader::load([
'e' => new BigInteger($e, 256),
'n' => new BigInteger($m, 256)
]);
return $rsa->getPublicKey();
if (method_exists($parsedKey, 'getPublicKey')) {
$parsedKey = $parsedKey->getPublicKey();
}
return $parsedKey->toString('PKCS8');
}
/**
* @param string key
* @return string
*/
public static function rsaToPem($key) {
$rsa = new RSA();
$rsa->setPublicKey($key);
return $rsa->getPublicKey(RSA::PUBLIC_FORMAT_PKCS8);
public static function rsaToPem(string $key): string
{
$parsedKey = PublicKeyLoader::load($key);
if (method_exists($parsedKey, 'getPublicKey')) {
$parsedKey = $parsedKey->getPublicKey();
}
return $parsedKey->toString('PKCS8');
}
/**
* @param string key
* @return string
*/
public static function pemToRsa($key) {
$rsa = new RSA();
$rsa->setPublicKey($key);
return $rsa->getPublicKey(RSA::PUBLIC_FORMAT_PKCS1);
public static function pemToRsa(string $key): string
{
$parsedKey = PublicKeyLoader::load($key);
if (method_exists($parsedKey, 'getPublicKey')) {
$parsedKey = $parsedKey->getPublicKey();
}
return $parsedKey->toString('PKCS1');
}
/**
@@ -58,23 +59,28 @@ class Keyutils {
* @param string $m reference modulo
* @param string $e reference exponent
*/
public static function pemToMe($key, &$m, &$e) {
public static function pemToMe(string $key): array
{
$parsedKey = PublicKeyLoader::load($key);
if (method_exists($parsedKey, 'getPublicKey')) {
$parsedKey = $parsedKey->getPublicKey();
}
$raw = $parsedKey->toString('Raw');
$rsa = new RSA();
$rsa->loadKey($key);
$rsa->setPublicKey();
$m = $rsa->modulus->toBytes();
$e = $rsa->exponent->toBytes();
$m = $raw['n'];
$e = $raw['e'];
return [$m->toBytes(), $e->toBytes()];
}
/**
* @param string $pubkey
* @return string
*/
public static function salmonKey($pubkey) {
self::pemToMe($pubkey, $m, $e);
public static function salmonKey(string $pubkey): string
{
[$m, $e] = self::pemToMe($pubkey);
/** @noinspection PhpRedundantOptionalArgumentInspection */
return 'RSA' . '.' . base64url_encode($m, true) . '.' . base64url_encode($e, true);
}
@@ -82,11 +88,13 @@ class Keyutils {
* @param string $key
* @return string
*/
public static function convertSalmonKey($key) {
if (strstr($key, ','))
public static function convertSalmonKey(string $key): string
{
if (str_contains($key, ',')) {
$rawkey = substr($key, strpos($key, ',') + 1);
else
} else {
$rawkey = substr($key, 5);
}
$key_info = explode('.', $rawkey);
@@ -96,4 +104,4 @@ class Keyutils {
return self::meToPem($m, $e);
}
}
}

View File

@@ -8,9 +8,10 @@ class LDSignatures {
static function verify($data,$pubkey) {
$expand_and_check_unsafe = true;
$ohash = self::hash(self::signable_options($data['signature']));
$dhash = self::hash(self::signable_data($data));
$ohash = self::hash(self::signable_options($data['signature']), $expand_and_check_unsafe);
$dhash = self::hash(self::signable_data($data), $expand_and_check_unsafe);
$x = Crypto::verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey);
logger('LD-verify: ' . intval($x));
@@ -74,11 +75,11 @@ class LDSignatures {
return json_encode($newopts,JSON_UNESCAPED_SLASHES);
}
static function hash($obj) {
return hash('sha256', self::normalise($obj));
static function hash($obj, $expand_and_check_unsafe = false) {
return hash('sha256', self::normalise($obj, $expand_and_check_unsafe));
}
static function normalise($data) {
static function normalise($data, $expand_and_check_unsafe) {
$ret = '';
if(is_string($data)) {
@@ -90,6 +91,15 @@ class LDSignatures {
jsonld_set_document_loader('jsonld_document_loader');
if ($expand_and_check_unsafe) {
$expanded = jsonld_expand($data);
if (self::contains_unsafe_keys($expanded)) {
logger('contains_unsafe_keys: ' . print_r($data,true));
throw new \Exception('json-ld graph modification operation detected');
}
}
try {
$ret = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
@@ -132,6 +142,41 @@ class LDSignatures {
}
static function contains_unsafe_keys(array|object $data, int $depth = 0): bool
{
if ($depth > 64) {
return true;
}
$unsafe_keys = ['@graph', '@included', '@reverse'];
if (is_object($data)) {
$data = (array) $data;
}
if (is_array($data)) {
foreach ($data as $key => $value) {
//
// We can't use `in_array` since the keys may contain more than
// just the keyword after expansion, typically "_:@included"
// for an unnamed node with the "@included" key.
//
// So we use `array_filter` with a callback instead:
$matches = array_filter($unsafe_keys, fn ($k) => strpos($key, $k) !== false);
if (!empty($matches)) {
return true;
}
if (is_array($value) || is_object($value)) {
if (self::contains_unsafe_keys($value, $depth + 1)) {
return true;
}
}
}
}
return false;
}
}

View File

@@ -5,6 +5,7 @@ namespace Zotlabs\Lib;
use App;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Config;
class Libsync {
@@ -135,14 +136,13 @@ class Libsync {
$info['collection_members'] = $r;
}
$interval = ((get_config('system', 'delivery_interval') !== false)
? intval(get_config('system', 'delivery_interval')) : 2);
$interval = Config::Get('queueworker', 'queue_interval', 500000);
logger('Packet: ' . print_r($info, true), LOGGER_DATA, LOG_DEBUG);
$total = count($synchubs);
foreach ($synchubs as $hub) {
$hash = random_string();
$hash = new_uuid();
$n = Libzot::build_packet($channel, 'sync', $env_recips, json_encode($info), 'hz', $hub['hubloc_sitekey'], $hub['site_crypto']);
Queue::insert([
'hash' => $hash,
@@ -155,19 +155,26 @@ class Libsync {
]);
/*
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if (intval($x[0]['total']) > intval(get_config('system', 'force_queue_threshold', 3000))) {
if (intval($x[0]['total']) > intval(Config::Get('system', 'force_queue_threshold', 3000))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
Queue::update($hash);
continue;
}
*/
Master::Summon(['Deliver', $hash]);
$total = $total - 1;
if ($interval && $total)
@time_sleep_until(microtime(true) + (float)$interval);
/*
$total = $total - 1;
*/
if ($interval) {
usleep($interval);
}
}
}
@@ -192,7 +199,9 @@ class Libsync {
dbesc($sender)
);
$DR = new DReport(z_root(), $sender, $d, 'sync');
$mid = $arr['item'][0]['message_id'] ?? 'sync';
$DR = new DReport(z_root(), $sender, $d, $mid);
if (!$r) {
$DR->update('recipient not found');
@@ -202,7 +211,6 @@ class Libsync {
$channel = $r[0];
$mid = 'sync';
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
@@ -258,7 +266,7 @@ class Libsync {
}
if ($cat !== 'hz_delpconfig') {
set_pconfig($channel['channel_id'],$cat,$k,$v,$pconfig_updated[$k]);
set_pconfig($channel['channel_id'], $cat, $k, $v, $pconfig_updated[$k]);
}
}
}
@@ -297,15 +305,8 @@ class Libsync {
if (array_key_exists('item', $arr) && $arr['item']) {
sync_items($channel, $arr['item'], ((array_key_exists('relocate', $arr)) ? $arr['relocate'] : null));
$mid = $arr['item']['mid'] . '#sync';
}
// deprecated, maintaining for a few months for upward compatibility
// this should sync webpages, but the logic is a bit subtle
//if (array_key_exists('item_id', $arr) && $arr['item_id'])
// sync_items($channel, $arr['item_id']);
if (array_key_exists('menu', $arr) && $arr['menu'])
sync_menus($channel, $arr['menu']);
@@ -317,10 +318,7 @@ class Libsync {
if (array_key_exists('channel', $arr) && is_array($arr['channel']) && count($arr['channel'])) {
$remote_channel = $arr['channel'];
$remote_channel['channel_id'] = $channel['channel_id'];
if (array_key_exists('channel_pageflags', $arr['channel']) && intval($arr['channel']['channel_pageflags'])) {
if (array_key_exists('channel_pageflags', $arr['channel'])) {
// Several pageflags are site-specific and cannot be sync'd.
// Only allow those bits which are shareable from the remote and then
@@ -331,6 +329,8 @@ class Libsync {
}
$columns = db_columns('channel');
$disallowed = [
'channel_id', 'channel_account_id', 'channel_primary', 'channel_prvkey',
'channel_address', 'channel_notifyflags', 'channel_removed', 'channel_deleted',
@@ -341,16 +341,21 @@ class Libsync {
'channel_a_delegate'
];
$clean = [];
foreach ($arr['channel'] as $k => $v) {
if (in_array($k, $disallowed))
continue;
$clean[$k] = $v;
if (empty($channel['channel_epubkey']) && empty($channel['channel_eprvkey'])) {
$eckey = sodium_crypto_sign_keypair();
$channel['channel_epubkey'] = sodium_bin2base64(sodium_crypto_sign_publickey($eckey), SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
$channel['channel_eprvkey'] = sodium_bin2base64(sodium_crypto_sign_secretkey($eckey), SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
}
if (count($clean)) {
foreach ($clean as $k => $v) {
dbq("UPDATE channel set " . dbesc($k) . " = '" . dbesc($v) . "' where channel_id = " . intval($channel['channel_id']));
foreach ($arr['channel'] as $k => $v) {
if (in_array($k, $disallowed)) {
continue;
}
if (!in_array($k, $columns)) {
continue;
}
$r = dbq("UPDATE channel set " . dbesc($k) . " = '" . dbesc($v)
. "' where channel_id = " . intval($channel['channel_id']));
}
}
@@ -744,9 +749,7 @@ class Libsync {
*/
call_hooks('process_channel_sync_delivery', $addon);
$DR = new DReport(z_root(), $d, $d, $mid, 'channel sync processed');
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
$DR->update('channel sync processed');
$result[] = $DR->get();
}
@@ -759,13 +762,17 @@ class Libsync {
*
* @param array $sender
* @param array $arr
* @param boolean $absolute (optional) default false
* @return array
*/
static function sync_locations($sender, $arr, $absolute = false) {
static function sync_locations($sender, $arr) {
$ret = [
'change_message' => '',
'changed' => false,
'message' => ''
];
$ret = [];
$what = '';
$changed = false;
@@ -780,10 +787,7 @@ class Libsync {
if (isset($arr['locations']) && $arr['locations']) {
if ($absolute)
Libzot::check_location_move($sender['hash'], $arr['locations']);
$xisting = q("select * from hubloc where hubloc_hash = '%s'",
$xisting = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0",
dbesc($sender['hash'])
);
@@ -855,7 +859,9 @@ class Libsync {
);
}
// update connection timestamp if this is the site we're talking to
// Update connection timestamp if this is the site we're talking to.
// Also mark all entries from the current site with different sitekeys
// deleted (the site has been re-installed)
// This only happens when called from import_xchan
$current_site = false;
@@ -869,6 +875,12 @@ class Libsync {
intval($r[0]['hubloc_id']),
dbesc($t)
);
q("update hubloc set hubloc_error = 1, hubloc_deleted = 1 where hubloc_url = '%s' and hubloc_sitekey != '%s' and hubloc_network = 'zot6'",
dbesc($r[0]['hubloc_url']),
dbesc($r[0]['hubloc_sitekey'])
);
$current_site = true;
}
@@ -918,14 +930,7 @@ class Libsync {
$what .= 'primary_hub ';
$changed = true;
}
elseif ($absolute) {
// Absolute sync - make sure the current primary is correctly reflected in the xchan
$pr = hubloc_change_primary($r[0]);
if ($pr) {
$what .= 'xchan_primary ';
$changed = true;
}
}
if (intval($r[0]['hubloc_deleted']) && (!intval($location['deleted']))) {
q("update hubloc set hubloc_deleted = 0, hubloc_updated = '%s' where hubloc_id_url = '%s'",
dbesc(datetime_convert()),
@@ -994,9 +999,9 @@ class Libsync {
}
}
// get rid of any hubs we have for this channel which weren't reported.
// get rid of any hublocs we have for this channel which weren't reported.
if ($absolute && $xisting) {
if ($xisting) {
foreach ($xisting as $x) {
if (!array_key_exists('updated', $x)) {
logger('Deleting unreferenced hub location ' . $x['hubloc_addr']);

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Lib;
use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\Webfinger;
@@ -20,7 +22,7 @@ class Libzotdir {
static function find_upstream_directory($dirmode) {
$preferred = get_config('system','directory_server');
$preferred = Config::Get('system','directory_server');
// Thwart attempts to use a private directory
@@ -47,17 +49,17 @@ class Libzotdir {
$directory_fallback_servers = get_directory_fallback_servers();
$dirmode = intval(get_config('system','directory_mode'));
$dirmode = intval(Config::Get('system','directory_mode'));
if ($dirmode == DIRECTORY_MODE_NORMAL) {
$toss = mt_rand(0,count($directory_fallback_servers));
$preferred = $directory_fallback_servers[$toss];
if(! $preferred) {
$preferred = DIRECTORY_FALLBACK_MASTER;
}
set_config('system','directory_server',$preferred);
Config::Set('system','directory_server',$preferred);
}
else {
set_config('system','directory_server',z_root());
Config::Set('system','directory_server',z_root());
}
}
if($preferred) {
@@ -77,7 +79,7 @@ class Libzotdir {
static function check_upstream_directory() {
$directory = get_config('system', 'directory_server');
$directory = Config::Get('system', 'directory_server');
// it's possible there is no directory server configured and the local hub is being used.
// If so, default to preserving the absence of a specific server setting.
@@ -94,7 +96,7 @@ class Libzotdir {
}
if (! $isadir)
set_config('system', 'directory_server', '');
Config::Set('system', 'directory_server', '');
}
@@ -106,7 +108,7 @@ class Libzotdir {
$ret = ((array_key_exists($setting,$_SESSION)) ? intval($_SESSION[$setting]) : false);
if($ret === false)
$ret = get_config('directory', $setting);
$ret = Config::Get('directory', $setting);
// 'safemode' is the default if there is no observer or no established preference.
@@ -114,7 +116,7 @@ class Libzotdir {
if($setting === 'safemode' && $ret === false)
$ret = 1;
if($setting === 'globaldir' && intval(get_config('system','localdir_hide')))
if($setting === 'globaldir' && intval(Config::Get('system','localdir_hide')))
$ret = 1;
return $ret;
@@ -133,7 +135,7 @@ class Libzotdir {
$globaldir = self::get_directory_setting($observer, 'globaldir');
$pubforums = self::get_directory_setting($observer, 'pubforums');
$hide_local = intval(get_config('system','localdir_hide'));
$hide_local = intval(Config::Get('system','localdir_hide'));
if($hide_local)
$globaldir = 1;
@@ -141,7 +143,7 @@ class Libzotdir {
// Build urls without order and pubforums so it's easy to tack on the changed value
// Probably there's an easier way to do this
$directory_sort_order = get_config('system','directory_sort_order');
$directory_sort_order = Config::Get('system','directory_sort_order');
if(! $directory_sort_order)
$directory_sort_order = 'date';
@@ -172,13 +174,12 @@ class Libzotdir {
}
/**
* @brief Checks the directory mode of this hub.
* @brief fetches updates from known directories
*
* Checks the directory mode of this hub to see if it is some form of directory server. If it is,
* get the directory realm of this hub. Fetch a list of all other directory servers in this realm and request
* a directory sync packet. This will contain both directory updates and new ratings. Store these all in the DB.
* In the case of updates, we will query each of them asynchronously from a poller task. Ratings are stored
* directly if the rater's signature matches.
* a directory sync packet. Store these all in the DB.
* In the case of updates, we will query each of them asynchronously from a poller task.
*
* @param int $dirmode;
*/
@@ -216,7 +217,7 @@ class Libzotdir {
[
'site_url' => DIRECTORY_FALLBACK_MASTER,
'site_flags' => DIRECTORY_MODE_PRIMARY,
'site_update' => NULL_DATE,
'site_update' => DBA::$dba->get_null_date(),
'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
'site_realm' => DIRECTORY_REALM,
'site_valid' => 1,
@@ -233,6 +234,8 @@ class Libzotdir {
if (! $r)
return;
$dir_trusted_hosts = array_merge(get_directory_fallback_servers(), Config::Get('system', 'trusted_directory_servers', []));
foreach ($r as $rr) {
if (! $rr['site_directory'])
continue;
@@ -243,9 +246,9 @@ class Libzotdir {
// It will take about a month for a new directory to obtain the full current repertoire of channels.
/** @FIXME Go back and pick up earlier ratings if this is a new directory server. These do not get refreshed. */
$token = get_config('system','realm_token');
$token = Config::Get('system','realm_token');
$syncdate = (($rr['site_sync'] <= NULL_DATE) ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']);
$syncdate = (($rr['site_sync'] <= DBA::$dba->get_null_date()) ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']);
$x = z_fetch_url($rr['site_directory'] . '?f=&sync=' . urlencode($syncdate) . (($token) ? '&t=' . $token : ''));
if (! $x['success'])
@@ -264,31 +267,65 @@ class Libzotdir {
if (is_array($j['transactions']) && count($j['transactions'])) {
foreach ($j['transactions'] as $t) {
if (empty($t['hash']) || empty($t['transaction_id']) || empty($t['address'])) {
if (empty($t['hash']) || empty($t['host']) || empty($t['address'])) {
continue;
}
$r = q("select * from updates where ud_guid = '%s' limit 1",
dbesc($t['transaction_id'])
$r = q("select * from updates where ud_hash = '%s' limit 1",
dbesc($t['hash'])
);
if($r)
continue;
$ud_flags = 0;
if (is_array($t['flags']) && in_array('deleted',$t['flags']))
$ud_flags |= UPDATE_FLAGS_DELETED;
if (is_array($t['flags']) && in_array('forced',$t['flags']))
$ud_flags |= UPDATE_FLAGS_FORCED;
if ($r) {
$update = 0;
$z = q("insert into updates ( ud_hash, ud_guid, ud_date, ud_flags, ud_addr )
values ( '%s', '%s', '%s', %d, '%s' ) ",
dbesc($t['hash']),
dbesc($t['transaction_id']),
dbesc($t['timestamp']),
intval($ud_flags),
dbesc($t['address'])
);
// no need to look at updates that originated from our own site
if ($t['host'] === z_root()) {
continue;
}
// there is more recent xchan information
if ($r[0]['ud_date'] <= $t['timestamp']) {
$update = 1;
}
// the host is trusted and flags have changed - update flags immediately
if (in_array($t['host'], $dir_trusted_hosts) &&
$rr['site_url'] === $t['host'] &&
intval($r[0]['ud_flags']) !== intval($t['flags'])) {
q("UPDATE updates SET ud_update = %d, ud_flags = %d WHERE ud_id = %d",
intval($update),
intval($t['flags']),
dbesc($r[0]['ud_id'])
);
q("UPDATE xchan SET xchan_censored = %d WHERE xchan_hash = '%s'",
intval($t['flags']),
dbesc($r[0]['ud_hash'])
);
continue;
}
if (!$update) {
continue;
}
q("UPDATE updates SET ud_update = %d WHERE ud_id = %d",
intval($update),
dbesc($r[0]['ud_id'])
);
}
else {
q("insert into updates ( ud_hash, ud_host, ud_date, ud_addr, ud_update, ud_flags )
values ( '%s', '%s', '%s', '%s', 1, %d) ",
dbesc($t['hash']),
dbesc($t['host']),
dbesc($t['timestamp']),
dbesc($t['address']),
dbesc(in_array($t['host'], $dir_trusted_hosts) ? $t['flags'] : 0)
);
}
}
}
}
@@ -303,8 +340,9 @@ class Libzotdir {
*
* Ignore updating records marked as deleted.
*
* If successful, sets ud_last in the DB to the current datetime for this
* If successful, sets ud_updated in the DB to the current datetime for this
* reddress/webbie.
* Else update ud_last so we can stop trying after 7 days (Daemon/Poller.php)
*
* @param array $ud Entry from update table
*/
@@ -313,32 +351,44 @@ class Libzotdir {
logger('update_directory_entry: ' . print_r($ud,true), LOGGER_DATA);
if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) {
$success = false;
$zf = [];
// TODO: remove this check after all directory servers have version > 8.4
// ud_addr will always be the channel url at that time
$href = ((strpos($ud['ud_addr'], '://') === false) ? Webfinger::zot_url(punify($ud['ud_addr'])) : punify($ud['ud_addr']));
if($href) {
$zf = Zotfinger::exec($href);
if($zf && array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
$xc = Libzot::import_xchan($zf['data']);
// xchan_hash mismatch - this can happen after a site re-install at the same url
if ($xc['success'] && $xc['hash'] !== $ud['ud_hash']) {
self::delete_by_hash($ud['ud_hash']);
}
// if the channel was deleted - delete the entry in updates
if (!empty($zf['data']['deleted_locally'])) {
self::delete_by_hash($ud['ud_hash']);
}
$href = Webfinger::zot_url(punify($ud['ud_addr']));
if($href) {
$zf = Zotfinger::exec($href);
}
if(array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
$xc = Libzot::import_xchan($zf['data'], 0, $ud);
// This is a workaround for a missing xchan_updated column
// TODO: implement xchan_updated in the xchan table and update this column instead
if($zf['data']['primary_location']['address'] && $zf['data']['primary_location']['url']) {
if(!empty($zf['data']['primary_location']['url'])) {
q("UPDATE hubloc SET hubloc_updated = '%s' WHERE hubloc_id_url = '%s' AND hubloc_primary = 1",
dbesc(datetime_convert()),
dbesc($zf['data']['primary_location']['url'])
);
}
}
else {
q("update updates set ud_last = '%s' where ud_addr = '%s'",
dbesc(datetime_convert()),
dbesc($ud['ud_addr'])
);
return true;
}
}
q("UPDATE updates SET ud_addr = '%s', ud_last = '%s' WHERE ud_hash = '%s'",
dbesc($href ? $href : $ud['ud_addr']),
dbesc(datetime_convert()),
dbesc($ud['ud_hash'])
);
return false;
}
@@ -353,85 +403,78 @@ class Libzotdir {
*/
static function local_dir_update($uid, $force) {
logger('local_dir_update uid: ' . $uid, LOGGER_DEBUG);
logger('local_dir_update: uid: ' . $uid, LOGGER_DEBUG);
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.*, xchan.xchan_hidden, xchan.xchan_url from profile left join channel on channel_id = uid left join xchan on channel_hash = xchan_hash where profile.uid = %d and profile.is_default = 1",
intval($uid)
);
$profile = array();
$profile['encoding'] = 'zot';
if ($p) {
$hash = $p[0]['channel_hash'];
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
if ($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
$profile['age'] = $age;
$profile['gender'] = $p[0]['gender'];
$profile['marital'] = $p[0]['marital'];
$profile['sexual'] = $p[0]['sexual'];
$profile['locale'] = $p[0]['locality'];
$profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name'];
$profile['about'] = $p[0]['about'];
$profile['homepage'] = $p[0]['homepage'];
$profile['hometown'] = $p[0]['hometown'];
if ($p[0]['keywords']) {
$tags = array();
$k = explode(' ', $p[0]['keywords']);
if ($k)
foreach ($k as $kk)
if (trim($kk))
$tags[] = trim($kk);
if ($tags)
$profile['keywords'] = $tags;
}
$hidden = (1 - intval($p[0]['publish']));
logger('hidden: ' . $hidden);
$r = q("select xchan_hidden from xchan where xchan_hash = '%s'",
dbesc($p[0]['channel_hash'])
);
if(intval($r[0]['xchan_hidden']) != $hidden) {
$r = q("update xchan set xchan_hidden = %d where xchan_hash = '%s'",
intval($hidden),
dbesc($hash)
);
}
$arr = [ 'channel_id' => $uid, 'hash' => $hash, 'profile' => $profile ];
call_hooks('local_dir_update', $arr);
$address = channel_reddress($p[0]);
if (perm_is_allowed($uid, '', 'view_profile')) {
self::import_directory_profile($hash, $arr['profile'], $address, 0);
}
else {
// they may have made it private
q("delete from xprof where xprof_hash = '%s'",
dbesc($hash)
);
q("delete from xtag where xtag_hash = '%s'",
dbesc($hash)
);
}
if (!$p) {
logger('profile not found');
return;
}
$ud_hash = random_string() . '@' . \App::get_hostname();
self::update_modtime($hash, $ud_hash, channel_reddress($p[0]),(($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED));
$profile = [];
$profile['encoding'] = 'zot';
$hash = $p[0]['channel_hash'];
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
if ($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
$profile['age'] = $age;
$profile['gender'] = $p[0]['gender'];
$profile['marital'] = $p[0]['marital'];
$profile['sexual'] = $p[0]['sexual'];
$profile['locale'] = $p[0]['locality'];
$profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name'];
$profile['about'] = $p[0]['about'];
$profile['homepage'] = $p[0]['homepage'];
$profile['hometown'] = $p[0]['hometown'];
if ($p[0]['keywords']) {
$tags = array();
$k = explode(' ', $p[0]['keywords']);
if ($k)
foreach ($k as $kk)
if (trim($kk))
$tags[] = trim($kk);
if ($tags)
$profile['keywords'] = $tags;
}
$hidden = (1 - intval($p[0]['publish']));
logger('hidden: ' . $hidden);
if(intval($p[0]['xchan_hidden']) !== $hidden) {
q("update xchan set xchan_hidden = %d where xchan_hash = '%s'",
intval($hidden),
dbesc($hash)
);
}
$arr = [ 'channel_id' => $uid, 'hash' => $hash, 'profile' => $profile ];
call_hooks('local_dir_update', $arr);
if (perm_is_allowed($uid, '', 'view_profile')) {
self::import_directory_profile($hash, $arr['profile']);
}
else {
// they may have made it private
q("delete from xprof where xprof_hash = '%s'",
dbesc($hash)
);
q("delete from xtag where xtag_hash = '%s'",
dbesc($hash)
);
}
self::update($hash, $p[0]['xchan_url']);
}
@@ -441,13 +484,10 @@ class Libzotdir {
*
* @param string $hash
* @param array $profile
* @param string $addr
* @param number $ud_flags (optional) UPDATE_FLAGS_UPDATED
* @param number $suppress_update (optional) default 0
* @return boolean $updated if something changed
*/
static function import_directory_profile($hash, $profile, $addr, $ud_flags = UPDATE_FLAGS_UPDATED, $suppress_update = 0) {
static function import_directory_profile($hash, $profile) {
logger('import_directory_profile', LOGGER_DEBUG);
if (! $hash)
@@ -480,7 +520,12 @@ class Libzotdir {
$clean = array();
if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) {
self::import_directory_keywords($hash,$profile['keywords']);
foreach ($profile['keywords'] as $kw) {
if (in_array($kw, $clean)) {
continue;
}
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
@@ -587,9 +632,6 @@ class Libzotdir {
*/
call_hooks('import_directory_profile', $d);
if (($d['update']) && (! $suppress_update))
self::update_modtime($arr['xprof_hash'],random_string() . '@' . \App::get_hostname(), $addr, $ud_flags);
return $d['update'];
}
@@ -607,6 +649,10 @@ class Libzotdir {
dbesc($hash)
);
$xchan = q("select xchan_censored from xchan where xchan_hash = '%s'",
dbesc($hash)
);
if($r) {
foreach($r as $rr)
$existing[] = $rr['xtag_term'];
@@ -614,6 +660,10 @@ class Libzotdir {
$clean = array();
foreach($keywords as $kw) {
if (in_array($kw, $clean)) {
continue;
}
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
@@ -628,9 +678,10 @@ class Libzotdir {
}
foreach($clean as $x) {
if(! in_array($x, $existing)) {
$r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', 0 )",
$r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', %d )",
dbesc($hash),
dbesc($x)
dbesc($x),
intval($xchan[0]['xchan_censored'])
);
}
}
@@ -640,40 +691,83 @@ class Libzotdir {
/**
* @brief
*
* @param string $hash
* @param string $guid
* @param string $addr
* @param int $flags (optional) default 0
* @param string $hash the channel hash
* @param string $addr the channel url
* @param bool $bump_date (optional) default true
*/
static function update_modtime($hash, $guid, $addr, $flags = 0) {
static function update($hash, $addr, $bump_date = true, $flag = null) {
$dirmode = intval(get_config('system', 'directory_mode'));
$dirmode = intval(Config::Get('system', 'directory_mode'));
if($dirmode == DIRECTORY_MODE_NORMAL) {
return;
}
if (empty($hash) || empty($guid) || empty($addr)) {
if (empty($hash) || empty($addr)) {
return;
}
if($flags) {
q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )",
dbesc($hash),
dbesc($guid),
dbesc(datetime_convert()),
intval($flags),
dbesc($addr)
);
$u = q("SELECT * FROM updates WHERE ud_hash = '%s' LIMIT 1",
dbesc($hash)
);
$date_sql = '';
if ($bump_date) {
$date_sql = "ud_date = '" . dbesc(datetime_convert()) . "',";
}
else {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d)>0 ",
intval(UPDATE_FLAGS_UPDATED),
$flag_sql = '';
if ($flag !== null) {
$flag_sql = "ud_flags = '" . intval($flag) . "',";
}
if ($u) {
$x = q("UPDATE updates SET $date_sql $flag_sql ud_last = '%s', ud_host = '%s', ud_addr = '%s', ud_update = 0 WHERE ud_id = %d",
dbesc(DBA::$dba->get_null_date()),
dbesc(z_root()),
dbesc($addr),
intval(UPDATE_FLAGS_UPDATED)
intval($u[0]['ud_id'])
);
return;
}
q("INSERT INTO updates (ud_hash, ud_host, ud_date, ud_addr, ud_flags) VALUES ( '%s', '%s', '%s', '%s', %d )",
dbesc($hash),
dbesc(z_root()),
dbesc(datetime_convert()),
dbesc($addr),
intval($flag)
);
return;
}
/**
* @brief deletes a entry in updates by hash
*
* @param string $hash the channel hash
* @return boolean
*/
static function delete_by_hash($hash) {
if (!$hash) {
return false;
}
$x = q("DELETE FROM updates WHERE ud_hash = '%s'",
dbesc($hash)
);
if ($x) {
return true;
}
return false;
}
}

86
Zotlabs/Lib/Mailer.php Normal file
View File

@@ -0,0 +1,86 @@
<?php
/**
* Mailer class for sending emails from Hubzilla.
*
* SPDX-FileCopyrightText: 2024 Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use App;
/**
* A class for sending emails.
*
* Based on the previous `z_mail` function, but adaped and made more
* robust and usable as a class.
*/
class Mailer {
public function __construct(private array $params = []) {
}
public function deliver(): bool {
if(empty($this->params['fromEmail'])) {
$this->params['fromEmail'] = Config::Get('system','from_email');
if(empty($this->params['fromEmail'])) {
$this->params['fromEmail'] = 'Administrator@' . App::get_hostname();
}
}
if(empty($this->params['fromName'])) {
$this->params['fromName'] = Config::Get('system','from_email_name');
if(empty($this->params['fromName'])) {
$this->params['fromName'] = System::get_site_name();
}
}
if(empty($this->params['replyTo'])) {
$this->params['replyTo'] = Config::Get('system','reply_address');
if(empty($this->params['replyTo'])) {
$this->params['replyTo'] = 'noreply@' . App::get_hostname();
}
}
if (!isset($this->params['additionalMailHeader'])) {
$this->params['additionalMailHeader'] = '';
}
$this->params['sent'] = false;
$this->params['result'] = false;
/**
* @hooks email_send
* * \e params @see z_mail()
*/
call_hooks('email_send', $this->params);
if($this->params['sent']) {
logger('notification: z_mail returns ' . (($this->params['result']) ? 'success' : 'failure'), LOGGER_DEBUG);
return $this->params['result'];
}
$fromName = email_header_encode(html_entity_decode($this->params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');
$messageSubject = email_header_encode(html_entity_decode($this->params['messageSubject'],ENT_QUOTES,'UTF-8'),'UTF-8');
$messageHeader =
$this->params['additionalMailHeader'] .
"From: $fromName <{$this->params['fromEmail']}>" . PHP_EOL .
"Reply-To: $fromName <{$this->params['replyTo']}>" . PHP_EOL .
"Content-Type: text/plain; charset=UTF-8";
// send the message
$res = mail(
$this->params['toEmail'], // send to address
$messageSubject, // subject
$this->params['textVersion'],
$messageHeader // message headers
);
logger('notification: z_mail returns ' . (($res) ? 'success' : 'failure'), LOGGER_DEBUG);
return $res;
}
}

View File

@@ -4,242 +4,417 @@ namespace Zotlabs\Lib;
require_once('include/html2plain.php');
class MessageFilter {
class MessageFilter
{
protected $lastMatch = '';
protected $item = null;
protected $include = '';
protected $exclude = '';
protected $options = [];
protected $tags = null;
protected $language = '';
protected $text = '';
protected $excludeRules = [];
protected $includeRules = [];
public static function evaluate($item, $incl, $excl) {
public function __construct($item, $include = '', $exclude = '', $options = [])
{
$this->item = $item;
$this->include = $include;
$this->exclude = $exclude;
$this->options = $options;
$this->setup();
}
$text = prepare_text($item['body'],((isset($item['mimetype'])) ? $item['mimetype'] : 'text/bbcode'));
$text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text);
protected function setup()
{
// Option: plaintext
// Improve language detection by providing a plaintext version of $item['body'] which has no markup constructs/tags.
$lang = null;
if (array_key_exists('plaintext', $this->options)) {
$this->text = $this->options['plaintext'];
} else {
$this->text = $this->item['body'];
}
if ((strpos($incl, 'lang=') !== false) || (strpos($excl, 'lang=') !== false) || (strpos($incl, 'lang!=') !== false) || (strpos($excl, 'lang!=') !== false)) {
$lang = detect_language($text);
}
$this->language = '';
$tags = ((isset($item['term']) && is_array($item['term']) && count($item['term'])) ? $item['term'] : false);
// Language matching is a bit tricky, because the language can be ambiguous (detect_language() returns '').
// If the language is ambiguous, the message will pass (be accepted) regardless of language rules.
// exclude always has priority
if (str_contains($this->include, 'lang=')
|| str_contains($this->exclude, 'lang=')
|| str_contains($this->include, 'lang!=')
|| str_contains($this->exclude, 'lang!=')) {
$this->language = detect_language($this->text);
}
$exclude = (($excl) ? explode("\n", $excl) : null);
$this->tags = ((isset($this->item['term']) && is_array($this->item['term'])
&& count($this->item['term'])) ? $this->item['term'] : null);
if ($exclude) {
foreach ($exclude as $word) {
$word = trim($word);
if (! $word) {
continue;
}
if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
if (!strlen($lang)) {
// Result is ambiguous. As we are matching deny rules only at this time, continue tests.
// Any matching deny rule concludes testing.
continue;
}
if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
return false;
} elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
return false;
}
}
elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return false;
}
}
} elseif (substr($word, 0, 1) === '$' && $tags) {
foreach ($tags as $t) {
if (($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return false;
}
}
} elseif (substr($word, 0, 2) === '?+') {
if (self::test_condition(substr($word, 2), $item['obj'])) {
return false;
}
} elseif (substr($word, 0, 1) === '?') {
if (self::test_condition(substr($word, 1), $item)) {
return false;
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return false;
} elseif (stristr($text, $word) !== false) {
return false;
}
}
}
$this->excludeRules = $this->parse($this->exclude);
$this->includeRules = $this->parse($this->include);
$include = (($incl) ? explode("\n", $incl) : null);
}
if ($include) {
foreach ($include as $word) {
$word = trim($word);
if (! $word) {
continue;
}
if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
if (!strlen($lang)) {
// Result is ambiguous. However we are checking allow rules
// and an ambiguous language is always permitted.
return true;
}
if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
return true;
} elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
return true;
}
}
elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return true;
}
}
} elseif (substr($word, 0, 1) === '$' && $tags) {
foreach ($tags as $t) {
if (($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return true;
}
}
} elseif (substr($word, 0, 2) === '?+') {
if (self::test_condition(substr($word, 2), $item['obj'])) {
return true;
}
} elseif (substr($word, 0, 1) === '?') {
if (self::test_condition(substr($word, 1), $item)) {
return true;
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return true;
} elseif (stristr($text, $word) !== false) {
return true;
}
}
} else {
return true;
}
protected function parse($string): array
{
$rules = [];
if (! strlen($string)) {
return $rules;
}
return false;
}
$phrases = preg_split("/(\s\|\|\s|\s&&\s|\n)/", $string, flags: PREG_SPLIT_DELIM_CAPTURE);
if (!$phrases) {
return $rules;
}
for ($index = 0; $index < count($phrases); $index ++) {
// Even indices are rules and odd indices are operations, linefeed is an implict OR.
if (!($index & 1)) {
$currentRule = ['operation' => '', 'rule' => $phrases[$index]];
if ($index && isset($phrases[$index - 1])) {
$currentRule['operation'] = $phrases[$index - 1];
if ($currentRule['operation'] === "\n") {
$currentRule['operation'] = ' || ';
}
$index++;
}
$rules[] = $currentRule;
}
}
return $rules;
}
/**
* @brief Test for Conditional Execution conditions. Shamelessly ripped off from Code/Render/Comanche
*
* This is extensible. The first version of variable testing supports tests of the forms:
*
* - ?foo ~= baz which will check if item.foo contains the string 'baz';
* - ?foo == baz which will check if item.foo is the string 'baz';
* - ?foo != baz which will check if item.foo is not the string 'baz';
* - ?foo >= 3 which will check if item.foo is greater than or equal to 3;
* - ?foo > 3 which will check if item.foo is greater than 3;
* - ?foo <= 3 which will check if item.foo is less than or equal to 3;
* - ?foo < 3 which will check if item.foo is less than 3;
*
* - ?foo {} baz which will check if 'baz' is an array element in item.foo
* - ?foo {*} baz which will check if 'baz' is an array key in item.foo
* - ?foo which will check for a return of a true condition for item.foo;
public function evaluate(): bool
{
$previousResult = $newResult = null;
// exclude always has priority
$exclude = $this->excludeRules;
$include = $this->includeRules;
if ($exclude) {
foreach ($exclude as $rule) {
if (!strlen(trim($rule['rule']))) {
continue;
}
if (!strlen($this->language) && ((str_starts_with($rule['rule'], 'lang=')) || (str_starts_with($rule['rule'], 'lang!=')))) {
continue;
}
$result = $this->evaluateRule($rule['rule']);
switch ($rule['operation']) {
case '':
$previousResult = $newResult = $result;
break;
case ' || ':
$newResult = $previousResult || $result;
break;
case ' && ':
$newResult = $previousResult && $result;
break;
}
}
if ($newResult) {
return false;
}
}
$previousResult = $newResult = null;
if ($include) {
foreach ($include as $rule) {
if (!strlen(trim($rule['rule']))) {
continue;
}
if (!strlen($this->language) && ((str_starts_with($rule['rule'], 'lang=')) || (str_starts_with($rule['rule'], 'lang!=')))) {
continue;
}
$result = $this->evaluateRule($rule['rule']);
switch ($rule['operation']) {
case '':
$previousResult = $newResult = $result;
break;
case ' || ':
$newResult = $previousResult || $result;
break;
case ' && ':
$newResult = $previousResult && $result;
break;
}
}
}
return $newResult ?? true;
}
protected function evaluateRule($ruleText): bool
{
$ruleText = trim($ruleText);
if (($this->language) && ((str_starts_with($ruleText, 'lang=')) || (str_starts_with($ruleText, 'lang!=')))) {
if (str_starts_with($ruleText, 'lang=') && strcasecmp($this->language, trim(substr($ruleText, 5))) == 0) {
$this->lastMatch = $ruleText;
return true;
} elseif (str_starts_with($ruleText, 'lang!=') && strcasecmp($this->language, trim(substr($ruleText, 6))) != 0) {
$this->lastMatch = $ruleText;
return true;
}
} elseif (str_starts_with($ruleText, 'until=')) {
$until = strtotime(trim(substr($ruleText, 6)));
if ($until > strtotime($this->item['created'] . ' UTC')) {
$this->lastMatch = $ruleText;
return true;
}
} elseif (str_starts_with($ruleText, '#') && $this->tags) {
// #hashtag match
foreach ($this->tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (!strcasecmp($t['term'], substr($ruleText, 1)) || (substr($ruleText, 1) === '*'))) {
$this->lastMatch = $ruleText;
return true;
}
}
// hashtag count match
if (substr($ruleText, 1, 1) === '>') {
$hashtagLimit = (int)substr($ruleText, 2);
$hashtagCount = 0;
foreach ($this->tags as $t) {
if ($t['ttype'] == TERM_HASHTAG || $t['ttype'] == TERM_COMMUNITYTAG) {
$hashtagCount++;
}
}
if ($hashtagLimit && $hashtagCount > $hashtagLimit) {
$this->lastMatch = $ruleText;
return true;
}
}
} elseif (str_starts_with($ruleText, '@') && $this->tags) {
// @mention match
foreach ($this->tags as $t) {
if ((($t['ttype'] == TERM_MENTION && (!strcasecmp($t['term'], substr($ruleText, 1)))) || (substr($ruleText, 1) === '*'))) {
$this->lastMatch = $ruleText;
return true;
}
}
// mention count match
if (substr($ruleText, 1, 1) === '>') {
$mentionLimit = (int)substr($ruleText, 2);
$mentionCount = 0;
foreach ($this->tags as $t) {
if ($t['ttype'] == TERM_MENTION) {
$mentionCount++;
}
}
if ($mentionLimit && $mentionCount > $mentionLimit) {
$this->lastMatch = $ruleText;
return true;
}
}
} elseif (str_starts_with($ruleText, '$') && $this->tags) {
foreach ($this->tags as $t) {
if (($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($ruleText, 1)) || (substr($ruleText, 1) === '*'))) {
$this->lastMatch = $ruleText;
return true;
}
}
} elseif (str_starts_with($ruleText, '?+') && is_array($this->item['obj'])) {
if ($this->test_condition(substr($ruleText, 2), $this->item['obj'])) {
$this->lastMatch = $ruleText;
return true;
}
} elseif (str_starts_with($ruleText, '?')) {
$this->item['ua'] = $_SERVER['HTTP_USER_AGENT'] ?? '';
if (empty($this->item['app'])) {
$author_app = $this->item['author']['site_project'] ?? '';
if (!$author_app && isset($this->item['author'])) {
if (str_contains($this->item['author']['xchan_hash'], 'threads.net') || str_contains($this->item['author']['xchan_hash'], 'threads.com')) {
$author_app = 'threads';
}
}
$this->item['app'] = $author_app;
}
if ($this->test_condition(substr($ruleText, 1), $this->item)) {
unset($this->item['ua']);
$this->lastMatch = $ruleText;
return true;
}
unset($this->item['ua']);
} elseif ((str_starts_with($ruleText, '/')) && preg_match($ruleText, $this->item['body'])) {
$this->lastMatch = $ruleText;
return true;
} elseif (stristr($this->item['body'], $ruleText) !== false) {
$this->lastMatch = $ruleText;
return true;
}
return false;
}
public function getLastMatch(): string
{
return $this->lastMatch;
}
public function setLastMatch($string): MessageFilter
{
$this->lastMatch = $string;
return $this;
}
/**
* @brief Test for Conditional Execution conditions. Shamelessly ripped off from src/Render/Comanche
*
* This is extensible. The first version of variable testing supports tests of the forms:
*
* - ?foo ~= baz will check if item.foo contains the string 'baz';
* - ?foo == baz will check if item.foo is the string 'baz';
* - ?foo != baz will check if item.foo is not the string 'baz';
* - ?foo // baz will check if item.foo matches the regular expression 'baz';
* - ?foo >= 3 will check if item.foo is greater than or equal to 3;
* - ?foo > 3 will check if item.foo is greater than 3;
* - ?foo <= 3 will check if item.foo is less than or equal to 3;
* - ?foo < 3 will check if item.foo is less than 3;
* - ?foo & 2 will check if item.foo has the second bit set.
* - ?foo !& 2 will check if item.foo does not have the second bit set.
*
* - ?foo {} baz which will check if 'baz' is an array element in item.foo
* - ?foo {*} baz which will check if 'baz' is an array key in item.foo
* - ?foo which will check for a return of a true condition for item.foo;
* - ?!foo which will check for a return of a false condition for item.foo;
*
* The values 0, '', an empty array, and an unset value will all evaluate to false.
*
* @param string $s
* @param array $item
* @return bool
*/
* The values 0, '', an empty array, and an unset value will all evaluate to false.
*
* @param string $s
* @param array $item
* @return bool
*/
protected function test_condition($s,$item)
{
$s = trim($s);
public static function test_condition($s,$item) {
if (preg_match('/(.*?)\s&\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x & (int) trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\~\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (stripos($x, trim($matches[2])) !== false) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s!&\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (!($x & (int) trim($matches[2]))) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\=\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x == trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s~=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_string($x) && stripos($x, trim($matches[2])) !== false) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\!\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x != trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s==\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x == trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x >= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s!=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x != trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\<\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x <= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\/\/\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (substr(trim($matches[2]),0,1) !== substr(trim($matches[2]),-1)) {
$matches[2] = '/' . trim($matches[2]) . '/';
}
if (preg_match(trim($matches[2]), $x)) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x > trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s>=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x >= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x < trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s<=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x <= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/[\$](.*?)\s\{\}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && in_array(trim($matches[2]), $x)) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s>\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x > trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\{\*\}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && array_key_exists(trim($matches[2]), $x)) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s<\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x < trim($matches[2])) {
return true;
}
return false;
}
// Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important.
if (preg_match('/\!(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (!$x) {
return true;
}
return false;
}
// Array contains value
if (preg_match('/(.*?)\s\{\}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && in_array(trim($matches[2]), $x)) {
return true;
}
return false;
}
if (preg_match('/(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x) {
return true;
}
return false;
}
// Array contains key
if (preg_match('/(.*?)\s\{\*}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && array_key_exists(trim($matches[2]), $x)) {
return true;
}
return false;
}
return false;
}
// Ordering of this check (for falseness) with relation to the following one (check for truthiness) is important.
if (preg_match('/!(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (!$x) {
return true;
}
return false;
}
if (preg_match('/(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x) {
return true;
}
return false;
}
return false;
}
}

34
Zotlabs/Lib/Multibase.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace Zotlabs\Lib;
use StephenHill\Base58;
class Multibase {
protected $key = null;
public function __construct() {
return $this;
}
public function publicKey($key) {
$base58 = new Base58();
$raw = hex2bin('ed01') . sodium_base642bin($key, SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
return 'z' . $base58->encode($raw);
}
public function secretKey($key) {
$base58 = new Base58();
$raw = hex2bin('8026') . sodium_base642bin($key, SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
return 'z' . $base58->encode($raw);
}
public function decode($key, $binary = false) {
$base58 = new Base58();
$key = substr($key,1);
$raw = $base58->decode($key);
$binaryKey = substr($raw, 2);
return $binary ? $binaryKey : sodium_bin2base64($binaryKey, SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* SPDX-FileCopyrightText: 2026 The Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use DBA;
use PDO;
/**
* Concrete implementation for getting stats from MySQL and MariaDB databases.
*/
class MySQLDbStats extends DbStats {
public function getQueries(): int {
//
// We can't use the regular Hubzilla db helper function here, as
// it will only return information from a `SELECT` statement.
//
// Use the basic PDO access instead.
//
$query = DBA::$dba->db->prepare('SHOW STATUS LIKE "Queries"');
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
logger(print_r($result, true));
if (!empty($result)) {
return $result['Value'] ?? -1;
}
return 0;
}
}

40
Zotlabs/Lib/ObjCache.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
namespace Zotlabs\Lib;
class ObjCache
{
public static function Get($path, $type = 'as')
{
if (!$path) {
return [];
}
$localpath = Hashpath::path($path, 'store/[data]/[obj]/' . $type, 2, alg: 'sha256');
if (file_exists($localpath)) {
return json_unserialize(file_get_contents($localpath));
}
return [];
}
public static function Set($path, $content, $type = 'as') {
if (!$path) {
return;
}
$localpath = Hashpath::path($path, 'store/[data]/[obj]/' . $type, 2, alg: 'sha256');
file_put_contents($localpath, json_serialize($content));
}
public static function Delete($path, $type = 'as') {
if (!$path) {
return;
}
$localpath = Hashpath::path($path, 'store/[data]/[obj]/' . $type, 2, alg: 'sha256');
if (file_exists($localpath)) {
unlink($localpath);
}
}
}

View File

@@ -117,7 +117,7 @@ class PermissionDescription {
}
/**
* Returns an icon css class name if an appropriate one is available, e.g. "fa-globe" for Public,
* Returns an icon css class name if an appropriate one is available, e.g. "bi-globe" for Public,
* otherwise returns empty string.
*
* @return string icon css class name (often FontAwesome)
@@ -125,12 +125,12 @@ class PermissionDescription {
public function get_permission_icon() {
switch($this->channel_perm) {
case 0:/* only me */ return 'fa-eye-slash';
case PERMS_PUBLIC: return 'fa-globe';
case PERMS_NETWORK: return 'fa-share-alt-square'; // fa-share-alt-square is very similiar to the hubzilla logo, but we should create our own logo class to use
case PERMS_SITE: return 'fa-sitemap';
case PERMS_CONTACTS: return 'fa-group';
case PERMS_SPECIFIC: return 'fa-list';
case 0:/* only me */ return 'bi-eye-slash';
case PERMS_PUBLIC: return 'bi-globe';
case PERMS_NETWORK: return 'bi-share'; // bi-share is very similiar to the hubzilla logo, but we should create our own logo class to use
case PERMS_SITE: return 'bi-geo';
case PERMS_CONTACTS: return 'bi-people';
case PERMS_SPECIFIC: return 'bi-list-ul';
case PERMS_AUTHED: return '';
case PERMS_PENDING: return '';
default: return '';

View File

@@ -0,0 +1,32 @@
<?php
/*
* SPDX-FileCopyrightText: 2026 The Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Lib;
use DBA;
/**
* Concrete implementation for getting stats from PostgreSQL databases.
*/
class PostgresDbStats extends DbStats {
public function getQueries(): int {
$sqlGetQps = <<<'SQL'
select (xact_commit + xact_rollback) as queries
from pg_stat_database
where datname='%s'
SQL;
$result = q($sqlGetQps, DBA::$dba->dbname);
if (!empty($result)) {
return $result[0]['queries'] ?? -1;
}
return 0;
}
}

View File

@@ -7,6 +7,20 @@ use Zotlabs\Zot6\Zot6Handler;
class Queue {
/**
* Get number of entries in the out queue.
*
* When delivery is successful, the item is removed from the out queue, so
* the number of items in the queue reflects the number of pending delivery
* attempts.
*
* @return int Number of items in the out queue.
*/
static function count(): int {
$r = dbq('select count(*) as total from outq');
return $r[0]['total'] ?? 0;
}
static function update($id, $add_priority = 0) {
logger('queue: requeue item ' . $id,LOGGER_DEBUG);
@@ -57,7 +71,6 @@ class Queue {
outq_priority = outq_priority + %d,
outq_scheduled = '%s'
WHERE outq_hash = '%s'",
dbesc(datetime_convert()),
intval($add_priority),
dbesc($next),
@@ -65,16 +78,38 @@ class Queue {
);
}
static function remove($id,$channel_id = 0) {
logger('queue: remove queue item ' . $id,LOGGER_DEBUG);
public static function remove($id, $channel_id = 0) {
logger('queue: remove queue item ' . $id, LOGGER_DEBUG);
$sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : '');
q("DELETE FROM outq WHERE outq_hash = '%s' $sql_extra",
// figure out what endpoint it is going to.
$record = q("select outq_posturl from outq where outq_hash = '%s' $sql_extra",
dbesc($id)
);
}
if ($record) {
q("DELETE FROM outq WHERE outq_hash = '%s' $sql_extra",
dbesc($id)
);
// If there's anything remaining in the queue for this site, move one of them to the next active
// queue run by setting outq_scheduled back to the present. We may be attempting to deliver it
// as a 'piled_up' delivery, but this ensures the site has an active queue entry as long as queued
// entries still exist for it. This fixes an issue where one immediate delivery left everything
// else for that site undeliverable since all the other entries had been pushed far into the future.
$r = q("SELECT outq_hash, outq_posturl FROM outq WHERE outq_posturl = '%s' LIMIT 1",
dbesc($record[0]['outq_posturl'])
);
if ($r) {
$hashes = ids_to_querystr($r, 'outq_hash', true);
$x = q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_hash IN ($hashes)",
dbesc(datetime_convert())
);
}
}
}
static function remove_by_posturl($posturl) {
logger('queue: remove queue posturl ' . $posturl,LOGGER_DEBUG);
@@ -84,8 +119,6 @@ class Queue {
);
}
static function set_delivered($id,$channel = 0) {
logger('queue: set delivered ' . $id,LOGGER_DEBUG);
$sql_extra = (($channel['channel_id']) ? " and outq_channel = " . intval($channel['channel_id']) . " " : '');
@@ -152,17 +185,19 @@ class Queue {
$y = q("select site_update, site_dead from site where site_url = '%s' ",
dbesc($base)
);
if($y) {
if(intval($y[0]['site_dead'])) {
if ($y) {
// Don't bother delivering if the site is dead.
// And if we haven't heard from the site in over a month - let them through but 3 strikes you're out.
if (intval($y[0]['site_dead']) || ($y[0]['site_update'] < datetime_convert('UTC', 'UTC', 'now - 1 month') && $outq['outq_priority'] > 20)) {
q("update dreport set dreport_result = '%s' where dreport_queue = '%s'",
dbesc('site dead'),
dbesc($outq['outq_hash'])
);
self::remove_by_posturl($outq['outq_posturl']);
logger('dead site ignored ' . $base);
return;
}
if($y[0]['site_update'] < datetime_convert('UTC','UTC','now - 1 month')) {
self::update($outq['outq_hash'], 10);
logger('immediate delivery deferred for site ' . $base);
return;
}
}
else {
@@ -225,7 +260,7 @@ class Queue {
if($result['success']) {
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],$result, $outq);
Libzot::process_response($outq['outq_posturl'], $result, $outq);
}
else {
logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);

375
Zotlabs/Lib/QueueWorker.php Normal file
View File

@@ -0,0 +1,375 @@
<?php
namespace Zotlabs\Lib;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnableToBuildUuidException;
use Zotlabs\Lib\Config;
require_once 'include/dba/dba_transaction.php';
class QueueWorker {
public static $queueworker = null;
public static $maxworkers = 0;
public static $workermaxage = 0;
public static $workersleep = 100;
public static $default_priorities = [
'Notifier' => 10,
'Deliver' => 10,
'Cache_query' => 10,
'Content_importer' => 1,
'File_importer' => 1,
'Channel_purge' => 1,
'Directory' => 1
];
// Exceptions for processtimeout ($workermaxage) value.
// Currently the value is overriden with 3600 seconds (1h).
public static $long_running_cmd = [
'Queue',
'Expire'
];
public static function Summon($argv) {
if ($argv[0] !== 'Queueworker') {
$priority = 0; // @TODO allow reprioritization
if (isset(self::$default_priorities[$argv[0]])) {
$priority = self::$default_priorities[$argv[0]];
}
$workinfo = ['argc' => count($argv), 'argv' => $argv];
$workinfo_json = json_encode($workinfo);
$uuid = self::getUuid($workinfo_json);
$r = q("SELECT * FROM workerq WHERE workerq_uuid = '%s'",
dbesc($uuid)
);
if ($r) {
logger("Summon: Ignoring duplicate workerq task", LOGGER_DEBUG);
logger(print_r($workinfo, true));
return;
}
logger('queueworker_stats_summon: cmd:' . $argv[0] . ' ' . 'timestamp:' . time());
$transaction = new \DbaTransaction(\DBA::$dba);
$r = q("INSERT INTO workerq (workerq_priority, workerq_data, workerq_uuid, workerq_cmd) VALUES (%d, '%s', '%s', '%s')",
intval($priority),
dbesc($workinfo_json),
dbesc($uuid),
dbesc($argv[0])
);
if (!$r) {
// Transaction is autmatically rolled back on return
logger("INSERT FAILED", LOGGER_DEBUG);
return;
}
$transaction->commit();
logger('INSERTED: ' . $workinfo_json, LOGGER_DEBUG);
}
$workers = self::GetWorkerCount();
if ($workers < self::$maxworkers) {
logger($workers . '/' . self::$maxworkers . ' workers active', LOGGER_DEBUG);
$phpbin = Config::Get('system', 'phpbin', 'php');
proc_run($phpbin, 'Zotlabs/Daemon/Master.php', ['Queueworker']);
}
}
public static function Release($argv) {
if ($argv[0] !== 'Queueworker') {
$priority = 0; // @TODO allow reprioritization
if (isset(self::$default_priorities[$argv[0]])) {
$priority = self::$default_priorities[$argv[0]];
}
$workinfo = ['argc' => count($argv), 'argv' => $argv];
$workinfo_json = json_encode($workinfo);
$uuid = self::getUuid($workinfo_json);
$r = q("SELECT * FROM workerq WHERE workerq_uuid = '%s'",
dbesc($uuid)
);
if ($r) {
logger("Release: Duplicate task - do not insert.", LOGGER_DEBUG);
logger(print_r($workinfo, true));
return;
}
$transaction = new \DbaTransaction(\DBA::$dba);
$r = q("INSERT INTO workerq (workerq_priority, workerq_data, workerq_uuid, workerq_cmd) VALUES (%d, '%s', '%s', '%s')",
intval($priority),
dbesc($workinfo_json),
dbesc($uuid),
dbesc($argv[0])
);
if (!$r) {
// Transaction is automatically rolled back on return
logger("Insert failed: " . $workinfo_json, LOGGER_DEBUG);
return;
}
$transaction->commit();
logger('INSERTED: ' . $workinfo_json, LOGGER_DEBUG);
}
self::Process();
}
public static function GetWorkerCount() {
if (self::$maxworkers == 0) {
self::$maxworkers = Config::Get('queueworker', 'max_queueworkers', 4);
self::$maxworkers = self::$maxworkers > 3 ? self::$maxworkers : 4;
}
if (self::$workermaxage == 0) {
self::$workermaxage = Config::Get('queueworker', 'max_queueworker_age');
self::$workermaxage = self::$workermaxage > 120 ? self::$workermaxage : 300;
}
$transaction = new \DbaTransaction(\DBA::$dba);
// skip locked is preferred but is not supported by mariadb < 10.6 which is still used a lot - hence make it optional
$sql_quirks = ((Config::Get('system', 'db_skip_locked_supported')) ? 'SKIP LOCKED' : 'NOWAIT');
$r = q("SELECT workerq_id FROM workerq WHERE workerq_reservationid IS NOT NULL AND workerq_processtimeout < %s FOR UPDATE $sql_quirks",
db_utcnow()
);
if ($r) {
// TODO: some long running services store their pid in config.procid.daemon
// we could possibly check if a pid exist and check if the process is still alive
// prior to reseting workerq_reservationid
$ids = ids_to_querystr($r, 'workerq_id');
$u = dbq("update workerq set workerq_reservationid = null where workerq_id in ($ids)");
}
$transaction->commit();
//q("update workerq set workerq_reservationid = null where workerq_reservationid is not null and workerq_processtimeout < %s",
//db_utcnow()
//);
//usleep(self::$workersleep);
$workers = dbq("select count(*) as total from workerq where workerq_reservationid is not null");
logger("WORKERCOUNT: " . $workers[0]['total'], LOGGER_DEBUG);
return intval($workers[0]['total']);
}
public static function GetWorkerID() {
if (self::$queueworker) {
return self::$queueworker;
}
$wid = uniqid('', true);
//usleep(mt_rand(300000, 1000000)); //Sleep .3 - 1 seconds before creating a new worker.
$workers = self::GetWorkerCount();
if ($workers >= self::$maxworkers) {
logger("Too many active workers ($workers) max = " . self::$maxworkers, LOGGER_DEBUG);
return false;
}
self::$queueworker = $wid;
return $wid;
}
private static function getWorkId() {
self::GetWorkerCount();
$transaction = new \DbaTransaction(\DBA::$dba);
// skip locked is preferred but is not supported by mariadb < 10.6 which is still used a lot - hence make it optional
$sql_quirks = ((Config::Get('system', 'db_skip_locked_supported')) ? 'SKIP LOCKED' : 'NOWAIT');
$work = dbq("SELECT workerq_id, workerq_cmd FROM workerq WHERE workerq_reservationid IS NULL ORDER BY workerq_priority DESC, workerq_id ASC LIMIT 1 FOR UPDATE $sql_quirks");
if (!$work) {
// Transaction automatically rolled back on return
return false;
}
$id = $work[0]['workerq_id'];
$cmd = $work[0]['workerq_cmd'];
$age = self::$workermaxage;
if (in_array($cmd, self::$long_running_cmd)) {
$age = 3600; // 1h TODO: make this configurable
}
$work = q("UPDATE workerq SET workerq_reservationid = '%s', workerq_processtimeout = %s + INTERVAL %s WHERE workerq_id = %d",
self::$queueworker,
db_utcnow(),
db_quoteinterval($age . " SECOND"),
intval($id)
);
if (!$work) {
// Transaction automatically rolled back on return
logger("Could not update workerq.", LOGGER_DEBUG);
return false;
}
logger("GOTWORK: " . json_encode($work), LOGGER_DEBUG);
$transaction->commit();
return $id;
}
public static function Process() {
$sleep = intval(Config::Get('queueworker', 'queue_worker_sleep', 100));
$auto_queue_worker_sleep = Config::Get('queueworker', 'auto_queue_worker_sleep', 0);
if (!self::GetWorkerID()) {
if ($auto_queue_worker_sleep) {
Config::Set('queueworker', 'queue_worker_sleep', $sleep + 100);
}
logger('Unable to get worker ID. Exiting.', LOGGER_DEBUG);
killme();
}
if ($auto_queue_worker_sleep && $sleep > 100) {
$next_sleep = $sleep - 100;
Config::Set('queueworker', 'queue_worker_sleep', (($next_sleep < 100) ? 100 : $next_sleep));
}
$jobs = 0;
$workid = self::getWorkId();
$load_average_sleep = false;
self::$workersleep = $sleep;
self::$workersleep = ((intval(self::$workersleep) > 100) ? intval(self::$workersleep) : 100);
if (function_exists('sys_getloadavg') && Config::Get('queueworker', 'load_average_sleep')) {
// very experimental!
$load_average_sleep = true;
}
while ($workid) {
if ($load_average_sleep) {
$load_average = sys_getloadavg();
self::$workersleep = intval($load_average[0]) * 10000;
if (!self::$workersleep) {
self::$workersleep = 100;
}
}
logger('queue_worker_sleep: ' . self::$workersleep, LOGGER_DEBUG);
usleep(self::$workersleep);
$workitem = dbq("SELECT * FROM workerq WHERE workerq_id = $workid");
if ($workitem) {
// At least SOME work to do.... in case there's more, let's ramp up workers.
$workers = self::GetWorkerCount();
if ($workers < self::$maxworkers) {
logger($workers . '/' . self::$maxworkers . ' workers active', LOGGER_DEBUG);
$phpbin = Config::Get('system', 'phpbin', 'php');
proc_run($phpbin, 'Zotlabs/Daemon/Master.php', ['Queueworker']);
}
$jobs++;
logger("Workinfo: " . $workitem[0]['workerq_data'], LOGGER_DEBUG);
$workinfo = json_decode($workitem[0]['workerq_data'], true);
$argv = $workinfo['argv'];
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$argv = flatten_array_recursive($argv);
$argc = count($argv);
$rnd = random_string(16);
logger('PROCESSING: ' . $rnd . ' ' . print_r($argv[0], true));
$start_timestamp = microtime(true);
$cls::run($argc, $argv);
logger('logger_stats_data cmd:' . $argv[0] . ' start:' . $start_timestamp . ' ' . 'end:' . microtime(true) . ' meta:' . $rnd);
logger('COMPLETED: ' . $rnd);
// @FIXME: Right now we assume that if we get a return, everything is OK.
// At some point we may want to test whether the run returns true/false
// and requeue the work to be tried again if needed. But we probably want
// to implement some sort of "retry interval" first.
dbq("delete from workerq where workerq_id = $workid");
}
else {
logger("NO WORKITEM!", LOGGER_DEBUG);
}
$workid = self::getWorkId();
}
logger('Master: Worker Thread: queue items processed:' . $jobs, LOGGER_DEBUG);
}
public static function ClearQueue() {
$work = q("select * from workerq");
while ($work) {
foreach ($work as $workitem) {
$workinfo = json_decode($workitem['v'], true);
$argc = $workinfo['argc'];
$argv = $workinfo['argv'];
logger('Master: process: ' . print_r($argv, true), LOGGER_ALL, LOG_DEBUG);
if (!isset($argv[0])) {
q("delete from workerq where workerq_id = %d",
$work[0]['workerq_id']
);
continue;
}
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc, $argv);
q("delete from workerq where workerq_id = %d",
$work[0]['workerq_id']
);
//Give the server .3 seconds to catch its breath between tasks.
//This will hopefully keep it from crashing to it's knees entirely
//if the last task ended up initiating other parallel processes
//(eg. polling remotes)
usleep(300000);
}
//Make sure nothing new came in
$work = q("select * from workerq");
}
}
/**
* @brief Generate a name-based v5 UUID with custom namespace
*
* @param string $data
* @return string $uuid
*/
private static function getUuid(string $data) {
$namespace = '3a112e42-f147-4ccf-a78b-f6841339ea2a';
try {
$uuid = Uuid::uuid5($namespace, $data)->toString();
} catch (UnableToBuildUuidException $e) {
logger('UUID generation failed');
return '';
}
return $uuid;
}
}

Some files were not shown because too many files have changed in this diff Show More