Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,40 @@ appending comment blocks before and after the <html> tags.
Please note that this application does not work on arbitrary HTML files. It is a tool for compiling special
purpose HTML source files to a static, signed single-source web page.

Usage:
```php pagesign.php source destination fingerprint comments```

_source_ : The source HTML file name.
<table>
<tbody>
<tr>
<th>Usage</th>
<td>

_destination_ : The destination HTML file name.

_fingerprint_ : The fingerprint for the signing key's public key. The (private) signing key must exist in GPG keychain.
```php pagesign.php source destination fingerprint comments```

_comments_ : Path to text file containing the template for the information block to be inserted immediately before
the &lt;html&gt; start tag. The tag {keyinfo} can be used anywhere in this text file to output basic
information of the signing key.
</td>
</tr>
<tr>
<th>Source</th>
<td>The source HTML file name.</td>
</tr>
<tr>
<th>Destination</th>
<td>The destination HTML file name.</td>
</tr>
<tr>
<th>Fingerprint</th>
<td>The fingerprint for the signing key's public key. The (private) signing key must exist in GPG keychain.</td>
</tr>
<tr>
<th>Comments</th>
<td>Path to text file containing the template for the information block to be inserted immediately beforethe &lt;html&gt; start tag. The tag {keyinfo} can be used anywhere in this text file to output basicinformation of the signing key.</td>
</tr>
</tbody>
</table>

The entire content of the resulting HTML page, including image assets, can then be verified by anoyne using GPG.

##Example
## Example

The HTML file _source.html_ points to ``my_styles.css`` in a CSS link tag, uses ``my_functions.js`` as source for
The HTML file _``source.html``_ points to ``my_styles.css`` in a CSS link tag, uses ``my_functions.js`` as source for
a script tag and embeds ``my_logo.jpg`` in an image tag. All files are located locally in the same directory.

```html
Expand All @@ -52,6 +68,7 @@ Assuming that ``/path/to/pagesign.php`` is where the pagesign script is located,
with fingerprint ``BA7EAC9F78DAC483B0C7DE79DD32F64A341F8E25`` is already imported to your GPG keychain, the command

```shell
#!/bin/bash
php /path/to/pagesign.php source.html destination.html BA7EAC9F78DAC483B0C7DE79DD32F64A341F8E25
```

Expand Down Expand Up @@ -97,6 +114,7 @@ KToPQRBF/9IDI2cdAGrd
On Linux/OSX, the signature may then be verified by running

```shell
#!/bin/bash
gpg --verify destination.html
```

Expand All @@ -105,6 +123,7 @@ gpg --verify destination.html
or, if the HTML file is published on a web server:

```shell
#!/bin/bash
curl https://url.to/destination.html | gpg > /dev/null
```

Expand Down