Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Haakon Meland Eriksen 2016-01-18 07:31:37 +01:00
commit dd3f69eaf3
19 changed files with 317 additions and 207 deletions

View File

@ -118,6 +118,51 @@ function check_sanity {
fi
}
function check_config {
print_info "config check..."
# backup is important and should be checked
if [ -n "$backup_device_name" ]
then
device_mounted=0
if fdisk -l | grep -i "$backup_device_name.*linux"
then
print_info "ok - filesystem of external device is linux"
if [ -n "$backup_device_pass" ]
then
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
if [ ! -d /media/hubzilla_backup ]
then
mkdir /media/hubzilla_backup
fi
if mount /dev/mapper/cryptobackup /media/hubzilla_backup
then
device_mounted=1
print_info "ok - could encrypt and mount external backup device"
umount /media/hubzilla_backup
else
print_warn "backup to external device will fail because encryption failed"
fi
cryptsetup luksClose cryptobackup
else
if mount $backup_device_name /media/hubzilla_backup
then
device_mounted=1
print_info "ok - could mount external backup device"
umount /media/hubzilla_backup
else
print_warn "backup to external device will fail because mount failed"
fi
fi
else
print_warn "backup to external device will fail because filesystem is either not linux or 'backup_device_name' is not correct in $configfile"
fi
if [ $device_mounted == 0 ]
then
die "backup device not ready"
fi
fi
}
function die {
echo "ERROR: $1" > /dev/null 1>&2
exit 1
@ -619,85 +664,94 @@ function configure_cron_daily {
# - update hubzilla core and addon
# - update and upgrade linux
# - reboot
cat > /var/www/$hubzilladaily <<END
#!/bin/sh
#
echo " "
echo "+++ \$(date) +++"
echo " "
# renew certificat if over 30 days old
echo "\$(date) - renew certificat if 30 days old..."
bash /var/www/letsencrypt/letsencrypt.sh --cron
#
# stop hubzilla
echo "\$(date) - stoping apaache and mysql..."
service apache2 stop
/etc/init.d/mysql stop # to avoid inconsistancies
#
# backup
echo "\$(date) - try to mount external device for backup..."
backup_device_name=$backup_device_name
backup_device_pass=$backup_device_pass
backup_mount_point=$backup_mount_point
device_mounted=0
if [ -n "$backup_device_name" ] && [ -n "$backup_device_pass" ]
then
if blkid | grep $backup_device_name
then
echo "decrypting backup device..."
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
if [ ! -d $backup_mount_point ]
then
mkdir $backup_mount_point
fi
echo "mounting backup device..."
if mount /dev/mapper/cryptobackup $backup_mount_point
then
device_mounted=1
echo "device $backup_device_name is now mounted. Starting backup..."
rsnapshot -c $snapshotconfig_external_device daily
rsnapshot -c $snapshotconfig_external_device weekly
rsnapshot -c $snapshotconfig_external_device monthly
echo "\$(date) - disk sizes..."
df -h
echo "\$(date) - db size..."
du -h $backup_mount_point | grep mysql/hubzilla
echo "unmounting backup device..."
umount $backup_mount_point
else
echo "failed to mount device $backup_device_name"
fi
echo "closing decrypted backup device..."
cryptsetup luksClose cryptobackup
echo "#!/bin/sh" > /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"+++ \$(date) +++\"" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - renew certificat if 30 days old...\"" >> /var/www/$hubzilladaily
echo "bash /var/www/letsencrypt/letsencrypt.sh --cron" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# stop hubzilla" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - stoping apaache and mysql...\"" >> /var/www/$hubzilladaily
echo "service apache2 stop" >> /var/www/$hubzilladaily
echo "/etc/init.d/mysql stop # to avoid inconsistancies" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# backup" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - try to mount external device for backup...\"" >> /var/www/$hubzilladaily
echo "backup_device_name=$backup_device_name" >> /var/www/$hubzilladaily
echo "backup_device_pass=$backup_device_pass" >> /var/www/$hubzilladaily
echo "backup_mount_point=$backup_mount_point" >> /var/www/$hubzilladaily
echo "device_mounted=0" >> /var/www/$hubzilladaily
echo "if [ -n \"$backup_device_name\" ]" >> /var/www/$hubzilladaily
echo "then" >> /var/www/$hubzilladaily
echo " if blkid | grep $backup_device_name" >> /var/www/$hubzilladaily
echo " then" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " echo \"decrypting backup device...\"" >> /var/www/$hubzilladaily
echo " echo "\"$backup_device_pass\"" | cryptsetup luksOpen $backup_device_name cryptobackup" >> /var/www/$hubzilladaily
fi
fi
if [ \$device_mounted == 0 ]
then
echo "device could not be mounted $backup_device_name. Using internal disk for backup..."
rsnapshot -c $snapshotconfig daily
rsnapshot -c $snapshotconfig weekly
rsnapshot -c $snapshotconfig monthly
fi
#
echo "\$(date) - db size..."
du -h /var/cache/rsnapshot/ | grep mysql/hubzilla
#
# update
echo "\$(date) - updating letsencrypt.sh..."
git -C /var/www/letsencrypt/ pull
echo "\$(date) - updating hubhilla core..."
git -C /var/www/html/ pull
echo "\$(date) - updating hubhilla addons..."
git -C /var/www/html/addon/ pull
chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver
chown root:www-data /var/www/html/.htaccess
chmod 0644 /var/www/html/.htaccess # www-data can read but not write it
echo "\$(date) - updating linux..."
apt-get -q -y update && apt-get -q -y dist-upgrade # update linux and upgrade
echo "\$(date) - Backup hubzilla and update linux finished. Rebooting..."
#
reboot
END
echo " if [ ! -d $backup_mount_point ]" >> /var/www/$hubzilladaily
echo " then" >> /var/www/$hubzilladaily
echo " mkdir $backup_mount_point" >> /var/www/$hubzilladaily
echo " fi" >> /var/www/$hubzilladaily
echo " echo \"mounting backup device...\"" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " if mount /dev/mapper/cryptobackup $backup_mount_point" >> /var/www/$hubzilladaily
else
echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$hubzilladaily
fi
echo " then" >> /var/www/$hubzilladaily
echo " device_mounted=1" >> /var/www/$hubzilladaily
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device daily" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device weekly" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device monthly" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily
echo " df -h" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo " du -h $backup_mount_point | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo " echo \"unmounting backup device...\"" >> /var/www/$hubzilladaily
echo " umount $backup_mount_point" >> /var/www/$hubzilladaily
echo " else" >> /var/www/$hubzilladaily
echo " echo \"failed to mount device $backup_device_name\"" >> /var/www/$hubzilladaily
echo " fi" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " echo \"closing decrypted backup device...\"" >> /var/www/$hubzilladaily
echo " cryptsetup luksClose cryptobackup" >> /var/www/$hubzilladaily
fi
echo " fi" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
echo "then" >> /var/www/$hubzilladaily
echo " echo \"device could not be mounted $backup_device_name. Using internal disk for backup...\"" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig daily" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig weekly" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig monthly" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# update" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating letsencrypt.sh...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating hubhilla addons...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/html/addon/ pull" >> /var/www/$hubzilladaily
echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily
echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily
echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily
echo "apt-get -q -y update && apt-get -q -y dist-upgrade # update linux and upgrade" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - Backup hubzilla and update linux finished. Rebooting...\"" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "reboot" >> /var/www/$hubzilladaily
if [ -z "`grep 'hubzilla-daily.sh' /etc/crontab`" ]
then
echo "30 05 * * * root /bin/bash /var/www/$hubzilladaily >> /var/www/html/hubzilla-daily.log 2>&1" >> /etc/crontab
@ -761,6 +815,7 @@ sslconf=/etc/apache2/sites-available/default-ssl.conf
#set -x # activate debugging from here
check_config
update_upgrade
install_apache
install_php

View File

@ -998,7 +998,7 @@ class App {
'$user_scalable' => $user_scalable,
'$baseurl' => $this->get_baseurl(),
'$local_channel' => local_channel(),
'$generator' => PLATFORM_NAME . ' ' . RED_VERSION,
'$generator' => get_platform_name() . ((get_project_version()) ? ' ' . get_project_version() : ''),
'$update_interval' => $interval,
'$icon' => head_get_icon(),
'$head_css' => head_get_css(),
@ -2338,3 +2338,41 @@ function check_cron_broken() {
set_config('system','lastpollcheck',datetime_convert());
return;
}
function get_platform_name() {
$a = get_app();
if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['platform_name'])
return $a->config['system']['platform_name'];
return PLATFORM_NAME;
}
function get_project_version() {
$a = get_app();
if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['hide_version'])
return '';
return RED_VERSION;
}
function get_update_version() {
$a = get_app();
if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['hide_version'])
return '';
return DB_UPDATE_VERSION;
}
function get_notify_icon() {
$a = get_app();
if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['email_notify_icon_url'])
return $a->config['system']['email_notify_icon_url'];
return z_root() . '/images/hz-white-32.png';
}
function get_site_icon() {
$a = get_app();
if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['site_icon_url'])
return $a->config['system']['site_icon_url'];
return z_root() . '/images/hz-32.png';
}

