1
1
Fork 0

Compare commits

...

23 Commits

Author SHA1 Message Date
Bill Ewanick ae69018842 Add posts 2023-08-12 10:28:19 -04:00
Bill Ewanick 1ac23158c8 Add seal images back 2023-08-12 10:28:11 -04:00
Bill Ewanick 1eb14f0e3d Add seal site partial 2023-08-12 10:28:01 -04:00
Bill Ewanick ccd0e31805 Remove old script, move to serviceConfig.ExecStart 2023-08-11 20:35:21 -04:00
Bill Ewanick ddec052cff Add scripts to try and get this to work 2023-08-11 20:28:51 -04:00
Bill Ewanick b30bb30021 Try hardcoded locations 2023-08-11 15:21:32 -04:00
Bill Ewanick 072a1bbfe6 Don't use relative paths 2023-08-09 21:13:29 -04:00
Bill Ewanick 3d3d1a9b5b Delete submodule 2023-08-09 21:07:21 -04:00
Bill Ewanick 190b0308f8 Attempt to fix scripts 2023-08-09 20:49:47 -04:00
Bill Ewanick 9b01406ed1 Fix scripts 2023-08-09 19:22:16 -04:00
Bill Ewanick a61e5e6b68 Add systemd services to generate posts and run site 2023-08-09 19:07:15 -04:00
Bill Ewanick 61947907ce Update submodules 2023-08-09 18:43:39 -04:00
Bill Ewanick e9f5aad38e Add cutesealfanpage submodule 2023-08-09 17:19:17 -04:00
Bill Ewanick f4fbdc5224 Disable this as it doesn't work currently 2023-08-08 18:12:02 -04:00
Bill Ewanick ef45d73acd Turn off new seal post actions for now 2023-08-08 18:11:54 -04:00
Bill Ewanick 745366b1bc Re-order imports to match tree file system 2023-08-02 15:05:49 -04:00
Bill Ewanick a09ee8d294 Activate cron job for seal post commits 2023-08-02 15:05:35 -04:00
Bill Ewanick ba03575caa Get rid of submodules 2023-08-02 15:03:15 -04:00
Bill Ewanick 86e48105bc Give Alice a hashed password for vm testing 2023-08-02 14:37:50 -04:00
Bill Ewanick 36cbfd2921 Update to latest formatting 2023-08-02 14:37:36 -04:00
Bill Ewanick 8e33c482e5 Add gitignore 2023-08-02 14:37:22 -04:00
Bill Ewanick 5b9a63bd20 Add acme certs to sealblog 2023-08-02 11:55:31 -04:00
Bill Ewanick 5f1ac39a0e Add the seal post script into nix file itself.
Some comments on how to use Gitea.
Switching mentions of users to alice
2023-06-28 19:46:20 -04:00
584 changed files with 5491 additions and 26 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
linode-nixos.qcow2
result

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "nixos-apps/seal-blog"]
path = nixos-apps/seal-blog
url = gitea@git.ewanick.com:bill/seal-blog.git

View File

