Delete all of the old wacky DIY php rendering

This commit is contained in:
Thomas Karpiniec 2016-06-18 11:47:34 +10:00
parent b97d07d845
commit 840d5f58e7
20 changed files with 0 additions and 1374 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
docs/_build/
rendered/
venv/
*~
.*.swp

View File

@ -1,34 +0,0 @@
<?php
// Title of manual, to appear in header and page title
$config["title"] = "The Unofficial Admin Manual";
// Directory (relative to render.php) where html pages are located
$config["html_dir"] = "html/admin";
// Directory (relative to render.php) where static resources are located
$config["resources_dir"] = "resources/admin";
// Name of subdirectory in the output where used resources are placed
$config["resources_output_dir"] = "res_admin";
// Where rendered output is placed
$config["output_dir"] = "rendered/admin";
// Page listing
// These must be specified in the order you want them to appear
// id - If "foo" will look for "foo.html"
// title - Used in the table of contents and {PAGE_TITLE:foo} substitutions
$config["pages"] = array(
array("id" => "installing", "title" => "Installing GNU social"),
array("id" => "queue_daemons", "title" => "Using Queue Daemons"),
array("id" => "backup_restore", "title" => "Backing Up and Restoring"),
array("id" => "upgrading", "title" => "Upgrading Your Installation"),
array("id" => "protocol_overview", "title" => "Protocol Overview"),
array("id" => "contributing", "title" => "Contributing")
);
?>

View File

@ -1,32 +0,0 @@
<?php
// Title of manual, to appear in header and page title
$config["title"] = "The Unofficial User Manual";
// Directory (relative to render.php) where html pages are located
$config["html_dir"] = "html/user";
// Directory (relative to render.php) where static resources are located
$config["resources_dir"] = "resources/user";
// Name of subdirectory in the output where used resources are placed
$config["resources_output_dir"] = "res_user";
// Where rendered output is placed
$config["output_dir"] = "rendered/user";
// Page listing
// These must be specified in the order you want them to appear
// id - If "foo" will look for "foo.html"
// title - Used in the table of contents and {PAGE_TITLE:foo} substitutions
$config["pages"] = array(
array("id" => "what_is_gnu_social", "title" => "What is GNU social"),
array("id" => "getting_started", "title" => "Getting Started"),
array("id" => "exploring", "title" => "Exploring the Network"),
array("id" => "tags", "title" => "Hashtags and Groups")
);
?>

View File

@ -1,79 +0,0 @@
{HEADING:SECTION:backup_procedure:Backing Up}
<p>It is important to back up GNU social regularly. If you need to revert to an old backup you will lose any newer notices. Any follows that happened since then will result in mismatched information on your server and remote servers.</p>
<p>You should also back up immediately prior to any upgrade. This is especially important if you are following the <i>nightly</i> branch where serious bugs might slip through.</p>
<p>There are two parts to your GNU social installation and they most <i>both</i> be backed up at the same time.</p>
<ol>
<li>The files hosted by your webserver. This is a mixture of GNU social code and user data. This a directory probably located somewhere like <tt>/var/www/social</tt>.</li>
<li>The contents of the MariaDB/MySQL database.</li>
</ol>
{HEADING:SUBSECTION:backup_web_files:Web Files}
<p>You don't need to do anything fancy. Just make sure you have a copy of the folder. If you're using a commercial web hosting service there is probably a button you can press to download an archive of all your files. Note that this normally does <em>not</em> include your database.</p>
<p>If you have shell access on the server, assuming the GNU social folder is located at <tt>/var/www/social</tt>, you can make a compressed backup in your home directory like this:</p>
<p>
<tt>TIMESTAMP=$(date +%Y%m%d-%H%M)</tt><br />
<tt>cd /var/www</tt><br />
<tt>tar -Jcf "~/$TIMESTAMP-social-www.tar.xz" --exclude=.git social</tt>
</p>
<p>If you are serving files straight out of the git repository this will back up only the currently checked out copy, not the entire history. (Using a git repository this way is not recommended as you may cause chaos in your database if you accidentally check out the wrong thing.)</p>
{HEADING:SUBSECTION:backup_database:Database}
<p>There are many different tools and techniques for backing up MySQL databases. If you're using a commercial web hosting service there will probably be somewhere in the web interface where you can download a copy of the GNU social database.</p>
<p>If you have shell access the simplest way to create a backup is using the tool <i>mysqldump</i>.</p>
<p>
<tt>TIMESTAMP=$(date +%Y%m%d-%H%M)</tt><br />
<tt>mysqldump -u "database_username" -p "database_name" | xz -c - > "~/$TIMESTAMP-social.sql.xz"</tt>
</p>
<p>You will be prompted for a password. Type in the password for the MySQL user.</p>
{HEADING:SECTION:restore_procedure:Restoring from a Backup}
<ol>
<li>Stop the queue daemons if they're running.</li>
<li>Restore the web files.</li>
<li>Restore the database.</li>
<li>Restart the queue daemons.</li>
</ol>
<p>If you followed the examples above you might type the following:</p>
<pre>cd /var/www/social
# Stop the daemons
bash ./scripts/stopdaemons.sh
# Delete and restore the web files
rm -r *
cd ..
tar -Jxf ~/20160130-1200-social-www.tar.xz
# Recreate the database (using MySQL root account)
mysqladmin -u root -p drop social
mysqladmin -u root -p create social
mysql -u root -p social
# Inside mysql client
GRANT ALL on social.* TO 'social'@'localhost' IDENTIFIED BY 'the_old_password';
exit
# Restore the database as the GNU social MySQL user
xzcat ~/20160130-1200-social.sql.xz | mysql -u social -p social
# Restart the queue daemons
cd social
bash ./scripts/startdaemons.sh</pre>

View File

@ -1,11 +0,0 @@
{HEADING:SECTION:translations:Translations}
<p>For info on helping with translations, see the <a href="https://www.transifex.com/projects/p/gnu-social/">platform currently in use</a> for translations.</p.
Translations use the <a href="http://www.gnu.org/software/gettext/">gettext system</a>. If you for some reason do not wish to sign up to the Transifex service, you can review the files in the "locale/" sub-directory of GNU social. Each plugin also has its own translation files.
<p>To get your own site to use all the translated languages, and you are tracking the git repo, you will need to install at least 'gettext' on your system and then run:</p>
<p><tt>$ make translations</tt></p>

View File

