Some initial content

This commit is contained in:
Diogo Peralta Cordeiro 2021-03-23 13:36:33 +00:00
parent 2a9eab0206
commit 88c194c013
1382 changed files with 157806 additions and 0 deletions

65
index.html Normal file
View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GNU social</title>
</head>
<body>
<header>
<h1>GNU social</h1>
<aside>The free/libre software social networking platform.</aside>
</header>
<h2>The project</h2>
<p>True to the Unix-philosophy of small programs to do a small job, GNU
social is a social communication software used
in <a href="https://blog.diogo.site/what-is-the-fediverse">federated social networks</a>.
</p>
<p>It is widely supported and has a large userbase. It is already used by
the <a href="https://www.fsf.org/">Free Software Foundation</a>.
As the GNU operating system, is built around privacy and trustworthy
technology based on free software(free as in freedom, specifically
to run, study, change and distribute yoursoftware as you please).
GNU social is technology for communities to runand host their own social media.</p>
<p>Currently, were working on adding features to easily and flexibly
create groups and improve tags, allowing easier content filtering and
connecting with anyone that shares your interests, all under your own
control and without infringing your privacy.</p>
<h2>Features</h2>
<ul>
<li><strong>Versatile.</strong> GNU social supports both single-user and community modes and can be used in
an intranet environment or as part of the wider Free Network.</li>
<li><strong>Stable.</strong> GNU social has been used in production environments for over ten years.</li>
<li><strong>Plug and Play.</strong> Because GNU social is minimal and libre, it runs virtually anywhere you
can run a common piece of web software, such as WordPress or Drupal. JavaScript is optional.</li>
<li><strong>Privacy focused.</strong> GNU social is part of the GNU project, it's 100% free software, with
no malicious features or spyware.</li>
</ul>
<h2>FAQ</h2>
<h3>Where can I join GNU social?</h3>
<p>There are many kinds of GNU social server instances online right now!</p>
<p><a href="try/">Click here</a> to see a list of popular GNU social sites you can join!</p>
<strong>Disclaimer: </strong><i>Please note that the GNU social development team is not responsible for
the operation or content of sites that run its software.</i>
<h3>Who makes GNU social?</h3>
<p>The current development team is lead by <a href="https://www.diogo.site/">Diogo Cordeiro</a>. A
list containing the current devs and other contributors is
available <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/experimental/CREDITS.md">here</a>.
The founders of the GNU social project were <a href="https://mat.tl/">Matt Lee</a>,
<a href="https://en.wikipedia.org/wiki/Evan_Prodromou">Evan Prodromou</a> and
<a href="http://mmn-o.se">Mikael Nordfeldth</a>.
</p>
<h2>Contact</h2>
<p>Discuss the project on our IRC channel <a
href="https://webchat.freenode.net/?channels=#social">#social</a> on irc.freenode.net</p>
<p>Contribute code, report bugs and request features on our <a
href="https://notabug.org/diogo/gnu-social">repository</a>.
</p>
<p>If you are a student you can also apply to <a
href="/soc">GNU social's Summer of Code</a>.
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

331
soc/2018/index.html Normal file
View File