View File

@ -11,14 +11,14 @@ member configuration.
This document assumes you're an administrator.
[b]pconfig[/b]
[b]system > user_scalable[/b]
[b]system.user_scalable[/b]
Determine if the app is scalable on touch screens. Defaults to on, to
disable, set to zero - real zero, not just false.
[b]system > always_my_theme[/b]
[b]system.always_my_theme[/b]
Always use your own theme when viewing channels on the same hub. This
will break in some quite imaginative ways when viewing channels with
theme dependent Comanche.
[b]system > paranoia[/b]
[b]system.paranoia[/b]
Sets the security level of IP checking. If the IP address of a logged-in session changes
apply this level to determine if the account should be logged out as a security breach.
Options are:
@ -26,157 +26,165 @@ This document assumes you're an administrator.
1 - check 3 octets
2 - check 2 octets
3 - check for any difference at all
[b]system > prevent_tag_hijacking[/b]
[b]system.prevent_tag_hijacking[/b]
Prevent foreign networks hijacking hashtags in your posts and directing them at its own resources.
[b]system > blocked[/b]
[b]system.blocked[/b]
An array of xchans blocked by this channel. Technically, this is a
hidden config and does belong here, however, addons (notably
superblock) have made this available in the UI.
[b]system > default_cipher[/b]
[b]system.default_cipher[/b]
Set the default cipher used for E2EE items.
[b]system > network_page_default[/b]
[b]system.network_page_default[/b]
Set default params when viewing the network page. This should contain
the same querystring as manual filtering.
[b]system > display_friend_count[/b]
[b]system.display_friend_count[/b]
Set the number of connections to display in the connections profile
widget.
[b]system > taganyone[/b]
[b]system.taganyone[/b]
Requires the config of the same name to be enabled. Allow the @mention tagging
of anyone, whether you are connected or not. This doesn't scale.
[b]system > startpage[/b]
[b]system.startpage[/b]
Another of those technically hidden configs made available by addons.
Sets the default page to view when logging in. This is exposed to the
UI by the startpage addon.
[b]system > forcepublicuploads[/b]
[b]system.forcepublicuploads[/b]
Force uploaded photos to be public when uploaded as wall items. It
makes far more sense to just set your permissions properly in the first
place. Do that instead.
[b]system > do_not_track[/b]
[b]system.do_not_track[/b]
As the browser header. This will break many identity based features.
You should really just set permissions that make sense.
[b]Site config[/b]
[b]system > taganyone[/b]
[b]system.taganyone[/b]
Allow the @mention tagging of anyone whether you are connected or not.
[b]system > directorytags[/b]
[b]system.directorytags[/b]
Set the number of keyword tags displayed on the directory page.
[b]system > disable_dreport[/b]
[b]system.disable_dreport[/b]
If '1', don't store or link to delivery reports
[b]system > startpage[/b]
[b]system.startpage[/b]
Set the default page to be taken to after a login for all channels at
this website. Can be overwritten by user settings.
[b]system > projecthome[/b]
[b]system.projecthome[/b]
Set the project homepage as the homepage of your hub.
[b]system > default_permissions_role[/b]
[b]system.default_permissions_role[/b]
If set to a valid permissions role name, use that role for
the first channel created by a new account and don't ask for the "Channel Type" on
the channel creation form. Examples of valid names are: 'social', 'social_restricted', 'social_private', 'forum', 'forum_restricted' and 'forum_private'. Read more about permissions roles [zrl=[baseurl]/help/roles]here[/zrl].
[b]system > workflow_channel_next[/b]
[b]system.workflow_channel_next[/b]
The page to direct users to immediately after creating a channel.
[b]system > max_daily_registrations[/b]
[b]system.max_daily_registrations[/b]
Set the maximum number of new registrations allowed on any day.
Useful to prevent oversubscription after a bout of publicity
for the project.
[b]system > tos_url[/b]
[b]system.tos_url[/b]
Set an alternative link for the ToS location.
[b]system > block_public_search[/b]
[b]system.block_public_search[/b]
Similar to block_public, except only blocks public access to
search features. Useful for sites that want to be public, but
keep getting hammered by search engines.
[b]system > paranoia[/b]
[b]system.paranoia[/b]
As the pconfig, but on a site-wide basis. Can be overwritten
by member settings.
[b]system > openssl_conf_file[/b]
[b]system.openssl_conf_file[/b]
Specify a file containing OpenSSL configuration. Read the code first.
If you can't read the code, don't play with it.
[b]system > optimize_items[/b]
[b]system.optimize_items[/b]
Runs optimise_table during some tasks to keep your database nice and
defragmented. This comes at a performance cost while the operations
are running, but also keeps things a bit faster while it's not.
There also exist CLI utilities for performing this operation, which you
may prefer, especially if you're a large site.
[b]system > expire_limit
[b]system.expire_limit
Don't expire any more than this number of posts per channel per
expiration run to keep from exhausting memory. Default 5000.
[b]system > dlogfile[/b]
[b]system.dlogfile[/b]
Logfile to use for logging development errors. Exactly the same as
logger otherwise. This isn't magic, and requires your own logging
statements. Developer tool.
[b]system > authlog[/b]
[b]system.authlog[/b]
Logfile to use for logging auth errors. Used to plug in to server
side software such as fail2ban. Auth failures are still logged to
the main logs as well.
[b]system > hide_in_statistics[/b]
[b]system.hide_in_statistics[/b]
Tell the red statistics servers to completely hide this hub in hub lists.
[b]system > reserved_channels[/b]
[b]system.reserved_channels[/b]
Don't allow members to register channels with this comma separated
list of names (no spaces)
[b]system > auto_follow[/b]
[b]system.auto_follow[/b]
Make the first channel of an account auto-follow channels listed here - comma separated list of webbies (member@hub addresses).
[b]system > admin_email[/b]
[b]system.admin_email[/b]
Specifies the administrator's email for this site. This is initially set during install.
[b]system > cron_hour[/b]
[b]system.cron_hour[/b]
Specify an hour in which to run cron_daily. By default with no config, this will run at midnight UTC.
[b]system > minimum_feedcheck_minutes[/b]
[b]system.minimum_feedcheck_minutes[/b]
The minimum interval between polling RSS feeds. If this is lower than the cron interval, feeds will be polled with each cronjob. Defaults to 60 if not set. The site setting can also be over-ridden on a channel by channel basis by a service class setting aptly named 'minimum_feedcheck_minutes'.
[b]system > blacklisted_sites[/b]
[b]system.blacklisted_sites[/b]
An array of specific hubs to block from this hub completely.
[b]system > ignore_imagick[/b]
[b]system.ignore_imagick[/b]
Ignore imagick and use GD, even if imagick is installed on the server. Prevents some issues with PNG files in older versions of imagick.
[b]system > no_age_restriction[/b]
[b]system.no_age_restriction[/b]
Do not restrict registration to people over the age of 13. This carries legal responsibilities in many countries to require that age be provided and to block all personal information from minors, so please check your local laws before changing.
[b]system > override_poll_lockfile[/b]
[b]system.override_poll_lockfile[/b]
Ignore the lock file in the poller process to allow more than one process to run at a time.
[b]system > projecthome[/b]
[b]system.projecthome[/b]
Display the project page on your home page for logged out viewers.
[b]system > sellpage[/b]
[b]system.sellpage[/b]
A URL shown in the public sites list to sell your hub - display service classes, etc.
[b]randprofile > check[/b]
[b]randprofile.check[/b]
When requesting a random profile, check that it actually exists first
[b]randprofile > retry[/b]
[b]randprofile.retry[/b]
Number of times to retry getting a random profile
[b]system > photo_cache_time[/b]
[b]system.photo_cache_time[/b]
How long to cache photos, in seconds. Default is 86400 (1 day).
Longer time increases performance, but it also means it takes longer for changed permissions to apply.
[b]system > poco_rating_enable[/b]
[b]system.poco_rating_enable[/b]
Distributed reputation reporting and data collection may be disabled. If your site does not participate in distributed reputation you will also not be able to make use of the data from your connections on other sites. By default and in the absence of any setting it is enabled. Individual members can opt out by restricting who can see their connections or by not providing any reputation information for their connections.
[b]system > register_link[/b]
[b]system.register_link[/b]
path to direct to from the "register" link on the login form. On closed sites this will direct to 'pubsites'. For open sites it will normally redirect to 'register' but you may change this to a custom site page offering subscriptions or whatever.
[b]system > max_import_size[/b]
[b]system.max_import_size[/b]
If configured, the maximum length of an imported text message. This is normally left at 200Kbytes or more to accomodate Friendica private photos, which are embedded.
[b]system > tempdir[/b]
[b]system.tempdir[/b]
Place to store temporary files, default is defined in the PHP configuration
[b]system > uploaddir[/b]
[b]system.uploaddir[/b]
Location to upload files (default is system.tempdir)
[b]system > disable_discover_tab[/b]
[b]system.disable_discover_tab[/b]
This allows you to completely disable the ability to discover public content from external sites.
[b]system > sys_expire_days[/b]
[b]system.sys_expire_days[/b]
How many days to keep discovered public content from other sites
[b]system > openssl_encrypt[/b]
[b]system.openssl_encrypt[/b]
Use openssl encryption engine, default is false (uses mcrypt for AES encryption)
[b]system > max_tagged_forums[/b]
[b]system.max_tagged_forums[/b]
Spam prevention. Limits the number of tagged forums which are recognised in any post. Default is 2. Only the first 'n' tags will be delivered as forums, the others will not cause any delivery.
[b]system > openssl_conf_file[/b]
[b]system.openssl_conf_file[/b]
Needed in some Windows installations to locate the openssl configuration file on the system.
[b]system > hide_help[/b]
[b]system.hide_help[/b]
Don't display help documentation link in nav bar
[b]system > expire_delivery_reports[/b]
[b]system.expire_delivery_reports[/b]
Expiration in days for delivery reports - default 10
[b]system.platform_name[/b]
What to report as the platform name in webpages and statistics
[b]system.hide_version[/b]
If true, do not report the software version on webpages and tools.
[b]system.hidden_version_siteinfo[/b]
If true, do not report the software version on siteinfo pages (system.hide_version also hides the version on these pages, this setting *only* hides the version on siteinfo pages).
[b]system.email_notify_icon_url
URL of image (32x32) to display in email notifications (HTML bodies).
[b]Directory config[/b]
[b]Directory search defaults[/b]
[b]directory > safemode[/b]
[b]directory.safemode[/b]
0 or 1.
[b]directory > globaldir[/b]
[b]directory.globaldir[/b]
0 or 1. Default 0. If you visit the directory on a site you'll just see the members of that site by default. You have to go through an extra step to see the people in the rest of the network; and by doing so there's a clear delineation that these people *aren't* members of that site but of a larger network.
[b]directory > pubforums[/b]
[b]directory.pubforums[/b]
0 or 1. Public forums *should* be default 0.
[b]Directory server configuration (see [zrl=[baseurl]/help/directories]help/directories[/zrl])[/b]
[b]system > directory_server[/b]
[b]system > directory_primary[/b]
[b]system > directory_realm[/b]
[b]system > realm_token[/b]
[b]system > directory_mode[/b]
[b]system.directory_server[/b]
[b]system.directory_primary[/b]
[b]system.directory_realm[/b]
[b]system.realm_token[/b]
[b]system.directory_mode[/b]

