aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--.github/workflows/codeql-analysis.yml39
-rw-r--r--.github/workflows/go.yml21
-rw-r--r--.github/workflows/kubernetes-cd.yml80
-rw-r--r--.github/workflows/nix.yml46
-rw-r--r--.github/workflows/rust.yml25
-rw-r--r--.gitignore2
-rw-r--r--Cargo.lock2592
-rw-r--r--Cargo.toml48
-rw-r--r--Dockerfile20
-rw-r--r--LICENSE2
-rw-r--r--README.md7
-rw-r--r--blog/OVE-20190623-0001.markdown (renamed from blog/OVE-20190623-0001.md)0
-rw-r--r--blog/OVE-20191021-0001.markdown (renamed from blog/OVE-20191021-0001.md)0
-rw-r--r--blog/site-update-2020-07-16.markdown189
-rw-r--r--cmd/site/clacks.go25
-rw-r--r--cmd/site/html.go245
-rw-r--r--cmd/site/internal/blog/blog.go137
-rw-r--r--cmd/site/internal/blog/blog_test.go66
-rw-r--r--cmd/site/internal/date.go10
-rw-r--r--cmd/site/internal/date_test.go28
-rw-r--r--cmd/site/internal/front/LICENSE19
-rw-r--r--cmd/site/internal/front/front.go24
-rw-r--r--cmd/site/internal/front/front_test.go42
-rw-r--r--cmd/site/internal/hash.go14
-rw-r--r--cmd/site/internal/middleware/metrics.go43
-rw-r--r--cmd/site/internal/middleware/requestid.go31
-rw-r--r--cmd/site/main.go296
-rw-r--r--cmd/site/pageview.go53
-rw-r--r--cmd/site/patreon.go112
-rw-r--r--cmd/site/rss.go91
-rw-r--r--cmd/site/signalboost.go29
-rw-r--r--cmd/site/signalboost_test.go28
-rw-r--r--config.dhall27
-rw-r--r--css/shim.css20
-rw-r--r--default.nix23
-rw-r--r--docker.nix21
-rw-r--r--go.mod21
-rw-r--r--go.sum211
-rw-r--r--jsonfeed/.travis.yml17
-rw-r--r--jsonfeed/LICENSE363
-rw-r--r--jsonfeed/README.md8
-rw-r--r--jsonfeed/jsonfeed.go73
-rw-r--r--jsonfeed/jsonfeed_test.go42
-rw-r--r--jsonfeed/testdata/feed.json21
-rw-r--r--lib/go_vanity/Cargo.toml15
-rw-r--r--lib/go_vanity/src/build.rs5
-rw-r--r--lib/go_vanity/src/lib.rs12
-rw-r--r--lib/go_vanity/templates/gitea.rs.html14
-rw-r--r--lib/go_vanity/templates/github.rs.html14
-rw-r--r--lib/jsonfeed/.gitignore4
-rw-r--r--lib/jsonfeed/Cargo.toml15
-rw-r--r--lib/jsonfeed/LICENSE-APACHE201
-rw-r--r--lib/jsonfeed/LICENSE-MIT25
-rw-r--r--lib/jsonfeed/README.adoc27
-rw-r--r--lib/jsonfeed/src/builder.rs204
-rw-r--r--lib/jsonfeed/src/errors.rs7
-rw-r--r--lib/jsonfeed/src/feed.rs296
-rw-r--r--lib/jsonfeed/src/item.rs493
-rw-r--r--lib/jsonfeed/src/lib.rs252
-rw-r--r--lib/patreon/.gitignore1
-rw-r--r--lib/patreon/Cargo.toml20
-rw-r--r--lib/patreon/examples/campaign.rs17
-rw-r--r--lib/patreon/src/lib.rs158
-rw-r--r--nix/deps.nix588
-rw-r--r--nix/sources.json12
-rwxr-xr-xscripts/docker.sh6
-rwxr-xr-xscripts/nixrun.sh4
-rwxr-xr-xscripts/release.sh10
-rw-r--r--shell.nix18
-rw-r--r--site.dhall23
-rw-r--r--site.nix53
-rw-r--r--src/app.rs191
-rw-r--r--src/build.rs11
-rw-r--r--src/handlers/blog.rs77
-rw-r--r--src/handlers/feeds.rs73
-rw-r--r--src/handlers/gallery.rs40
-rw-r--r--src/handlers/mod.rs145
-rw-r--r--src/handlers/talks.rs40
-rw-r--r--src/main.rs154
-rw-r--r--src/post/frontmatter.rs114
-rw-r--r--src/post/mod.rs178
-rw-r--r--src/signalboost.rs23
-rw-r--r--static/js/installsw.js7
-rw-r--r--static/js/instantpage-3.0.0.js2
-rwxr-xr-xstatic/js/sw.js46
-rw-r--r--templates/blogindex.rs.html (renamed from templates/blogindex.html)18
-rw-r--r--templates/blogpost.rs.html122
-rw-r--r--templates/contact.rs.html (renamed from templates/contact.html)17
-rw-r--r--templates/error.html9
-rw-r--r--templates/error.rs.html13
-rw-r--r--templates/feeds.rs.html (renamed from templates/feeds.html)11
-rw-r--r--templates/footer.rs.html17
-rw-r--r--templates/galleryindex.html26
-rw-r--r--templates/galleryindex.rs.html23
-rw-r--r--templates/gallerypost.html116
-rw-r--r--templates/gallerypost.rs.html (renamed from templates/blogpost.html)97
-rw-r--r--templates/header.rs.html (renamed from templates/base.html)75
-rw-r--r--templates/index.rs.html (renamed from templates/index.html)27
-rw-r--r--templates/notfound.rs.html11
-rw-r--r--templates/patrons.rs.html (renamed from templates/patrons.html)20
-rw-r--r--templates/resume.html9
-rw-r--r--templates/resume.rs.html13
-rw-r--r--templates/series.html16
-rw-r--r--templates/series.rs.html17
-rw-r--r--templates/series_posts.rs.html18
-rw-r--r--templates/serieslist.html16
-rw-r--r--templates/signalboost.rs.html (renamed from templates/signalboost.html)31
-rw-r--r--templates/talkindex.rs.html (renamed from templates/talkindex.html)19
-rw-r--r--templates/talkpost.rs.html (renamed from templates/talkpost.html)98
110 files changed, 6352 insertions, 3294 deletions
diff --git a/.gitattributes b/.gitattributes
index 813e826..5491853 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1 @@
-nix/deps.nix linguist-vendored
nix/sources.nix linguist-vendored
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index 5e7db4c..0000000
--- a/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: "Code scanning - action"
-
-on:
- push:
- pull_request:
- schedule:
- - cron: '0 18 * * 6'
-
-jobs:
- CodeQL-Build:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
- with:
- # We must fetch at least the immediate parents so that if this is
- # a pull request then we can checkout the head.
- fetch-depth: 2
-
- # If this run was triggered by a pull request event, then checkout
- # the head of the pull request instead of the merge commit.
- - run: git checkout HEAD^2
- if: ${{ github.event_name == 'pull_request' }}
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- # Override language selection by uncommenting this and choosing your languages
- with:
- languages: go
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
deleted file mode 100644
index e1e986f..0000000
--- a/.github/workflows/go.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: Go
-on:
- - push
- - pull_request
-jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
- steps:
- - name: Set up Go 1.14
- uses: actions/setup-go@v1
- with:
- go-version: 1.14
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v1
- - name: Test
- run: go test -v ./...
- env:
- GO111MODULE: on
- GOPROXY: https://cache.greedo.xeserv.us
diff --git a/.github/workflows/kubernetes-cd.yml b/.github/workflows/kubernetes-cd.yml
deleted file mode 100644
index 37f47b1..0000000
--- a/.github/workflows/kubernetes-cd.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-name: "CI/CD"
-on:
- push:
- branches:
- - master
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - name: Build container image
- run: |
- docker build -t xena/christinewebsite:$(echo $GITHUB_SHA | head -c7) .
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker push xena/christinewebsite
- env:
- DOCKER_USERNAME: "xena"
- DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- - name: Download secrets/Install/Configure/Use Dyson
- run: |
- mkdir ~/.ssh
- echo $FILE_DATA | base64 -d > ~/.ssh/id_rsa
- md5sum ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- git clone git@ssh.tulpa.dev:cadey/within-terraform-secret
- curl https://xena.greedo.xeserv.us/files/dyson-linux-amd64-0.1.0.tgz | tar xz
- cp ./dyson-linux-amd64-0.1.1/dyson .
- rm -rf dyson-linux-amd64-0.1.1
- mkdir -p ~/.config/dyson
-
- echo '[DigitalOcean]
- Token = ""
-
- [Cloudflare]
- Email = ""
- Token = ""
-
- [Secrets]
- GitCheckout = "./within-terraform-secret"' > ~/.config/dyson/dyson.ini
-
- ./dyson manifest \
- --name=christinewebsite \
- --domain=christine.website \
- --dockerImage=xena/christinewebsite:$(echo $GITHUB_SHA | head -c7) \
- --containerPort=5000 \
- --replicas=2 \
- --useProdLE=true > $GITHUB_WORKSPACE/deploy.yml
- env:
- FILE_DATA: ${{ secrets.SSH_PRIVATE_KEY }}
- GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
- - name: Save DigitalOcean kubeconfig
- uses: digitalocean/action-doctl@master
- env:
- DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
- with:
- args: kubernetes cluster kubeconfig show kubermemes > $GITHUB_WORKSPACE/.kubeconfig
- - name: Deploy to DigitalOcean Kubernetes
- uses: docker://lachlanevenson/k8s-kubectl
- with:
- args: --kubeconfig=/github/workspace/.kubeconfig apply -n apps -f /github/workspace/deploy.yml
- - name: Verify deployment
- uses: docker://lachlanevenson/k8s-kubectl
- with:
- args: --kubeconfig=/github/workspace/.kubeconfig rollout status -n apps deployment/christinewebsite
- - name: Ping Google
- uses: docker://lachlanevenson/k8s-kubectl
- with:
- args: --kubeconfig=/github/workspace/.kubeconfig apply -f /github/workspace/k8s/job.yml
- - name: Sleep
- run: |
- sleep 5
- - name: Don't Ping Google
- uses: docker://lachlanevenson/k8s-kubectl
- with:
- args: --kubeconfig=/github/workspace/.kubeconfig delete -f /github/workspace/k8s/job.yml
- - name: POSSE
- env:
- MI_TOKEN: ${{ secrets.MI_TOKEN }}
- run: |
- curl -H "Authorization: $MI_TOKEN" --data "https://christine.website/blog.json" https://mi.within.website/blog/refresh
diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml
index 1c09d87..a2e3a4a 100644
--- a/.github/workflows/nix.yml
+++ b/.github/workflows/nix.yml
@@ -1,16 +1,42 @@
name: "Nix"
on:
push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
jobs:
- tests:
+ docker-build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v1
- - uses: cachix/install-nix-action@v6
- - uses: cachix/cachix-action@v3
- with:
- name: xe
- - run: |
- nix-build docker.nix
- docker load -i result
- docker tag xena/christinewebsite:latest xena/christinewebsite:$(echo $GITHUB_SHA | head -c7)
+ - uses: actions/checkout@v1
+ - uses: cachix/install-nix-action@v6
+ - uses: cachix/cachix-action@v3
+ with:
+ name: xe
+ signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - run: |
+ docker load -i result
+ docker tag xena/christinewebsite:latest xena/christinewebsite:$GITHUB_SHA
+ echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
+ docker push xena/christinewebsite
+ env:
+ DOCKER_USERNAME: "xena"
+ DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
+ release:
+ runs-on: ubuntu-latest
+ needs: docker-build
+ if: github.ref == 'refs/heads/master'
+ steps:
+ - uses: cachix/install-nix-action@v6
+ - name: deploy
+ run: ./scripts/release.sh
+ env:
+ DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
+ MI_TOKEN: ${{ secrets.MI_TOKEN }}
+ PATREON_ACCESS_TOKEN: ${{ secrets.PATREON_ACCESS_TOKEN }}
+ PATREON_CLIENT_ID: ${{ secrets.PATREON_CLIENT_ID }}
+ PATREON_CLIENT_SECRET: ${{ secrets.PATREON_CLIENT_SECRET }}
+ PATREON_REFRESH_TOKEN: ${{ secrets.PATREON_REFRESH_TOKEN }}
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 0000000..1e18d23
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,25 @@
+name: Rust
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+env:
+ CARGO_TERM_COLOR: always
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Build
+ run: cargo build --all
+ - name: Run tests
+ run: |
+ cargo test
+ (cd lib/jsonfeed && cargo test)
+ (cd lib/patreon && cargo test)
+ env:
+ PATREON_ACCESS_TOKEN: ${{ secrets.PATREON_ACCESS_TOKEN }}
+ PATREON_CLIENT_ID: ${{ secrets.PATREON_CLIENT_ID }}
+ PATREON_CLIENT_SECRET: ${{ secrets.PATREON_CLIENT_SECRET }}
+ PATREON_REFRESH_TOKEN: ${{ secrets.PATREON_REFRESH_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 950c877..44098b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,4 @@ cw.tar