@ -1,5 +1,7 @@
{ pkgs, ... }:
let
PROJECT_ROOT = builtins.toString ./.;
PROJECT_ROOT = "/workspace/deployed-nixos-server-and-apps/nixos-apps";
in
{
services.caddy = {
@ -8,18 +10,43 @@ in
"cutesealfanpage.love" = {
serverAliases = [ "www.cutesealfanpage.love" ];
extraConfig = ''
root * ${PROJECT_ROOT}/cutesealfanpage.love/
root * ${PROJECT_ROOT}/cutesealfanpage.love/_site
file_server
'';
};
};
};
systemd.services = {
cutesealfanpage-hakyll-site = {
enable = true;
description = "The hakyll executable that rebuilds the site when a new blog post is created.";
serviceConfig = {
ExecStart = "cd /workspace/deployed-nixos-server-and-apps/nixos-apps/cutesealfanpage.love; ./hakyll-site";
};
};
cutesealfanpage-generatePosts = {
enable = true;
description = "The haskell script that creates the new post of the day.";
startAt = "08:12:42";
serviceConfig = {
ExecStart = "cd /workspace/deployed-nixos-server-and-apps/nixos-apps/cutesealfanpage.love; ./generatePosts";
};
};
};
# when in doubt, clear away the certs with
# sudo rm -rf /var/lib/acme/
security.acme.acceptTerms = true;
security.acme.defaults.email = "admin@cutesealfanpage.love";
# uncomment this to use the staging server
# security.acme.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
# services.cron = {
# enable = true;
# systemCronJobs = [
# # "12 12 * * * alice . /etc/profile; /home/alice/seal-blog/devops/newSealPost.sh > /home/alice/logs/backup.log 2>&1"
# # "* * * * * alice . /etc/profile; /home/alice/seal-blog/devops/newSealPost.sh"
# "12 12 * * * alice . /etc/profile; ${pkgs.newSealPost} > /home/alice/logs/backup.log 2>&1"
# ];
# };
}

View File

@ -0,0 +1 @@
use flake

View File

@ -0,0 +1,3 @@
[user]
email = admin@cutesealfanpage.love
name = Alice

View File

@ -0,0 +1,15 @@
# Haykll site
_cache
_site
result
# Haskell stuff
site
dist
*.dyn_hi
*.dyn_o
*.hi
*.o
# Direnv lorri stuff
.direnv

View File

@ -0,0 +1,21 @@
{
"git.ignoreLimitWarning": true,
"cSpell.words": [
"cutesealfanpage",
"Dhall",
"Fanpage",
"fmap",
"Hakyll",
"Lookie",
"mappend",
"Monoid",
"Namecheap",
"NOINLINE",
"pandoc",
"runghc",
"uncurry",
"unlines",
"utct"
],
"nix.serverPath": "nil"
}

View File

