Initial commit

This commit is contained in:
Robert Miles 2018-08-09 00:40:24 -04:00
commit c236caa20d
12 changed files with 481 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/vendor/
composer.phar

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# rfcs
Similar to [khuxkm's previous attempt](https://github.com/tildetown/tilde-rfcs), this project will bring an RFC-style proposals system to the the tildeverse.
However, unlike that attempt, this system will use YAML front-matter.
See [RFC 0](https://rfc.tildeverse.org/rfc.php?number=0) for more info.

BIN
apple-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

6
composer.json Normal file
View File

@ -0,0 +1,6 @@
{
"require": {
"mnapoli/front-yaml": "^1.6",
"michelf/php-markdown": "^1.8"
}
}

262
composer.lock generated Normal file
View File

@ -0,0 +1,262 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "f693531fd51bd92297c17d6a290a6f16",
"packages": [
{
"name": "erusev/parsedown",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2018-03-08T01:11:30+00:00"
},
{
"name": "michelf/php-markdown",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
"reference": "01ab082b355bf188d907b9929cd99b2923053495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495",
"reference": "01ab082b355bf188d907b9929cd99b2923053495",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Michelf\\": "Michelf/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "https://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "https://daringfireball.net/"
}
],
"description": "PHP Markdown",
"homepage": "https://michelf.ca/projects/php-markdown/",
"keywords": [
"markdown"
],
"time": "2018-01-15T00:49:33+00:00"
},
{
"name": "mnapoli/front-yaml",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/mnapoli/FrontYAML.git",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mnapoli/FrontYAML/zipball/24070ace8b741247bb3161cbb38ecc541268b296",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.0",
"php": ">=5.4.0",
"symfony/yaml": "~2.1|^3.0|^4.0"
},
"require-dev": {
"league/commonmark": "~0.7",
"phpunit/phpunit": "~4.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Mni\\FrontYAML\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"time": "2017-10-29T19:29:55+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/yaml",
"version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/46bc69aa91fc4ab78a96ce67873a6b0c148fd48c",
"reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
},
"require-dev": {
"symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-07-26T11:24:31+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

6
footer.php Normal file
View File

@ -0,0 +1,6 @@
<br><br>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
</html>

21
header.php Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://tilde.team/css/hacker.css">
<link rel="stylesheet" href="https://tilde.team/css/fork-awesome.css">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<title>tildeverse RFCs | <?=($title ?? 'the tildeverse RFC system')?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta property="og:title" content="tildeverse RFCs | <?=($title ?? 'the tildeverse RFC system')?>">
<meta property="og:url" content="https://rfc.tildeverse.org<?=$_SERVER['REQUEST_URI']?>">
<meta property="og:description" content="<?=($desc??($title??'the home of the tildeverse RFC system'))?>">
<meta property="og:image" content="https://rfc.tildeverse.org/apple-icon.png">
<meta property="og:site_name" content="tildeverse RFCs">
<meta property="og:type" content="website">
</head>
<body style="padding-top: 70px;">
<div class="container">
<?php require 'navbar.php'; ?>

25
index.php Normal file
View File

@ -0,0 +1,25 @@
<?php include "header.php";?>
<h2>Tildeverse RFC system</h2>
<blockquote>
<p>...The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as <a href="//git.tildeverse.org/tildeverse/rfcs">tildeverse/rfcs</a>...</p>
<p>...RFC documents are simply requests. They are for simple things like defining how something should work or how something should be done.</p>
<p>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.</p>
<footer>
<cite><a href="./rfc.php?number=0">RFC 0: Standard 1: RFC Format and Semantics</a> by <a href="https://tilde.team/~khuxkm">Robert Miles</a> (aka khuxkm)</cite>
</footer>
</blockquote>
This system aims to help codify some things about Tildeverse tilde servers.
<h3>Submission guidelines (<a href="./rfc.php?number=0">from the standard</a>)</h3>
<p>An RFC should be submitted as a PR to the <a href="https://git.tildeverse.org/tildeverse/rfcs">git repo</a>.</p>
<p>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 <code>draft-tilde-chat-without-ssl</code>.</p>
<p>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 <code>rfcX.md</code>, where X is
the number). The status must be changed to <code>Accepted</code> and the number tag must contain the assigned number. When you
finish doing this, the PR will be merged.</p>
<?php include 'footer.php';?>

26
navbar.php Normal file
View File

@ -0,0 +1,26 @@
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">tildeverse RFCs</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/"><i class="fa fa-home"></i> home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">pages <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="https://rfc.tildeverse.org/rfclist.php"><i class="fa fa-file-text"></i> RFC list</a></li>
<li><a href="https://git.tildeverse.org/tildeverse/rfcs"><i class="fa fa-code-fork"></i> git</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>

34
rfc.php Normal file
View File

@ -0,0 +1,34 @@
<?php
include 'vendor/autoload.php';
class MDParse implements Mni\FrontYAML\Markdown\MarkdownParser {
public function parse($markdown) {
return Michelf\MarkdownExtra::defaultTransform($markdown);
}
}
$parser = new Mni\FrontYAML\Parser(null, new MDParse());
$filename = 'rfc'.$_GET["number"].'.md';
if (!file_exists($filename)) {
// header("Location: https://rfc.tildeverse.org/");
include 'header.php';
echo "<p>{$filename}</p>";
include 'footer.php';
die();
}
$document = $parser->parse(file_get_contents($filename));
$yml = $document->getYAML();
$content = $document->getContent();
$title = ($yml['title'] ?? 'invalid');
$description = "RFC {$yml['number']}: {$yml['title']} by {htmlspecialchars($yml['author'])}";
include 'header.php';
?>
<h1>RFC <?=$yml['number']?>: <?=$yml['title']?></h1>
<p>Author: <?=htmlspecialchars($yml['author'])?><br />
<?php if(isset($yml['updates'])){?>
Updates: <?php $arr=explode(", ",$yml['updates']); foreach($arr as $num) { echo "<a href='./rfc.php?number={$num}'>{$num}</a>"; if(next($arr)) { echo ", "; }}?><br />
<?php };?>
<?php if(isset($yml['updated-by'])){?>
Updated by: <?php $arr=explode(", ",$yml['updated-by']); foreach($arr as $num) { echo "<a href='./rfc.php?number={$num}'>{$num}</a>"; if(next($arr)) { echo ", "; }}?><br />
<?php };?>
<?=$content?>
<?php include 'footer.php'; ?>

74
rfc0.md Normal file
View File

@ -0,0 +1,74 @@
---
title: "Standard 1: RFC Format and Semantics"
number: 0
author: Robert Miles <khuxkm@tilde.team>
status: Approved
---
## 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}
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.](#standards))
- `number`: The canonical number of the RFC. Starts at 0 (this document) and counts up in decimal.
- `author`: The author of the document. May contain email.
- `status`: The status of this document. Should be `Accepted` or `Proposed`. (Rejected documents are not made a part of the repository.)
The front-matter MAY contain the following key-value pairs:
- `updates`: A comma-seperated list of RFCs this RFC updates.
- `updated-by`: A comma-seperated list of RFCs that update this RFC.
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}
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).
### Types of Documents {#doc-types}
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.
### Procedural Section {#procedural-section}
Every RFC and Standards document should end with a procedural information section (id tagged as [#procedures](#procedures)).
There are 2 sub-sections to the procedural info section:
- Security Considerations (tagged [#security](#security)) - If there are any security reasons/concerns for the document, they MUST be subsections of this.
- Configuration Considerations (tagged [#config](#config)) - For example, if configs need to be changed due to the RFC.
### Submission guidelines {#submission}
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.
For example, a draft name for an RFC to make tilde.chat allow IRC connections without SSL could be `draft-tilde-chat-without-ssl`.
The only time an RFC can omit the number tag in its front-matter is when it is a draft. Drafts do not have numbers and are of the
status `Proposed`. 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 the former draft
meets these requirements, the PR will be merged.
## Procedural Information {#procedures}
### Security Considerations {#security}
There are no security considerations to this document.
### Configuration Considerations {#config}
A subdomain of tildeverse.org has been provisioned for the RFC project, and a repo has been created, in accordance with this document.

17
rfclist.php Normal file
View File

@ -0,0 +1,17 @@
<?php
include 'vendor/autoload.php';
$parser = new Mni\FrontYAML\Parser();
$title="RFC List";
$description="A list of Tildeverse RFCs.";
include 'header.php';
?>
<h1>RFC List</h1>
<ul>
<?php
foreach (glob("./rfc*.md") as $rfc) {
$num = substr(basename($rfc,".md"),3);
$yml = $parser->parse(file_get_contents($rfc))->getYAML();
echo "\t<li><a href='rfc.php?number={$num}'>RFC {$num}: {$yml['title']}</a></li>\n";
}
?></ul>
<?php include 'footer.php';?>