diff --git a/.gitignore b/.gitignore index 36c7e13..2f377df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /vendor/ composer.phar - diff --git a/composer.json b/composer.json index ed8bfd9..e742c36 100644 --- a/composer.json +++ b/composer.json @@ -2,5 +2,10 @@ "require": { "mnapoli/front-yaml": "^1.6", "michelf/php-markdown": "^1.8" + }, + "autoload": { + "psr-4": { + "Rfcs\\": "src/" + } } } diff --git a/draft.php b/draft.php deleted file mode 100644 index 6b49a74..0000000 --- a/draft.php +++ /dev/null @@ -1,32 +0,0 @@ -parse(file_get_contents($filename)); - $yml = $document->getYAML(); - $content = $document->getContent(); - $title = ($yml['title'] ?? 'invalid'); - $author_san = htmlspecialchars($yml['author']); - $description = "Draft {$_GET['name']}: {$yml['title']} by {$author_san}"; - include 'header.php'; -?> -

Draft :

-

Author:
- -Updates: {$num}"; if(next($arr)) { echo ", "; }}?>
- - -Updated by: {$num}"; if(next($arr)) { echo ", "; }}?>
- - - diff --git a/drafts/index.php b/drafts/index.php new file mode 100644 index 0000000..9b37bb1 --- /dev/null +++ b/drafts/index.php @@ -0,0 +1,82 @@ +parse(file_get_contents($filename)); + $yml = $document->getYAML(); + $content = $document->getContent(); + $title = $yml['title'] ?? 'invalid'; + $author = htmlspecialchars($yml['author']); + $description = "Draft {$yml['number']}: {$yml['title']} by {$author}"; + + include __DIR__.'/../header.php'; + + ?> + + < back to list + +

RFC :

+ +

Author: +
+ + + Updates: + {$num}"; + if (next($arr)) { + echo ", "; + } + } + ?> +
+ + + + Updated by: + {$num}"; + if (next($arr)) { + echo ", "; + } + }?> +
+ + + + + +

Draft List

+ + + + + diff --git a/header.php b/header.php index 83c273a..1efbb58 100644 --- a/header.php +++ b/header.php @@ -10,7 +10,7 @@ - + diff --git a/index.php b/index.php index e99fc24..42ae2a6 100644 --- a/index.php +++ b/index.php @@ -1,25 +1,29 @@ - -

Tildeverse RFC system

-
-

...The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as tildeverse/rfcs...

-

...RFC documents are simply requests. They are for simple things like defining how something should work or how something should be done.

-

Standards documents are like mandates. They require something. For example, this document requires a would-be submitter to follow this -format for RFCs. A Standards document can be amended by RFC documents, and any RFC documents in violation of a Standards document, -unless otherwise stated within the Standards document, are invalid.

- -
+ -This system aims to help codify some things about Tildeverse tilde servers. +

Tildeverse RFC system

+ +
+

...The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as tildeverse/rfcs...

+

...RFC documents are simply requests. They are for simple things like defining how something should work or how something should be done.

+

Standards documents are like mandates. They require something. For example, this document requires a would-be submitter to follow this + format for RFCs. A Standards document can be amended by RFC documents, and any RFC documents in violation of a Standards document, + unless otherwise stated within the Standards document, are invalid.

+ +
-

Submission guidelines (from the standard)

+

This system aims to help codify some things about Tildeverse tilde servers.

-

An RFC should be submitted as a PR to the git repo.

+

Submission guidelines (from the standard)

-

Until your RFC gets assigned a number, give it a draft name. For example, a draft name for an RFC to make tilde.chat allow IRC connections without SSL could be draft-tilde-chat-without-ssl.

+

An RFC should be submitted as a PR to the git repo.

-

Your RFC stays a draft until it is accepted. If or when an RFC is accepted, it will be given a number (at which time it must be renamed rfcX.md, where X is -the number). The status must be changed to Accepted and the number tag must contain the assigned number. When you -finish doing this, the PR will be merged.

- +

Until your RFC gets assigned a number, give it a draft name. For example, a draft name for an RFC to make tilde.chat allow IRC connections without SSL could be draft-tilde-chat-without-ssl.

+ +