@ -1,388 +0,0 @@
{HEADING:SECTION:prerequisites:Prerequisites}
{HEADING:SUBSECTION:choosing_branch:Selecting a branch}
<p>GNU social has three different branches of development offering a range of choices between stability and the latest features.
<dl>
<dt>1.2.x</dt>
<dd>This is the current stable release. The code has been tested for a while.</dd>
<dt>master</dt>
<dd><tt>master</tt> receives more frequent updates and is usually working well.</dd>
<dt>nightly</dt>
<dd><tt>nightly</tt> gets updated the most but is not always working.</dd>
</dl>
<p>When you download the source code in {LINK:up_and_running} you will need to know which branch you want to install. You can always move to a more unstable branch but going backwards is not guaranteed to work.</p>
<p>If you want to use <a href="https://git.gnu.io/h2p/Qvitter">Qvitter</a>&mdash;that's the plugin that makes GNU social look like Twitter&mdash;be aware that it is tested against GNU social <i>nightly</i>. If you are using a different branch and having problems with that plugin try upgrading to nightly.</p>
{HEADING:SUBSECTION:choosing_web_config:Web server configuration}
<p>You should use HTTPS to encrypt all communications with your GNU social instance. Until recently it cost money to get a trusted certificate but now the Let's Encrypt project enables you to <a href="https://letsencrypt.org/howitworks/">obtain a trusted certificate at no cost</a>.</p>
<p>If you are thinking about starting with HTTP and setting up encryption later, don't do that. You may have problems if you start with HTTP and later move to HTTPS.</p>
<p>If you want to use Qvitter be aware that it only supports installations that are installed directly on the domain. That is, the URL to access GNU social needs to be <tt>https://www.some.domain/</tt> and not <tt>https://www.some.domain/gnusocial/</tt>. It also requires you to have {LINK:fancy_urls} enabled. If you're using apache that means you need mod_rewrite and the ability to use <tt>.htaccess</tt> files.</p>
{HEADING:SUBSECTION:php_modules:PHP modules}
<p>The following software packages are <em>required</em> for this software to run correctly.</p>
<dl>
<dt>PHP 5.5+</dt>
<dd>For newer versions, some functions that are used may be disabled by default, such as the <tt>pcntl_*</tt> family. See the section on {LINK:queue_daemons} for more information.</dd>
<dt>MariaDB 5+</dt>
<dd>GNU Social uses, by default, a MariaDB server for data storage. Versions 5.x and 10.x have both reportedly worked well. It is also possible to run MySQL 5.5+.</dd>
<dt>Web server</dt>
<dd>Apache, lighttpd and nginx will all work. CGI mode is recommended and also some variant of 'suexec' (or a proper setup php-fpm pool)<br />NOTE: mod_rewrite or its equivalent is extremely useful.</dd>
</dl>
<p>Your PHP installation must include the following PHP extensions for a functional setup of GNU social:</p>
<dl>
<dt>openssl</dt> <dd>(compiled in for Debian, enabled manually in Arch Linux)</dd>
<dt>php5-curl</dt> <dd>Fetching files by HTTP.</dd>
<dt>php5-gd</dt> <dd>Image manipulation (scaling).</dd>
<dt>php5-gmp</dt> <dd>For Salmon signatures (part of OStatus).</dd>
<dt>php5-intl</dt> <dd>Internationalization support (transliteration et al).</dd>
<dt>php5-json</dt> <dd>For WebFinger lookups and more.</dd>
<dt>php5-mysqlnd</dt> <dd>The native driver for PHP5 MariaDB connections. If you use MySQL, 'php5-mysql' or 'php5-mysqli' may be enough.</dd>
</dl>
<p>The above package names are for Debian based systems. In the case of Arch Linux, PHP is compiled with support for most extensions but they require manual enabling in the relevant <tt>php.ini</tt> file (mostly <tt>php5-gmp</tt>).</p>
{HEADING:SUBSECTION:better_performance:Better performance}
<p>For some functionality, you will also need the following extensions:</p>
<dl>
<dt>opcache</dt>
<dd>Improves performance a <em>lot</em>. Included in PHP, must be enabled manually in <tt>php.ini</tt> for most distributions. Find and set at least: <tt>opcache.enable=1</tt></dd>
<dt>mailparse</dt>
<dd>Efficient parsing of email requires this extension. Submission by email or SMS-over-email uses this.</dd>
<dt>sphinx</dt>
<dd>A client for the sphinx server, an alternative to MySQL or Postgresql fulltext search. You will also need a Sphinx server to serve the search queries.</dd>
<dt>gettext</dt>
<dd>For multiple languages. Default on many PHP installs; will be emulated if not present.</dd>
<dt>exif</dt>
<dd>For thumbnails to be properly oriented.</dd>
</dl>
<p>You may also experience better performance from your site if you configure a PHP cache/accelerator. Most distributions come with "opcache" support. Enable it in your <tt>php.ini</tt> where it is documented together with its settings.</p>
{HEADING:SECTION:installation:Installation}
{HEADING:SUBSECTION:up_and_running:Getting it up and running}
<p>Installing the basic GNU Social web component is relatively easy, especially if you've previously installed PHP/MariaDB packages.</p>
<ol>
<li>
<p>The source code is distributed using a git repository <a href="https://git.gnu.io/gnu/gnu-social">on GNU's Gitlab server</a>. There are two ways to download it:</p>
<ul>
<li>Use <a href="https://git-scm.com/">git</a> on your own computer to clone the repository. Once it is on your computer it is easy to download incremental updates.<br /> or;</li>
<li>Download a zip or tarball from Gitlab's web interface. This way you won't need git but you will need to download the whole thing every time you update.</li>
</ul>
<p>If you want to use git, run the following command. It will download the whole repository and place it in a folder called <i>gnusocial</i>.</p>
<p><tt>git clone https://git.gnu.io/gnu/gnu-social.git gnusocial</tt></p>
<p>Then select the branch you wish to use.</p>
<p>
<tt>cd gnusocial</tt><br />
<tt>git checkout master</tt><br />
(or <tt>1.2.x</tt> or <tt>nightly</tt>)
</p>
<p>If you would like to download it directly instead, go to the <a href="https://git.gnu.io/gnu/gnu-social/tree/1.2.x">1.2.x</a>, <a href="https://git.gnu.io/gnu/gnu-social/tree/master">master</a> or <a href="https://git.gnu.io/gnu/gnu-social/tree/nightly">nightly</a> branch on the Gitlab web page. In the top-right corner there is a button to download a zip file containing that branch. If you press the drop-down arrow on the right you can access different types of archive.</p>
<img src="{RES:tree_download.png}" alt="Download button on gitlab" class="figure" />
<p>Unpack the tarball you downloaded on your Web server. Usually a command like this will work:</p>
<p><tt>tar zxf gnu-social-*.tar.gz</tt></p>
<p>...which will make a subdirectory in your current directory. (If you don't have shell access on your Web server, you may have to unpack the tarball on your local computer and FTP the files to the server.)</p>
</li>
<li>
<p>Whichever way you downloaded GNU social, move the files to a directory of your choosing in your Web root directory. Usually something like this will work:</p>
<p>
For a git repository:<br />
<tt>cd gnusocial</tt><br />
<tt>mkdir /var/www/gnusocial</tt><br />
<tt>cp -rv * /var/www/gnusocial</tt>
</p>
<p>
For a downloaded tarball:<br />
<tt>mv gnu-social-x.y.z /var/www/gnusocial</tt>
</p>
<p>This will often make your GNU Social instance available in the <tt>gnusocial</tt> path of your server, like <tt>http://example.net/gnusocial</tt>. "social" or "blog" might also be good path names. If you know how to configure virtual hosts on your web server, you can try setting up <tt>http://social.example.net/</tt> or the like.
<p>If you have "rewrite" support on your webserver, and you should, then please enable this in order to make full use of your site. This will enable {LINK:fancy_urls} support.</p>
</li>
<li>
<p>Make your target directory writeable by the Web server, please note however that <tta+w</tt> will give <em>all</em> users write access and securing the webserver is not within the scope of this document.</p>
<p><tt>chmod a+w /var/www/gnusocial/</tt></p>
<p>On some systems, this will work as a more secure alternative:</p>
<p>
<tt>chgrp www-data /var/www/gnusocial/</tt><br />
<tt>chmod g+w /var/www/gnusocial/</tt>
</p>
<p>If your Web server runs as another user besides <tt>www-data</tt>, try that user's default group instead. As a last resort, you can create a new group like <tt>gnusocial</tt> and add the web server's user to the group.</p>
</li>
<li>
<p>You should also take this moment to make your <tt>avatar</tt> and <tt>file</tt> sub-directories writeable by the Web server. The <em>insecure</em> way to do this is:
<p>
<tt>chmod a+w /var/www/gnusocial/avatar</tt><br />
<tt>chmod a+w /var/www/gnusocial/file</tt>
</p>
<p>You can also make the avatar, and file directories just writable by the web server group, as noted above.</p>
</li>
<li>
<p>Create a database to hold your site data. Something like this should work (you will be prompted for your database password):</p>
<p><tt>mysqladmin -u "root" -p create social</tt></p>
<p>Note that GNU social should have its own database; you should not share the database with another program. You can name it whatever you want, though.</p>
<p>(If you don't have shell access to your server, you may need to use a tool like phpMyAdmin to create a database. Check your hosting service's documentation for how to create a new MariaDB database.)</p>
</li>
<li>
<p>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:</p>
<p>
<tt>GRANT ALL on social.*</tt><br />
<tt>TO 'social'@'localhost'</tt><br />
<tt>IDENTIFIED BY 'agoodpassword';</tt>
</p>
<p>You should change the user identifier <tt>social</tt> and <tt>agoodpassword</tt> to your preferred new database username and password. You may want to test logging in to MariaDB as this new user.
</li>
<li>
<p>In a browser, navigate to the GNU Social install script; something like:</p>
<p><tt>https://social.example.net/install.php</tt></p>
<p>Enter the database connection information and your site name. The install program will configure your site and install the initial, almost-empty database.</p>
</li>
<li>
<p>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 users, post some notices, edit your profile, etc.</p>
</li>
</ol>
{HEADING:SUBSECTION:fancy_urls:Fancy URLs}
<p>By default, GNU Social will use URLs that include the main PHP program's name in them. For example, a user's home profile might be found at either of these URLS depending on the webserver's configuration and capabilities:</p>
<p>
<tt>https://social.example.net/index.php/fred</tt><br />
<tt>https://social.example.net/index.php?p=fred</tt>
</p>
<p>It's possible to configure the software to use fancy URLs so it looks like this instead:</p>
<p>
<tt>https://social.example.net/fred</tt>
</p>
<p>These "fancy URLs" are more readable and memorable for users. To use fancy URLs, you must either have Apache 2.x with <tt>.htaccess</tt> enabled and mod_rewrite enabled, <em>OR</em> know how to configure "url redirection" in your server (like lighttpd or nginx).</p>
<ol>
<li>
<p>See the instructions for each respective webserver software:</p>
<ul>
<li>For Apache, inspect the <tt>htaccess.sample</tt> file and save it as <tt>.htaccess</tt> after making any necessary modifications. Our sample file is well commented.</li>
<li>For lighttpd, inspect the <tt>lighttpd.conf.example</tt> file and apply the appropriate changes in your virtualhost configuration for lighttpd.</li>
<li>For nginx, inspect the <tt>nginx.conf.sample</tt> file and apply the appropriate changes.</li>
<li>For other webservers, we gladly accept contributions of server configuration examples.</li>
</ul>
</li>
<li>
<p>Assuming your webserver is properly configured and have its settings applied (remember to reload/restart it), you can add this to your GNU social's <tt>config.php</tt> file:</p>
<p><tt>$config['site']['fancy'] = true;</tt></p>
</li>
</ol>
<p>You should now be able to navigate to a "fancy" URL on your server, like:</p>
<p><tt>https://social.example.net/main/register</tt></p>
{HEADING:SUBSECTION:themes:Themes}
<p>As of right now, your ability change the theme is limited to CSS stylesheets and some image files; you can't change the HTML output, like adding or removing menu items, without the help of a plugin.</p>
<p>You can choose a theme using the <tt>$config['site']['theme']</tt> element in the <tt>config.php</tt> file. See below for details.</p>
<p>You can add your own theme by making a sub-directory of the 'theme' subdirectory with the name of your theme. Each theme can have the following files:</p>
<dl>
<dt>display.css</dt> <dd>a CSS2 file for "default" styling for all browsers.</a>
<dt>logo.png</dt> <dd>a logo image for the site.</dd>
<dt>default-avatar-profile.png</dt> <dd>a 96x96 pixel image to use as the avatar for users who don't upload their own.</dd>
<dt>default-avatar-stream.png</dt> <dd>Ditto, but 48x48. For streams of notices.</dd>
<dt>default-avatar-mini.png</dt> <dd>Ditto ditto, but 24x24. For subscriptions listing on profile pages.</dd>
</dl>
<p>You may want to start by copying the files from the default theme to your own directory.</p>
{HEADING:SUBSECTION:private:Private}
<p>A GNU social node can be configured as "private", which means it will not federate with other nodes in the network. It is not a recommended method of using GNU social and we cannot at the current state of development guarantee that there are no leaks (what a public network sees as features, private sites will likely see as bugs).</p>
<p>Private nodes are however an easy way to easily setup collaboration and image sharing within a workgroup or a smaller community where federation is not a desired feature. Also, it is possible to change this setting and instantly gain full federation features.</p>
<p>Access to file attachments can also be restricted to logged-in users only:</p>
<ol>
<li>
<p>Add a directory outside the web root where your file uploads will be stored. Use this command as an initial guideline to create it:</p>
<p><tt>mkdir /var/www/gnusocial-files</tt></p>
</li>
<li>
<p>Make the file uploads directory writeable by the web server. An insecure way to do this is (to do it properly, read up on UNIX file permissions and configure your webserver accordingly):</p>
<p><tt>chmod a+x /var/www/gnusocial-files</tt></p>
</li>
<li>
<p>Tell GNU social to use this directory for file uploads. Add a line like this to your <tt>config.php</tt>:</p>
<p><tt>$config['attachments']['dir'] = '/var/www/gnusocial-files';</tt></p>
</li>
</ol>
{HEADING:SECTION:extra_features:Extra features}
{HEADING:SUBSECTION:sphinx:Sphinx}
<p>To use a Sphinx server to search users and notices, you'll need to enable the SphinxSearch plugin. Add to your <tt>config.php</tt>:</p>
<p>
<tt>addPlugin('SphinxSearch');</tt><br />
<tt>$config['sphinx']['server'] = 'searchhost.local';</tt>
</p>
<p>You also need to install, compile and enable the sphinx pecl extension for php on the client side, which itself depends on the sphinx development files.</p>
<p>See <tt>plugins/SphinxSearch/README</tt> for more details and server setup.</p>
{HEADING:SUBSECTION:sms:SMS}
<p>StatusNet supports a cheap-and-dirty system for sending update messages to mobile phones and for receiving updates from the mobile. Instead of sending through the SMS network itself, which is costly and requires buy-in from the wireless carriers, it simply piggybacks on the email gateways that many carriers provide to their customers. So, SMS configuration is essentially email configuration.</p>
<p>Each user sends to a made-up email address, which they keep a secret. Incoming email that is "From" the user's SMS email address, and "To" the users' secret email address on the site's domain, will be converted to a notice and stored in the DB.</p>
<p>For this to work, there <em>must</em> be a domain or sub-domain for which all (or most) incoming email can pass through the incoming mail filter.</p>
<ol>
<li>
<p>Run the SQL script <tt>carrier.sql</tt> in your StatusNet database. This will usually work:</p>
<p><tt>mysql -u "statusnetuser" --password="statusnetpassword" statusnet &lt; db/carrier.sql</tt></p>
<p>This will populate your database with a list of wireless carriers that support email SMS gateways.</p>
</li>
<li>
<p>Make sure the maildaemon.php file is executable:</p>
<p><tt>chmod +x scripts/maildaemon.php</tt></p>
<p>Note that "daemon" is kind of a misnomer here; the script is more of a filter than a daemon.</p>
</li>
<li>
<p>Edit <tt>/etc/aliases</tt> on your mail server and add the following line:</p>
<p><tt>*: /path/to/statusnet/scripts/maildaemon.php</tt></p>
</li>
<li>
<p>Run whatever code you need to to update your aliases database. For many mail servers (Postfix, Exim, Sendmail), this should work:</p>
<p><tt>newaliases</tt></p>
<p>You may need to restart your mail server for the new database to take effect.</p>
</li>
<li>
<p>Set the following in your <tt>config.php</tt> file:</p>
<p><tt>$config['mail']['domain'] = 'yourdomain.example.net';</tt></p>
</li>
</ol>
{HEADING:SECTION:after_installation:After installation}
{HEADING:SUBSECTION:should_run_queue_daemons:Run queue daemons}
<p>By default GNU social tries to do regular work such as communicating with remote servers while it is handling HTTP requests for users. This is often insufficient. If possible you should run the <em>queue daemons</em>. Please refer to this section: {LINK:queue_daemons}.</p>
{HEADING:SUBSECTION:backups:Backups}
<p>There is no built-in system for doing backups in GNU social. You can make backups of a working system by backing up the database and the Web directory. To backup the database use <a href="https://mariadb.com/kb/en/mariadb/mysqldump/">mysqldump</a> and to backup the Web directory, try tar.
{HEADING:SUBSECTION:about_upgrading:Upgrading}
Upgrading is strongly recommended to stay up to date with security fixes
and new features. For instructions on how to upgrade GNU social code,
please refer to this section: {LINK:upgrading}.</p>

View File

@ -1,3 +0,0 @@
GNU social runs primarily on voodoo magic.
If anybody knows better please advise.

View File

@ -1,89 +0,0 @@
{HEADING:SECTION:queues_and_daemons:Queues and Daemons}
<p>Some activities that GNU social needs to do, like broadcast OStatus, SMS, XMPP messages and TwitterBridge operations, can be 'queued' and done by off-line bots instead.</p>
<p>Two mechanisms are available to achieve offline operations:</p>
<ul>
<li>New embedded OpportunisticQM plugin, which is enabled by default</li>
<li>Legacy queuedaemon script, which can be enabled via config file.</li>
</ul>
{HEADING:SUBSECTION:opportunisticqm:OpportunisticQM plugin}
<p>This plugin is enabled by default. It tries its best to do background jobs during regular HTTP requests, like API or HTML pages calls.</p>
<p>Since queueing system is enabled by default, notices to be broadcasted will be stored, by default, into DB (table <tt>queue_item</tt>).</p>
<p>Whenever it has time, OpportunisticQM will try to handle some of them.</p>
<p>This is a good solution whether you:</p>
<ul>
<li>have no access to command line (shared hosting)</li>
<li>do not want to deal with long-running PHP processes</li>
<li>run a low traffic GNU social instance</li>
</ul>
<p>In other case, you really should consider enabling the queuedaemon for performance reasons. Background daemons are necessary anyway if you wish to use the Instant Messaging features such as communicating via XMPP.</p>
{HEADING:SUBSECTION:queuedaemon:queuedaemon}
<p>If you want to use legacy queuedaemon, you must be able to run long-running offline processes, either on your main Web server or on another server you control. (Your other server will still need all the above prerequisites, with the exception of Apache.) Installing on a separate server is probably a good idea for high-volume sites.</p>
<ol>
<li>
<p>You'll need the "CLI" (command-line interface) version of PHP installed on whatever server you use.</p>
<p>Modern PHP versions in some operating systems have disabled functions related to forking, which is required for daemons to operate. To make this work, make sure that your php-cli config (<tt>/etc/php5/cli/php.ini</tt>) does NOT have these functions listed under 'disable_functions':</p>
<ul>
<li>pcntl_fork, pcntl_wait, pcntl_wifexited, pcntl_wexitstatus, pcntl_wifsignaled, pcntl_wtermsig
</ul>
<p>Other recommended settings for optimal performance are:</p>
<ul>
<li><tt>mysqli.allow_persistent = On</tt></li>
<li><tt>mysqli.reconnect = On</tt></li>
</ul>
</li>
<li>
<p>If you're using a separate server for queues, install GNU social somewhere on the server. You don't need to worry about the <tt>.htaccess</tt> file, but make sure that your <tt>config.php</tt> file is close to, or identical to, your Web server's version.</p>
</li>
<li>
<p>In your config.php files (on the server where you run the queue daemon), set the following variable:</p>
<p><tt>$config['queue']['daemon'] = true;</tt></p>
</li>
<li>
<p>On the queues server, run the command <tt>scripts/startdaemons.sh</tt>.</p>
<p>This will run the queue handlers:</p>
<dl>
<dt>queuedaemon.php</dt> <dd>polls for queued items for inbox processing and pushing out to OStatus, SMS, XMPP, etc.</dd>
<dt>imdaemon.php</dt> <dd>if an IM plugin is enabled (like XMPP)</dd>
<dt>(plugins)</dt> <dd>other daemons, like TwitterBridge ones, that you may have enabled</dd>
</dl>
</li>
</ol>
<p>These daemons will automatically restart in most cases of failure including memory leaks (if a memory_limit is set), but may still die or behave oddly if they lose connections to the XMPP or queue servers.</p>
<p>It may be a good idea to use a daemon-monitoring service, like 'monit', to check their status and keep them running.</p>
<p>All the daemons write their process IDs (pids) to <tt>/var/run/</tt> by default. This can be useful for starting, stopping, and monitoring the daemons. If you are running multiple sites on the same machine, it will be necessary to avoid collisions of these PID files by setting a site-specific directory in <tt>config.php</tt>:
<p><tt>$config['daemon']['piddir'] = __DIR__ . '/../run/';</tt></p>
<p>It is also possible to use a STOMP server instead of our kind of hacky home-grown DB-based queue solution. This is strongly recommended for best response time, especially when using XMPP.</p>

View File

@ -1,125 +0,0 @@
{HEADING:SECTION:gs1.1_to_gs1.2:Nightly or GNU social 1.1.x to GNU social 1.2.x}
<p>If you are tracking the GNU social git repository, we currently recommend using the "master" branch (or nightly if you want to use latest features) and follow this procedure:</p>
<ol>
<li>
<p>Back up your data. The StatusNet upgrade discussions below have some guidelines to back up the database and files (mysqldump and rsync).</p>
</li>
<li>
<p>Stop your queue daemons (you can run this command even if you do not use the queue daemons):</p>
<p><tt>$ bash scripts/stopdaemons.sh</tt></p>
</li>
<li>
<p>Run the command to fetch the latest sourcecode:</p>
<p><tt>$ git pull</tt></p>
<p>If you are not using git we recommend following the instructions below for upgrading "StatusNet 1.1.x to GNU social 1.2.x" as they are similar.</p>
</li>
<li>
<p>Run the upgrade script:</p>
<p><tt>$ php scripts/upgrade.php</tt></p>
<p>The upgrade script will likely take a long time because it will upgrade the tables to another character encoding and make other automated upgrades. Make sure it ends without errors. If you get errors, create a new issue on the <a href="https://git.gnu.io/gnu/gnu-social/issues">GNU social project page</a>.
</li>
<li>
<p>Start your queue daemons again (you can run this command even if you do not use the queue daemons):</p>
<p><tt>$ bash scripts/startdaemons.sh</tt></p>
</li>
<li>
<p>Report any issues at <a href="https://git.gnu.io/gnu/gnu-social/issues">https://git.gnu.io/gnu/gnu-social/issues</a></p>
</li>
</ol>
<p>If you are using ssh keys to log in to your server, you can make this procedure pretty painless (assuming you have automated backups already). Make sure you "cd" into the correct directory (in this case "htdocs") and use the correct login@hostname combo:</p>
<pre> $ ssh social@domain.example 'cd htdocs
&& bash scripts/stopdaemons.sh
&& git pull
&& time php scripts/upgrade.php
&& bash scripts/startdaemons.sh'
</pre>
{HEADING:SECTION:sn1.1_to_gs1.2:StatusNet 1.1.x to GNU social 1.2.x}
<p>We cannot support migrating from any other version of StatusNet than 1.1.1. If you are running a StatusNet version lower than this, please follow the upgrade procedures for each respective StatusNet version.</p>
<p>You are now running StatusNet 1.1.1 and want to migrate to GNU social 1.2.x. Beware there may be changes in minimum required version of PHP and the modules required, so review the INSTALL file (php5-intl is a newly added dependency for example).</p>
<p><b>Before you begin: Make backups</b>. Always make backups. Of your entire directory structure and the database too. All tables. All data. Alles.</p>
<ol>
<li>
<p>Make a backup of everything. To backup the database, you can use a variant of this command (you will be prompted for the database password):</p>
<p><tt>$ mysqldump -u dbuser -p dbname > social-backup.sql</tt></p>
</li>
<li>
<p>Stop your queue daemons.</p>
<p><tt>$ bash scripts/stopdaemons.sh</tt></p>
<p>Not everyone runs queue daemons, but the above command won't hurt.</p>
</li>
<li>
<p>Unpack your GNU social code to a fresh directory. You can do this by cloning our git repository:</p>
<p><tt>$ git clone https://git.gnu.io/gnu/gnu-social.git gnusocial</tt></p>
</li>
<li>
<p>Synchronize your local files to the GNU social directory. These will be the local files such as avatars, config and files:</p>
<ul>
<li><tt>avatar/*</tt></li>
<li><tt>file/*</tt></li>
<li><tt>local/*</tt></li>
<li><tt>.htaccess</tt></li>
<li><tt>config.php</tt></li>
</ul>
<p>This command will point you in the right direction on how to do it:</p>
<p><tt>$ rsync -avP statusnet/{.htaccess,avatar,file,local,config.php} gnusocial/</tt></p>
</li>
<li>
<p>Replace your old StatusNet directory with the new GNU social directory in your webserver root.</p>
</li>
<li>
<p>Run the upgrade script:</p>
<p><tt>$ php scripts/upgrade.php</tt></p>
<p>The upgrade script will likely take a long time because it will upgrade the tables to another character encoding and make other automated upgrades. Make sure it ends without errors. If you get errors, create a new issue on the <a href="https://git.gnu.io/gnu/gnu-social/issues">GNU social project page</a>.
</li>
<li>
<p>Start your queue daemons:</p>
<p><tt>$ bash scripts/startdaemons.sh</tt></p>
</li>
<li>
<p>Report any issues at <a href="https://git.gnu.io/gnu/gnu-social/issues">https://git.gnu.io/gnu/gnu-social/issues</a></p>
</li>
</ol>

View File

@ -1,14 +0,0 @@
<div class="spacer"></div>
<div class="navigation">
<div class="left"><a href="{PREV_URL}">{PREV_TITLE}</a></div>
<div class="right"><a href="{NEXT_URL}">{NEXT_TITLE}</a></div>
<div class="centre"><a href="{TOC_URL}">{TOC_TITLE}</a></div>
</div>
<hr />
<div class="footer">
<div class="left">Generated {TIMESTAMP}</div> <div class="right">Revision: {GIT_REV_ID} (<a href="https://git.gnu.io/tom/social-doc">src/license</a>)</div>
</div>
</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{PAGE_TITLE} - {TITLE} - GNU social</title>
<link rel="stylesheet" href="{RES:manual-style.css}">
</head>
<body><div class="contents">
<div class="heading">
<img src="{RES:logo.png}" width="175" height="55" />
<h1>{TITLE}</h1>
</div>
<div class="navigation">
<div class="left"><a href="{PREV_URL}">{PREV_TITLE}</a></div>
<div class="right"><a href="{NEXT_URL}">{NEXT_TITLE}</a></div>
<div class="centre"><a href="{TOC_URL}">{TOC_TITLE}</a></div>
</div>

View File

@ -1 +0,0 @@
<div class="toc-h1"><a href="{TOC_ENTRY_PAGE}#{TOC_ENTRY_SECTION}">{TOC_ENTRY_NUMBER}</a> {TOC_ENTRY_TITLE}</div>

View File

@ -1 +0,0 @@
<div class="toc-h2"><a href="{TOC_ENTRY_PAGE}#{TOC_ENTRY_SECTION}">{TOC_ENTRY_NUMBER}</a> {TOC_ENTRY_TITLE}</div>

View File

@ -1 +0,0 @@
<div class="toc-h3"><a href="{TOC_ENTRY_PAGE}#{TOC_ENTRY_SECTION}">{TOC_ENTRY_NUMBER}</a> {TOC_ENTRY_TITLE}</div>

View File

@ -1,2 +0,0 @@
<h2>Contents</h2>

View File

@ -1,101 +0,0 @@
{HEADING:SECTION:exploring:Exploring the network}
<p>To get the most out of GNU social you need to find your way around the various servers.</p>
{HEADING:SUBSECTION:exploring_timelines:The different timelines}
<p>If you've used Twitter before you're used to the <em>Home</em> timeline. This shows messages posted by people you follow. Because GNU social consists of separate servers you can browse three different timelines:</p>
<dl>
<dt>Home</dt> <dd>People you follow</dd>
<dt>Public / Public Timeline</dt> <dd>Everybody on this server</dd>
<dt>Network / The Whole Known Network</dt> <dd>Everybody that this server knows about</dd>
</dl>
<p>This is how it would look if you followed two people on the same server as you, plus two people from different servers:</p>
<a href="{RES:home-vs-public.png}">
<img src="{RES:home-vs-public.png}" alt="Difference between home and public timelines" class="figure" />
</a>
{HEADING:SECTION:following:Following}
<p>Thanks to federation it is easy to follow both people on the same server as you and on different servers. However, following someone on a different server can require a couple of extra clicks.</p>
<p>If you're on one of the <i>Quitter</i> servers (or any server that uses the Qvitter plugin) there is an easy way to do both. See {LINK:remote_follow_qvitter}.</p>
{HEADING:SUBSECTION:local_follow:Following people on the same server}
<p>Click on their username to go to their user page. There you will find a button to follow them. It will look like one of these:</p>
<img src="{RES:subscribe-button.png}" alt="Stock GNU social subscribe button" class="figure" />
<img src="{RES:follow-button.png}" alt="Qvitter follow button" class="figure" />
<p>Click the button. Their notices will now appear in your Home timeline.</p>
{HEADING:SUBSECTION:remote_follow:Following people on other servers}
<p>First go to their user page. You can always get there by clicking on their username. This will take you to the server where that person has their account.</p>
<p>Suppose your account is on <em>quitter.no</em> and you clicked on a user who is on <em>quitter.se</em>. Your browser will now be at an address like <tt>https://quitter.se/some_user</tt>. You will not be logged in on the remote server&mdash;you're just a public visitor. Don't try to log in or create an account; it's not necessary.</p>
<p>The page might look completely different from what you're used to! Every server can have its own custom style. What you need to look for is the remote follow button. Here are three examples:</p>
<img src="{RES:remote-follow-button.png}" alt="Qvitter remote follow button" class="figure" />
<img src="{RES:subscribe-button.png}" alt="Stock GNU social subscribe button (same as for local)" class="figure" />
<img src="{RES:subscribe-loadaverage.png}" alt="LoadAverage subscribe button" class="figure" />
<p>Click on it. A box will pop up asking what your account is, in email address format. If your username is <tt>fido</tt> and your server is <tt>quitter.no</tt> you would type <tt>fido@quitter.no</tt>. Then click <em>Subscribe</em> or <em>Remote follow</em> as appropriate.</p>
<a href="{RES:remote-part-2.png}">
<img src="{RES:remote-part-2.png}" alt="Entering your address" class="figure" />
</a>
<p>You might (or might not) be taken to an intermediate screen like this one. Check the details are correct and click <em>Subscribe</em> again.</p>
<a href="{RES:remote-part-3.png}">
<img src="{RES:remote-part-3.png}" alt="Remote follow, next step" class="figure" />
</a>
<p>You will now be taken back your own server where you're logged in. You will be shown profile information about the user you are about to follow. To complete the process click the <em>Confirm</em> button. It will look something like this:</p>
<img src="{RES:confirm-stock.png}" alt="Stock confirm button" class="figure" />
<img src="{RES:confirm-qvitter.png}" alt="Quitter.no confirm button (I guess qvitter hasn't styled it)" class="figure" />
<p>You are now following that person. Notices that they post from now on will now appear in your Home timeline. If someone else on your server was already following them you might get some older ones as well.</p>
{HEADING:SUBSECTION:remote_follow_qvitter:Following people using Qvitter}
<p>Qvitter has a handy shortcut for following people regardless of whether or not they're on the same server as you. Hover your mouse pointer over their name. A popup will appear. Click the <em>Follow</em> button.</p>
<a href="{RES:qvitter-hover1.png}">
<img src="{RES:qvitter-hover1.png}" alt="Hovering over a name in qvitter" class="figure" />
</a>
<p>It will change to <em>Following</em>. You're all done.</p>
<a href="{RES:qvitter-hover2.png}">
<img src="{RES:qvitter-hover2.png}" alt="Now following" class="figure" />
</a>
{HEADING:SUBSECTION:remote_follow_manual:Following people using manual subscription URL}
<p><i>Note: This is not the usual way to follow someone but it's a technique some people find convenient.</i></p>
<p>You can initiate a remote follow directly from your own server. To do this visit <tt>/main/ostatussub</tt> on your server. For example if you are logged in to quitter.se you would go to <tt>https://quitter.se/main/ostatussub</tt>. You will get to a page with an error like this:</p>
<a href="{RES:manual-confirm.png}">
<img src="{RES:manual-confirm.png}" alt="First page of the ostatussub confirmation" class="figure" />
</a>
<p>Enter a profile address such as <tt>https://quitter.no/doctorow</tt> and click <em>Continue</em>. You will jump straight to the confirmation screen as shown above.</p>

View File

@ -1,148 +0,0 @@
{HEADING:SECTION:choosing_a_server:Choosing a server}
<p>You have to make one decision to get on GNU social: which server to use. If you're technically inclined and want to host your own then <a href="https://git.gnu.io/gnu/gnu-social">you can do that</a>. For everyone else there are many choices available. Many of them are listed on <a href="http://www.skilledtests.com/wiki/List_of_Independent_Statusnet_Instances">this webpage</a>.</p>
<p>If you don't want to shop around, these are some popular choices, particularly for English speakers:</p>
<ul>
<li><a href="https://quitter.se/">Quitter.se</a></li>
<li><a href="https://loadaverage.org/">LoadAverage</a></li>
<li><a href="https://quitter.no/">Quitter.no</a></li>
</ul>
<p>There is a small advantage in choosing either a local server or a server where you already know people. Every server has a user directory that lists all the accounts registered there. This can make it easier for others to stumble across you.</p>
<p>Although there are many servers not all of them allow members of the public to create new accounts. The administrator of each server can turn this feature on or off.</p>
{HEADING:SECTION:registering:Registering an account}
<p>In this example we will use <a href="https://quitter.no/">Quitter.no</a>, which allows new users to register freely. This server looks very similar to Twitter because it is using a plugin called <a href="https://git.gnu.io/h2p/Qvitter">Qvitter</a>. If you don't like the appearance then you can simply pick a different server.</p>
<p>It has a Sign Up section on the bottom-left of the home page. Enter your basic information and click <i>Sign up to Quitter.no</i>:</p>
<a href="{RES:qno_signup.jpg}">
<img src="{RES:qno_signup_small.jpg}" alt="Sign Up section of quitter.no" class="figure" />
</a>
<p>You will be prompted for extra information:<p>
<a href="{RES:qno_signup_details.png}">
<img src="{RES:qno_signup_details_small.png}" alt="Sign Up Details section of quitter.no" class="figure" />
</a>
<p>Your nickname is the main name for your account. You won't be able to change it so choose carefully. You can also set a "Full Name" that appears on your profile and alongside your notices. Don't feel obligated to use any real information&mdash;anonymous and pseudonymous users are very welcome on GNU social.</p>
<p>A working email address is normally required for account verification. You can use it to receive email notifications too.</p>
<p>Choose a good password. As always it is a good idea to use a password that you don't use anywhere else. Free software like <a href="https://www.keepassx.org/">KeePassX</a> can help you generate and remember your passwords.</p>
<p>Press the <i>Sign up to Quitter.no</i> button. You can start using your account right away but you should confirm your email address when the email comes through.</p>
<p>Congratulations! You're on GNU social!</p>
{HEADING:SECTION:publishing:Publishing a notice}
<p>Depending on which server you're using you might see something different once you log in. Here are two examples:</p>
<a href="{RES:send_example_1.png}">
<img src="{RES:send_example_1_small.png}" alt="Publishing a notice on a standard server" class="figure" />
</a>
<a href="{RES:send_example_2.png}">
<img src="{RES:send_example_2_small.png}" alt="Publishing a notice on a Qvitter server" class="figure" />
</a>
<p>In both cases you have a text box to type a message. Click inside it, type a notice, then click <i>Send</i> to publish it to your followers.</p>
{HEADING:SECTION:repeat_reply:Favouriting, Repeating and Replying}
<p>After you have followed a few of your friends and interesting people on the network you will see their posts on your "HOME" newsfeed. Below each post are some icons that allow you to interact with the notice and/or the original poster.</p>
<p>Clicking on the <img src="{RES:reply.gif}"> will add a post text field to the page and allow you to respond to the post. Your reply will then appear as a threaded notice underneath the original post, as in this example:</p>
<a href="{RES:reply_example_1.png}">
<img src="{RES:reply_example_1.png}" alt="Replying to a notice" class="figure" />
</a>
<p>Clicking on the <img src="{RES:favourite.gif}"> will add the post to your list of favourite posts. This also pings the original poster alerting them that you favourited the post. You can see your list of favourite posts by clicking on the "FAVOURITES" link on the left navigation bar. If you are using <a href="https://github.com/chimo/gs-reverseFavs">Chimo's Reverse Favourites</a> plugin you can see who has favourited your previous posts.
<p>Clicking on the <img src="{RES:recycle.gif}"> will repeat the notice so that it will be shared to your own list of followers, and as such probably implies another more explicit favour to the original post.</p>
{HEADING:SECTION:groups_tags:Hashtags, Mentions and Groups}
<p>In addition to the above methods to interact with followers network, GNU social also supports features you will find familiar with other social networks. You can mention someone else in a post by using the '@' prefix. This example shows how to mention someone, and how the post will look after you post it.<p>
<a href="{RES:mention_example_1.png}">
<img src="{RES:mention_example_1.png}" alt="Mentioning a user in a post" class="figure" />
</a>
<p>You don't have to use the full 'username@domain.tld' format when mentioning someone. If you leave out the full '@domain.tld' part of a user you are mentioning then you are limiting the scope to people on your local instance and your followers.
<p>The social network hashtag '#' prefixed before a word, eg #federated makes keywords trend on your home feed and across the federated network as more people use the same hashtag</p>
<p>Groups are an optional part of GNU social. Each social instance can have one or more groups based on a topic. Then local users of the instance as well as remote social users can subscribe to the group. A group is similar to a user in GNU social but you refer to a group using the '!' prefix instead of the '@' prefix.</p>
<p>When you find a group on your local GNU social instance, or a remote instance you can follow it in a similar way to following users, simply enter your GNU social username when prompted after clicking on the "Join" button.</p>
<p>You can post a notice to the group by mentioning the group with a '!' prefix, for example:</p>
<a href="{RES:grouppost_example_1.png}">
<img src="{RES:grouppost_example_1.png}" alt="Making a post mentioning a group." class="figure" />
</a>
<p>Your post will then appear in your follower's feeds as well as anyone else subscribed to the group who may or may not also follow you.</p>
{HEADING:SECTION:account_names:Referring to your account}
<p>For somebody else to find you on GNU social you need to give them two pieces of information:</p>
<ol>
<li>What server you're on&mdash;for example, <i>quitter.no</i></li>
<li>Your account name. That's the one starting with an <i>@</i>&mdash;for example, <i>@fred</i>
</ol>
<p>There are three different ways of referring to your account and they're useful at different times.</p>
{HEADING:SUBSECTION:account_profile_url:Your profile URL}
<p>If you want someone to check out your account the easiest thing is to give them a link to your profile. They don't need a GNU social account of their own. If they have one and they want to follow you they will be able to do that easily from this page.</p>
<p>To access your profile click on your name. On quitter.no it's in the top-left and looks vaguely like this:</p>
<img src="{RES:qno_profile_link.png}" alt="Link to your profile on quitter.no" class="figure" />
<p>On a more standard server you can look for something in the menu called <i>Profile</i>:</p>
<img src="{RES:taslug_profile_link.png}" alt="Link to your profile on a standard GNU social server" class="figure" />
<p>Either way once you get there your browser will be at a URL that looks similar to this:</p>
<p><tt>https://quitter.no/fred</tt></p>
<p>Take that URL and give it to the person who wants to see your account.</p>
{HEADING:SUBSECTION:account_email_format:Doing a remote follow}
<p>Another way to describe your account is like an email address. You write your username, move the @ from the start to the end, then write the server without any <i>http</i>s or slashes:</p>
<p><tt>fred@quitter.no</tt></p>
<p>This is what you need to type in if you are doing a Remote Follow&mdash;that is, following someone on a different server from you. More about that in a later section: {LINK:remote_follow}.</p>
{HEADING:SUBSECTION:account_at_format:Writing notices}
<p>If you're writing a notice and want to mention another user simply tag their account with an @ like this: <i>@fred - Have you met @sandra? She's a colleague of mine.</i></p>
<p>You might be thinking that the server part is missing. You're right! But GNU social is clever. If you use an @ tag in a notice it assumes you must be talking about someone you follow. It looks through its database to find which account has that name and fills out the server part behind the scenes.</p>
{HEADING:SECTION:getting_started_next_steps:Next steps}
<p>In this part you signed up for GNU social and sent your first notice. This will quickly get boring unless you find some other people to follow. The next part describes the different ways you can explore the GNU social network and see what everyone else is saying.</p>

View File

@ -1,85 +0,0 @@
{HEADING:SECTION:tags:Tags}
On GNU social you will sometimes see words with a <tt>#</tt> or a <tt>!</tt> in front of them. The first is a hashtag; the second is a group. They are boths ways of linking together posts that relate to the same topic. They work in different ways.
{HEADING:SECTION:hashtags:Hashtags}
{HEADING:SUBSECTION:hashtags_using:Using hashtags}
<p>If you put a # in front of a word like <tt>#this</tt> then that word becomes a clickable link. When you click it you are shown messages from everyone that contain that same <em>hashtag</em>. It allows you to quickly find others who were posting about the same topic, or to bring your post to the attention of those who are watching the tag. Twitter turned the concept into a household name and it's now a staple of microblogging.</p>
<img src="{RES:typing-hashtag.png}" alt="Typing a hashtag in a post" class="figure" />
<p>Click on the link in a post to see all posts that include the tag:</p>
<img src="{RES:showing-hashtag.png}" alt="Browsing a hashtag stream" class="figure" />
<p>Note that this cannot show posts from the entire GNU social network. This limitation is explained more in the next section.</p>
<p>For network-wide conversations about particular topics, see the section about {LINK:groups}. Groups perform a similar function to hashtags and they use a <tt>!</tt> instead of a <tt>#</tt>.</p>
{HEADING:SUBSECTION:hashtags_limits:The limited reach of hashtags}
<p>Hashtags are somewhat limited in GNU social because your server does not have a complete view of the network. Suppose your server has 10 accounts on it. Obviously it knows about every post that those 10 people make. If each person follows 10 different people on remote servers, that's 100 extra people. All together your server knows about the posts from 110 accounts.</p>
<p>If you click on a hashtag on your server, it's only ever possible to see posts from those 110 people.</p>
<p>Note also that hashtags are linked to the server where you posted. If your account is on quitter.no and you use the tag <tt>#newyearseve</tt>, anyone who clicks on it will see quitter.no's list. If somebody on quitter.se uses the same tag, clicking on that tag will show you quitter.se's list. These lists might be different because each server has a different view of the network.</p>
<p>The GNU social federation has lots of benefits but you can see that it makes hashtags a little complicated. {LINK:groups} are a popular alternative that are more reliable.</p>
{HEADING:SUBSECTION:hashtags_subscribing:Hashtag subscriptions}
<p>You can subscribe to hashtags on your own server. This means that any time your server sees a post containing the hashtag, that post will appear in your <i>Home</i> timeline regardless of whether you normally follow the person who sent it.</p>
<p>The button to subscribe appears when you click on a hashtag. Note that this is not visible if you are using Qvitter (i.e. any of the "quitter" servers). You can access it by switching to the "classic" mode.</p>
<img src="{RES:subscribe-hashtag.png}" alt="Subscribing to a hashtag" class="figure" />
<p>Once you are subscribed, not only will those posts appear in your home timeline, but you will also get quick access to the tag in your left menu. From there you can unsubscribe again.</p>
<img src="{RES:subscribed-tag.png}" alt="Subscribed to a hashtag" class="figure" />
{HEADING:SECTION:groups:Groups}
{HEADING:SUBSECTION:groups_using:Joining groups}
<p>A group is effectively a noticeboard hosted on a particular server. If you join as a member of a group you can post messages to it by including a group tag. Every time a member makes a post to the group it is submitted to the hosting server. The hosting server then passes it on to all the members. This means that if you join you are guaranteed to see every post in your Home timeline. This is different from subscribing to {LINK:hashtags}, which are shown on a best-effort basis.</p>
<p>You will probably first notice a group in your timeline as a link you can click:</p>
<img src="{RES:group-in-timeline.png}" alt="A group in a timeline" class="figure" />
<p>Clicking on the word <tt>!tinsel</tt> takes you to the group page on the hosting server. If you want to join the group, click the Join button:</p>
<img src="{RES:groups-join-button.png}" alt="Join group button" class="figure" />
<p>You can also browse groups on your server by clicking on the Groups menu item:</p>
<img src="{RES:groups-menu-item.png}" alt="Groups in the left menu in stock GNU social" class="figure" />
<p>To post a message to the group, first ensure you have joined. Then use its nickname inside your post, like <tt>!tinsel</tt>.</p>
{HEADING:SUBSECTION:groups_creating:Creating groups}
<p>If you want to start a new group on your own server then you can do that. Click on <em>Groups</em> in the menu item and then click the <em>Create a new group</em> link:</p>
<img src="{RES:groups-create-button.png}" alt="Link to create a new group" class="figure" />
<p>You will have to fill in some initial information about the new group, like this:</p>
<img src="{RES:groups-create-form.png}" alt="Form for creating a new group" class="figure" />
<p>Once the group is created, anyone who has joined can post to it by using its nickname (<tt>!tinsel</tt>) or any of its aliases (<tt>!sparkly</tt>).</p>
<p>You will start off as the single administrator of the group. When you visit the group page on your server you will have links to edit settings and set a logo.</p>
<img src="{RES:groups-administration.png}" alt="Group admin page" class="figure" />
<p>To make another user an admin of the group, click the relevant button next to them:</p>
<img src="{RES:groups-make-admin.png}" alt="Making another user a group admin" class="figure" />

View File

@ -1,21 +0,0 @@
{HEADING:SECTION:what_is_gnu_social:What is GNU social}
<p>GNU social is a social network for microblogging. It enables you to publish short notices including URLs and pictures. If you're interested in what someone has to say you can <i>follow</i> them. When you log in to your account you see a timeline containing all of the notices from people that you follow. You can have a conversation with another person by replying to each other's notices.</p>
<a href="{RES:gnusocialno_general.png}">
<img src="{RES:gnusocialno_general_small.png}" alt="Homepage of gnusocial.no" class="figure" />
</a>
<p>You may have seen this sort of thing before. GNU social is special for two main reasons: it's <em>decentralised</em>, and it's <em>free software</em>.</p>
<p>Being decentralised means that there is no single server that controls GNU social. Instead, many servers are run by different people around the world. These servers communicate with each other to form a <i>federation</i>. You can create an account on any one of them. Although the servers sometimes look different, ultimately it doesn't matter which one you choose&mdash;you're still part of the same network as everyone else.</p>
<img src="{RES:federation.png}" alt="Diagram of federated servers" class="figure" />
<p>If one server suffers an outage it's inconvenient for the people who have an account on that particular server. The rest of the network continues to operate as normal. This makes GNU social highly resilient. Censorship is difficult as servers can be located anywhere in the world.</p>
<p>Because GNU social is free software it's here to stay. A corporate social network might disappear or start running advertisements when the venture capital runs out. The GNU social code is available to everybody and there are many servers where it's free to create an account.</p>
<p>This is a social network that does what's best for the people who use it&mdash;not what makes the most money.</p>

View File

@ -1,220 +0,0 @@
<?php
// This is pretty bad code. Sorry. I will clean it up.
foreach (glob("configs/*.php") as $config_file) {
if (is_file($config_file)) {
echo "Processing render configuration $config_file\n";
render_with_config_path($config_file);
}
}
function render_with_config_path($config_file) {
$config = array();
include($config_file);
if (!isset($config["pages"])) {
echo "Not a valid configuration; skipping\n";
return;
}
// Prepare substitutions
$substitutions = array("{TITLE}" => $config["title"]);
$rev_id = exec("git rev-parse --short HEAD", $output, $retval);
if ($retval != 0) {
$rev_id = "unknown";
}
$substitutions["{GIT_REV_ID}"] = $rev_id;
date_default_timezone_set('UTC');
$substitutions["{TIMESTAMP}"] = date("Y-m-d H:i:s e");
// Copy resources across
$resources_to_copy = array_merge(glob("resources/common/*"), glob($config["resources_dir"] . "/*"));
$res_out_dir = $config["output_dir"] . "/" . $config["resources_output_dir"];
if (!is_dir($res_out_dir)) {
mkdir($res_out_dir, 0777, true);
}
foreach ($resources_to_copy as $res) {
$res_name = basename($res);
$substitutions["{RES:$res_name}"] = $config["resources_output_dir"] . "/$res_name";
copy($res, "$res_out_dir/$res_name");
}
if (!is_dir($config["output_dir"])) {
mkdir($config["output_dir"], 0777, true);
}
// We need to pre-process all the pages to get the section headings ready
$sections = array(); // entries are associative arrays
$template_texts = array();
$page_no = 1;
foreach ($config["pages"] as $page) {
// Read in the text
$template_html = $config["html_dir"] . "/" . $page["id"] . ".html";
$text = file_get_contents($template_html);
$section_no = 0;
$subsection_no = 0;
// Look for things we need to convert to h1, h2, h3
preg_match_all("/{HEADING:(PAGE|SECTION|SUBSECTION):([^:]*):([^}]+)}/", $text, $section_matches);
$originals = $section_matches[0];
$types = $section_matches[1];
$ids = $section_matches[2];
$titles = $section_matches[3];
// TOC gets its info from the config file, not from an h1 which may or may not be present
$page_id = $page["id"];
$sections[] = array("type" => "PAGE", "page" => "$page_id.html", "section" => "", "number" => "$page_no.", "title" => $page["title"]);
$page_title = $page["title"];
$substitutions["{LINK:$page_id}"] = "<a href=\"$page_id.html\">$page_title</a>";
for ($i = 0; $i < count($types); $i++) {
$tag = "h1";
$number = "$page_no.";
if ($types[$i] == "SECTION") {
$tag = "h2";
$section_no++;
$subsection_no = 0;
$number = "$page_no.$section_no.";
}
if ($types[$i] == "SUBSECTION") {
$tag = "h3";
$subsection_no++;
$number = "$page_no.$section_no.$subsection_no.";
}
// If we have an ID
$anchor_start = "";
$anchor_end = "";
if (strlen($ids[$i]) > 0 && $types[$i] != "PAGE") { // pages are always added the TOC and have empty section_id
// Add it to the TOC array
$sections[] = array("type" => $types[$i], "page" => "$page_id.html", "section" => $ids[$i], "number" => $number, "title" => $titles[$i]);
// Also create an internal anchor
$anchor_start = "<a name=\"$ids[$i]\">";
$anchor_end = "</a>";
}
$final_tag = "<$tag>$anchor_start$number $titles[$i]$anchor_end</$tag>";
// Replace the template with the tag
$text = str_replace($originals[$i], $final_tag, $text);
// Now create substitutions for this tag so other pages can refer to them
$page_id = $page["id"];
$section_id = $ids[$i];
$title = $titles[$i];
$substitutions["{LINK:$section_id}"] = "<a href=\"$page_id.html#$section_id\">$title</a>";
$substitutions["{TITLE:$section_id}"] = $title;
}
// Save the text for later
$template_texts[$page["id"]] = $text;
$page_no++;
}
// Render each page
for ($i = 0; $i < count($config["pages"]); $i++) {
$page = $config["pages"][$i];
// Configure page-specific substitutions
$substitutions["{PREV_URL}"] = "";
$substitutions["{PREV_TITLE}"] = "";
$substitutions["{NEXT_URL}"] = "";
$substitutions["{NEXT_TITLE}"] = "";
$substitutions["{TOC_URL}"] = "index.html";
$substitutions["{TOC_TITLE}"] = "Contents";
$substitutions["{PAGE_TITLE}"] = $page["title"];
if (isset($config["pages"][$i-1])) {
$prev_page = $config["pages"][$i-1];
$substitutions["{PREV_URL}"] = $prev_page["id"] . ".html";
$substitutions["{PREV_TITLE}"] = $prev_page["title"];
}
if (isset($config["pages"][$i+1])) {
$next_page = $config["pages"][$i+1];
$substitutions["{NEXT_URL}"] = $next_page["id"] . ".html";
$substitutions["{NEXT_TITLE}"] = $next_page["title"];
}
$template_html = $config["html_dir"] . "/" . $page["id"] . ".html";
$out_html = $config["output_dir"] . "/" . $page["id"] . ".html";
if (is_file($out_html)) {
unlink($out_html);
}
append_file_and_sub($out_html, "html/common/header.html", $substitutions);
$text = do_substitutions($template_texts[$page["id"]], $substitutions);
file_put_contents($out_html, $text, FILE_APPEND);
append_file_and_sub($out_html, "html/common/footer.html", $substitutions);
}
// Render the index / TOC now that we have all the information at hand
$toc_html = $config["output_dir"] . "/index.html";
$toc_text = file_get_contents("html/common/toc.html");
$toc_h1 = file_get_contents("html/common/toc-h1.html");
$toc_h2 = file_get_contents("html/common/toc-h2.html");
$toc_h3 = file_get_contents("html/common/toc-h3.html");
foreach ($sections as $section) {
$start = $toc_h1;
if ($section["type"] == "SECTION") $start = $toc_h2;
if ($section["type"] == "SUBSECTION") $start = $toc_h3;
$toc_subs["{TOC_ENTRY_NUMBER}"] = $section["number"];
$toc_subs["{TOC_ENTRY_TITLE}"] = $section["title"];
$toc_subs["{TOC_ENTRY_PAGE}"] = $section["page"];
$toc_subs["{TOC_ENTRY_SECTION}"] = $section["section"];
$line = do_substitutions($start, $toc_subs);
$toc_text .= "$line\n";
}
$substitutions["{PREV_URL}"] = "";
$substitutions["{PREV_TITLE}"] = "";
$substitutions["{NEXT_URL}"] = $config["pages"][0]["id"] . ".html";
$substitutions["{NEXT_TITLE}"] = $config["pages"][0]["title"];
$substitutions["{PAGE_TITLE}"] = "Contents";
// Write it to disk
if (is_file($toc_html)) {
unlink($toc_html);
}
append_file_and_sub($toc_html, "html/common/header.html", $substitutions);
file_put_contents($toc_html, $toc_text, FILE_APPEND);
append_file_and_sub($toc_html, "html/common/footer.html", $substitutions);
// This manual is all done
echo "Manual '" . $config["title"] . "' completed rendering at: " . $config["output_dir"] . "\n\n";
}
function append_file_and_sub($dest, $src, $substitutions) {
// Read in starting text
$text = file_get_contents($src);
$text = do_substitutions($text, $substitutions);
// Append processed text to the destination file
touch($dest);
file_put_contents($dest, $text, FILE_APPEND);
}
function do_substitutions($text, $substitutions) {
// Perform all template substitutions
foreach ($substitutions as $from => $to) {
$text = str_replace($from, $to, $text);
}
return $text;
}
?>