Compare commits

..

23 Commits

Author SHA1 Message Date
eab712e421 config: disable /cloud/ link 2024-10-16 13:14:49 +02:00
ad6af66a61 goatcounter: add script tag to index.html 2024-01-21 21:52:06 +01:00
88ce25f6b4 avatar: change color tone to be visible with dark theme 2023-11-17 20:16:39 +01:00
be545b5225 add description 2023-11-15 23:33:27 +01:00
7b4ff3bad1 add title 2023-11-15 23:28:22 +01:00
76240e342c avatart convert from png to webp 2023-11-15 23:17:50 +01:00
8f378c2237 enable search 2023-11-15 22:56:26 +01:00
59fe04e1df add taxonomies 2023-11-15 22:56:10 +01:00
c2e5fad0ec enable tac within post 2023-11-15 22:06:56 +01:00
72ed4edcfe enable katex 2023-11-15 22:04:06 +01:00
086a0f8f71 enable toc 2023-11-15 22:02:11 +01:00
6873fb66dd remove wip from index 2023-11-15 21:06:41 +01:00
c30b26808b finish post abput gpg public key 2023-11-15 21:06:25 +01:00
b455eaa882 restore content index 2023-11-15 19:55:20 +01:00
d35a5e6bc3 restore index from previous theme 2023-11-15 18:49:58 +01:00
4de0fa9980 avatar: rename and resize canvas to 720 2023-11-15 18:07:00 +01:00
1c259e05b3 theme: set avatar, username, content 2023-11-15 17:22:15 +01:00
d36083c44f config: adjust for new theme 2023-11-15 16:49:27 +01:00
3212d72cf7 content/blog -> content/posts 2023-11-15 16:49:00 +01:00
2383c813c1 theme: anemone -> DeepThought 2023-11-15 16:43:50 +01:00
aacdd3b2cc post: start post about gpg publik key usage 2023-11-15 16:42:42 +01:00
2c830905d1 add Caddyfile for testing 2023-11-15 13:21:52 +01:00
fa5dd946de flake: add testing target with localhost as url 2023-11-15 13:21:38 +01:00
9 changed files with 190 additions and 23 deletions

18
Caddyfile Normal file
View File

@@ -0,0 +1,18 @@
{
auto_https off
}
:8080 {
root * ./result/public
encode gzip
file_server
# redirect to your custom 404 page
handle_errors {
@404 {
expression {http.error.status_code} == 404
}
rewrite @404 /404.html
file_server
}
}

View File

