...
 
Commits (12)
  • Danial Behzadi's avatar
    Update INSTALL · 16e7b5af
    Danial Behzadi authored
    Step 4 of `Getting it up and running` is not applicable in newer versions.
    16e7b5af
  • Florian Schmaus's avatar
    Fix PHP incompatibilities in XMPPHP · e6150323
    Florian Schmaus authored
    This fixes the following to errors in XMPPHP:
    
    Stack trace:
    0 [internal function]: XMPPHP_XMLStream->endXML(Resource id 150, 'STREAM:FEATURES')
    1 /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php(420): xml_parse(Resource id 150, '<?xml version='...', false)
    2 /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php(471): XMPPHP_XMLStream->__process()
    3 /var/vhosts/example.org/plugins/Xmpp/lib/xmppmanager.php(165): XMPPHP_XMLStream->processUntil(Array)
    4 /var/vhosts/example.org/plugins/Xmpp/lib/xmppmanager.php(49): XmppManager->connect()
    5 /var/vhosts/example.org/lib/iomaster.php(248): XmppManager->start(Object(ImMaster))
    6 /var/vhosts/example.org/lib/iomaster.php(111): IoMaster->start()
    7 /var/vhosts/example.org/scripts/imdaemon.php(58): IoMaster->service()
    8 /var/vhosts/example.org/lib/spawningdaemon.php(189): ImDaemon->runThread()
     in /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php on line 567
    PHP Fatal error:  Uncaught Error: Function name must be a string in /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php:567
    
    PHP Fatal error:  Uncaught Error: Call to undefined function split() in /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php:266
    Stack trace:
    0 /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMPP.php(129): XMPPHP_XMLStream->addXPathHandler('{http://etherx....', 'features_handle...')
    1 /var/vhosts/example.org/plugins/Xmpp/lib/xmppmanager.php(145): XMPPHP_XMPP->__construct('geekplace.eu', 5222, 'gnusocial', 'U^k&l5fV53duGy', 'gnusocial', 'geekplace.eu', false, NULL)
    2 /var/vhosts/example.org/plugins/Xmpp/lib/xmppmanager.php(49): XmppManager->connect()
    3 /var/vhosts/example.org/lib/iomaster.php(248): XmppManager->start(Object(ImMaster))
    4 /var/vhosts/example.org/lib/iomaster.php(111): IoMaster->start()
    5 /var/vhosts/example.org/scripts/imdaemon.php(58): IoMaster->service()
    6 /var/vhosts/example.org/lib/spawningdaemon.php(189): ImDaemon->runThread()
    7 /var/vhosts/example.org/lib/spawningdaemon.php(118): SpawningDaemon->initAndRunChild(1 in /var/vhosts/example.org/plugins/Xmpp/extlib/XMPPHP/XMLStream.php on line 266
    e6150323
  • mmn's avatar
    Merge branch 'patch-1' into 'master' · 34bd4e64
    mmn authored
    Update INSTALL
    
    See merge request !150
    34bd4e64
  • mmn's avatar
    Merge branch 'xmpphp-fix' into 'master' · 50f9f23f
    mmn authored
    Fix PHP incompatibilities in XMPPHP
    
    See merge request !152
    50f9f23f
  • Sebastian's avatar
    Fixed code so that GNU social can receive Mastodon boosts (from GNU social... · a6e33bdd
    Sebastian authored
    Fixed code so that GNU social can receive Mastodon boosts (from GNU social nightly commit: c741d1a5)
    a6e33bdd
  • nee's avatar
    Don't write the config file when --skip-config flag is given to the installer. · fdd3d630
    nee authored
    * scripts/installer_cli.php: Read the arguments list before checking
      if the config file is writeable.
    fdd3d630
  • nee's avatar
  • nee's avatar
    allow the cmd installer to load the config file from '/etc/gnusocial/config.d/'.$_server.'.php' · 0b9a2fdf
    nee authored
    using the commandline argument as $_server (passed through lib/common.php to lib/gnusocial.php)
    0b9a2fdf
  • mmn's avatar
    Merge branch 'master' into 'master' · 69bb8155
    mmn authored
    Allow GNU social master code to receive Mastodon boosts
    
    See merge request !153
    69bb8155
  • mmn's avatar
    Merge branch 'cli-install' into 'master' · a1ea3351
    mmn authored
    Don't write the config file when --skip-config flag is given to the installer.
    
    See merge request !155
    a1ea3351
  • mmn's avatar
    Merge branch 'cache-html-sanitizer' into 'master' · 67a9c041
    mmn authored
    set the html sanitizer cache directory to ['cache']['dir'] from the config file;
    
    See merge request !156
    67a9c041
  • mmn's avatar
    ec98fd0c
......@@ -774,6 +774,13 @@ high: if you need high performance, or if you're seeing bad
performance, set this to true. It will turn off some high-intensity code from
the site.
cache
-----
dir: A string path to a writable directory that will be used as temporary cache
for some functions (currently just the HtmlSanitizer).
If it is not set, the GNU social installation directory will be used.
oldschool
---------
......
......@@ -124,17 +124,7 @@ especially if you've previously installed PHP/MariaDB packages.
that user's default group instead. As a last resort, you can create
a new group like "gnusocial" and add the Web server's user to the group.
4. You should also take this moment to make your 'avatar' and 'file' sub-
directories writeable by the Web server. The _insecure_ way to do
this is:
chmod a+w /var/www/gnusocial/avatar
chmod a+w /var/www/gnusocial/file
You can also make the avatar, and file directories just writable by
the Web server group, as noted above.
5. Create a database to hold your site data. Something like this
4. Create a database to hold your site data. Something like this
should work (you will be prompted for your database password):
mysqladmin -u "root" -p create social
......@@ -147,7 +137,7 @@ especially if you've previously installed PHP/MariaDB packages.
a tool like phpMyAdmin to create a database. Check your hosting
service's documentation for how to create a new MariaDB database.)
6. Create a new database account that GNU Social will use to access the
5. Create a new database account that GNU Social will use to access the
database. If you have shell access, this will probably work from the
MariaDB shell:
......@@ -159,7 +149,7 @@ especially if you've previously installed PHP/MariaDB packages.
to your preferred new database username and password. You may want to
test logging in to MariaDB as this new user.
7. In a browser, navigate to the GNU Social install script; something like:
6. In a browser, navigate to the GNU Social install script; something like:
https://social.example.net/install.php
......@@ -167,7 +157,7 @@ especially if you've previously installed PHP/MariaDB packages.
install program will configure your site and install the initial,
almost-empty database.
8. You should now be able to navigate to your social site's main directory
7. You should now be able to navigate to your social site's main directory
and see the "Public Timeline", which will probably be empty. You can
now register new user, post some notices, edit your profile, etc.
......
......@@ -85,7 +85,7 @@ abstract class Installer
$pass = true;
$config = INSTALLDIR.'/config.php';
if (file_exists($config)) {
if (!$this->skipConfig && file_exists($config)) {
if (!is_writable($config) || filesize($config) > 0) {
if (filesize($config) == 0) {
$this->warning('Config file "config.php" already exists and is empty, but is not writable.');
......@@ -126,14 +126,16 @@ abstract class Installer
}
// @fixme this check seems to be insufficient with Windows ACLs
if (!is_writable(INSTALLDIR)) {
if (!$this->skipConfig && !is_writable(INSTALLDIR)) {
$this->warning(sprintf('Cannot write config file to: <code>%s</code></p>', INSTALLDIR),
sprintf('On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR));
$pass = false;
}
// Check the subdirs used for file uploads
$fileSubdirs = array('avatar', 'file');
// TODO get another flag for this --skipFileSubdirCreation
if (!$this->skipConfig) {
$fileSubdirs = array($this->avatarDir, $this->fileDir);
foreach ($fileSubdirs as $fileSubdir) {
$fileFullPath = INSTALLDIR."/$fileSubdir";
if (!file_exists($fileFullPath)) {
......@@ -148,7 +150,7 @@ abstract class Installer
$pass = false;
}
}
}
return $pass;
}
......@@ -515,6 +517,9 @@ abstract class Installer
*/
function registerInitialUser()
{
// initalize hostname from install arguments, so it can be used to find
// the /etc config file from the commandline installer
$server = $this->server;
require_once INSTALLDIR . '/lib/common.php';
$data = array('nickname' => $this->adminNick,
......@@ -580,10 +585,10 @@ abstract class Installer
return false;
}
if (!$this->skipConfig) {
// Make sure we can write to the file twice
$oldUmask = umask(000);
if (!$this->skipConfig) {
$this->updateStatus("Writing config file...");
$res = $this->writeConf();
......@@ -616,12 +621,12 @@ abstract class Installer
$this->updateStatus("Can't write to config file.", true);
return false;
}
}
// Restore original umask
umask($oldUmask);
// Set permissions back to something decent
chmod(INSTALLDIR.'/config.php', 0644);
}
$scheme = $this->ssl === 'always' ? 'https' : 'http';
$link = "{$scheme}://{$this->server}/{$this->path}";
......
......@@ -610,6 +610,10 @@ function common_purify($html, array $args=array())
$cfg->set('URI.Base', $args['URI.Base']); // if null this is like unsetting it I presume
$cfg->set('URI.MakeAbsolute', !is_null($args['URI.Base'])); // if we have a URI base, convert relative URLs to absolute ones.
}
if (common_config('cache', 'dir')) {
$cfg->set('Cache.SerializerPath', common_config('cache', 'dir'));
}
// if you don't want to use the default cache dir for htmlpurifier, set it specifically as $config['htmlpurifier']['Cache.SerializerPath'] = '/tmp'; or something.
foreach (common_config('htmlpurifier') as $key=>$val) {
$cfg->set($key, $val);
}
......
......@@ -47,10 +47,10 @@ class CliInstaller extends Installer
*/
function main()
{
if ($this->prepare()) {
if (!$this->checkPrereqs()) {
return false;
}
if ($this->prepare()) {
return $this->handle();
} else {
$this->showHelp();
......