Commit graph

20618 commits

Author SHA1 Message Date
Luke Granger-Brown
e010efb040 chore(gerrit): update to 3.2.2-1002-gea26b5ee7a
This is the version currently (2020-07-25) deployed on https://gerrit-review.googlesource.com/,
and includes features such as The Attention Set.

Change-Id: Idf29f96c38d7737efb0d64c4cd294dab46fe5412
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1437
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 20:27:13 +00:00
Griffin Smith
b10970a66f feat(3p/nix): Start implementing RPC store client
Add a stub class for wrapping a gRPC client to the new, proto-backed nix
store protocol, along with several methods implemented but several left
throwing a not implemented exception.

Paired-With: Vincent Ambo <mail@tazj.in>
Paired-With: Perry Lorier <isomer@tvl.fyi>
Change-Id: Id943d4f6d75084b8498786d580e6c9f7c92c104d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1436
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-25 20:18:29 +00:00
Griffin Smith
dcaba9de64 feat(3p/nix): Add main function for grpc daemon
Implement the main function for the new, proto-based nix daemon. This
mostly replicates the behavior of the previous nix daemon - it starts a
grpc server listening on the same nix socket path and supports the same
set of options - with the exception of --stdio, which has been renamed
to --pipe and documented in the man page.

Change-Id: Ib729283c1d5d35c0e1b0a968bc1f052f5527f2d7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1356
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-25 20:11:41 +00:00
William Carroll
722205b081 Remodel Account type
Remove unnecessary fields:
- name
- age

Add domain-specific fields:
- username
- password
- email
- role
2020-07-25 18:32:17 +01:00
William Carroll
d011616564 Change the name User to Account
Next I'll need to add / remove fields from the Account type.
2020-07-25 18:18:59 +01:00
Griffin Smith
7c56fccdad feat(3p/nix): Template systemd unit files in build
Template the systemd unit file templates as part of the nix
installPhase, putting them in the same place that the upstream nix
derivation does.

Change-Id: I3ceabfc0c837564e33b9ae7f9eeb7185d6fbe907
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1429
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 14:12:04 +00:00
Vincent Ambo
2ed0778103 chore(tazjin/frog): Enable Docker for Nixery testing
Change-Id: Ia0ffb781fc61f42aa4ad043a6f73fa995eb2c1b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1434
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 13:46:04 +00:00
Vincent Ambo
c194c5662b fix(build): Don't use Cachix as the binary cache during builds
Permission changes in the Travis CI Nix builders have caused this to
start failing, as the build user now has insufficient permissions to
use caches.

There may be a way to change the permissions instead, but in the
meantime we will just cause things to rebuild.
2020-07-25 14:43:21 +01:00
Vincent Ambo
bc9742f927 chore(build): Update pinned Go dependencies 2020-07-25 14:43:21 +01:00
Vincent Ambo
987a90510a fix(popcount): Accommodate upstream changes on nixos.org
Channel serving has moved to a new subdomain, and the redirect
semantics have changed. Instead of serving temporary redirects,
permanent redirects are now issued.

I've reported this upstream as a bug, but this workaround will fix it
in the meantime.
2020-07-25 14:43:21 +01:00
Vincent Ambo
b4e0b55e56 chore(build): Change pin for default nixpkgs used to build Nixery
This moves the pin from just being in the Travis configuration to also
being set in a nixpkgs-pin.nix file, which makes it trivial to build
at the right commit when performing local builds.
2020-07-25 14:43:21 +01:00
Kane York
bbbb97e142 chore(3p/nix): disable clang-tidy in cmake
Change-Id: I9ff1ae10afe5af066aaff377424522a19977dc3d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1428
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-25 03:06:10 +00:00
Griffin Smith
0b74688e9c chore(3p/nix): Remove obsolete upload-release.pl script
This hardcodes eelco's home directory, among other things we no longer
care about.

Change-Id: Ide894107c091c37e30bba9daf473fc7dfc8b8563
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1427
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 02:56:05 +00:00
Griffin Smith
850f6fc27b feat(web/panettone): Make responsive
Make the site responsive, by making all the hard :widths we were using
into :max-widths, and adding a viewport meta tag.

Change-Id: I02f054f81ff57fbd1c4603b179b2104367f03e3b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1415
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 02:38:43 +00:00
Griffin Smith
2f85dfe50c fix(3p/nix): Don't include depotPath in the main drv
Including depotPath in the shellHook of the main derivation for tvix
was, unsurprisingly, causing spurious rebuilds. It's still useful when
developing locally, though, so I've extracted it to a `build-shell`
derivation as a passthru attribute and updated the documentation.

Fixes: #20
Change-Id: Ibc686b9f06ec68e79759ca2c989414bd5fbce696
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1426
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-07-25 02:29:14 +00:00
Griffin Smith
4dca023385 feat(3p/nix): Add build for VM for testing tvix
Add an expression, based on the nixos qemu virtualisation framework, for
a basic system whose nix is tvix, to be used for testing tvix

Change-Id: I3c7422bb10d3ce05a3094671cb770f1f745d814c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1423
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Tested-by: BuildkiteCI
2020-07-25 02:29:14 +00:00
Vincent Ambo
6936ee40af feat(tools/cheddar): Add endpoint for Markdown rendering
Similar to the source code highlighting endpoint, but for Markdown.
This is to be used by the bug tracker, as well as Sourcegraph in the
future.

Change-Id: I4bea5c46ba969ba9965b61409e1c19c2edf1246c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1424
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-25 01:42:03 +00:00
Vincent Ambo
a12b0efc9e chore(3p/nix): Reduce number of active clang-tidy checks
The full clang-tidy check suite is *very* slow. This reduced list is
some kind of middle-ground between running all checks, and having a
useful developer experience.

Crucially most of the static analyzer checks (except for the ones
related to security issues) have been disabled.

We should look into running the full suite in CI only.

Change-Id: I02b96ad3b4d1a43bd6aa90ffdcba800dad966714
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1422
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-25 01:02:41 +00:00
Griffin Smith
2fcf2d0d20 refactor(3p/nix): Remove custom base64 implementation
Replace the custom, rather questionable base64 implementation with
absl::Base64{Une,E}scape. To make sure that the custom implementation
was doing the same thing I've also added a test covering
nix::Hash::to_string, which was one function that used it - the test
passed prior to the replacement, and continued to pass afterwards.

The previous base64Decode function threw an exception on failure - to
avoid going too far down the rabbit hole I've replicated that
functionality at all call sites, but this should be replaced with more
sensible error handling such as StatusOr eventually.

Also, before this change:

    ❯ nix eval -f . users.tazjin.emacs.outPath
    "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs"

And after:

    ❯ ./result/bin/nix eval -f . users.tazjin.emacs.outPath
    "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs"

Change-Id: Id292ffbb82fe808f3f1b34670afbe7b8c13ad615
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1385
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-07-25 00:04:43 +00:00
Griffin Smith
ece66d081b fix(web/panettone): Fix html5 compliance
- who:html-mode needs to be html5 rather than HTML5 apparently, even
  though the documentation says otherwise
- wrap content in an :html tag with the :lang "en" attribute

Fixes: #22
Change-Id: I58ff8947d17ac02659e4c8d98155f57127ec7005
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1421
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
2020-07-24 23:39:38 +00:00
William Carroll
718152ec14 Return a Session
Define the Session type and return it for the POST /user endpoint
2020-07-24 23:35:49 +01:00
Kane York
989563a75b chore(3p/nix): log whether or not clang-tidy is enabled
CMake likes to remember that we overrode it with an empty string and not use the new env var.

Change-Id: I16587f27750c9ebd4f65349bb59b37e0f8117f18
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1406
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-24 22:18:40 +00:00
Kane York
6039417431 fix(3p/nix): fix all UninitializedObject warnings
The cpptoml occurrences are ignored in CL 1419.