View File

@ -8,7 +8,6 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]SAML 2.0 and OpenID Connect provider functionality[/li]
[li]Create bug tracker module[/li]
[li]Filing posts - provide a dropdown menu integrated with the 'post actions menu'[/li]
[li]integrate Mozilla Persona (possibly via plugin) https://github.com/mozilla/id-specs/blob/prod/browserid/index.md and become an idP[/li]
[li]translation plugins - moses or apertium[/li]
[li]plugins - provide 'disable' which is softer than 'uninstall' for those plugins which create additional DB tables[/li]
[li]Infinite scroll improvements (i.e. embedded page links) see http://scrollsample.appspot.com/items [/li]
@ -20,7 +19,6 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]Support comments on webpages[/li]
[li]implement oembed provider interface[/li]
[li]refactor the oembed client interface so that we can safely sandbox remote content[/li]
[li]Many modern social apps now have both a profile photo and a "cover photo". Add support for this. [/li]
[li]Write more webpage layouts[/li]
[li]Write more webpage widgets[/li]
[li]restricted access OAuth clients[/li]
@ -40,7 +38,6 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]App taxonomy[/li]
[li]Customisable App collection pages[/li]
[li]replace the tinymce visual editor and/or make the visual editor pluggable and responsive to different output formats. We probably want library/bbedit for bbcode. This needs a fair bit of work to catch up with our &quot;enhanced bbcode&quot;, but start with images, links, bold and highlight and work from there.[/li]
[li]Photos module - turn photos into normal conversations and fix tagging[/li]
[li]Create mobile clients for the top platforms - which involves extending the API so that we can do stuff far beyond the current crop of Twitter/Statusnet clients. Ditto for mobile themes. We can probably use something like the Friendica Android app as a base to start from.[/li]
[li](in progress Habeas Codice) Implement owned and exchangeable &quot;things&quot;.[/li]
[li]Family Account creation - using service classes (an account holder can create a certain number of sub-accounts which are all tied to their subscription - if the subscription lapses they all go away).[/li]

