Contents
- Prerequisites
- Setup
- Verify draft article
- Derive URI title
- Construct article filename
- Verify article filename
- Sign article
- [optional] Verify signed article
Prerequisites
- How to write an article
- How to generate a GPG key
- How to upload a draft article
Setup
If you have worked through How to upload a draft article, you should have a work directory called "new_articles", with this directory layout:
new_articles
- keys
-- private_keys
-- public_keys
- drafts
- edgecase_article
- keys
-- private_keys
-- public_keys
- drafts
- edgecase_article
edgecase_article must have been successfully installed.
Inside "private_keys", you should have your secondary private key.
Example secondary private key filename:
stjohn_piano_2_private_key.txt
Explanation: Most articles will be signed using a secondary key, which can be kept on an internet-connected machine. This is more convenient than transferring data to/from an offline machine.
Inside "drafts", you should have a new article that you are ready to sign.
Important: Check that the author name within the article is your secondary key name. E.g. "stjohn_piano_2", not "stjohn_piano". The author name must match the key.
Note: Sometimes you may want to use a primary key to sign the article (e.g. "stjohn_piano"), or a corporate key (e.g. "edgecase", "morgan_industries").
Inside the work directory, create this subdirectory:
- "signed_articles"
Verify draft article
Open a shell and change directory to the work directory.
Set a shell value for the draft filename.
DRAFT_FILE_NAME=draft_1.txt
python3 edgecase_article/cli.py --task verify --logLevel info --verifyContent --articleFile drafts/$DRAFT_FILE_NAME
Construct article filename
Construct the final article filename. The draft filename was not important, but the article filename follows specific rules.
python3 edgecase_article/cli.py --task constructFilename --articleFile drafts/$DRAFT_FILE_NAME
Example article filename:
2021-12-24_stjohn_piano_2_jabberwocky_by_lewis_carroll.txt
The filename consists of:
- The date in YYYY-MM-DD format. This must match the date inside the article.
- The author name. This must match the author name inside the article.
- The URI title. URI format: Lowercase, numbers, and underscores. Periods and hyphens converted to underscores. Other punctuation removed.
- A '.txt' extension.
All the sections of the filename are joined by underscores.
Change the draft article filename to this new filename.
Verify article filename.
Set a shell value for the article filename.
ARTICLE_FILE_NAME=2021-12-24_stjohn_piano_2_jabberwocky_by_lewis_carroll.txt
python3 edgecase_article/cli.py --task verify --logLevel info --verifyFileName --articleFile drafts/$ARTICLE_FILE_NAME
Sign article
python3 edgecase_article/cli.py --task sign --articleFile drafts/$ARTICLE_FILE_NAME --publicKeyDir=keys/public_keys --privateKeyDir=keys/private_keys > signed_articles/$ARTICLE_FILE_NAME
[optional] Verify signed article
python3 edgecase_article/cli.py --task verify --logLevel info --verifyContent --verifyFileName --articleFile signed_articles/$ARTICLE_FILE_NAME --publicKeyDir=keys/public_keys --verifySignature