Updates: #11
Change-Id: Ifb21c93b09c67e6b6a4c9e7089abffe7616569fd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1407
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-07-24 22:18:23 +00:00
Kane York
6a0be19edd chore(3p/nix): ignore all unfixable clang-tidy warnings
Change-Id: I641c447fc57df4fed40ed4e89d79a88342b67bc8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1419
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-07-24 22:16:48 +00:00
Kane York
bd77090703 fix(3p/nix): do not call vfork
The use of vfork() in Nix is entirely illegal. Quote:

If the process created by vfork() returns from the function in which vfork() was
called, or calls any other function before successfully calling _exit() or
one of the exec*() family of functions, the behavior is undefined.

-- Linux man-pages, release 5.05

Add a TODO to use the higher-performance variants of clone() on Linux when it
is available.

Change-Id: I42370e1568ad6e2d00d70d0b66c8aded8f1288bb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1418
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
2020-07-24 22:16:08 +00:00
Kane York
388b5f1abe fix(3p/nix): fix null pointer dereferences
Change-Id: I4c37febcd4978f17720b2526c267c6bf96e84bcc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1417
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-24 22:15:19 +00:00
William Carroll
1d47e94bbe Integrate Persistent with Servant
Query my SQLite database from within my Servant handlers. Nothing I've written
is domain-specific to the business logic yet -- I'm just making sure everything
integrates.
2020-07-24 22:48:08 +01:00
William Carroll
660b8d43e5 Support a basic API
Use Servant to create a REST API supporting the following routes:
- GET /number
- POST /other

The server interacts with a SQLite database.
2020-07-24 19:00:29 +01:00
William Carroll
ec90748b82 Create a shell.nix
Manage the project's dependencies using Nix.
2020-07-24 18:59:34 +01:00
William Carroll
26271ec178 Create todo.org
Create an org file with the instructions sent from TopTal as TODOs.
2020-07-24 18:58:04 +01:00
Griffin Smith
e191e0afad feat(web/panettone): Make issues visible publicly
Make auth optional on the index, closed-issues, and view-issue pages,
and only render the various buttons (close issue, new issue, make
comment, etc.) if the user is authenticated.

Fixes: #5
Change-Id: I0a2aaf4a7cc4c5ef0494cc183410f00d2a3b7e06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1414
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-24 16:41:44 +00:00
Griffin Smith
3e033637b4 feat(web/panettone): Add a Log Out link to the footer
Generalize the rendering of the footer nav, and add a Log Out button to
the right.

Change-Id: I107e2370fd8f12949218ecacb611649a48abd738
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1413
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-24 16:41:44 +00:00
Griffin Smith
156c68698b feat(web/panettone): Add "All Issues" link on issue page
This was something that was complained about verbally - if someone gets
a link to an issue directly it's nice to be able to click on a link to
view all issues.

Change-Id: Id4e0c7208edc51980c6577bb10e6c6dea1e7ab55
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1412
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-24 15:50:40 +00:00
Griffin Smith
ed8fed5baa feat(web/panettone): Redirect to original URI after login
Once the user authenticates, redirect them to the original URI they were
trying to get to

Fixes: #7
Change-Id: Id7c8cbe3547923f6c4c5faed180ea8ea6528fddd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1411
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-24 15:50:40 +00:00
William Carroll
fd49b7f1be add README 2020-07-24 16:21:13 +01:00
William Carroll
d0c1645c16 Add two steps to finances playbook
I needed to add the first step since I dipped into my Emergency fund last month
to pay for someone to prepare my US tax return. I added the other step as a
reminder.
2020-07-24 10:07:30 +01:00
William Carroll
7f7ca4d6f5 Fix typo in finances playbook
amount -> amounts
2020-07-24 10:07:06 +01:00
Kane York
3ce4a6cc18 fix(3p/nix): fix more clang-tidy warnings
Change-Id: I1e8a4852ffa450c552a4cdfc709554799854934c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1416
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-24 02:40:11 +00:00
Griffin Smith
fba4d145f8 feat(web/panettone): Add issue subject to page title
Fixes: #8
Change-Id: I5513018e6d4908881a3522a24764729f2638b521
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1408
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-24 01:01:43 +00:00
Griffin Smith
add588e634 feat(web/panettone): Disallow comments with an empty body
Change-Id: Ic77a0caf419389e8460bf7e5688293f3a588caa4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1405
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-24 01:01:43 +00:00
Griffin Smith
943a4c9214 feat(web/panettone): Disallow issues with an empty subject
Disallow creating issues with an empty subject, and render a nice(ish)
alert box indicating the error.