@@ -1,23 +1,47 @@
# The URL the site will be built for
base_url = "https://project-cloud.net"
title = "project-cloud"
description = "Cloud and blog platform for personal and consulting projects."
# Whether to automatically compile all Sass files in the sass directory
compile_sass = true
# Whether to build a search index to be used later on by a JavaScript library
build_search_index = false
build_search_index = true
theme = "DeepThought"
minify_html = true
theme = "anemone"
taxonomies = [
{ name = "categories", feed = true, paginate_by = 10 },
{ name = "tags", feed = true, paginate_by = 10 },
]
[search]
include_title = true
include_description = false
include_path = false
include_content = true
[markdown]
highlight_code = true
[extra]
list_pages = true
header_nav = [
{ url = "/", name_en = "/home/"},
{ url = "/blog", name_en = "/blog/"},
{ url = "https://git.project-cloud.net", name_en = "/git/"},
{ url = "https://cloud.project-cloud.net", name_en = "/cloud/"}
toc = true
katex.enabled = true
katex.auto_render = true
navbar_items = [
{ code = "en", nav_items = [
{ url = "/", name = "/home/"},
{ url = "/posts", name = "/posts/"},
{ url = "https://git.project-cloud.net", name = "/git/"},
#{ url = "https://cloud.project-cloud.net", name = "/cloud/"}
]},
]
[extra.social]
# Author details
[extra.author]
name = "Asmir Abdulahovic"
avatar = "images/my_avatar.webp"

View File

@@ -1,14 +1,8 @@
+++
title = "project cloud"
description = "Cloud and blog platform for personal and consulting projects."
+++
## Project Cloud
Cloud and blog platform for personal and consulting projects.
## Public Key
WP
## Contact
- Email: [asmir.abdulahovic@gmail.com](mailto:asmir.abdulahovic@gmail.com)

View File

@@ -0,0 +1,95 @@
+++
title = "Using GPG Public Key"
[taxonomies]
tags = ["gpg", "encryption"]
[extra]
toc = true
comments = false
+++
GNU Privacy Guard (GPG) is an popular two factor encryption system often used for signing or encrypting emails, files or even git commits.
This post focuses on using provided public key to check signature validity for files signed using complementary public key.
## Install GPG
On Linux it's found in nearly all distributions with package name of either gpg or gpg2. If both are present and gpg is not an
alias to gpg2 please use gpg2.
On Windows besides using WSL there is native GPG distribution named gpg4win.
## Importing Key
One way to keep public keys is by using a keyserver such as _hkps://keyserver.ubuntu.com_ or _hkp://pgp.mit.edu_.
To import key with ID _3BDD542C9B0BE180D5802DFF020C42B7A9ABA3E2_ from **hkps://keyserver.ubuntu.com** keyserver
issue command:
```bash
$ gpg2 --keyserver hkps://keyserver.ubuntu.com --recv-key 3BDD542C9B0BE180D5802DFF020C42B7A9ABA3E2
```
Output of the command above will look like:
```
gpg: /home/akill/.gnupg/trustdb.gpg: trustdb created
gpg: key 020C42B7A9ABA3E2: public key "Asmir A (new key 300523) <asmir.abdulahovic@gmail.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
```
It's also possible to use "short" ID by using only the last 8 digits of hexadecimal
ID representation, in our case _A9ABA3E2_ - but it's discouraged because of possible ID collisions.
To search and import a key using email, example _asmir.abdulahovic@gmail.com_ issue command:
```bash
$ gpg2 --keyserver hkps://keyserver.ubuntu.com --search-keys "asmir.abdulahovic@gmail.com"
```
Note _hkps_ protocol selection acts similarly as _https_ for _http_,
preferably use it to avoid _MITM_ and other attacks.
## Verify Signature
After successfully importing the public key it's possible to verify signature of a
given file by issuing following command:
```bash
$ gpg2 --verify my_file.png.asc
```
Please notice .asc extension in the command above.
It's a result of using gpg to attach the signature at the end of the file while both file and signature are
represented in ASCII format.
It's, however, possible to compress the file and add signature in binary format.
In that case it's conventional practise is to use .gpg extension.
So in previous case file would be named _my_file.png.gpg_.
Verifying it would be identical to .asc file.
After verifying we still need original file. To extract it use:
```bash
$ gpg2 --out my_file.png --decrypt my_file.png.asc
```
Interestingly for files like .pdf which ignore data appended to the end of the file it's possible to attach
a signature and use resulting file as normal .pdf while being able to check the same signature.
More on that in other post.
## Export Key
Simply issue:
```
$ gpg2 --export --armor <KEY_ID>
```
Lastly I'll attach my public key, output of the command above, here which
can also be found in about/ section of this site.
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZHZDwBYJKwYBBAHaRw8BAQdAPTwI6nfqQ+DtOgyGnwh2Z/rHmeIaw48Cj1ac
r7siWg60NkFzbWlyIEEgKG5ldyBrZXkgMzAwNTIzKSA8YXNtaXIuYWJkdWxhaG92
aWNAZ21haWwuY29tPoiTBBMWCgA7FiEEO91ULJsL4YDVgC3/AgxCt6mro+IFAmR2
Q8ACGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQAgxCt6mro+LMfgD/
a1FeF7N7CxwCne8jD/4wPTCgNvo8JDLYIugd+b3w4fEA/Az6BIxa/s1Nf2fZmI9C
mvuMi9GztilFtCT+gHTtkAIPuDgEZHZDwBIKKwYBBAGXVQEFAQEHQE2Jm31r9Nv4
1H5HFOeIHwrUE09XuL/CzQE3WcXviq0hAwEIB4h4BBgWCgAgFiEEO91ULJsL4YDV
gC3/AgxCt6mro+IFAmR2Q8ACGwwACgkQAgxCt6mro+KfqgD9HrUJdZ2Y6cvcYyt/
yMoxPvGKDCYo4Pys9Qi3M1oKKUMBAMJ4Dt6xjWyZIrNDjXmJhm4Qap9CAo0+SPM1
BudaRLwI
=nRnt
-----END PGP PUBLIC KEY BLOCK-----
```

6
content/posts/_index.md Normal file
View File

@@ -0,0 +1,6 @@
+++
title = "Posts"
description = "Blog posts accumulated over the time."
sort_by = "date"
paginate_by = 5
+++

19
flake.lock generated
View File

@@ -19,7 +19,8 @@
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"theme_anemone": "theme_anemone"
"theme_anemone": "theme_anemone",
"theme_deepthought": "theme_deepthought"
}
},
"theme_anemone": {
@@ -37,6 +38,22 @@
"repo": "anemone",
"type": "github"
}
},
"theme_deepthought": {
"flake": false,
"locked": {
"lastModified": 1681035730,
"narHash": "sha256-dzhfGmhuNCbloqknM7lVnFbNYmf2/ue7az6DQok44yM=",
"owner": "RatanShreshtha",
"repo": "DeepThought",
"rev": "430c1d5085dd6bea4cd6bd2d55003db67ba6bea0",
"type": "github"
},
"original": {
"owner": "RatanShreshtha",
"repo": "DeepThought",
"type": "github"
}
}
},
"root": "root",

View File

@@ -5,20 +5,26 @@
flake = false;
};
inputs.theme_deepthought = {
url = "github:RatanShreshtha/DeepThought";
flake = false;
};
outputs = {
self,
nixpkgs,
theme_anemone,
theme_deepthought,
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
url = "https://project-cloud.net";
url_deploy = "https://project-cloud.net";
url_local = "http://localhost:8080";
name = "project-cloud";
theme = theme_anemone;
in {
packages = forAllSystems (system: {
default = pkgs.${system}.stdenv.mkDerivation {
theme = theme_deepthought;
package = system: url:
pkgs.${system}.stdenv.mkDerivation {
inherit name;
nativeBuildInputs = with pkgs.${system}; [zola];
@@ -26,20 +32,26 @@
submodules = true;
buildPhase = ''
ln -s ${theme} themes/anemone
ln -s ${theme} themes/DeepThought
zola build -u ${url}
'';
installPhase = ''
mkdir $out
cp -r public/ $out/
cat goatcounter.url >> $out/public/index.html
'';
};
in {
packages = forAllSystems (system: rec {
project-cloud = package system url_deploy;
test = package system url_local;
default = project-cloud;
});
devShells = forAllSystems (system: {
default = pkgs.${system}.mkShellNoCC {
packages = with pkgs.${system}; [zola];
packages = with pkgs.${system}; [zola caddy];
};
});
};

1
goatcounter.url Normal file
View File

@@ -0,0 +1 @@
<script data-goatcounter="https://stats.project-cloud.net/count" async src="//stats.project-cloud.net/count.js"></script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB