Merge branch 'ssleverything' into testing

This commit is contained in:
Evan Prodromou 2010-02-13 12:39:15 -05:00
commit 269b4711eb
7 changed files with 93 additions and 14 deletions

19
README
View File

@ -1192,6 +1192,8 @@ server: If set, defines another server where avatars are stored in the
typically only make 2 connections to a single server at a
time <http://ur1.ca/6ih>, so this can parallelize the job.
Defaults to null.
ssl: Whether to access avatars using HTTPS. Defaults to null, meaning
to guess based on site-wide SSL settings.
public
------
@ -1221,6 +1223,19 @@ path: Path part of theme URLs, before the theme name. Relative to the
(using version numbers as the path) to make sure that all files are
reloaded by caching clients or proxies. Defaults to null,
which means to use the site path + '/theme'.
ssl: Whether to use SSL for theme elements. Default is null, which means
guess based on site SSL settings.
javascript
----------
server: You can speed up page loading by pointing the
theme file lookup to another server (virtual or real).
Defaults to NULL, meaning to use the site server.
path: Path part of Javascript URLs. Defaults to null,
which means to use the site path + '/js/'.
ssl: Whether to use SSL for JavaScript files. Default is null, which means
guess based on site SSL settings.
xmpp
----
@ -1447,6 +1462,8 @@ server: server name to use when creating URLs for uploaded files.
a virtual server here can speed up Web performance.
path: URL path, relative to the server, to find files. Defaults to
main path + '/file/'.
ssl: whether to use HTTPS for file URLs. Defaults to null, meaning to
guess based on other SSL settings.
filecommand: command to use for determining the type of a file. May be
skipped if fileinfo extension is installed. Defaults to
'/usr/bin/file'.
@ -1506,6 +1523,8 @@ dir: directory to write backgrounds too. Default is '/background/'
subdir of install dir.
path: path to backgrounds. Default is sub-path of install path; note
that you may need to change this if you change site-path too.
ssl: Whether or not to use HTTPS for background files. Defaults to
null, meaning to guess from site-wide SSL settings.
ping
----

View File

@ -82,9 +82,20 @@ class Avatar extends Memcached_DataObject
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('avatar', 'ssl');
return 'http://'.$server.$path.$filename;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('avatar', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
return $protocol.'://'.$server.$path.$filename;
}
function displayUrl()

View File

@ -155,9 +155,20 @@ class Design extends Memcached_DataObject
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('background', 'ssl');
return 'http://'.$server.$path.$filename;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('background', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
return $protocol.'://'.$server.$path.$filename;
}
function setDisposition($on, $off, $tile)

View File

@ -228,9 +228,20 @@ class File extends Memcached_DataObject
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('attachments', 'ssl');
return 'http://'.$server.$path.$filename;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('attachments', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
return $protocol.'://'.$server.$path.$filename;
}
}

View File

@ -111,11 +111,13 @@ $default =
'avatar' =>
array('server' => null,
'dir' => INSTALLDIR . '/avatar/',
'path' => $_path . '/avatar/'),
'path' => $_path . '/avatar/',
'ssl' => null),
'background' =>
array('server' => null,
'dir' => INSTALLDIR . '/background/',
'path' => $_path . '/background/'),
'path' => $_path . '/background/',
'ssl' => null),
'public' =>
array('localonly' => true,
'blacklist' => array(),
@ -123,10 +125,12 @@ $default =
'theme' =>
array('server' => null,
'dir' => null,
'path'=> null),
'path'=> null,
'ssl' => null),
'javascript' =>
array('server' => null,
'path'=> null),
'path'=> null,
'ssl' => null),
'throttle' =>
array('enabled' => false, // whether to throttle edits; false by default
'count' => 20, // number of allowed messages in timespan
@ -184,6 +188,7 @@ $default =
array('server' => null,
'dir' => INSTALLDIR . '/file/',
'path' => $_path . '/file/',
'ssl' => null,
'supported' => array('image/png',
'image/jpeg',
'image/gif',

View File

@ -376,9 +376,20 @@ class HTMLOutputter extends XMLOutputter
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('javascript', 'ssl');
$src = 'http://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('javascript', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
$src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
}
$this->element('script', array('type' => $type,

View File

@ -110,9 +110,20 @@ class Theme
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('theme', 'ssl');
$this->path = 'http://'.$server.$path.$name;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('theme', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
$this->path = $protocol . '://'.$server.$path.$name;
}
}