Change-Id: I2857923dc0eb7702c85cd1974a73270ca27720fc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1404
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
2020-07-24 01:01:43 +00:00
Griffin Smith
280ec4a46c fix(3p/nix): Link nixutil to its dependencies
nixutil depends on bzip2, lzma, boost::context, brotli{enc,dec}, and
openssl, but wasn't directly linking to them. This was causing linker
errors in a test that only depended on nixutil.

Change-Id: I60e77ea7b18b08e2946fcf9176ae0f355cd71844
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1384
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-24 00:56:07 +00:00
Griffin Smith
6bdd191cbf fix(web/panettone): Fix failure on invalid username
Handle if the username submitted to the login form is one of a
nonexistent user, rather than returning a 500

Fixes: #1
Change-Id: Iebc68dea3c91dc928e4386cb172d3c1515fb1556
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1402
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-23 22:53:18 +00:00
Griffin Smith
d8a0bd9e75 fix(web/panettone): Put snapshot in the right place
For some reason cl-prevalence tries to put the snapshot in the *parent
directory* of the directory that's passed to make-prevalence-system.
This is icky, but this should work around it

Fixes: #2
Fixes: #3
Fixes: #4
Change-Id: I8300246275887653586108cd7b3b033df3bca203
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1401
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
2020-07-23 22:30:44 +00:00
Griffin Smith
bd3c19320a feat(web/panettone): Add issue statuses
Add support for issue statuses, which is currently a trivial groupoid of
open and closed. On the show page for open issues there's a Close
button, and on the show page for closed issues there's a Reopen button.
In addition, the index page is filtered by open issues only and there's
a link to view closed issues.

Change-Id: I6c0c3d2e874b1c801e9e06c804f5c1b12db5dbdc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1352
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-23 22:20:00 +00:00
Griffin Smith
a107d8e335 feat(web/panettone): Add support for comments
Add a new-comment form and list all issue comments on the issue page

Change-Id: Ia74083484614ba0ca0f2879276f717f709d0f42f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1351
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-07-23 22:20:00 +00:00
Griffin Smith
d445136140 feat(web/panettone): Add initial styles
Take an initial crack at styling most of the Panettone application,
taking inspiration from the styles from todo.tvl.fyi and tvl.fyi itself.
This uses the LASS CSS library, after a brief attempt at using css-lite
which I ended up not going with because I don't like the library's
design very much, and also it's not compatible with sbcl's (safety
3) (some macroexpansions SETQ undeclared variables).

Change-Id: I054402e4c68ae1e99884d5164e6e2fc39d2779ff
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1350
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-07-23 22:20:00 +00:00
Griffin Smith
d3b7de0783 feat(web/panettone): Display who opened issues and when
Add a line to the issue show page displaying who opened the issue and
when, the latter formatted in dottime.

Change-Id: Ie70d7fd9e62ae92f9a479969d4ea21daddccee40
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1345
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-07-23 22:20:00 +00:00
Bartosz Stebel
32c3f7731b feat(tvl-slapd): add implr
Change-Id: I7d22bf61ac72e86a17035d6125055da8aa53d762
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1387
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-07-23 22:19:23 +00:00
Griffin Smith
7101cc5375 feat(ops/nixos): Deploy Panettone to Whitby
Deploy Panettone to whitby as a systemd service, proxied to from an
nginx virtual host listening at b.tvl.fyi

Change-Id: I69755566151a45120e6b3453751af0e9291fa241
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1339
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-07-23 22:09:15 +00:00