Merge branch 'dev' of /home/macgirvin/z into dev

This commit is contained in:
nobody 2020-12-07 17:37:44 -08:00
commit 694c23e6d6
12 changed files with 333 additions and 15 deletions

View file

@ -19,6 +19,9 @@ if (array_search( __file__ , get_included_files()) === 0) {
class Run {
static public function Summon($arr) {
if (file_exists('maintenance_lock') || file_exists('cache/maintenance_lock')) {
return;
}
proc_run('php','Zotlabs/Daemon/Run.php',$arr);
}

View file

@ -353,6 +353,8 @@ class Libprofile {
'$rating' => '',
'$contact_block' => $contact_block,
'$change_photo' => t('Change your profile photo'),
'$copyto' => t('Copy to clipboard'),
'$copied' => t('Address copied to clipboard'),
'$editmenu' => self::edit_menu($profile['uid'])
));

View file

@ -489,11 +489,11 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
return false;
}
if(! ($sourceNode->data && $sourceNode->data->hash)) {
if(! ($sourceNode->data && $sourceNode->data['hash'])) {
return false;
}
return attach_move($this->auth->owner_id, $sourceNode->data->hash, $this->folder_hash);
return attach_move($this->auth->owner_id, $sourceNode->data['hash'], $this->folder_hash);
}

20
Zotlabs/Update/_1247.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Zotlabs\Update;
class _1247 {
function run() {
// remove deprecated apps from system list
$access = 'a2e9cee1a71e8b82f662d131a7cda1606b84b9be283715c967544e19cb34dd0821b65580c942ca38d7620638a44f26034536597a2c3a5c969e2dbaedfcd1d282';
q("delete from app where app_id = '$access' ");
return UPDATE_SUCCESS;
}
function verify() {
return true;
}
}

View file

@ -15,6 +15,10 @@ class WebServer {
require_once('boot.php');
if (file_exists('maintenance_lock') || file_exists('cache/maintenance_lock')) {
http_status_exit(503,'System unavailable');
}
sys_boot();

View file

@ -16,10 +16,10 @@ use Zotlabs\Daemon\Run;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '20.12.02' );
define ( 'STD_VERSION', '20.12.07' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1246 );
define ( 'DB_UPDATE_VERSION', 1247 );
define ( 'PLATFORM_NAME', 'redmatrix' );
define ( 'PLATFORM_ARCHITECTURE', 'zap' );

81
doc/en/addons.md Normal file
View file

@ -0,0 +1,81 @@
Addons
## ABC Music
Render ABC music notation as musical scores
## Content Importer
import content and file storage to a cloned channel
## Dreamhost
Improved operation on Dreamhost shared hosting
## Faces
Detect faces in images and make a guess who it is.
## Flashcards
Grandma style learning method that uses spaced repetition as a learning technique.
## Followlist
follow everybody in an ActivityPub followers/following list or Mastodon contact export file
## Gallery
Album gallery and photo viewer based on photoswipe
## Hexit
Hexadecimal Conversion Tool
## LDAP Authenticate
Authenticate an account against an enterprise LDAP directory such as Windows Active Directory
## Logrot
Logfile Rotator
## Nodeinfo Statistics
Generates some statistics for the-federation.info and other nodeinfo based services
## Not Safe For Work
Collapse posts with inappropriate content
## OpenStreetMap
Use OpenStreetMap for displaying locations.
## phpmailer
use phpmailer instead of built-in mail() function
## Rainbowtag
Add some colour to tag clouds
## Standard Embeds
Allow unfiltered access to embeds from top media providers (currently YouTube, Soundcloud, and Twitter)
## Stream Order
Provides an app to switch the post ordering
## Sudo
Allow site administrator to access/administer protected channels and content
## Twitter API
Implements a reasonable and useful subset the Twitter V1 and V1.1 API with StatusNet extensions
## Zot Crosspost Connector (zotpost)
Republish public posts to another Zot or Zot6 channel

152
doc/en/apps.md Normal file
View file