@ -0,0 +1,39 @@
# Cute Seal Fanpage
> An experiment using [Nix](https://nixos.org/), [Hakyll](https://jaspervdj.be/hakyll/), [Haskell](https://www.haskell.org/), and [shell scripts](https://en.wikipedia.org/wiki/Bourne_shell) to automate a simple website deployment pipeline.
## Why Seals?
It's an in-joke.
## What's all this code?
seal-blog/
- devops/
- build.sh
- Uses a [nix-shell](https://nixos.wiki/wiki/Development_environment_with_nix-shell) expression to build the Hakyll executable
- configuration.nix
- The [configuration file for the NixOS](https://nixos.org/manual/nixos/stable/index.html#ch-configuration) production server. This takes care of installing all the necessary software, setup [Nginx](https://www.nginx.com/), and get [ACME certs](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment) for verification.
- newSealPost.sh
- Script to be called daily by a cron job on the server. Generates the post for the day, builds and commits.
- website/
- A basic Hakyll site, slightly modified to serve seals. Most of the site is generated from the `site.hs` file. Check the [Hakyll](https://jaspervdj.be/hakyll/) documentation for more info.
## Work to be done
- The blog post generation and the hosting of the website are currently intertwined when they should be separated
- Seal post generator just makes posts
- Hakyll blog imports or calls the post generator
- The deployed server/nix config file has a cron job for adding a new blog and committing every day
- Need to move the blog and post generation inside nixos-apps on my beefier server
- The configuration file here is for it's own Linode, the current small one running, but I have a better setup for that now
- Pull out the useful parts for my deployed server, remove anything not necessary for a small config file
- Also switch to using caddy if not already
- Experiment with `*` A records
- For the seal blog
- Instead of having `www` and `git` and `...` subdomains spelled out in Namecheap
- Just have a `*` record and have caddy do the filtering

View File

@ -0,0 +1,6 @@
---
title: About Me
---
I collect the seal photos
Haven't missed a day yet!

View File

@ -0,0 +1,102 @@
{ sealImagesPath = "images"
, postsOutputPath = "posts"
, startDate = 2022-04-20
, seed = +137
, adjectives1 =
[ "absorbing"
, "adorable"
, "alluring"
, "ambrosial"
, "amiable"
, "appealing"
, "attractive"
, "beautiful"
, "bewitching"
, "captivating"
, "charismatic"
, "charming"
, "choice"
, "cute"
, "dainty"
, "darling"
, "dear"
, "delectable"
, "delicate"
, "delicious"
, "delightful"
, "desirable"
, "dishy"
, "dreamy"
, "electrifying"
, "elegant"
, "enamoring"
, "engaging"
, "engrossing"
, "enthralling"
, "entrancing"
, "eye-catching"
, "fascinating"
, "fetching"
, "glamorous"
, "graceful"
, "heavenly"
, "infatuating"
, "inviting"
, "irresistible"
, "likable"
, "lovable"
, "lovely"
, "magnetizing"
, "nice"
, "pleasant"
, "precious"
, "pretty"
, "provocative"
, "rapturous"
, "ravishing"
, "seducing"
, "seductive"
, "suave"
, "sweet"
, "tantalizing"
, "tempting"
, "titillating"
, "winning"
, "winsome"
]
, adjectives2 =
[ "ample"
, "bearish"
, "big"
, "butterball"
, "buxom"
, "chunky"
, "fatty"
, "flabby"
, "fleshy"
, "full-figured"
, "hefty"
, "husky"
, "pleasingly plump"
, "plump"
, "plumpish"
, "podgy"
, "portly"
, "pudgy"
, "roly-poly"
, "rotund"
, "round"
, "stout"
, "tubby"
, "zaftig"
]
, looks =
[ "Look at"
, "Gaze upon"
, "Check out"
, "Witness!"
, "Look upon and tremble at"
, "Lookie here at"
, "Whoa! See"
]
}

View File

@ -0,0 +1,6 @@
---
title: Contact
---
If you have a seal or seal photos, I'd love to post them!
Send yours to admin AT cutesealfanpage.love

View File

@ -0,0 +1,141 @@
html {
font-size: 62.5%;
}
body {
font-size: 1.6rem;
color: #000;
}
header {
border-bottom: 0.2rem solid #000;
}
nav {
text-align: right;
}
nav a {
font-size: 1.8rem;
font-weight: bold;
color: black;
text-decoration: none;
text-transform: uppercase;
}
footer {
margin-top: 3rem;
padding: 1.2rem 0;
border-top: 0.2rem solid #000;
font-size: 1.2rem;
color: #555;
}
h1 {
font-size: 2.4rem;
}
h2 {
font-size: 2rem;
}
article .header {
font-size: 1.4rem;
font-style: italic;
color: #555;
}
.logo a {
font-weight: bold;
color: #000;
text-decoration: none;
}
@media (max-width: 319px) {
body {
width: 90%;
margin: 0;
padding: 0 5%;
}
header {
margin: 4.2rem 0;
}
nav {
margin: 0 auto 3rem;
text-align: center;
}
footer {
text-align: center;
}
.logo {
text-align: center;
margin: 1rem auto 3rem;
}
.logo a {
font-size: 2.4rem;
}
nav a {
display: block;
line-height: 1.6;
}
}
@media (min-width: 320px) {
body {
width: 90%;
margin: 0;
padding: 0 5%;
}
header {
margin: 4.2rem 0;
}
nav {
margin: 0 auto 3rem;
text-align: center;
}
footer {
text-align: center;
}
.logo {
text-align: center;
margin: 1rem auto 3rem;
}
.logo a {
font-size: 2.4rem;
}
nav a {
display: inline;
margin: 0 0.6rem;
}
}
@media (min-width: 640px) {
body {
width: 60rem;
margin: 0 auto;
padding: 0;
}
header {
margin: 0 0 3rem;
padding: 1.2rem 0;
}
nav {
margin: 0;
text-align: right;
}
nav a {
margin: 0 0 0 1.2rem;
display: inline;
}
footer {
text-align: right;
}
.logo {
margin: 0;
text-align: left;
}
.logo a {
float: left;
font-size: 1.8rem;
}
}

View File

@ -0,0 +1,85 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1691421349,
"narHash": "sha256-RRJyX0CUrs4uW4gMhd/X4rcDG8PTgaaCQM5rXEJOx6g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "011567f35433879aae5024fc6ec53f2a0568a6c4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"spg": "spg",
"utils": "utils"
}
},
"spg": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": [
"utils"
]
},
"locked": {
"lastModified": 1691530010,
"narHash": "sha256-4xtMxEstoQ0iM/BOgGhla08xL/DFjS0+Q8nLOl9Gmls=",
"ref": "refs/heads/main",
"rev": "f25dd9c99382fd4e945e4d0d034254fc552d9aca",
"revCount": 14,
"type": "git",
"url": "https://git.ewanick.com/bill/sealPostGenerator.git"
},
"original": {
"type": "git",
"url": "https://git.ewanick.com/bill/sealPostGenerator.git"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -0,0 +1,59 @@
{
description = "A Nix flake for my long-running seal blog";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
spg.url = "git+https://git.ewanick.com/bill/sealPostGenerator.git";
spg.inputs.nixpkgs.follows = "nixpkgs";
spg.inputs.utils.follows = "utils";
};
outputs = { self, nixpkgs, utils, ... }@inputs:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ghc' = pkgs.haskellPackages.ghcWithHoogle (self: with self; [
hakyll
]);
in
rec {
apps.generateSealPosts = {
type = "app";
program = "${inputs.spg.packages.${system}.default}/bin/generateSealPosts";
};
apps.hakyll-site = {
type = "app";
program = "${packages.default}/bin/site";
};
apps.default = apps.hakyll-site;
packages.default = pkgs.stdenv.mkDerivation {
name = "site";
src = self;
buildPhase = ''
${ghc'}/bin/ghc \
-O2 \
-static \
-o site \
site.hs
'';
installPhase = "mkdir -p $out/bin; install -t $out/bin site";
};
devShells.default = pkgs.mkShell {
name = "hakyll-shell";
buildInputs = with pkgs.haskellPackages; [
ghc'
hlint
haskell-language-server
];
};
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

View File

@ -0,0 +1,16 @@
---
title: Seal Blog!
---
<h2>Welcome</h2>
<img src="/images/seal1.jpg" style="float: right; margin: 10px;" width="200px"/>
<p>Welcome to my seal blog!</p>
<p>Here's a list of recent posts for your reading pleasure:</p>
<h2>Seal Posts</h2>
$partial("templates/post-list.html")$
<p>…or you can find more in the <a href="/archive.html">archives</a>.</p>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 1
---
Gaze upon this alluring, tubby seal!
<img
src="/images/seal23.jpg"
alt="A picture of a alluring, tubby seal! <3"
width="400"
/>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 2
---
Lookie here at this attractive, bearish seal!
<img
src="/images/seal4.jpg"
alt="A picture of a attractive, bearish seal! <3"
width="400"
/>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 3
---
Witness! this engrossing, portly seal!
<img
src="/images/seal8.jpg"
alt="A picture of a engrossing, portly seal! <3"
width="400"
/>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 4
---
Gaze upon this engaging, plumpish seal!
<img
src="/images/seal25.jpg"
alt="A picture of a engaging, plumpish seal! <3"
width="400"
/>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 5
---
Look upon and tremble at this enthralling, chunky seal!
<img
src="/images/seal39.jpg"
alt="A picture of a enthralling, chunky seal! <3"
width="400"
/>

View File

@ -0,0 +1,10 @@
---
title: Seal Post Number 6
---
Gaze upon this delightful, pleasingly plump seal!
<img
src="/images/seal18.jpg"
alt="A picture of a delightful, pleasingly plump seal! <3"
width="400"
/>

Some files were not shown because too many files have changed in this diff Show More