View File

@ -2106,10 +2106,10 @@ require_once('include/api_auth.php');
'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl,
'shorturllength' => '30',
'hubzilla' => array(
'PLATFORM_NAME' => PLATFORM_NAME,
'RED_VERSION' => RED_VERSION,
'PLATFORM_NAME' => get_platform_name(),
'RED_VERSION' => get_project_version(),
'ZOT_REVISION' => ZOT_REVISION,
'DB_UPDATE_VERSION' => DB_UPDATE_VERSION
'DB_UPDATE_VERSION' => get_update_version()
)
));
@ -2142,12 +2142,12 @@ require_once('include/api_auth.php');
if($type === 'xml') {
header("Content-type: application/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<version>' . RED_VERSION . '</version>' . "\r\n";
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<version>' . get_project_version() . '</version>' . "\r\n";
killme();
}
elseif($type === 'json') {
header("Content-type: application/json");
echo '"' . RED_VERSION . '"';
echo '"' . get_project_version() . '"';
killme();
}
}

View File

@ -529,6 +529,7 @@ function notification($params) {
$tpl = get_markup_template('email_notify_html.tpl');
$email_html_body = replace_macros($tpl,array(
'$banner' => $datarray['banner'],
'$notify_icon' => get_notify_icon(),
'$product' => $datarray['product'],
'$preamble' => $datarray['preamble'],
'$sitename' => $datarray['sitename'],

View File

@ -67,7 +67,7 @@ function ical_wrapper($ev) {
$o .= "BEGIN:VCALENDAR";
$o .= "\r\nVERSION:2.0";
$o .= "\r\nMETHOD:PUBLISH";
$o .= "\r\nPRODID:-//" . get_config('system','sitename') . "//" . PLATFORM_NAME . "//" . strtoupper(get_app()->language). "\r\n";
$o .= "\r\nPRODID:-//" . get_config('system','sitename') . "//" . get_platform_name() . "//" . strtoupper(get_app()->language). "\r\n";
if(array_key_exists('start', $ev))
$o .= format_event_ical($ev);
else {

View File

@ -482,6 +482,8 @@ function identity_basic_export($channel_id, $items = false) {
$ret = array();
// use constants here as otherwise we will have no idea if we can import from a site
// with a non-standard platform and version.
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION);
$r = q("select * from channel where channel_id = %d limit 1",

View File

@ -604,8 +604,8 @@ function get_feed_for($channel, $observer_hash, $params) {
$atom = '';
$atom .= replace_macros($feed_template, array(
'$version' => xmlify(RED_VERSION),
'$red' => xmlify(PLATFORM_NAME),
'$version' => xmlify(get_project_version()),
'$red' => xmlify(get_platform_name()),
'$feed_id' => xmlify($channel['xchan_url']),
'$feed_title' => xmlify($channel['channel_name']),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now' , ATOM_TIME)) ,

View File

@ -182,7 +182,7 @@ function t($s, $ctx = '') {
function translate_projectname($s) {
return str_replace(array('$projectname','$Projectname'),array(PLATFORM_NAME,ucfirst(PLATFORM_NAME)),$s);
return str_replace(array('$projectname','$Projectname'),array(get_platform_name(),ucfirst(get_platform_name())),$s);
}

View File

@ -1619,18 +1619,19 @@ function format_and_send_email($sender,$xchan,$item) {
// load the template for private message notifications
$tpl = get_markup_template('email_notify_html.tpl');
$email_html_body = replace_macros($tpl,array(
'$banner' => $banner,
'$product' => $product,
'$preamble' => '',
'$sitename' => $sitename,
'$siteurl' => $siteurl,
'$banner' => $banner,
'$notify_icon' => get_notify_icon(),
'$product' => $product,
'$preamble' => '',
'$sitename' => $sitename,
'$siteurl' => $siteurl,
'$source_name' => $sender['xchan_name'],
'$source_link' => $sender['xchan_url'],
'$source_photo' => $sender['xchan_photo_m'],
'$username' => $xchan['xchan_name'],
'$username' => $xchan['xchan_name'],
'$hsitelink' => $datarray['hsitelink'],
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $thanks,
'$thanks' => $thanks,
'$site_admin' => $site_admin,
'$title' => $title,
'$htmlversion' => $htmlversion,
@ -1639,20 +1640,20 @@ function format_and_send_email($sender,$xchan,$item) {
// load the template for private message notifications
$tpl = get_markup_template('email_notify_text.tpl');
$email_text_body = replace_macros($tpl, array(
'$banner' => $banner,
'$product' => $product,
'$preamble' => '',
'$sitename' => $sitename,
'$siteurl' => $siteurl,
'$banner' => $banner,
'$product' => $product,
'$preamble' => '',
'$sitename' => $sitename,
'$siteurl' => $siteurl,
'$source_name' => $sender['xchan_name'],
'$source_link' => $sender['xchan_url'],
'$source_photo' => $sender['xchan_photo_m'],
'$username' => $xchan['xchan_name'],
'$hsitelink' => $datarray['hsitelink'],
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $thanks,
'$username' => $xchan['xchan_name'],
'$hsitelink' => $datarray['hsitelink'],
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $thanks,
'$site_admin' => $site_admin,
'$title' => $title,
'$title' => $title,
'$textversion' => $textversion
));
@ -1666,13 +1667,13 @@ function format_and_send_email($sender,$xchan,$item) {
// use the EmailNotification library to send the message
enotify::send(array(
'fromName' => $product,
'fromEmail' => $sender_email,
'replyTo' => $sender_email,
'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']),
'messageSubject' => (($title) ? $title : t('No Subject')),
'htmlVersion' => $email_html_body,
'textVersion' => $email_text_body,
'fromName' => $product,
'fromEmail' => $sender_email,
'replyTo' => $sender_email,
'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']),
'messageSubject' => (($title) ? $title : t('No Subject')),
'htmlVersion' => $email_html_body,
'textVersion' => $email_text_body,
'additionalMailHeader' => '',
));
@ -1767,16 +1768,13 @@ function get_site_info() {
$site_info = get_config('system','info');
$site_name = get_config('system','sitename');
if(! get_config('system','hidden_version_siteinfo')) {
$version = RED_VERSION;
$version = get_project_version();
$tag = get_std_version();
if(@is_dir('.git') && function_exists('shell_exec')) {
$commit = trim( @shell_exec('git log -1 --format="%h"'));
// if(! get_config('system','hidden_tag_siteinfo'))
// $tag = trim( @shell_exec('git describe --tags --abbrev=0'));
// else
// $tag = '';
}
if(! isset($commit) || strlen($commit) > 16)
$commit = '';
}
@ -1820,7 +1818,7 @@ function get_site_info() {
'locked_features' => $locked_features,
'admin' => $admin,
'site_name' => (($site_name) ? $site_name : ''),
'platform' => PLATFORM_NAME,
'platform' => get_platform_name(),
'dbdriver' => $db->getdriver(),
'lastpoll' => get_config('system','lastpoll'),
'info' => (($site_info) ? $site_info : ''),

View File

@ -18,20 +18,13 @@ function authenticate_success($user_record, $login_initial = false, $interactive
$_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
$lastlog_updated = false;
if(x($user_record, 'account_id')) {
$a->account = $user_record;
$_SESSION['account_id'] = $user_record['account_id'];
$_SESSION['authenticated'] = 1;
if($login_initial || $update_lastlog) {
q("update account set account_lastlog = '%s' where account_id = %d",
dbesc(datetime_convert()),
intval($_SESSION['account_id'])
);
$a->account['account_lastlog'] = datetime_convert();
call_hooks('logged_in', $a->account);
}
$uid_to_load = (((x($_SESSION,'uid')) && (intval($_SESSION['uid'])))
? intval($_SESSION['uid'])
@ -42,9 +35,19 @@ function authenticate_success($user_record, $login_initial = false, $interactive
change_channel($uid_to_load);
}
if($login_initial || $update_lastlog) {
q("update account set account_lastlog = '%s' where account_id = %d",
dbesc(datetime_convert()),
intval($_SESSION['account_id'])
);
$a->account['account_lastlog'] = datetime_convert();
$lastlog_updated = true;
call_hooks('logged_in', $a->account);
}
}
if($login_initial) {
if(($login_initial) && (! $lastlog_updated)) {
call_hooks('logged_in', $user_record);

View File

@ -3828,7 +3828,7 @@ function zotinfo($arr) {
$ret['site']['channels'] = channel_total();
$ret['site']['version'] = PLATFORM_NAME . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
$ret['site']['version'] = get_platform_name() . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
$ret['site']['admin'] = get_config('system','admin_email');
@ -3848,7 +3848,7 @@ function zotinfo($arr) {
$ret['site']['sellpage'] = get_config('system','sellpage');
$ret['site']['location'] = get_config('system','site_location');
$ret['site']['realm'] = get_directory_realm();
$ret['site']['project'] = PLATFORM_NAME;
$ret['site']['project'] = get_platform_name();
}

View File

@ -11,6 +11,10 @@
* bootstrap the application
*/
require_once('boot.php');
if(file_exists('.htsite.php'))
include('.htsite.php');
// our global App object
$a = new App;

View File

@ -157,7 +157,7 @@ function help_content(&$a) {
$path = trim(substr($dirname,4),'/');
$o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_',' ',notags($fname))) . '</a><br />' .
str_replace('$Projectname',PLATFORM_NAME,substr($rr['text'],0,200)) . '...<br /><br /></li>';
str_replace('$Projectname',get_platform_name(),substr($rr['text'],0,200)) . '...<br /><br /></li>';
}
$o .= '</ul>';
@ -229,6 +229,8 @@ function help_content(&$a) {
if($doctype === 'bbcode') {
require_once('include/bbcode.php');
$content = bbcode($text);
// bbcode retargets external content to new windows. This content is internal.
$content = str_replace(' target="_blank"','',$content);
}
$content = preg_replace_callback("/#include (.*?)\;/ism", 'preg_callback_help_include', $content);
@ -248,7 +250,9 @@ function preg_callback_help_include($matches) {
if(preg_match('/\.bb$/', $matches[1]) || preg_match('/\.txt$/', $matches[1])) {
require_once('include/bbcode.php');
$include = bbcode($include);
} elseif(preg_match('/\.md$/', $matches[1])) {
$include = str_replace(' target="_blank"','',$include);
}
elseif(preg_match('/\.md$/', $matches[1])) {
require_once('library/markdown.php');
$include = Markdown($include);
}

View File

@ -113,7 +113,7 @@ function linkinfo_content(&$a) {
// If this is a Red site, use zrl rather than url so they get zids sent to them by default
if( x($siteinfo,'generator') && (strpos($siteinfo['generator'],PLATFORM_NAME . ' ') === 0))
if( x($siteinfo,'generator') && (strpos($siteinfo['generator'], get_platform_name() . ' ') === 0))
$template = str_replace('url','zrl',$template);
if($siteinfo["title"] == "") {

View File

@ -12,7 +12,7 @@ function siteinfo_init(&$a) {
function siteinfo_content(&$a) {
if(! get_config('system','hidden_version_siteinfo')) {
$version = sprintf( t('Version %s'), RED_VERSION );
$version = sprintf( t('Version %s'), get_project_version());
if(@is_dir('.git') && function_exists('shell_exec')) {
$commit = @shell_exec('git log -1 --format="%h"');
$tag = get_std_version(); // @shell_exec('git describe --tags --abbrev=0');

View File

@ -7,7 +7,7 @@
<body>
<table style="border:1px solid #ccc; background-color: #FFFFFF; color: #000000;">
<tbody>
<tr><td colspan="2" style="background:#43488A; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='{{$siteurl}}/images/hz-white-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div><div style="clear: both;"></div></td></tr>
<tr><td colspan="2" style="background:#43488A; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src="{{$notify_icon}}"><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div><div style="clear: both;"></div></td></tr>
<tr><td style="padding-top:22px;" colspan="2">{{$preamble}}</td></tr>

View File

@ -4,23 +4,23 @@
<Subject>{{$base}}</Subject>
<Property
type="http://www.oexchange.org/spec/0.8/prop/vendor">Friendika</Property>
type="http://www.oexchange.org/spec/0.8/prop/vendor">Zotlabs</Property>
<Property
type="http://www.oexchange.org/spec/0.8/prop/title">Friendika Social Network</Property>
type="http://www.oexchange.org/spec/0.8/prop/title">Hubzilla</Property>
<Property
type="http://www.oexchange.org/spec/0.8/prop/name">Friendika</Property>
type="http://www.oexchange.org/spec/0.8/prop/name">Hubzilla</Property>
<Property
type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Friendika</Property>
type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Hubzilla</Property>
<Link
rel="icon"
href="{{$base}}/images/friendika-16.png"
href="{{$base}}/images/hz-16.png"
type="image/png"
/>
<Link
rel="icon32"
href="{{$base}}/images/friendika-32.png"
href="{{$base}}/images/hz-32.png"
type="image/png"
/>