@ -0,0 +1,152 @@
Available apps:
## Calendar
This app provides access to a local CalDAV server which can be used to sync/manage calendars from your operating system or email program. It is not the same as the Events app and should only be installed if you have a specific need for CalDAV.
## Categories
This app allows you to add named categories to your posts. The major difference between categories and hashtags is that category searches only return your own posts. They are personal to you. Hashtag searches search all posts across all channels on your website/instance.
## Channel Home
Installed by default. This app provides access to your channel home page.
## Clients
This app allows you to create Oauth2/Openid access credentials. Typically used to provide authentication for mobile and third-party client applications.
## Comment Control
This app lets you control the ability to comment on your posts. You can choose to disable comments, disable comments after a specific date/time, and select different audiences who are given comment permission. For example 'anybody' or 'just my friends'. Disallowed comments will be rejected by your website/instance. Whether or not the sender is notified of these rejections is dependent on their own software capabilities.
## Connections
Installed by default. This app manages your connections (followers and following) as well as their permissions and filter settings.
## Content Filter
Allows you to specify different rules to incoming posts and comments, either on a per connection basis or as a global filter which applies to all incoming messages. Filtering can take place using hashtags, categories, regular expressions, text content, and language matching.
## Content Import
Requires the 'content_import' addon. When migrating to a new site, first import the identity and settings. Then install/run this app to import your content - such as posts, comments, files, and photos.
## Directory
Installed by default. Lets you discover others in the network. This displays everybody known to your website/instance except those that choose to be "hidden".
## Drafts
This optional app allows you to save a post you are composing and finish it later. After installing, click the 'disk' icon in the post editor to save a draft. Click the app itself to display your current drafts, and 'Edit Post' to continue editing. Important: please use the 'disk' icon to continue saving the draft if you wish to continue working on it. As soon as you click 'Share', the post will be published.
## Events
Installed by default. This provides access to your personal calendar and events. Your friends' birthdays are automatically added to your calendar as well as any events that you have chosen to attend. If you wish to receive a reminder for other events, please select 'Add to Calendar' from the message menu of the desired post.
## Expire Posts
This app allows you to automatically remove all your own posts at some point in the future.
## Files
Installed by default. This app provides access to your cloud storage and WebDAV resources (anything you upload).
## Followlist
This app is only present if the 'followlist' addon is installed. It allows you to bulk connect with a list of channels. Typically this will be the 'following' ActivityPub collection on another server. We also accept Mastodon contact export files.
## Friend Zoom
This provides a slider control at the top of your stream. Every connection may be assigned a value from 0-100. The default is 80 for new connections. Unknown people in your stream are 100. You are 0. You can adjust your friends anywhere within the slider control range and use it to zoom in to your close friends and zoom out to people/channels you are less familiar with or who post very frequently and tend to drown out everybody else.
## Future Posting
Set a post to be published at/after a certain date/time. Usually used for automatically posting while you are on vacation. The specified date/time must be at least fifteen minutes in the future in order for publishing to be delayed. Otherwise it is published immediately but with the provided date/time.
## Gallery
Requires the 'gallery' addon. This provides an improved image browser to your photos than the stock 'Photos' app. Interactions with photos in your stream are modified slightly.
## Language
This is generally used by developers to test alternate languages and is rarely needed. The language of your website will usually depend on the language settings of your browser and the existence of available translations. This app allows you to quickly over-ride the defaults and specify a particular language.
## Lists
Installed by default. Some software refers to this functionality as 'Aspects' (Diaspora) or 'Circles' (Google+). This allows you to create/manage named lists of connections which you can view and/or share with as a single named group.
## Markup
Provides editor buttons for bold, italic, underline, etc. Otherwise the relevant codes will need to be entered manually. This software recognises both Markdown and bbcode.
## Notes
Provides a simple notepad on your stream page for making notes and reminders.
## NSFW
"Not Safe For Work". Requires the 'nsfw' addon. By default this will collapse and hide posts matching any of your rules unless you are running in "safe mode". These rules are based on hashtags, text content, regular expressions, and language. It is like the 'Content Filter' app except that all matching posts are present in your stream but require you to open each such message to view. Posts matching 'Content Filter' rules are rejected and will not be present in your stream. You can select whether or not you are running in 'safe mode' in your personal menu, and this setting is preserved separately for each login. This means your work computer can be in 'safe mode' and questionable content hidden, while your home computer may be configured to show everything by default.
## Photomap
If your uploaded photos have location support, this addon provides an optional map display of those locations in your 'Photos' app. This may require installing either the 'openstreetmap' addon or some other map provider.
## Photos
Installed by default. This displays your uploaded photos and photo albums separately from other uploaded files.
## Post
This app lets you open a post editor at any time.
## Search
One click interface to the search page.
## Secrets
This app provides basic end-to-end encryption using the Stanford Javascript Crypto Library and lets you assign a key and optional key hint, such as "grandma's anniversary yyyy-mm-dd". An encryption button is added to the post editor. Transmitting the actual key should be done using another service or based on common knowledge/experience. The encryption button will encrypt the entire contents of the message window, which may include basic bbcode constructs like bold and italic text. For best results, please restrict your content to plain text, as unsupported markup will be displayed verbatim. Links are permitted, but should probably be avoided since fetching them at the other end may leak secret knowledge.
## Site Admin
If you are the site administrator, this app provides access to the admin control panel.
## Sites
Provides a categorised listing of all sites that this website/instance is aware of.
## Stream
Installed by default. This represents the conversations of you and your connections.
## Stream Order
Requires the 'stream_order' addon. Provides a setting on the Stream page to select between various sort orders, such as 'last commented date' (conversational), 'posted date' (also conversational) and 'date unthreaded' which lists every activity as a separate message.
## Suggest Channels
Analyses your own connections and those of your friends who have provided you with permission to see their other connections. It returns a page of channels ranked by how many of your other friends are friends with the given channel, but where you are not.
## Tagadelic
Named after the Drupal module of the same name. This provides a tag cloud of your hashtags on your channel home page. Also useful with the 'rainbowtag' addon to give it some added colour.
## Tasks
Provides a very simple to-do list on your Stream page (and also the 'tasks' page).
## Virtual Lists
This is like 'Lists', except you do not need to manage the list membership. By default, three dynamic lists are created: all connections, all zot6 (protocol) connections, and all activitypub (protocol) connections. These virtual lists may be used anywhere you can use a list; either as permission controls, post audiences, or stream filtering.
## Zotpost
Requires the 'zotpost' addon. This configures the zotpost addon to automatically cross-post to your channel on another Zot6 site.

