diff options
-rw-r--r-- | .gitlab-ci.yml | 62 | ||||
-rw-r--r-- | Procfile | 1 | ||||
-rw-r--r-- | content/posts/2020-07-12Road_to_local_K8S.html | 150 | ||||
-rw-r--r-- | src/blog.rs | 32 | ||||
-rw-r--r-- | src/router.rs | 11 | ||||
-rw-r--r-- | templates/head.html | 2 | ||||
-rw-r--r-- | templates/header.html | 18 | ||||
-rw-r--r-- | templates/index.html | 44 | ||||
-rw-r--r-- | templates/main.css | 263 | ||||
-rw-r--r-- | templates/post.html | 32 |
10 files changed, 411 insertions, 204 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index dd3bba4..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -stages: - - test - - production - - prepare - - release - -test: - image: rust:alpine - stage: test - script: - - apk add musl-dev - - cargo install cargo2junit - - cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml - only: - - master - artifacts: - reports: - junit: results.xml - -production: - stage: production - image: ruby:latest - needs: - - test - script: - - apt-get update -qy - - apt-get install -y ruby-dev - - gem install dpl - - gem install faraday -v 1.8.0 - - dpl --provider=heroku --app=$HEROKU_APP --api-key=$HEROKU_API_KEY - only: - - master - -prepare_job: - stage: prepare - image: rust:alpine - rules: - - if: $CI_COMMIT_TAG - script: - - echo "running release_job" - - apk add musl-dev - - cargo build --release - artifacts: - paths: - - target/release/hyper - - target/release/actix - -release_job: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - rules: - - if: $CI_COMMIT_TAG - script: - - echo "running release_job for $TAG" - needs: - - job: prepare_job - artifacts: true - release: - name: 'Release $CI_COMMIT_TAG' - description: 'New macroblog version' - tag_name: '$CI_COMMIT_TAG' - ref: '$CI_COMMIT_TAG' diff --git a/Procfile b/Procfile deleted file mode 100644 index 51c4728..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: ./target/release/actix diff --git a/content/posts/2020-07-12Road_to_local_K8S.html b/content/posts/2020-07-12Road_to_local_K8S.html index 5d34b27..52820b3 100644 --- a/content/posts/2020-07-12Road_to_local_K8S.html +++ b/content/posts/2020-07-12Road_to_local_K8S.html @@ -1,43 +1,43 @@ <section> - <h3>Goal</h3> - <p> + <h3>Goal</h3> + <p> The goal is to deploy kubernetes on my local networks, and keep everything as reproducible as possible. - </p> - <h3>Stack</h3> - <p> + </p> + <h3>Stack</h3> + <p> I'll use Fedora Core OS, Matchbox and Terraform <sup><a href="#footnotes">1</a></sup>, a match the requirements for Tectonic<sup><a href="#footnotes">2</a></sup>.</p> - <h3>Steps</h3> - <ul> - <li>Network Setup DHCP/TFTP/DNS<sup><a href="#footnotes">3</a></sup></li> - <li>Matchbox<sup><a href="#footnotes">4</a></sup></li> - <li>PXE nextwork boot evnrionment</li> - <li>Terraform Tectonic<sup><a href="#footnotes">5</a></sup></li> - </ul> - <h3>Network Setup DHCP/TFTP/DNS</h3> - <p>First learning the basics</p> - <ul> - <li> - <a href="https://linuxhint.com/install_dhcp_server_ubuntu/"> - https://linuxhint.com/install_dhcp_server_ubuntu/ - </a> - </li> - <li> - <a href="https://www.youtube.com/watch?v=XQ3T14SIlV4"> - https://www.youtube.com/watch?v=XQ3T14SIlV4 - </a> - </li> - </ul> - <p> + <h3>Steps</h3> + <ul> + <li>Network Setup DHCP/TFTP/DNS<sup><a href="#footnotes">3</a></sup></li> + <li>Matchbox<sup><a href="#footnotes">4</a></sup></li> + <li>PXE nextwork boot evnrionment</li> + <li>Terraform Tectonic<sup><a href="#footnotes">5</a></sup></li> + </ul> + <h3>Network Setup DHCP/TFTP/DNS</h3> + <p>First learning the basics</p> + <ul> + <li> + <a href="https://linuxhint.com/install_dhcp_server_ubuntu/"> + https://linuxhint.com/install_dhcp_server_ubuntu/ + </a> + </li> + <li> + <a href="https://www.youtube.com/watch?v=XQ3T14SIlV4"> + https://www.youtube.com/watch?v=XQ3T14SIlV4 + </a> + </li> + </ul> + <p> To check open ports -<pre><code>lsof -Pni | grep LISTEN</code></pre> - </p> - <p> + <pre><code>lsof -Pni | grep LISTEN</code></pre> + </p> + <p> Run the provided<sup><a href="#footnotes">6</a></sup> image with dnsmasq and PXE toolkit -<pre><code>docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \ + <pre><code>docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \ -d -q \ --dhcp-range=192.168.1.3,192.168.1.254 \ --enable-tftp --tftp-root=/var/lib/tftpboot \ @@ -54,48 +54,48 @@ --address=/matchbox.example/192.168.1.2 \ --log-queries \ --log-dhcp</code></pre> - </p> - <h3>Matchbox</h3> - <p>...</p> - <h3>PXE network boot enviroment</h3> - <p>...</p> - <h3>Terraform Tectonic</h3> - <p>...</p> - <h3 id="footnotes">Links</h3> - <div > - <sup>1</sup> - <a href="https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html"> - https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html - </a> - <div> - <div> - <sup>2</sup> - <a href="https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html"> - https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html - </a> - <div> - <div> - <sup>3</sup> - <a href="https://coreos.com/matchbox/docs/latest/network-setup.html"> - https://coreos.com/matchbox/docs/latest/network-setup.html - </a> - <div> - <div> - <sup>4</sup> - <a href="https://coreos.com/matchbox/docs/latest/deployment.html"> - https://coreos.com/matchbox/docs/latest/deployment.html - </a> - <div> - <div> - <sup>5</sup> - <a href="https://coreos.com/tectonic/releases/"> - https://coreos.com/tectonic/releases/ - </a> - <div> - <div> - <sup>6</sup> - <a href="https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq"> - https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq - </a> - <div> + </p> + <h3>Matchbox</h3> + <p>...</p> + <h3>PXE network boot enviroment</h3> + <p>...</p> + <h3>Terraform Tectonic</h3> + <p>...</p> + <h3 id="footnotes">Links</h3> + <div > + <sup>1</sup> + <a href="https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html"> + https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html + </a> + <div> + <div> + <sup>2</sup> + <a href="https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html"> + https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html + </a> + <div> + <div> + <sup>3</sup> + <a href="https://coreos.com/matchbox/docs/latest/network-setup.html"> + https://coreos.com/matchbox/docs/latest/network-setup.html + </a> + <div> + <div> + <sup>4</sup> + <a href="https://coreos.com/matchbox/docs/latest/deployment.html"> + https://coreos.com/matchbox/docs/latest/deployment.html + </a> + <div> + <div> + <sup>5</sup> + <a href="https://coreos.com/tectonic/releases/"> + https://coreos.com/tectonic/releases/ + </a> + <div> + <div> + <sup>6</sup> + <a href="https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq"> + https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq + </a> + <div> </section> diff --git a/src/blog.rs b/src/blog.rs index 6bbda49..0fa9543 100644 --- a/src/blog.rs +++ b/src/blog.rs @@ -1,9 +1,9 @@ +use chrono::NaiveDate; +use regex::Regex; use rust_embed::RustEmbed; use sailfish::TemplateOnce; -use chrono::NaiveDate; -use regex::{Regex}; +use std::cmp::{Eq, Ord, PartialEq, PartialOrd}; use std::str; -use std::cmp::{PartialOrd, Ord, PartialEq, Eq}; const BLOG_REGEX: &str = r"(?P<date>[\d]{4}-[\d]{2}-[\d]{2})(?P<title>[a-zA-Z0-9-_]*)"; @@ -11,7 +11,6 @@ const BLOG_REGEX: &str = r"(?P<date>[\d]{4}-[\d]{2}-[\d]{2})(?P<title>[a-zA-Z0-9 #[folder = "content/posts/"] struct PostAsset; - #[derive(TemplateOnce)] #[template(path = "index.html")] struct IndexTemplate { @@ -23,7 +22,7 @@ struct IndexTemplate { struct PostTemplate { content: String, title: String, - date: String + date: String, } #[derive(PartialEq, Eq, PartialOrd, Ord)] @@ -43,12 +42,11 @@ impl BlogEntry { BlogEntry { title: String::from(title), file: String::from(path), - datetime: NaiveDate::parse_from_str(date, "%Y-%m-%d").unwrap() + datetime: NaiveDate::parse_from_str(date, "%Y-%m-%d").unwrap(), } } pub fn read_assets() -> Vec<BlogEntry> { - let mut entries: Vec<BlogEntry> = PostAsset::iter() .map(|e| format!("{}", e)) .map(|e| BlogEntry::new(&e)) @@ -61,29 +59,27 @@ impl BlogEntry { } fn get_file_content(path: &str) -> String { - let buffer = PostAsset::get(path) - .unwrap() - .data - .into_owned(); + let buffer = PostAsset::get(path).unwrap().data.into_owned(); return String::from_utf8(buffer).unwrap(); } - pub fn render_post_page(path: &String) -> String { let blog = BlogEntry::new(path); PostTemplate { content: get_file_content(path), title: blog.title, - date: blog.datetime.format("%Y-%m-%d").to_string() + date: blog.datetime.format("%Y-%m-%d").to_string(), } - .render_once() - .unwrap() + .render_once() + .unwrap() } pub fn render_index_page() -> String { - IndexTemplate { posts: BlogEntry::read_assets() } - .render_once() - .unwrap() + IndexTemplate { + posts: BlogEntry::read_assets(), + } + .render_once() + .unwrap() } diff --git a/src/router.rs b/src/router.rs index 0bba091..35fdf3e 100644 --- a/src/router.rs +++ b/src/router.rs @@ -1,4 +1,4 @@ -use regex::{Regex}; +use regex::Regex; const ACTION_REGEX: &str = r"/{0,1}(?P<action>\w*)/(?P<id>.+)"; @@ -14,14 +14,15 @@ impl Router { let caps = re.captures(path); let action = match caps { Some(ref value) => &value["action"], - None => "index" + None => "index", }; match action { - "posts" => Router::Post { page: caps.unwrap()["id"].to_string() }, + "posts" => Router::Post { + page: caps.unwrap()["id"].to_string(), + }, "index" => Router::Index, - _ => Router::NotFound + _ => Router::NotFound, } } } - diff --git a/templates/head.html b/templates/head.html index c054157..3492eda 100644 --- a/templates/head.html +++ b/templates/head.html @@ -3,5 +3,5 @@ <title>Yet Another Blog</title> <link rel="icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAAAAAAAEAIADLFQAAFgAAAIlQTkcNChoKAAAADUlI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JcIvCZdG9pAkwTdgtPtz5DZv+U8ATCGCW8T1h0v10tWdq/uHSGuBmh7O9f6PteIJqyCPRmZsv/sOlApgkzmqF61YECdIF+z4rxIkvifBFAjAtGSvOyG2KcoL0Qh6NsaZlzV8vrgGKaCXM5iDLtH1OUAPLOChM2Yqimr9eLAD5E8DL9rS2zwkuwJ52GBC6KMo1ngJMR/aIt3+60X6g7XSCmjA3IO2TVXLVhR0Fa9YA48Xh356EP2qwH7BdmDSb8Rd+qSkA+RSQ+druJqgF8qjUiPT5JsBkUUZbkbmlp/1U29sEl8L0YKfwrUA57W3V2R8v1AADheGHd5PwRxH2U94VJm3LwHM/XhBAgfhOL2m7mqAOyCNTcO4HdwGcYpG2nwnqwCJOCVMWnPuhWgAmi+FC01XJArCowh5BsCkMAMNNdeTP1QDyHkCxtpsJ6oE0Oud7AecEUCC+hfy1QwL/kEen4Ox/rgI4xHptHxPUg/VI9wovOPtfFjj1AFaee35MEEXYKvGGftW9gLM1QNIDaDxw7AWcFcBIcfZJDyDqkEdoJJwTwHVCk712q7Z/CeqH3cpeYdLr4JwAegtNku9/HCCNUm9wFUDSA4gDpFE6JwDTjvZCk9XaviUQQBql9qbd2RpA+v2vIFkHGAeUUiFM2dtNADttpbZvCRqGrUS6YN9RAMnBr3GBNFKOApDOOUugDWmkkhqgkcKlBjCGb4acbQJtSCP1TWOy6EpLYfJEAHGBNFIt6ZolbgDK7ZfafiWQwX5JuTBp7yzxYdBJFzBOkEarexathUmTBiBOkEardZZ4PbD0HVOCKEAarVZZ4iOhjmr7lMAB0mjlygWQTAaPE6TRypU3AUkNECdIo5U0AY0UDk1AUgM0RiQ1QIYjqQEyHEkNkOFIw2NgIoA4QSwAw9fC0wGaJxvDxQemGbIz3E//P7HdiQ8VHEQYAAAAAElFTkSuQmCC"> <style> - <% include!("pico.min.css"); %> +<% include!("main.css"); %> </style> diff --git a/templates/header.html b/templates/header.html index 1340aa1..c830273 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,10 +1,12 @@ <header class="container"> - <nav class="container-fluid"> - <ul> - <li><h2><a href="/">Yet Another Blog</a></h2></li> - </ul> - <ul> - <li><a href="https://gitlab.com/gabrielgio/cv/-/raw/main/cv.pdf?inline=false" class="secondary">Resume</a></li> - </ul> - </nav> + <div class="title-wrapper"> + <a href="/"> + <h2 class="title">Yet Another Blog</h2> + </a> + <nav class="container-fluid"> + <ul> + <li><a href="https://gitlab.com/gabrielgio/cv/-/raw/main/cv.pdf?inline=false" class="secondary">Resume</a></li> + </ul> + </nav> + </div> </header> diff --git a/templates/index.html b/templates/index.html index 006643a..f6f3ca9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,22 +1,28 @@ <!DOCTYPE html> <html data-theme="light" lang="en"> -<head> - <% include!("head.html"); %> -</head> -<body> -<% include!("header.html"); %> -<main class="container"> - <section> - A gathering of information about some things I do on my spare time. - You can find me on gitlab, twitter and linkedin. - </section> - <section> - <ul> - <% for p in &posts { %> - <li><a href="/posts/<%- p.file %>"><%- p.title %></a></li> - <% } %> - </ul> - </section> -</main> -</body> + <head> + <% include!("head.html"); %> + </head> + <body> + <div class="layout"> + <% include!("header.html"); %> + <main> + <div class="slim-description"> + A gathering of information about some things I do on my + spare time. You can find me on gitlab, twitter and + linkedin. + </div> + <div class="blog-list"> + <% for p in &posts { %> + <article class="list-item"> + <div class="post-title"> + <a href="/posts/<%- p.file %>"><%- p.title %></a> + </div> + <span classname="data-label"><%- p.datetime | disp %></span> + </article> + <% } %> + </div> + </main> + </div> + </body> </html> diff --git a/templates/main.css b/templates/main.css new file mode 100644 index 0000000..f056a50 --- /dev/null +++ b/templates/main.css @@ -0,0 +1,263 @@ +* { + box-sizing: border-box; + font-family: dejavu sans; +} +body { + margin: 0; +} +h1, +h2, +h3, +h4 { + font-weight: 400; +} +code[class*="language-"], +nav, +.blog-list { + font-style: normal; + font-weight: 400; + font-size: 1.025rem; +} +code { + font-family: dejavu sans mono; +} +tags { + font-family: dejavu sans mono; +} +.list-item { + font-family: dejavu sans mono; +} +html { + font-size: 16px; +} +body { + line-height: 1.8em; + color: #333; + background: #fefefe; +} +.post-title, +.date-label { + letter-spacing: 0.025rem; +} +p, +sub, +nav { + letter-spacing: 0.05rem; +} +.title-wrapper, +.title { + letter-spacing: 0.075rem; +} +a { + text-decoration: none; +} +.brand-icon { + color: #f93a3a; + display: inline-flex; + border-bottom: 1px solid; +} +.brand-icon:hover { + border-bottom: none; +} +.layout { + max-width: 48rem; + margin-left: auto; + margin-right: auto; + padding: 2.625rem 1.3125rem; +} +.layout .title-wrapper { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 0.5rem; +} +.layout .title { + color: #333; + text-align: left; + display: block; + font-size: 1.875rem; + margin: 0; +} +nav { + font-size: 1.025rem; + text-align: center; +} +nav ul { + display: block; + padding: 0; +} +nav ul li { + display: inline; + list-style-type: none; +} +nav ul li a { + color: #333; + display: inline-block; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + border-bottom: 1px solid #fefefe; +} +nav ul li a:hover { + color: #f93a3a; +} +nav ul li:not(:last-child) { + padding: 0 1rem 0 0; +} +.slim-description { + margin-bottom: calc(16px * 2); + color: #666; +} +.blog-post-content a { + color: #f93a3a; + text-decoration: none; + border-bottom: 1px solid; +} +.blog-post-content a:hover { + border-bottom: none; +} +.blog-list .list-item { + display: flex; + flex-direction: column-reverse; + align-items: baseline; + padding: 0.5rem 0.5rem 0.5rem 0; +} +.blog-list .post-title a { + text-decoration: none; + color: #333; + border-bottom: none; +} +.blog-list .post-title a:hover { + border-bottom: 1px solid; +} +.blog-list .date-label { + font-size: 80%; + margin-right: 1rem; +} +.content .title { + font-size: 1.275rem; +} +.blog-post-content a { + color: #f93a3a; + text-decoration: none; + border-bottom: 1px solid; +} +.blog-post-content a:hover { + border-bottom: none; +} +.blog-post-content img { + width: 100%; +} +.post-image { + margin-left: calc(-1.3125rem); + margin-right: calc(-1.3125rem); +} +.post-image img { + width: 100%; +} +.tags { + font-size: 0.9em; + text-align: left; +} +.tags ul { + display: block; + padding: 0; +} +.tags ul li { + display: inline; + list-style-type: none; + text-align: center; +} +.tags ul li a { + border: 1px solid #f93a3a; + border-radius: 3px; + background: #f93a3a; + padding: 0.2em; + color: #fff; + margin: 10px 2px 10px 0; + line-height: 1em; +} +.tags ul li a:hover { + background: #fefefe; + color: #f93a3a; +} +.tags ul li:not(:last-child) { + padding: 0 0.1rem 0 0; +} +.highlight { + margin-left: calc(-1.3125rem); + margin-right: calc(-1.3125rem); +} +.highlight pre { + line-height: 1.2rem; + border: 1px solid #ddd; + border-radius: 5px; + overflow: auto; + padding: 1.3125rem; + margin: 0; +} +.highlight pre code[class*="language-"] { + font-size: 0.9em; +} +.highlight pre .token.comment { + font-style: italic; +} +blockquote { + background: #f9f9f9; + border-left: 5px solid #333; + margin: 1.5em 10px; + padding: 0.5em 10px; + quotes: "“" "”" "‘" "’"; +} +blockquote:before { + color: #333; + content: open-quote; + font-size: 4em; + line-height: 0.1em; + margin-right: 0.25em; + vertical-align: -0.4em; +} +blockquote p { + display: inline; +} +time { + font-size: 80%; + margin-right: 1rem; +} +@media only screen and (min-width: 600px) { + .layout .title-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + } + .layout .title { + margin-block-start: 0.83em; + margin-block-end: 0.83em; + margin-inline-start: 0; + margin-inline-end: 0; + } + .blog-list .list-item { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: unset; + padding: 0; + margin-bottom: 0.5rem; + } + .blog-list .date-label { + font-size: 100%; + margin-right: 0; + } + .project-board { + grid-template-columns: 1fr 1fr; + } + .highlight { + margin-left: 0; + margin-right: 0; + } + .post-image { + margin-left: 0; + margin-right: 0; + } +} + diff --git a/templates/post.html b/templates/post.html index 7e0a909..99a7852 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,18 +1,20 @@ <!DOCTYPE html> <html data-theme="light" lang="en"> -<head> - <% include!("head.html"); %> -</head> -<body> -<% include!("header.html"); %> -<main class="container"> - <h2><%- title %></h2> - <h5>Created At: <%- date %></h2> - <%- content %> - </section> -</main> -</body> - -<script> -</script> + <head> + <% include!("head.html"); %> + </head> + <body> + <div class="layout"> + <% include!("header.html"); %> + <main> + <article> + <h1><%- title %></h1> + <time>Created At: <%- date %></time> + <div class="blog-post-content"> + <%- content %> + </div> + </article> + </main> + </div> + </body> </html> |