Your RFC stays a draft until it is accepted. If or when an RFC is accepted, it will be given a number (at which time it must be renamed rfcX.md, where X is the number). The status must be changed to Accepted and the number tag must contain the assigned number. When you finish doing this, the PR will be merged.

+ + diff --git a/navbar.php b/navbar.php index f446715..2349dcf 100644 --- a/navbar.php +++ b/navbar.php @@ -11,16 +11,11 @@ - diff --git a/rfc.php b/rfc.php deleted file mode 100644 index 6daf1dc..0000000 --- a/rfc.php +++ /dev/null @@ -1,32 +0,0 @@ -parse(file_get_contents($filename)); - $yml = $document->getYAML(); - $content = $document->getContent(); - $title = ($yml['title'] ?? 'invalid'); - $author_san = htmlspecialchars($yml['author']); - $description = "RFC {$yml['number']}: {$yml['title']} by {$author_san}"; - include 'header.php'; -?> -

RFC :

-

Author:
- -Updates: {$num}"; if(next($arr)) { echo ", "; }}?>
- - -Updated by: {$num}"; if(next($arr)) { echo ", "; }}?>
- - - diff --git a/rfclist.php b/rfclist.php deleted file mode 100644 index 497c97a..0000000 --- a/rfclist.php +++ /dev/null @@ -1,17 +0,0 @@ - -

RFC List

- - diff --git a/rfcs/index.php b/rfcs/index.php new file mode 100644 index 0000000..8909605 --- /dev/null +++ b/rfcs/index.php @@ -0,0 +1,82 @@ +parse(file_get_contents($filename)); + $yml = $document->getYAML(); + $content = $document->getContent(); + $title = $yml['title'] ?? 'invalid'; + $author = htmlspecialchars($yml['author']); + $description = "RFC {$yml['number']}: {$yml['title']} by {$author}"; + + include __DIR__.'/../header.php'; + + ?> + + < back to list + +

RFC :

+ +

Author: +
+ + + Updates: + {$num}"; + if (next($arr)) { + echo ", "; + } + } + ?> +
+ + + + Updated by: + {$num}"; + if (next($arr)) { + echo ", "; + } + }?> +
+ + + + + +

RFC List

+ + + + + diff --git a/rfc0.md b/rfcs/rfc0.md similarity index 82% rename from rfc0.md rename to rfcs/rfc0.md index b775fc2..809f0fa 100644 --- a/rfc0.md +++ b/rfcs/rfc0.md @@ -2,19 +2,19 @@ title: "Standard 1: RFC Format and Semantics" number: 0 author: Robert Miles -status: Approved +status: Accepted --- -## Abstract {#abstract} +## Abstract This RFC defines the format used by an RFC. RFCs in this system are stored as Markdown files with YAML front-matter. RFC files MAY be stored with any extension commonly used by markdown files. This RFC also defines the semantics of how the RFC system will work. -## Front-matter format {#front-matter-format} +## Front-matter format The front-matter MUST contain the following key-value pairs: - - `title`: The title of the document. Standards documents should be titled in the format `Standards X: Y` where X is the standards number and Y is the title of the standard. ([See below for an explanation of standards.](#doc-types)) + - `title`: The title of the document. Standards documents should be titled in the format `Standards X: Y` where X is the standards number and Y is the title of the standard. ([See below for an explanation of standards.](#types-of-documents)) - `number`: The canonical number of the RFC. Starts at 0 (this document) and counts up in decimal. @@ -30,11 +30,11 @@ The front-matter MAY contain the following key-value pairs: Note that the two lists should be added to in sequence; if RFC 2 updates RFC 1, then RFC 2 needs to have 1 in its `updates` and RFC 1 needs 2 in its `updated-by`. -## Semantics of the RFC System {#semantics-of-system} +## Semantics of the RFC System -The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as [tildeverse/rfcs](//git.tildeverse.org/tildeverse/rfcs). +The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as [tildeverse/rfcs](https://tildegit.org/tildeverse/rfcs). -### Types of Documents {#doc-types} +### Types of Documents RFC documents are simply requests. They are for simple things like defining how something should work or how something should be done. @@ -42,7 +42,7 @@ Standards documents are like mandates. They require something. For example, this format for RFCs. A Standards document can be amended by RFC documents, and any RFC documents in violation of a Standards document, unless otherwise stated within the Standards document, are invalid. -### Procedural Section {#procedural-section} +### Procedural Section Every RFC and Standards document should end with a procedural information section (id tagged as [#procedures](#procedures)). @@ -52,9 +52,9 @@ There are 2 sub-sections to the procedural info section: - Configuration Considerations (tagged [#config](#config)) - For example, if configs need to be changed due to the RFC. -### Submission guidelines {#submission} +### Submission guidelines -An RFC should be submitted as a PR to the [git repo](https://git.tildeverse.org/tildeverse/rfcs). RFCs MUST come with a draft name. +An RFC should be submitted as a PR to the [git repo](https://tildegit.org/tildeverse/rfcs). RFCs MUST come with a draft name. For example, a draft name for an RFC to make tilde.chat allow IRC connections without SSL could be `draft-tilde-chat-without-ssl`. @@ -63,12 +63,12 @@ status `Proposed`. If or when an RFC is accepted, it will be given a number (at the number). The status MUST be changed to `Accepted` and the number tag MUST contain the assigned number. When the former draft meets these requirements, the PR will be merged. -## Procedural Information {#procedures} +## Procedural Information -### Security Considerations {#security} +### Security Considerations There are no security considerations to this document. -### Configuration Considerations {#config} +### Configuration Considerations A subdomain of tildeverse.org has been provisioned for the RFC project, and a repo has been created, in accordance with this document. diff --git a/rfc1.md b/rfcs/rfc1.md similarity index 92% rename from rfc1.md rename to rfcs/rfc1.md index b578175..700be8c 100644 --- a/rfc1.md +++ b/rfcs/rfc1.md @@ -4,11 +4,11 @@ number: 1 author: Robert Miles status: Approved --- -## Abstract {#abstract} +## Abstract tilde.town member [abraxas](//tilde.town/~abraxas/) passed away in a motorcycle accident recently. He shall be missed. -## Clacks-Overhead {#clacks-overhead} +## Clacks-Overhead In Sir Terry Pratchett's Discworld series, the clacks are a series of semaphore towers loosely based on the concept of the telegraph. Invented by an artificer named Robert Dearheart, the towers could send messages "at the speed of light" using standardized codes. When Dearheart's son John died due to an accident while working on a clacks tower, Dearheart inserted John's name into the overhead of the clacks with a "GNU" in front of it (meaning, basically, to send it on, unlogged, and turning around at the end of the line) as a way to memorialize his son forever (or for at least as long as the clacks are standing.) (explanation paraphrased and plagiarized from [GNU Terry Pratchett](https://gnuterrypratchett.com/)) @@ -20,12 +20,12 @@ In this spirit, I propose that we honor our dear friend abraxas, a true townie, > > -- Sir Terry Pratchett, Going Postal -## Procedural Information {#procedures} +## Procedural Information -### Security Considerations {#security} +### Security Considerations There are no security considerations to this document. -### Configuration Considerations {#config} +### Configuration Considerations Conforming tildes must add a configuration block to their web server to serve the message. Examples for most servers can be found [here](http://www.gnuterrypratchett.com/#servers). diff --git a/rfc2.md b/rfcs/rfc2.md similarity index 89% rename from rfc2.md rename to rfcs/rfc2.md index c044742..2d8e27c 100644 --- a/rfc2.md +++ b/rfcs/rfc2.md @@ -4,13 +4,13 @@ author: Robert Miles status: Accepted number: 2 --- -## Abstract {#abstract} +## Abstract IRC bots are programs that communicate with users through Internet Relay Chat. These bots can do a wide assortment of things, from getting weather information to running games. We accept IRC bots on tilde.chat, but we ask that any prospective bot operator follow these rules. -### `!botlist` command {#botlist} +### `!botlist` command The botlist command is our answer to not knowing the functions a bot provides. @@ -28,13 +28,13 @@ Please note that the prefix of `!` is constant: no matter the usual prefix of th All bots on tilde.chat must set usermode +B on or near connect. -## Procedural Information {#procedures} +## Procedural Information -### Security Considerations {#security} +### Security Considerations There are no security considerations to this document. -### Configuration Considerations {#config} +### Configuration Considerations IRC bots on tilde.chat MUST be updated to follow the botlist convention and set usermode +B on connect. diff --git a/rfc3.md b/rfcs/rfc3.md similarity index 97% rename from rfc3.md rename to rfcs/rfc3.md index f6e5a37..ad8d4c6 100644 --- a/rfc3.md +++ b/rfcs/rfc3.md @@ -4,14 +4,14 @@ number: 3 author: Austin Ewens status: Approved --- -## Abstract {#abstract} +## Abstract This document outlines the core philosophy and components that the Tilde Center project is composed of, as well as laying out the fundation to bootstrap the rest of the project for future modifications and expansion to create a sustainable, self-reliant, decentralized network of tilde servers. -## Introduction {#introduction} +## Introduction The [Tilde Center](https://tilde.center) (herein referred to as ~center) project was created by Austin Ewens (better known in the community as ~aewens), @@ -19,7 +19,7 @@ in December 2018. The goal of the project is to create a decentralized and federated server architecture built upon home-brewed open source projects (herein referred to as HBOSP) made by and maintained by its user base. -## Terminology {#terminology} +## Terminology To assist in clarifying the intentions of the project, this section will outline the meanings behind the terminology used thought the document: @@ -49,7 +49,7 @@ another. * Tildeverse - A loose association of like-minded tilde communities (see [here](https://tildeverse.org) for more details). -## Clarifications {#clarifications} +## Clarifications Before going any further into the specifics of the ~center project, some clarifications should be made. @@ -64,7 +64,7 @@ They are unique servers managed by their own system administrator (aka sysadmin), but they share the user accounts along with select data and services with other servers to create a decentralized network of services for its users. -## Peer Servers {#peer-servers} +## Peer Servers To better understand the peer servers in the Tilde Center Network (herein referred to as TCN) it helps to define what they will and will not do: @@ -103,7 +103,7 @@ will not be direct clones of one another). The next few sections will outline some more of the specifics for the points listed above. -### Prerequisites {#prerequisites} +### Prerequisites Due to the nature of the project, it would preferable to have more rather than less peer servers in the TCN for the sake of decentralization (the more peers @@ -119,7 +119,7 @@ across the TCN should aim to minimize the data that actually needs to be stored and processed by all of its peers to make it easier for new peer servers to join the network. -### Center Directory {#center-directory} +### Center Directory On all peer servers there will be a /center directory that will contain the bulk of the ~center related files. Within this directory will be the following @@ -147,7 +147,7 @@ users. This will be linked to $HOME/.center for convenience. Aside from /center/home, all other sub-directories under /center will be synchronized with the other peer servers. -### Dispatcher {#dispatcher} +### Dispatcher Arguably one of the most important components of the ~center server components, the dispatcher will be in charge of federating data across the TCN and handling @@ -159,7 +159,7 @@ execution (RCE), it is important that the dispatcher only receive requests and deliver them to the appropriate targets without ever directly executing the instructions. -#### Communication Model {#communication-model} +#### Communication Model For this to work, dispatcher will use a publish-subscribe communication model where services can subscribe to specific events from the dispatcher and, if @@ -198,7 +198,7 @@ decrypting before parsing its contents, but should still verify that the metadata in the message is valid before making any additional actions on the rest of the message. -#### Stored Information {#stored-information} +#### Stored Information For the dispatcher to properly handle communication with the other peers, it will need to maintain a list of all known peer servers via their last known IP @@ -217,7 +217,7 @@ sysadmin to ensure only valid services are listening to the dispatcher, only receiving appropriate events, and only sending out appropriate events to the peer servers. -#### Adding New Peers {#adding-new-peers} +#### Adding New Peers To facilitate the process of authenticating messages from server-to-server, when a new peer server is created it will generate a UUID and GPG key pair for @@ -312,7 +312,7 @@ the other peers. However, the dispatcher must communicate the new peer server to the rest of its peers so that other peer servers in the TCN can receive dispatcher messages from the new peer server. -### User Accounts {#user-accounts} +### User Accounts When a user joins the TCN, an account is created on the peer server the joined from, which is then subsequently created on all other peer servers. Also, @@ -344,7 +344,7 @@ logged within the ~center database on the peer node. This can be useful for both observing how the TCN is growing along with help to investigate or protect against any rogue peer servers. -### Shared Directory {#shared-directory} +### Shared Directory When a user gets an account on a peer server, they will be provided with a size limited directory to store any files they wish to be available across the other @@ -372,7 +372,7 @@ the peer servers. Should a service be created by one of the users to replace the functionality rsync for this process, it can be put to a vote to use this service instead in favor of the HBOSP philosophy of the ~center project. -### Database {#database} +### Database While the LDAP database takes care of handling the user accounts, peer servers will also need to maintain an SQL database to be used holding the data utilized @@ -433,7 +433,7 @@ this data stored under appmetadata. The tokens is to provide services access to the data they own while also offering a simple system to for services to share data amongst themselves without needing to duplicate entries. -### Services {#services} +### Services Regardless of the efforts that go into providing the ~center project with the architecture to decentralize or federate itself, the true value in the project @@ -441,7 +441,7 @@ is the services provided by the servers. Of which, there are two types of services that the server's users can anticipate: tilde services and ~center services. -#### Tilde Services {#tilde-services} +#### Tilde Services Due to the ~center project being a decentralized network of tilde servers at its core, the peer servers will need to provide services expected from a tilde @@ -456,7 +456,7 @@ standard, at the bare minimum the peer server should provide its users a shell account and access to an IRC server to communicate with the other users on the TCN to be considered an acceptable tilde server to become a peer server. -##### Tilde Chat {#tilde-chat} +##### Tilde Chat During the bootstrapping process of the ~center project, the IRC server currently used in the TCN is [Tilde Chat](https://tilde.chat) since it is an @@ -465,7 +465,7 @@ are members of the Tildeverse). However, this server can be changed later to a ~center operated decentralized IRC network if decided by the users through a vote. -#### Center Services {#center-services} +#### Center Services With one of the core philosophies of the ~center project being the development of HBOSPs by users of the TCN, one of the offerings that will bring value to @@ -485,7 +485,7 @@ resource_id of the transaction belongs to the service. However, realistically this will be done more efficiently by unsubscribing from the events related to the service in the dispatcher so they are never processed to begin with. -## Proposals {#proposals} +## Proposals While this specifies many factors of the ~center project, as time goes by there will likely be a desire to make amendments to the specification of the ~center @@ -498,7 +498,7 @@ once a draft is published and will be canonized once agreed upon by the leadership assigned to making these decisions by the currently used governance model. -### Governance {#governance} +### Governance While some projects do well with having a [BDFL](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life) to handle @@ -551,7 +551,7 @@ users within the next two weeks or the new leadership (whichever occurs first). Should the decision be vetoed via petition, the issue cannot be brought up again until the project is no longer in an emergency state. -## Joining The Network {#joining-the-network} +## Joining The Network Given the unique privileges and influence that peer servers will have in the TCN, peer servers will need to invited into the network by at least one other @@ -582,9 +582,9 @@ is officially a member of the ~center project, but it is recommended to have more than one peer server that it communicates with to strengthen its resilience to losing communications with the rest of the TCN. -## Procedural Information {#procedures} +## Procedural Information -### Security Considerations {#security} +### Security Considerations The certificate authority used to sign the SSL certificate for the LDAP database, the signed certificate itself, credentials to the LDAP root user, @@ -594,7 +594,7 @@ sysadmin(s). Should any one of these be exposed in any way, they should be changed as soon as possible to retain the integrity of the server's and/or network's security. -### Configuration Considerations {#config} +### Configuration Considerations Outside of the configurations already mentioned prior in this document, there are no other required configurations to consider for the Tilde Center project. diff --git a/src/MDParser.php b/src/MDParser.php new file mode 100644 index 0000000..8edeffa --- /dev/null +++ b/src/MDParser.php @@ -0,0 +1,23 @@ +mdparser = new MarkdownExtra(); + $this->mdparser->header_id_func = function ($header) { + return preg_replace('/[^a-z0-9]/', '-', strtolower($header)); + }; + } + + public function parse($markdown) { + return $this->mdparser->transform($markdown); + } + + public static function factory() { + return new FrontYAML\Parser(null, new MDParser()); + } +}