View file

@ -726,11 +726,10 @@ function bb_checklist($match) {
/**
* @brief Sanitize style properties from BBCode to HTML.
*
* @param array $input
* @param boolean $raw - false if $input is a preg_match() result array, true if $input is a string.
* @param array|string $input
* @return string A HTML span tag with the styles.
*/
function bb_sanitize_style($input, $raw = false) {
function bb_sanitize_style($input) {
// whitelist array: property => limits (0 = no limitation)
$w = array(
// color properties
@ -746,8 +745,11 @@ function bb_sanitize_style($input, $raw = false) {
"text-decoration" => 0,
);
// determine if input is string or array
$input_is_array = is_array($input);
$css = array();
$css_string = (($raw) ? $input : $input[1]);
$css_string = (($input_is_array) ? $input[1] : $input);
$a = explode(';', $css_string);
foreach($a as $parts){
@ -782,10 +784,11 @@ function bb_sanitize_style($input, $raw = false) {
$css_string_san .= $key . ":" . $value ."; ";
}
if ($raw) {
return $css_string_san;
if ($input_is_array) {
return '<span style="' . $css_string_san . '">' . $input[2] . '</span>';
}
return '<span style="' . $css_string_san . '">' . $input[2] . '</span>';
return $css_string_san;
}
function oblanguage_callback($matches) {
@ -907,12 +910,12 @@ function bb_imgoptions($match) {
$x = preg_match("/style='(.*?)'/ism", $attributes, $matches);
if ($x) {
$style = bb_sanitize_style($matches[1],true);
$style = bb_sanitize_style($matches[1]);
}
$x = preg_match("/style=\&quot\;(.*?)\&quot\;/ism", $attributes, $matches);
if ($x) {
$style = bb_sanitize_style($matches[1],true);
$style = bb_sanitize_style($matches[1]);
}
// legacy img options
@ -971,7 +974,6 @@ function bb_code_preunprotect($s) {
}
function bb_code_protect($s) {
return 'b64.^9e%.' . base64_encode($s) . '.b64.$9e%';
}

1
util/db_update.php → util/db_update Normal file → Executable file
View file

@ -1,3 +1,4 @@
#!/usr/bin/env php
<?php

40
util/maintenance Executable file
View file

@ -0,0 +1,40 @@
#!/bin/bash
# enable, disable or check the maintenance mode.
# If enabled, web access and execution of background tasks are blocked.
# Interaction with the server is only possible through foreground scripts
# We look for the existence of two files: maintenance_lock and cache/maintenance_lock
# and if either exist the system is locked. We attempt to create and remove both of these.
# One or the other _may_ fail due to permissions or ownership issues but the other will
# usually succeed.
if [ $# -ne 0 ]; then
action=$1
else
if [ -f maintenance_lock -o -f cache/maintenance_lock ]; then
echo "Maintenance mode is enabled"
else
echo "Maintenance mode is disabled"
fi
echo Usage: $0 'on|off'
exit
fi
if [ $1 == 'on' ]; then
touch maintenance_lock > /dev/null 2>&1
touch cache/maintenance_lock > /dev/null 2>&1
if [ -f maintenance_lock -o -f cache/maintenance_lock ]; then
echo "Maintenance mode is enabled"
else
echo "Failed: Maintenance mode is disabled"
fi
fi
if [ $1 == 'off' ]; then
rm maintenance_lock > /dev/null 2>&1
rm cache/maintenance_lock > /dev/null 2>&1
if [ -f maintenance_lock -o -f cache/maintenance_lock ]; then
echo "Failed: Maintenance mode is enabled"
else
echo "Maintenance mode is disabled"
fi
fi

View file

@ -24,7 +24,20 @@
{{if ! $zcard}}
<div class="fn p-name">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div>
{{if $reddress}}<div class="reddress">{{$profile.reddress}}</div>{{/if}}
{{if $reddress}}
<div><span id="profile-reddress" class="reddress">{{$profile.reddress}}</span>
<i class="fa fa-copy fakelink" style="margin-left:1em;" title="{{$copyto}}" onclick="copyReddress(); return false;"></i></div>
<script>function copyReddress() {
$('#profile-reddress').attr("contenteditable", true)
.select()
.on("focus", function() {
document.execCommand('selectAll', false, null)
}).focus()
document.execCommand("Copy");
$('#profile-reddress').removeAttr("contenteditable");
alert("{{$copied}}");
}</script>
{{/if}}
{{/if}}
{{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
{{if $active}}