@ -0,0 +1,331 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>ActivityPub plugin - Tech Report - GNU social Summer of Code 2018</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.diogo.site/projects/excalibur_template/assets/css/main.css">
<style>
@page {
size: A4 portraint;
}
@page :blank {
@top-center { content: "This page is intentionally left blank." }
}
h1 {
page-break-before: always;
}
h1, h2, h3, h4, h5 {
page-break-after: avoid;
}
table, figure {
page-break-inside: avoid;
}
@page:right{
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="../"><strong>&larr; GS GSoC</strong></a></li>
<li><a href="#about">About</a></li>
<li><a href="#activitypub">ActivityPub</a></li>
<li><a href="#plugin-workflow">Plugin Workflow</a></li>
<li><a href="#inboxes">Inboxes</a></li>
<li><a href="#collections">Collections</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
<li><a href="#testimonials">Testimonials</a></li>
</ul>
</nav>
<h1>ActivityPub plugin for GNU social</h1>
<p>Developed by <strong><a href="https://www.diogo.site/">Diogo Cordeiro</a></strong> during <strong><a href="https://summerofcode.withgoogle.com/archive/2018/projects/5289876471676928/">Google Summer of Code 2018</a></strong></p>
<p>Mentored by <a href="https://github.com/dansup">Daniel Supernault</a> and <a href="https://mmn-o.se/">Mikael Nordfeldth</a></p>
</header>
<article id="about">
<h1><a href="#about">About the project and this document</a></h1>
<h2>What is this document?</h2>
<p>This is a technical Google Summer of Code Project Report describing
briefly what I did from April 23 to August 6.
</p>
<p>The whole code I wrote during this period is available
<a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2">here</a>.
The API documentation is available
<a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377">here</a>.
</p>
<p>This document helps understanding what was done in a simple and informal way,
highlighting the most relevant parts, why some decisions were made and what
I've learned with it.
</p>
<p>The following document is intended to be reasonably self contained
and capable of quickstarting anyone in the world of ActivityPub implementation,
yet not replacing the official standard specification.
</p>
<p>From April 23 to May 14 I had to familiarize myself with the
Activity Pub standard and GNU social's plugins/events API and community.
</p>
<h2>What is GNU social?</h2>
<p>GNU social is a social communication software used in federated
social networks.
</p>
<h2>ActivityPub?</h2>
<p>In order to achieve said decentralization, a variety of standards on
how communication between different pieces of software in a federated
context should be done were created, such as OStatus. <a href="https://www.w3.org/TR/activitypub/">ActivityPub</a>, however,
is the newest and covers parts left out of OStatus's specification, namely
app/client development.
</p>
<h3>Benefits</h3>
<ul>
<li>The tendency is that newer software will focus in the
implementation of the ActivityPub Protocol (as it is newer
and considered to be simpler) instead of OStatus, given
that, it is important for GNU social to support it in order to stay updated
and relevant in an even larger <a href="https://en.wikipedia.org/wiki/Fediverse">fediverse</a>;
</li>
<li>It will simplify app/client development which is not covered by the
OStatus's specification and is becoming more and more relevant,
with the increase of smartphone users.
</li>
</ul>
<h2>Why a plugin?</h2>
<h3 id="unix-tools-design-philosophy">Unix tools design philosophy</h3>
<p>GNU social is true to the Unix-philosophy of small programs to do a
small job.
</p>
<blockquote>
<ul>
<li>Compact and concise input syntax, making full use of ASCII repertoire to minimise keystrokes</li>
<li>Output format should be simple and easily usable as input for other programs</li>
<li>Programs can be joined together in “pipes” and “scripts” to solve more complex problems</li>
<li>Each tool originally performed a simple single function</li>
<li>Prefer reusing existing tools with minor extension to rewriting a new tool from scratch</li>
<li>The main user-interface software (“shell”) is a normal replaceable program without special privileges</li>
<li>Support for automating routine tasks</li>
</ul>
<footer>- Brian W. Kernighan, Rob Pike: The Unix Programming Environment. Prentice-Hall, 1984.</footer>
</blockquote>
<p>As so the project aims at building a plugin that will
implement the ActivityPub Protocol in GNU social.
</p>
</article>
<article id="activitypub">
<h1><a href="#activitypub">So how does ActivityPub work?</a></h1>
<p>The ActivityPub protocol is a decentralized social networking
protocol based upon the <a href="https://www.w3.org/TR/activitystreams-core/">ActivityStreams</a> 2.0 data format.
It provides a client to server API for creating, updating and deleting
content, as well as a federated server to server API for delivering
notifications and content.
</p>
<img src="https://www.w3.org/TR/activitypub/illustration/tutorial-2.png">
<blockquote>
<p><strong>Note:</strong> You are advised to read (at least) the <a href="https://www.w3.org/TR/activitypub/#Overview">standard
overview</a> before continuing.
</p>
</blockquote>
<h2>Actor</h2>
<p>Actor is the user doing a change in the fediverse and are identified by an URI.
In GNU social they have the following format:
<code>https://myinstance.net/user/{id}</code>. Thus allowing users to change their
usernames (or nicknames).
</p>
<h2 id="objects">Objects</h2>
<p>Objects are our building blocks for the bigger concept of Activity.
The plugin has the following objects:
</p>
<ul>
<li>Actors are defined by the <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#profile">profile object</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_profile.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Error">Error</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_error.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Tag">Tag</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_tag.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Mention">Mention Tag</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_mention_tag.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Notice">Notice</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_notice.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Attachment">Attachment</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_attachment.php">here</a>.</li>
</ul>
<blockquote>
<p><strong>Note:</strong> Tags, Attachment and Image are ("minor")
objects and, usually, wrapped by ("major") objects.
</p>
</blockquote>
<h2>Activities</h2>
<p>Wrappers allow to give additional information on a given object.
The implemented wrappers are the following:
</p>
<ul>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Create">Create</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_create.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Announce">Announce</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_announce.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Delete">Delete</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_delete.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Undo">Undo</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_undo.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Accept">Accept</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_accept.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Reject">Reject</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_reject.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Like">Like</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_like.php">here</a>.</li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin-doc/src/7188c0039793969417b4be912615125658f69377/objects_and_activities.md#Follow">Follow</a> which can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_follow.php">here</a>.</li>
</ul>
<p>By wrapping an <a href="#objects">object</a> with one of those we are
able to perform an action in name of a given Actor.
</p>
</article>
<article id="plugin-workflow">
<h1><a href="#plugin-workflow">And how does the plugin work?</a></h1>
<p>For the plugin I decided to create two key components.</p>
<h2 id="explorer">The Explorer</h2>
<p>Defined in this <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/utils/explorer.php">file</a> it is responsable for grabbing remote users and creating an identity for those in the local instance. It is higly related with <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_profile.php">Activitypub_profile.php</a>.</p>
<h2 id="postman">The Postman</h2>
<p>This guy does the magic of <code>publishing</code> the <code>activities</code>
(thus the name ActivityPub!) to remote instances, he kinda is the
responsable for the federation provided by this plugin. Its code is <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/utils/postman.php">here</a>.
</p>
<h3>Becoming familiar with GNU social's events</h3>
<p>We just know what and when to deliver something thanks to <a href="https://git.gnu.io/gnu/gnu-social/blob/nightly/EVENTS.txt">GNU social's events</a>.</p>
<h4>Events the plugin is handling</h4>
<div class="tasks">
<h5>Discovery Events</h5>
<ul>
<li>Find remote profiles from mentions in texts (<em>onEndFindMentions)</em></li>
<li>Allow to reference a remote profile (<em>onStartCommandGetProfile)</em></li>
<li>Allow to reference a remote profile (<em>onStartGetProfileUri)</em></li>
</ul>
<h5>Delivery Events</h5>
<ul>
<li>Notify remote instance of subscription (<em>onEndSubscribe</em>)</li>
<li>Notify remote instance when a subscription is canceled (<em>onEndUnsubscribe</em>)</li>
<li>Notify remote instances when a notice is liked (<em>onEndFavorNotice</em>)</li>
<li>Notify remote instances when a notice like is reverted (<em>onEndDisfavorNotice</em>)</li>
<li>Notify remote instances when a notice is deleted (<em>onEndDeleteOwnNotice</em>)</li>
<li>Notify remote instances when a notice is created (<em>onStartNoticeDistribute</em>)</li>
</ul>
</div>
<p>These are not the only events this plugin is listening to, but are
the most relevant. All these events hooks can be found <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/ActivityPubPlugin.php">here</a>.
</p>
</article>
<article id="inboxes">
<h1><a href="#inboxes">Hold on, if you have a Postman then there sure is an inbox, right?</a></h1>
<p>Two actually! :)</p>
<p>Fediverse is similar to the real world in some aspects. And one of those
is that people, sometimes, share the same "building". A list of some
public GNU social instances is available <a href="https://gnu.io/social/try/">here</a>.
</p>
<p>Well, if two people live in the same place then our <a href="#postman">Postman</a> doesn't have to "travel" twice! Thus
the concept of <code><a href="https://www.w3.org/TR/activitypub/#shared-inbox-delivery">shared inbox</a></code>.
</p>
<p>Lets start with the <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a>. An
inbox is where we, I mean, the <a href="#postman">Postman</a> publishes
our Activity.
</p>
<p>By now you should have already realized that Activities are just
verbs wrapping objects thus basically forming a phrase:
<code>Actor</code> <code>verb</code> <code>Object</code> <code>to Attention Actor(s)</code>.
</p>
<p>Well, for each <code>Attention actor</code> we deliver the same
<code>Actor</code> <code>verb</code> <code>Object</code>.
</p>
<p>Since it is the same message and frequently for people residing
in the same server we can obviously reduce a lot of traffic and
processing power here.
</p>
<p>The <a href="#postman">Explorer</a> hands the <a href="#postman">Postman</a> the sharedInbox address always that
it is possible.
</p>
<ul>
<li>
<p>Inbox Handler code is <a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/utils/inbox_handler.php">here</a>.</p>
</li>
</ul>
</article>
<article id="collections">
<h1><a href="#collections">Our plugin also is a collector</a></h1>
<p>The following collections have been implemented:</p>
<div class="tasks">
<ul>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/actions/apactorfollowers.php">Followers</a></li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/actions/apactorfollowing.php">Following</a></li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/actions/apactorliked.php">Liked</a></li>
<li><a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/actions/apactoroutbox.php">Outbox</a></li>
</ul>
</div>
<p>Collections are lists. And lists are very important in the world of
fediverse both for <a href="https://www.w3.org/TR/activitypub/#server-to-server-interactions">Server
to Server</a> and <a href="https://www.w3.org/TR/activitypub/#client-to-server-interactions">Client
to Server</a>.
</p>
</article>
<article id="todo">
<h1><a href="#todo">What is left to do?</a></h1>
<p>This plugin fulfills and even exceeds what I've originally proposed to
do during this summer (hooray!). But there is still room for further development
and improvement!
</p>
<h2>Todo</h2>
<ul>
<li>Finish implementing Client to Server</li>
<li>Implement a Circuit Breaker</li>
<li>Redis caching of collections</li>
<li>Queues</li>
</ul>
</article>
<article id="left-out">
<h1><a href="#left-out">So, that was it?</a></h1>
<p>Not really, this document doesn't describe the implementation of
<a href="https://notabug.org/diogo/gnu-social-activitypub-plugin/src/6fbf37b7fee8c73271a47089a4f4a70304cf15a2/classes/Activitypub_rsa.php">
HTTP Signatures</a>, the internal representation of ActivityPub Actors,
nor the details of Activity Streams or even the particularities of integrating
this in GNU social (I'm looking at you OStatus plugin). As stated in the
beginning of this document, the whole code and documentation is available
above, this was just meant to make the reading easier.
</p>
<h2>I'm interested in implementing ActivityPub on my program and reading
this really helped me! Is there something else that I should know of that
wasn't mentioned in the article?
</h2>
<p>Be sure to know <a href="https://www.restapitutorial.com/httpstatuscodes.html">HTTP Status Codes</a>
and to start soon with the <a href="https://en.wikipedia.org/wiki/Test-driven_development">Test-driven development</a>.
</p>
<p>And, obviously, follow rigorously the ActivityPub specification!</p>
<p>If you need help you can <a href="https://www.diogo.site/#contact">contact me</a>
or Daniel Supernault directly or, even better, join the
<a href="irc://irc.w3.org:6665/social">W3C social IRC channel (#social@irc.w3.org)</a>,
you will definitely find us both there! :)
</p>
<article id="acknowledgements">
<h1><a href="#acknowledgements">Final Words</a></h1>
<p>GSoC was a wonderful experience for me. I now feel more comfortable
with the GNU socials codebase. I learned a lot of useful stuff like
ActivityPub, ActivityStreams, HTTP Signatures, PSR and Redis as well as
software engineering concepts like Circuit Breakers. I've also learned
more about Git and how libre and open source software development is
done and organized.
</p>
<p>I will try my best to regularly contribute to GNU social and other
projects.
</p>
<p>Thanks to Daniel Supernault and Mikael Nordfeldth for such a
wonderful experience and the knowledge.
</p>
</article>
<article id="testimonials">
<h1><a href="https://www.diogo.site/testimonials.html">Testimonials</a></h1>
<blockquote>
<p style="margin:0">You're active, persistent and productive. Keep it up and we'll all have a great summer of code!</p>
<footer>- Mikael Nordfeldth, GNU social Maintainer (2018) on my first GSoC evaluation</footer>
</blockquote>
<a href="https://mastodon.social/@dansup/100331648394320885"><img src="images/testimonial1.png"></a>
<a href="https://mastodon.social/@dansup/100353565526207146"><img src="images/testimonial2.png"></a>
<a href="https://mastodon.social/@dansup/100416797627457542"><img src="images/testimonial3.png"></a>
</article>
</article>
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

248
soc/2019/ideas.php Normal file
View File

@ -0,0 +1,248 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Google Summer of Code 2019 Ideas | GNU social</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://hackersatporto.com/assets/css/main.css">
<style>
video {
width: 100%;
height: auto;
}
body {
/*max-width: 81em;*/
max-width: 52em;
/*background: #fefefe;*/
}
/* Youtube video old
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Youtube video
.videoWrapper {
position: relative;
width: 100%;
height: 0;
background-color: #000;
}
.videoWrapper169 {
padding-top: 56%;
}
.videoIframe {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background-color: transparent;
}
.videoPoster {
position: absolute;
top: 0;
right: 0;
left: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
cursor: pointer;
border: 0;
outline: none;
background-position: 50% 50%;
background-size: 100% 100%;
background-size: cover;
text-indent: -999em;
overflow: hidden;
opacity: 1;
-webkit-transition: opacity 800ms, height 0s;
-moz-transition: opacity 800ms, height 0s;
transition: opacity 800ms, height 0s;
-webkit-transition-delay: 0s, 0s;
-moz-transition-delay: 0s, 0s;
transition-delay: 0s, 0s;
}
.videoPoster:before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 80px;
height: 80px;
margin: -40px 0 0 -40px;
border: 5px solid #fff;
border-radius: 100%;
-webkit-transition: border-color 300ms;
-moz-transition: border-color 300ms;
transition: border-color 300ms;
}
.videoPoster:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
margin: -20px 0 0 -10px;
border-left: 40px solid #fff;
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
-webkit-transition: border-color 300ms;
-moz-transition: border-color 300ms;
transition: border-color 300ms;
}
.videoPoster:hover:before, .videoPoster:focus:before {
border-color: #f00;
}
.videoPoster:hover:after, .videoPoster:focus:after {
border-left-color: #f00;
}
.videoWrapperActive .videoPoster {
opacity: 0;
height: 0;
-webkit-transition-delay: 0s, 800ms;
-moz-transition-delay: 0s, 800ms;
transition-delay: 0s, 800ms;
}*/
</style>
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="../"><strong>&larr; GS GSoC</strong></a></li>
<li><a href="#about">About</a></li>
<li><a href="#todo">Ideas</a></li>
<li><a href="#apply">Apply</a></li>
</ul>
</nav>
<h1>GNU social Summer of Code 2019 - WARNING: THIS IS AN ARCHIVE OF OUR 2019 IDEAS PAGE</h1>
<strong>For the latest ideas page, <a href="https://www.diogo.site/projects/GNU-social/soc/current/">click here</a>.</strong>
<p>Organized by <strong><a href="https://www.diogo.site/">Diogo Cordeiro</a></strong></p>
<p>Mentors: <a href="https://github.com/dansup">Daniel Supernault</a>, <a href="https://www.diogo.site/">Diogo Cordeiro</a> and <a href="https://mmn-o.se/">Mikael Nordfeldth</a></p>
</header>
<article id="about">
<?php
$video_data = json_decode(file_get_contents("https://you-link.herokuapp.com/?url=https://www.youtube.com/watch?v=z_3dsP_FCAM"));
?>
<h2>Ready?</h2>
<!-- HTML video -->
<video width="720" controls class="image" style="margin-left: auto; margin-right: auto; display: block" poster="../../images/youtube-poster-gs-on-gsoc.png">
<source src="<?php echo $video_data[1]->url; ?>" type="video/mp4">
<source src="../../videos/gs-on-gsoc.webm" type="video/webm">
</video>
<!-- Youtube video
<div onclick="this.nextElementSibling.style.display='block'; this.style.display='none'">
<img src="../../images/youtube-poster-gs-on-gsoc.png" style="cursor:pointer" />
</div>
<div style="display:none">
<div class="video-container"><iframe width="853" height="480" src="https://www.youtube-nocookie.com/embed/z_3dsP_FCAM?modestbranding=1&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
</div>
<div class="videoWrapper videoWrapper169 js-videoWrapper">
<!-- YouTube iframe. -->
<!-- note the iframe src is empty by default, the url is in the data-src="" argument -->
<!-- also note the arguments on the url, to autoplay video, remove youtube adverts/dodgy links to other videos
<iframe class="videoIframe js-videoIframe" src="" allowtransparency="true" allowfullscreen="" data-src="https://www.youtube-nocookie.com/embed/z_3dsP_FCAM?autoplay=1&amp; modestbranding=1&amp;rel=0" frameborder="0"></iframe>
<!-- the poster frame - in the form of a button to make it keyboard accessible
<button class="videoPoster js-videoPoster" style="background-image:url(../../images/small-poster-gs-on-gsoc.png);">Play video</button>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
// poster frame click event
$(document).on('click', '.js-videoPoster', function (ev) {
ev.preventDefault();
var $poster = $(this);
var $wrapper = $poster.closest('.js-videoWrapper');
videoPlay($wrapper);
});
// play the targeted video (and hide the poster frame)
function videoPlay($wrapper) {
var $iframe = $wrapper.find('.js-videoIframe');
var src = $iframe.data('src');
// hide poster
$wrapper.addClass('videoWrapperActive');
// add iframe src in, starting the video
$iframe.attr('src', src);
}
</script>-->
<br>
<p>GNU social is a social communication software used in <a href="https://blog.diogo.site/posts/what-is-the-fediverse">federated social networks</a>. It is widely supported and has a large userbase. It is already used by the Free Software Foundation, and Richard Stallman himself.</p>
<p>If you would like to know how is it like to be a GSoC student at GNU social, <a href="https://blog.diogo.site/posts/gsoc-2018">read this blog post</a>!</p>
<h3>What would be expected from me?</h3>
<dl>
<dt><strong>Reliability Engineering</strong></dt>
<dd>Fix bugs of current code base and ensure it stays functional</dd>
<dt><strong>Software Engineering</strong></dt>
<dd>Further development of GNU social v2</dd>
<dt><strong>Computer Security Engineering</strong></dt>
<dd>Ensure GS is secure</dd>
</dl>
<p>Every student will have to pick tasks in each of these fields in GS's GSoC. Excited already? Then read below some of our ideas and learn how you can be part of this!</p>
<p>Difficulty varies per task but in general GS's SoC is demanding, so you better be honestly interested and willing to work hard and learn a lot.</p>
</article>
<article id="todo">
<h2>Ideas</h2>
<p>Below is a list of (not very defined) ideas of things/areas you can work on this summer at GNU social. They are just ideas, not full proposals. You should pick some of them that seem to be related and talk on IRC about it. The community will help you understanding what has to be done so you can put a good proposal together.</p>
<h3 id="todo-finish-ap-plugin">Make the ActivityPub plugin started in previous GSoC reliable</h3>
<p>In previous GSoC an ActivityPub plugin for GS was developed but isn't compatible with every piece of software used in the fediverse (only working with Mastodon so far) nor completely safe and robust for large usage.</p>
<p>Some of the existing key problems are:</p>
<ul>
<li>It is unable to de-duplicate when OStatus and ActivityPub are both enabled - mostly noticed between GS instances with both enabled;</li>
<li>Is unable to verify signatures which is an attack vector that makes the plugin unsafe for use right now;</li>
<li>It also doesn't make use of queues nor collections caching nor has any kind of circuit breaker implemented. This makes its use risky in a highly active GS instance.</li>
</ul>
<h3 id="todo-storage">Optimize how storage is used</h3>
<p>Add support for temporary posts: This will allow support for "stories" and empower whole instances (and/or single users) to have temporary posts.</p>
<p>Optimize OEmbed plugin and further development on image handler: Work on this has already been started.</p>
<h3 id="todo-third-party-developer-interfaces">Review third party developer interfaces</h3>
<p>There are various bots in the fediverse and we feel it might be about time to set them apart from humans so that we know who to kill when the robotic uprising comes, so to speak (ahem).</p>
<p>Ultimately, bots aren&rsquo;t humans and, therefore, they shouldn&rsquo;t have accounts claiming that they are &ldquo;Persons&rdquo;.</p>
<p>So some good measures for making change are:</p>
<ul>
<li>Introduce <strong>OAuth 2</strong> in GNU social for authentication of clients that aren&rsquo;t browsers;</li>
<li>Review current APIs for <strong>Tools</strong> that act in the User&rsquo;s behalf and introduce a user platform for the management of those;</li>
<li>Review current APIs for <strong>Bots</strong> that act in their own behalf and introduce a developer platform for the management of those.</li>
</ul>
<p>Technical sidenote for those who have read the ActivityPub standard: GS Bots are represented as Actors with the <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-application">Application</a> type, while GS Tools are an internal (not federated) thing that allow Actors with the <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person">Person</a> type (commonly referred to as Users) to use third party tools to control their account.</p>
<h3 id="todo-gs2">&ldquo;We have you noticed we&rsquo;ve straighten every dent up&rdquo;</h3>
<p>Props to <a href="https://loadaverage.org/XRevan86">XRevan86</a> for that pun! (Notices in GNU social are colloquially referred to as Dents).</p>
<p>GNU social wants to get polished with a <span id="todo-themes">modern looking default theme</span>. For this, it would be interesting to come up with some themes guidelines so, if you&rsquo;re into web design, this might be <em>the task</em> for you! :)</p>
<p>On the other hand, if you are more into backend development, we&rsquo;ve got you covered. Some new and interesting concepts in the world of Software Engineering were introduced and we are naturally looking forward to include them and refresh the current code base for the release of GNU social 2 with them!</p>
</article>
<article id="apply">
<h2>How to apply?</h2>
<p>First read <a href="https://www.gnu.org/software/soc-projects/guidelines.html">GNU's guidelines</a> on how to prepare a good proposal.</p>
<p>Then please contact us on GS's <a href="irc://irc.freenode.net:6697/social">IRC channel (#social@irc.freenode.net)</a> to get started on your proposal. For an example proposal, you can refer to <a href="https://www.diogo.site/projects/GNU-social/soc/2018/proposal.pdf">AP plugin proposal</a>.</p>
<p>We also suggest that you <a href="https://gnusocial.network/try/">create an account in the fediverse</a>.</p>
<p>You can contact Diogo either on the above mentioned IRC channel (under the nick: up201705417), <a href="https://www.diogo.site/#contact">by email</a> or on his <a href="https://loadaverage.org/diogo">GNU social profile</a>.</p>
<a href="https://summerofcode.withgoogle.com/" class="BigButton"><strong>GO!</strong></a>
</article>
</body>
</html>

78
soc/2019/index.html Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Google Summer of Code 2019 | GNU social</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://hackersatporto.com/assets/css/main.css">
<style>
#side-menu #menu-title {
color: #7a7a7a !important;
font-weight: 700;
}
@media screen and (max-width: 1200px) {
#side-menu #menu-title {
display:none;
}
}
</style>
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="../"><strong>&larr; GS GSoC</strong></a></li>
<li><a href="#about">How was it?</a></li>
<li><a href="ideas.php">Ideas of 2019</a></li>
<li id="menu-title">Tech Reports</li>
<li><a href="#network">Network</a></li>
<li><a href="#load">Load</a></li>
</ul>
</nav>
<h1>GNU social Summer of Code 2019</h1>
<p>Organized by <strong><a href="https://www.diogo.site/">Diogo Cordeiro</a></strong></p>
</header>
<article id="about">
<h2>What a summer!</h2>
<span class="image right"><img src="coding_environment.jpg" alt=""></span>
<p>We are truly proud of all the progress we made with the help of our students. GNU social mentees have to submit code on the level of typical contributors without spoon-feeding and that's something achieved in all of ours GSoC editions.</p>
<p>A GNU social contributor deals with {reliability, software and computer security} engineering. Mastery with full-stack web development and git is acquired in a hands-on way without ever dismissing theoretical computer science teachings for optimal efficiency and effective designs.</p>
<p>GNU social is a beautiful software that follows GNU and UNIX philosophies by heart.</p>
<p>A big thanks for all the support of our lovely community and devs who have been with us in yet another great journey!</p>
</article>
<article id="network">
<h2>Network Services Improvements</h2>
<p>Proposed by <a href="https://loadaverage.org/tenma">Bruno Casteleiro</a> and mentored by <a href="https://www.diogo.site/">Diogo Cordeiro</a></p>
<ul>
<li>Improvements on OpenID support</li>
<li>Improvements on URLMapper</li>
<li>The Free Network - fluid transition between federation protocols</li>
<li>Some ActivityPub support improvements:
<ul>
<li>Add Queues</li>
<li>Add collection caching</li>
<li>Proper audience targetting</li>
<li>Inbox Forwarding</li>
<li>Groups over ActivityPub</li>
</ul>
</li>
</ul>
<a href="tech_report/network/" class="BigButton">Technical Report</a>
</article>
<article id="load">
<h2>Optimizations on Load Balance System and Storage Usage</h2>
<p>Proposed by <a href="https://loadaverage.org/biodan">Miguel Dantas</a> and mentored by <a href="https://www.diogo.site/">Diogo Cordeiro</a></p>
<ul>
<li>Improvements on the OEmbed plugin (turned into Embed plugin)</li>
<li>Improvements on the Media Handling System</li>
<li>Added Redis support (queues and caching)</li>
<li>Fixed Memcached support</li>
</ul>
<a href="tech_report/load/" class="BigButton">Technical Report</a>
</article>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Optimizations on Load Balance System and Storage Usage - Tech Report - GNU social Summer of Code 2019</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.diogo.site/projects/excalibur_template/assets/css/main.css">
<style>
@page {
size: A4 portraint;
}
@page :blank {
@top-center { content: "This page is intentionally left blank." }
}
h1 {
page-break-before: always;
}
h1, h2, h3, h4, h5 {
page-break-after: avoid;
}
table, figure {
page-break-inside: avoid;
}
@page:right{
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="../../"><strong>&larr; GS GSoC 2019</strong></a></li>
<li><a href="#about">About</a></li>
<li><a href="#image-system">Image System</a></li>
<li><a href="#embed-plugin">Embed Plugin</a></li>
<li><a href="#queue-system">Queue System</a></li>
<li><a href="#caching-system">Caching System</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
</ul>
</nav>
<h1 class="title">Optimizations on GNU social's Load Balance and Storage systems</h1>
<p>Developed by <strong><a href="https://http://loadaverage.org/biodan">Miguel Dantas</a></strong> during <strong><a href="https://summerofcode.withgoogle.com/archive/2019/#5289618063228928">Google Summer of Code 2019</a></strong></p>
<p>Mentored by <a href="https://www.diogo.site/">Diogo Cordeiro</a></p>
</header>
<h2 id="about">About</h2>
<h3 id="what-is-this-document">What is this document?</h3>
<p>This is a technical Google Summer of Code Project Report describing briefly what I did from May 6 to August 26.
</p>
<p>All the code I wrote during this period is available
<a href="https://notabug.org/diogo/gnu-social/src/7291e1b2a4d01a03400a1685879d4faa62c1645d">here</a>.
</p>
<p>This document helps understand what was done in a simple and informal way, highlighting the most relevant parts, why some decisions were made and what Ive learned with it.</p>
<p>From May 6 to May 27 I had to familiarize myself with the GNU socials plugins and events API, as well as other internal components and the community.</p>
<h3 id="what-is-gnu-social">What is GNU social?</h3>
<p>GNU social is a social communication software used in federated social networks. That requires queues and caching systems that are friendly to use and yet powerful and robust enough to handle the high load in servers with limited network, low storage
and reduced processing power. While scalable enough to take advantage of more powerful systems.</p>
<h3 id="abstract">Abstract</h3>
<p>TODO</p>
<h4 id="benefits">Benefits</h4>
<ul>
<li>Improvements on the Image Systems</li>
<li>Improvements of the Embed plugin</li>
<li>Improvements on the Queue System</li>
<li>Improvements on the Caching System</li>
<!--<li>Cleanup and organize the <code>lib</code> folder into semantic categories</li>-->
</ul>
<h2 id="image-system">Image System</h2>
<p>The new Image handling system was my first bigger project and in it I essentially reviewed and refactored the existing code, followed by making sure a consistent and filesystem safe encoding is use for the filename, which is then further provided
when the file download is requested. This very file download was moved into PHP code so that the code could have easy control over what files are accessed; the main goal with this change was to allow arbitrary file uploads, while still ensuring
that no file is directly publicly accessible, as a misconfigured webserver or a maliciously crafted file could cause unwanted execution. In addition, this will allow, in the future, for easy permission control, via events, if a plugin to do so
is written. Along the same lines, it was important to make image validation more aggressive. While not immediately apparent, an image and a script may be contained in the same file and it was possible for a file to be identified as an image by
the upload code and then be executed by the webserver.</p>
<h2 id="embed-plugin">Embed Plugin</h2>
<p>The existing Oembed plugin did a valiant attempt trying to get both Oembed and OpenGraph info about a page. The problem, besides the poor name given the dual purpose, was that it used an in-house implementation, which was not complete. This was therefore
replaced by an external library called <code>Embed</code>, by <code>oscarotero</code>. After refactoring and checking the existing code, as well as making sure the same filename conventions as above were in effect, image handling became significantly
more robust, eliminating the barrage of errors users would previously see, instead of images. In addition, I made it so only a configurable thumbnail size for the images was saved to disk, while still supporting upscaling should further themes
need it, which should significantly reduce disk space usage.</p>
<h2 id="queue-system">Queue System</h2>
<p>The queue system received a refactor and checking, modernizing and cleaning up the code in places. I also added the option to use Redis as a backing for this, through a new <code>RedisQueue</code> plugin.</p>
<p>In addition, the existing DB, STOMP and UNQUEUE queue managers were broken out into plugins, allowing for easier management as well as making it more unified.</p>
<h2 id="caching-system">Caching System</h2>
<p>Similarly, the caching system received the same treatment and a new <code>RedisCache</code> plugin was created.</p>
<!--
<h2 id="lib-refactor"><code>lib</code> Refactor</h2>
<p>The entire <code>lib</code> folder was separated into categories of semantic meaning. At first I planned to use the <code>@category</code> tags in some files, but this proved both sparse and unreliable, as some seem to have been copied. This change also required updating the internal autoload system, which while clever in concept, consisted, in practice, of a bunch of <code>if</code> statements. My change made it much more easily expandable and cleaner.</p>
-->
<h2 id="acknowledgements">Final Words</h2>
<p>GSoC was a wonderful experience for me. I now feel more comfortable with the GNU socials codebase as well as more confident in tackling other such large codebases. I learned a lot of useful stuff general software design principles, maintainability,
web security and Redis. Ive also learned more about <code>git</code> and how libre and open source software development is made and organized.</p>
<p>I look forward to regularly contributing to GNU social and other projects.</p>
<p>Thanks to Diogo Cordeiro for such a wonderful experience and the help and knowledge he lent.</p>
</body>
</html>

View File

@ -0,0 +1,166 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Improvements on GNU social's network systems - Tech Report - GNU social Summer of Code 2019</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.diogo.site/projects/excalibur_template/assets/css/main.css">
<style>
@page {
size: A4 portraint;
}
@page :blank {
@top-center { content: "This page is intentionally left blank." }
}
h1 {
page-break-before: always;
}
h1, h2, h3, h4, h5 {
page-break-after: avoid;
}
table, figure {
page-break-inside: avoid;
}
@page:right{
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="../../"><strong>&larr; GS GSoC 2019</strong></a></li>
<li><a href="#about">About</a></li>
<li><a href="#openid">OpenID</a></li>
<li><a href="#routing">Routing</a></li>
<li><a href="#private-messaging">Private Messaging</a></li>
<li><a href="#activitypub">ActivityPub</a></li>
<li><a href="#remote-actions">Remote Actions</a></li>
<li><a href="#todo">TODO</a></li>
</ul>
</nav>
<h1>Improvements on GNU social's network systems</h1>
<p>Developed by <strong><a href="https://http://loadaverage.org/tenma">Bruno Casteleiro</a></strong> during <strong><a href="https://summerofcode.withgoogle.com/archive/2019/#6563945798696960">Google Summer of Code 2019</a></strong></p>
<p>Mentored by <a href="https://www.diogo.site/">Diogo Cordeiro</a></p>
</header>
<h2 id="about">About</h2>
<h3 id="what-is-this-document">What is this document?</h3>
<p>This is a technical Google Summer of Code Project Report describing briefly what I did from May 27 to August 19.</p>
<p>The whole code I wrote during this period is available <a href="https://notabug.org/diogo/gnu-social/src/c2a0f85274d01b1ea15caebe8d328d2fd290f228">here</a>.</p>
<p>This document helps understanding what was done in a simple and informal way, highlighting the most relevant parts, why some decisions were made and what I've learned with it. Unless explicitly said, the order in which I'll write about my tasks may
not exactly correspond to the real order by which I did the work.</p>
<h3 id="what-is-gnu-social">What is GNU social?</h3>
<p>GNU social is a social communication software used in federated social networks.</p>
<h3 id="abstract">Abstract</h3>
<p>My work for this summer involved, in a general way, working the different network systems of GNU social. Due to an unexpected increase of the workload in some of the tasks, my plan, although still related to network systems, turned to be a lot more
focused in the ActivityPub protocol, a communication standard for federated software. During my journey, other systems like the OpenID protocol or the internal url mapper were part of my work.</p>
<h4 id="benefits">Benefits</h4>
<ul>
<li>Ensuring federation of GNU social with other software that only implement the ActivityPub protocol.</li>
<li>Extending the ActivityPub implementation to correctly handle new interactions important in a social network.</li>
<li>Fix, extend and improve core code, ensuring better and greater usability.</li>
</ul>
<h2 id="openid">OpenID</h2>
<p>OpenID is an authentication protocol that allow users to use an unique identifier to login in multiple sites without needing to individual registration in each of them.</p>
<p>In GNU social, OpenID support is provided by a plugin and my task was to perform a revision of it.</p>
<h3 id="related-work">Related work</h3>
<p>During my revision it was necessary to update the external libraries used by the plugin. Since no code changes were required afterwards, this was a trivial update.</p>
<p>The OpenID user interface was also updated. Users had no option to choose whether to sync or not their GNU social accounts when adding an OpenID identifier in the settings. I've extended the interface with such sync option.</p>
<h3 id="learnings">Learnings</h3>
<p>Being the first task, reviewing OpenID helped me to better understand how plugins were structured and the back/front-end code interaction.</p>
<h2 id="routing">Routing</h2>
<p>Internally, the <code>URLMapper</code> class is responsible for the creation of the many routes used in GNU social. This class was known for having a few issues and, having affected some of my work during other tasks, I was responsible to fix some
of those issues in different times during the summer.</p>
<h3 id="related-work-1">Related work</h3>
<p>Fully reworking the Mapper was considered as an option at a certain time, however, taking into account the many routes spread all over the codebase and my work schedule, I decided that fixing the existent class in the best way possible was the safest
and more rentable option I could take.</p>
<h4 id="accept-headers">Accept-Headers</h4>
<p>One of the first changes to the Mapper were result of needing to have two or more routes with exactly the same path to coexist, differentiated only by the accept-headers that should be set in the request.</p>
<p>This necessity was solved by extending the route creation function with an option array of accept-headers. When populated, the function verifies the request accept-headers and in case of any match, it stores/substitutes the new route in the appropriate
variables.
</p>
<h4 id="wrong-matching">Wrong matching</h4>
<p>In some cases, some paths that would differ from one another only in their regex attributes were being routed. Although fundamentally equal, these paths generated different regex's during route creation. Because of this and because of being stored
by order of arrival, path matching was matching the wrong route in some cases.</p>
<p>This problem was solved by simply storing new routes at the head of the according array variable.</p>
<h4 id="dynamics-first">Dynamics first!</h4>
<p>The Mapper distinguishes what are dynamic and static routes. Static routes are the ones with regex attributes in their paths. Because of both being stored in the same place, grouped by the action to be executed, some static routes were incorrectly
being matched in the place of the dynamic ones, simply because of being found first in the storage array.</p>
<p>It makes sense to look all dynamic routes first, specially when these don't have the problem of wrongly match with a request for a static route. Therefore, this problem was solved by separating both types in different variables and explicitly enforcing
the lookup of the dynamic routes first.</p>
<h4 id="so-many-routes">So many routes!</h4>
<p>Spread all over the codebase, a great deal of the calls to the route creation function were making an improper use of the function parameters. All these calls were appropriately fixed.</p>
<h3 id="learnings-1">Learnings</h3>
<p>Specially because of some undo/redo that these changes required, this task was important for me to be more cautious with core code changes. Verification of the surrounding code and careful analysis of the changes to be done is very important.</p>
<h2 id="private-messaging">Private Messaging</h2>
<p>GNU social private messaging support is provided with the <code>DirectMessage</code> plugin . By requirement of the changes related to ActivityPub, this plugin end up being totally reworked by me.</p>
<h3 id="related-work-2">Related Work</h3>
<p>The plugin suffered many changes in practically all of its code, making it hard to write about every change. Still, because of their importance, three changes are worth of an highlight spot:</p>
<h4 id="porting-to-the-notice-db-table">Porting to the Notice DB table</h4>
<p>GNU social already had notices, so it didn't make much sense to have a separated table just for private messages. The most important part of this port was ensuring an upgrade function and the correct handling of a newly introduced Notice <code>MESSAGE_SCOPE</code> scope.</p>
<h4 id="supporting-multi-recipient">Supporting multi-recipient</h4>
<p>Porting to the Notice table automatically enabled text mentioning, so with just a few adjustments the plugin was handling multi-recipient messages.</p>
<h4 id="supporting-federation">Supporting federation</h4>
<p>Of course, the whole reason for this task. Events were added in key points of the private messaging flow for the federation plugins to subscribe and handle in their own way.</p>
<h3 id="learnings-2">Learnings</h3>
<p>Because of its big extent, this task was a test to everything I had learned so far and, therefore, completing it gave me great pleasure and some energy boost for what was to come. In particular, I've learned how to add upgrading logic to plugins.</p>
<h2 id="activitypub">ActivityPub</h2>
<p>Support for the ActivityPub protocol in GNU social is given by means of a plugin wrote by my own mentor, during last year's edition of GSoC. Since the last tests with other federated software some things changed and it was known that some interactions
weren't properly working, so part of my job was to review and ensure ActivityPub could federate again. Furthermore, some functionality was yet to be implemented and other came along the way, summing up the reasons as for why this task to consume
more time than the expected.</p>
<h3 id="related-work-3">Related Work</h3>
<p>Following, the most important changes this plugin seen this summer:</p>
<h4 id="follow-collections">Follow collections</h4>
<p>The followers/following endpoints for ActivityPub users weren't retrieving the most accurate information due to accounting invalid users. This was easily fixed by porting and correctly adapting the subscriptions functions from the core to the plugin.
Furthermore, I've handled the caching of these collections.</p>
<h4 id="ensuring-federation">Ensuring federation</h4>
<p>This sub-task involved ensuring the operation of all interactions supported by the plugin, both from the sender and receiver sides. These interactions are: Accept-Follow, Create-Note, Delete-Note, Follow-Person, Like, Undo-Follow, Undo-Like and Announce.
In some of the cases the changes were something trivial, others require small function rewrites and bug-fixing. The interactions were tested with remote instances of GNU social, Pleroma, Mastodon and Pixelfed.</p>
<p>Later I've also introduced and ensured the operation of the Delete-Person activity.</p>
<h4 id="queue-support">Queue support</h4>
<p>The GNU social queue system was added for ActivityPub notice distributions, these were proving to be quite a time consuming experience.</p>
<h4 id="audience-targeting">Audience targeting</h4>
<p>At this point me and my mentor, Diogo, agreed that, despite not being supported in GNU social, we should still properly handle the different non-public types of notes that the inbox could receive, like the unlisted, followers-only or private/direct
types.</p>
<p>Handling private notes was fairly easy since I had already reworked the <code>DirectMessage</code> plugin, so it was only needed to introduce a new Create-Direct-Note activity and subscribe the DirectMessage events. It is worth mentioning that this
type of note has (yet) no standard way to be differentiated. After some research me and Diogo decided that making GNU social conforming with the discussed <a href="https://github.com/w3c/activitypub/issues/196#issuecomment-304958984">directMessage</a> flag was the best way to handle the activity.</p>
<p>The unlisted and followers-only types of note were handled by storing such notices with a special <code>GATEWAY</code> type flag. This flag was originally introduced to represent notices with origin in services other than the OStatus protocol. Being
that way guarantees that the notice won't show in the public timelines. For the time being, I believe this is the best option for handling such note types: 1. easy to change (if required) in the future when proper support for these types is added
and 2. provides at least the minimum requirements of visibility scope.</p>
<h3 id="learnings-3">Learnings</h3>
<p>With this task I've learned how to use more systems of the program, like the caching and queue systems. Furthermore, I gained further knowledge in different aspects of the ActivityPub standard.</p>
<h2 id="remote-actions">Remote Actions</h2>
<h3>Remote-follow button</h3>
<p>Aiming to provide better user experience and to ensure federation in a general way, this task led to a new <code>RemoteFollow</code> plugin. This plugin is responsible to fully control the remote-follow button that shows on user profiles and to provide
the necessary events for all federation plugins to subscribe and make this button work.</p>
<h3 id="related-work-4">Related work</h3>
<p>As there isn't no standard way to treat a remote-follow button ActivityPub, the common way to do it is to extend the logic of OStatusSub, the OStatus way of handling such button. That is precisely what I did. I've ported the necessary actions related
to remote-following a user from the <code>OStatus</code> plugin and adapted it to be event-driven.</p>
<h3 id="learnings-4">Learnings</h3>
<p>This task was my first time working in the <code>OStatus</code> plugin, so I learned some details of its implementation.</p>
<h3 id="search-box">Search-box</h3>
<p>I've introduced the &quot;ActivityPub way&quot; of fetching remote users and notices, allowing remote-following users without needing to leave the local instance.</p>
<h2 id="todo">Anything left to do?</h2>
<p>Of course, there's always something more to do :)</p>
<ul>
<li>Further ActivityPub improvements (e.g Inbox Forwarding)</li>
<li>ActivityPub C2S (part of the original plan)</li>
<li>Some minor TODOs I left in the <code>DirectMessage</code> plugin (not crucial)</li>
</ul>
</body>
</html>

222
soc/2020/academics.html Normal file
View File

@ -0,0 +1,222 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Assessment | GNU social SoC</title>
<link rel="icon" href="../../favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://hackersatporto.com/assets/css/main.css">
</head>
<body>
<header id="header">
<nav id="side-menu">
<label for="show-menu" id="menu-button">Menu</label>
<input id="show-menu" role="button" type="checkbox">
<ul id="menu">
<li><a href="./"><strong>&larr; GS GSoC</strong></a></li>
<li><a href="#Grading_System_employed_0">Grading</a></li>
<li><a href="#Web_Technologies_69">Proposal</a></li>
<li><a href="#Internship__Training_91">Summer</a></li>
</ul>
</nav>
<h1>GNU social Summer of Code</h1>
<p>Organized by <strong><a href="https://www.diogo.site/">Diogo Cordeiro</a></strong></p>
<p>Mentors: <a href="https://www.diogo.site/">Diogo Cordeiro</a>, <a href="https://loadaverage.org/XRevan86">Alexei Sorokin</a>, <a href="https://dansup.com">Daniel Supernault</a>, <a href="https://www.hackerposse.com/~rozzin/">Joshua Judson Rosen</a> and <a href="https://github.com/phablulo">Phablulo Joel</a></p>
</header>
<article id="about">
<h1 class="code-line" data-line-start=0 data-line-end=1 ><a id="Grading_System_employed_0"></a>Grading System employed</h1>
<h2 class="code-line" data-line-start=2 data-line-end=3 ><a id="Effective_Grading_2"></a>Effective Grading</h2>
<p class="has-line-data" data-line-start="3" data-line-end="4">Either <em>pass</em> or <em>fail</em>.</p>
<h2 class="code-line" data-line-start=5 data-line-end=6 ><a id="Qualitative_Grading_5"></a>Qualitative Grading</h2>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Grade</th>
<th>Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td>31337</td>
<td>Outstanding</td>
</tr>
<tr>
<td>1337</td>
<td>Very Good</td>
</tr>
<tr>
<td>42</td>
<td>Competent</td>
</tr>
<tr>
<td>0</td>
<td>Failed</td>
</tr>
</tbody>
</table>
<h2 class="code-line" data-line-start=13 data-line-end=14 ><a id="Method_13"></a>Method</h2>
<p class="has-line-data" data-line-start="14" data-line-end="15">Graded every month, the ceiled average is the final.</p>
<p class="has-line-data" data-line-start="16" data-line-end="17">No Quantitative Grading system will be used.</p>
<p class="has-line-data" data-line-start="18" data-line-end="19">The contributions will be evaluated according to the following directives:</p>
<blockquote>
<p class="has-line-data" data-line-start="20" data-line-end="21">Autonomy with which the work was done</p>
</blockquote>
<ul>
<li class="has-line-data" data-line-start="21" data-line-end="22">Low (was unable to progress autonomously);</li>
<li class="has-line-data" data-line-start="22" data-line-end="24">Competent (some autonomy but with blocking situations that required the<br>
intervention of the mentor);</li>
<li class="has-line-data" data-line-start="24" data-line-end="26">Very Good (very good ability to solve problems independently in useful time<br>
with the mentor mostly focused on defining the next steps of the work);</li>
<li class="has-line-data" data-line-start="26" data-line-end="28">Outstanding (is sometimes able to suggest surprising and valid alternatives to what was originally planned by the mentor).</li>
</ul>
<blockquote>
<p class="has-line-data" data-line-start="28" data-line-end="29">Objectives satisfaction</p>
</blockquote>
<ul>
<li class="has-line-data" data-line-start="29" data-line-end="30">Low (haven't reached to the minimum objectives admissible for the proposed work);</li>
<li class="has-line-data" data-line-start="30" data-line-end="31">Competent (the objectives were reached though not entirely);</li>
<li class="has-line-data" data-line-start="31" data-line-end="32">Very Good (reached up fully);</li>
<li class="has-line-data" data-line-start="32" data-line-end="34">Outstanding (exceeded up the objectives set).</li>
</ul>
<blockquote>
<p class="has-line-data" data-line-start="34" data-line-end="35">Intrinsic difficulty level of their work</p>
</blockquote>
<ul>
<li class="has-line-data" data-line-start="35" data-line-end="37">Low (relatively easy work, both from a scientific or technical point of view,<br>
based on widespread knowledge);</li>
<li class="has-line-data" data-line-start="37" data-line-end="39">Competent (work with some high complexity of details requiring more advanced<br>
knowledge/expertise, either technical or scientific);</li>
<li class="has-line-data" data-line-start="39" data-line-end="41">Very Good (relatively complex work, requiring a substantial knowledge and<br>
technical skills, or resulting in some innovative contribution);</li>
<li class="has-line-data" data-line-start="41" data-line-end="43">Outstanding (InSaNe).</li>
</ul>
<h3 class="code-line" data-line-start=46 data-line-end=47 ><a id="Grade_formula_per_month_46"></a>Grade formula per month</h3>
<pre>
Autonomy level
Satisfaction of objectives | Low Competent Very Good Outstanding
-----------+-------------------------------------------------------
Low | 0 0 0 0
Competent | 42 42 42 1337
Very Good | 42 1337 1337 31337
Outstanding| 42 1337 1337 31337
Grade from matrix above
Difficulty level | 0 42 1337 31337
-----------+-----------------------------------------
Low | 0 0 42 1337
Competent | 0 42 1337 1337
Very Good | 0 1337 1337 1337
Outstanding| 0 1337 1337 31337
</pre>
<hr>
<h1 class="code-line" data-line-start=67 data-line-end=68 ><a id="Modules_67"></a>Modules</h1>
<p>N.B.: The following are the minimum averages in GNU social's Summer of Code, we will come up with a custom
"transcript" for any interested student.</p>
<h2 class="code-line" data-line-start=69 data-line-end=70 ><a id="Web_Technologies_69"></a>Web Technologies</h2>
<h3 class="code-line" data-line-start=71 data-line-end=72 ><a id="Amount_of_time_allocated_to_each_module_unit_71"></a>Amount of time allocated to each module unit</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Designation</th>
<th>Time (hours)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Autonomous study</td>
<td>80</td>
</tr>
<tr>
<td>Mentorship</td>
<td>20</td>
</tr>
<tr>
<td>Project work</td>
<td>46</td>
</tr>
<tr>
<td>Total</td>
<td>146</td>
</tr>
</tbody>
</table>
<h3 class="code-line" data-line-start=79 data-line-end=80 ><a id="Assessment_Components_79"></a>Assessment Components</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Designation</th>
<th>Weight (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Proposal</td>
<td>80</td>
</tr>
<tr>
<td>Proof of Competence</td>
<td>20</td>
</tr>
</tbody>
</table>
<h3 class="code-line" data-line-start=85 data-line-end=86 ><a id="Proposed_Credits_85"></a>Proposed Credits</h3>
<p class="has-line-data" data-line-start="86" data-line-end="88">1 Carnegie Unit<br>
5 ECTS</p>
<p><strong><a href="proposal_rating_guidelines.txt">Proposal Rating Guidelines</a></strong><p>
<hr>
<h2 class="code-line" data-line-start=91 data-line-end=92 ><a id="Internship__Training_91"></a>Internship | Training</h2>
<h3 class="code-line" data-line-start=93 data-line-end=94 ><a id="Amount_of_time_allocated_to_each_module_unit_93"></a>Amount of time allocated to each module unit</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Designation</th>
<th>Time (hours)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Internship</td>
<td>276.5</td>
</tr>
<tr>
<td>Autonomous Study</td>
<td>93.5</td>
</tr>
<tr>
<td>Final Report</td>
<td>24</td>
</tr>
<tr>
<td>Mentorship</td>
<td>44</td>
</tr>
<tr>
<td>Total</td>
<td>438</td>
</tr>
</tbody>
</table>
<h3 class="code-line" data-line-start=102 data-line-end=103 ><a id="Assessment_Components_102"></a>Assessment Components</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Designation</th>
<th>Weight (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Practical or project work</td>
<td>100</td>
</tr>
</tbody>
</table>
<h3 class="code-line" data-line-start=107 data-line-end=108 ><a id="Proposed_Credits_107"></a>Proposed Credits</h3>
<p class="has-line-data" data-line-start="108" data-line-end="112">4 Carnegie Unit<br>
18 Austria, Italy, and Spain ECTS<br>
16 Finland, The Netherlands, Portugal, and Russia ECTS<br>
15 Germany, Belgium, Romania, and Hungary ECTS</p>
</article>
</body>
</html>

File diff suppressed because it is too large Load Diff