Commit graph

80 commits

Author SHA1 Message Date
Vincent Ambo
67a31e7252 fix(web/panettone): unbind LDAP connections after auth
unbind & close the stream of newly created LDAP connections after
auth, which might prevent some of the resource leaking we've got going
on

i did actually verify in sly that this still works. yay.

Change-Id: I92c8ca20de642585ae4c24aa455d051ee6e44a87
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5193
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2022-02-07 17:13:41 +00:00
sterni
a2ecd53f58 chore: clean up some obsolete TODOs
* //3p/nix: probably not worth investing time into this anymore

* //users/sterni/emacs: The emoji problem disappeared by itself with a
  newer emacs version, however a different one remains…

* //web/panettone: If we ever want to change the behavior, we should
  just decide the behavior statically instead of using conditions and
  restarts, as we only call it in one place, so making different
  decisions depending on call sites is not really a use case we have.

Change-Id: Iff9d439ce356db41ce34d690fb7b6a01822022fa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5223
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: sterni <sternenseemann@systemli.org>
2022-02-04 15:55:19 +00:00
Vincent Ambo
aa122cbae7 style: format entire depot with nixpkgs-fmt
This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
2022-01-31 16:11:53 +00:00
sterni
0d24efcdc9 fix(web/panettone): make (who:html-mode) stick
(who:html-mode) needs to be set at macro expansion time to properly take
effect which wasn't the case before, but is ensured now by
:compile-toplevel. :load-toplevel ensures that who inside the repl will
behave the same.

Since the :html5 behavior is now actually used, we need to adjust some
of the test cases to account for the different :html5 escaping mode.

Change-Id: I4dfe1d2db38da6a2486fde86596f7e5f50ed8b9f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4885
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2022-01-13 23:19:31 +00:00
Griffin Smith
a8ec166c72 fix(panettone): Fix export of issue status to SQL
Postmodern changed[0] how users customize the way lisp values get exported
to SQL - now, in addition to defining methods of
`cl-postgres:to-sql-string`, we have to pass `:col-export` and
`:col-import` args to the field itself in the dao class.

I'm not *entirely* sure why both are necessary, but without both this
doesn't work.

[0]: https://github.com/marijnh/Postmodern/blob/v1.33.1/CHANGELOG.md#changelog-v-1331

Change-Id: Iae8fb63c34fb6c79b9dfa350129032aab5cd2233
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4383
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: grfn <grfn@gws.fyi>
2021-12-16 18:59:01 +00:00
Smitty
4ea7fc392a feat(web/panettone): support dark mode
When the system is set to dark mode, this is detected through
prefers-color-scheme and the color scheme is adjusted accordingly. This
fixes #18.

The colors are set using CSS variables on the body that are overrridden
based on the current color scheme.

Change-Id: Id2f95dee4d6968e1b62ce37534f623e489fabde4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3722
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-10-20 19:52:13 +00:00
sterni
d7e70b1d72 feat(nix/buildLisp): add ccl
This adds support for Clozure's CL implementation to buildLisp. This is
quite trivial in comparison to ECL since SBCL and CCL have very similar
in how they work (so much so that CCL also suffers from b/136).

Also the similarities in the code actually added here are striking, so
I'll try to make an effort to reduce the code duplication in the
future.

To fix builds with CCL the following changes were made:

* //3p/lisp/nibbles: The double inclusion of the types.lisp file was
  fixed. CCL doesn't like double definitions and refuses to compile
  otherwise.

* //3p/lisp/physical-quantities: Update to a new bug fix release which
  contains a compilation fix for CCL.

* //3p/lisp/routes: apply a patch fixing the build which was previously
  failing due to a double definition.

* //3p/lisp/usocket: only depend on sb-bsd-sockets for SBCL and ECL, the
  latter of which seems to have a SBCL compatible implementation of the
  package.

* Conditionally include a few CCL-specific source files and add
  `badImplementation` entries for the remaining failures which are
  //fun/gemma (to be expected) and //web/panettone which fails with an
  incredibly vague message.

Change-Id: I666efdc39a0f16ee1bb6e23225784c709b04e740
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3350
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-08-24 22:00:15 +00:00
sterni
02566cdcfb feat(nix/buildLisp): add ecl
Adds ECL as a second supported implementation, specifically a statically
linked ECL. This is interesting because we can create statically linked
binaries, but has a few drawbacks which doesn't make it generally
useful:

* Loading things is very slow: The statically linked ECL only has byte
  compilation available, so when we do load things or use the REPL it is
  significantly worse than with e. g. SBCL.

* We can't load shared objects via the FFI since ECL's dffi is not
  available when linked statically. This means that as it stands, we
  can't build a statically linked //web/panettone for example.

Since ECL is quite slow anyways, I think these drawbacks are worth it
since the biggest reason for using ECL would be to get a statically
linked binary. If we change our minds, it shouldn't be too hard to
provide ecl-static and ecl-dynamic as separate implementations.

ECL is LGPL and some libraries it uses as part of its runtime are as
well. I've outlined in the ecl-static overlay why this should be of no
concern in the context of depot even though we are statically linking.

Currently everything is building except projects that are using cffi to
load shared libaries which have gotten an appropriate
`badImplementations` entry. To get the rest building the following
changes were made:

* Anywhere a dependency on UIOP is expressed as `bundled "uiop"` we now
  use `bundled "asdf"` for all implementations except SBCL. From my
  testing, SBCL seems to be the only implementation to support using
  `(require 'uiop)` to only load the UIOP package. Where both a
  dependency on ASDF and UIOP exists, we just delete the UIOP one.
  `(require 'asdf)` always causes UIOP to be available.

* Where appropriate only conditionally compile SBCL-specific code and
  if any build the corresponding files for ECL.

* //lisp/klatre: Use the standard condition parse-error for all
  implementations except SBCL in try-parse-integer.

* //3p/lisp/ironclad: disable SBCL assembly optimization hack for all
  other platforms as it may interfere with compilation.

* //3p/lisp/trivial-mimes: prevent call to asdf function by substituting
  it out of the source since it always errors out in ECL and we hardcode
  the correct path elsewhere anyways.

As it stands ECL still suffers from a very weird problem which happens
when compiling postmodern and moptilities:
https://gitlab.com/embeddable-common-lisp/ecl/-/issues/651

Change-Id: I0285924f92ac154126b4c42145073c3fb33702ed
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3297
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: eta <tvl@eta.st>
2021-08-24 22:00:15 +00:00
Vincent Ambo
224c9ca0bb chore: Replace remaining mentions of ##tvl[-dev] with #tvl
... and fix the capitalisation of hackint

Change-Id: I800aef75152d2dc77a33876888e36530143e9d3e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3148
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-05-23 19:46:46 +00:00
Griffin Smith
43e3355eae fix(panettone): Don't display the full before/after of issue bodies
Issue bodies tend to be very long, so displaying the full diff whenever
the issue is updated takes up a lot of visual room and is very hard to
read. Specifically for this field, this changes the display to only show
"updated the body of this issue", hiding the previous and new values.

At some point in the future, I'd love to have some CSS fun with active
anchor links to have an "expanded" view that *does* display the previous
and new value, but for now this should be fine - the data isn't gone,
after all!

Fixes: b/111
Change-Id: I0188540188729142e0b9205ff5cc9ea576c4edb6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3142
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-05-23 14:46:03 +00:00
Griffin Smith
a7d07e1a8a fix(panettone): Fix username display on issue events
7aebba7, which added anchor links to comments, also incorrectly added
only the *key* for the `:id` attribute to the `li` element for
issue *events*, swallowing up the next form (which happened to be the
username) as the value. this adds a *proper* value for the `:id`
attribute, bringing back the actual display of the username.

Fixes: b/97
Change-Id: I33ee628ddfd4a291e069980512fcc5f74014aac4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3141
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-05-23 14:41:15 +00:00
Griffin Smith
ba6bee80fb fix(panettone): Fix handling of issue-not-found
The accessor function to get the ID of the `model:issue-not-found`
condition is `not-found-id`, not `id`! Also, add a missing space to the
title.

Fixes: b/127
Change-Id: I91c71feaf1fe877e6a14453a9e75cf27d56fee31
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3140
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2021-05-23 14:16:58 +00:00
grfn
17239c597d revert: "feat(web/panettone): Allow requesting JSON"
This reverts commit 77c09076ec.

Reason for revert: It doesn't work - attempting to request any of the pages now gives:

[ERROR]] No keys match in SWITCH. Testing against
         "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
         with EQUAL.

Change-Id: Ic4c795fd2a971003a6823a3b68ddee9a03b9f7c9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3061
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-04-30 11:54:45 +00:00
Griffin Smith
77c09076ec feat(web/panettone): Allow requesting JSON
Allow specifying an `Accept: application/json` header to the index and
show issue routes, to request that those pages be returned as JSON.

Change-Id: Ic225139fc9e7fdce0da98984df4ca987685dafe0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3043
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-22 15:35:55 +00:00
Griffin Smith
6266c5d32f refactor(users/glittershark): Rename to grfn
Rename my //users directory and all places that refer to glittershark to
grfn, including nix references and documentation.

This may require some extra attention inside of gerrit's database after
it lands to allow me to actually push things.

Change-Id: I4728b7ec2c60024392c1c1fa6e0d4a59b3e266fa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2933
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: glittershark <grfn@gws.fyi>
2021-04-12 14:45:51 +00:00
sterni
4edef59ba4 feat(panettone): don't use _ for em in inline markdown
Since we are still using third_party, underscores are kind of common in
issue titles and are probably often forgotten to escape. Let's just
support `*` for emphasized text in titles for now.

Change-Id: I305bcf4d4c59123bba4ce816a6da2ee8b022c34e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2926
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
2021-04-11 20:11:07 +00:00
sterni
055fe7ce8e fix(panettone): always use displayname in subjects
Emails for (re)opening and closing where send out with the user's DN in
the subject which is probably not what we want.

Using displayname-if-known is probably not necessary as there is not
really a case where (not *user*) wouldn't justify a 500 in this context.

Change-Id: Id12d3d9619f42eb5337c2d3482b7c1646b5d6a81
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2911
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-04-10 09:18:46 +00:00
sterni
435b883f5c fix(panettone): set external-format for stream from cheddar
drakma ignores the :external-format-in parameter if :want-stream is t:

> If want-stream is true, the message body is NOT read and instead
> the (open) socket stream is returned as the first return value.
> If the sixth value of HTTP-REQUEST is true, the stream should be
> closed (and not be re-used) after the body has been read. The
> stream returned is a flexi-stream with a chunked stream as its
> underlying stream. If you want to read binary data from this
> stream, read from the underlying stream which you can get with
> FLEXI-STREAM-STREAM.

Since it doesn't return a plain CL stream which would just work with
SBCL, we need to set the external format on the resulting flexi-stream.

Fixes b/107.

Change-Id: I6e3178123c0927ef21fabf8118d9d357c8afbd42
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2869
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
2021-04-06 16:34:15 +00:00
sterni
63a0b28bea refactor(panettone): remove code duplication in render-markdown
Move the common part (encoding/decoding json and connecting to cheddar)
into request-markdown-from-cheddar. The two render-markdown
implementations are now only thin wrappers around that function.

Change-Id: I81bb34b684af44228dcad02fca541082e6d060ce
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2868
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-06 16:34:15 +00:00
Griffin Smith
5319465f60 fix(panettone): Add email.lisp to source files
email.lisp was missing from the buildLisp derivaation's source files,
which meant that none of its definitions were being loaded into the
image even though the package was defined by packages.lisp.

As an aside, this really should've broken the build - we got a
style-warning in panettone.lisp for referencing the missing definitions,
but that only surfaced as a warning, and ended up breaking once deployed

Change-Id: Ie99c3efeef8e6943aa1f9cfc426957d622c2d718
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2845
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2021-04-04 14:43:14 +00:00
Griffin Smith
808448682c feat(panettone): Add some more info to emails
Add a little bit more information to issue notification emails,
including the IDs of issues and links to the issues themselves.

Change-Id: Ia54209f936a37c6dbdb60ebff5bb8c1034cffc9a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2809
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
6c78cb69c7 feat(panettone): Send notifications when issues are reopened
Send notifications both to IRC and email when issues are reopened after
being closed

Change-Id: I3a63419c6547ac28eeaafbe212a2a01a5fc2b5af
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2808
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
606d2af2da feat(panettone): Send emails when issues are closed
Send notification emails to the same group of users who receive
notifications on issue comments when issues are marked as closed. This
also takes the opportunity to generalize issue notification emails a
bit, and lay the groundwork for (but not implement) explicit issue
subscriber lists.

Change-Id: Ie2572ed3ad0207d415b4c362438f772925e7a2c5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2807
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
3ec15ec9f9 feat(panettone): Add a settings page
Add a user settings page, with a single checkbox that allows disabling
receiving all email notifications.

Change-Id: Ibef2a497cd59f93b695ff8b9cd36047e514e00c2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2806
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
8d3ab61e7c feat(panettone): Send email notifications for comments
When a user posts a comment on an issue, send email
notifications (respecting the enable-email-notifications setting) to the
author of that issue and all the other users who have commented on that
issue. Since the oauth & gmail API stuff that the relay does is slow,
this happens in a background thread.

Change-Id: Ic00c265deab1030d9ba64c29c9f56314dd179141
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2805
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
349b98ccc8 feat(panettone): Add functions to send email notifications
Add a new package to panettone, :panettone.email with functions to send
email notifications to users through the SMTP relay on whitby,
respecting the value of `enable_email_notifications` on the
user_settings table.

Change-Id: Ia4ec65965abda06f1fadb178143d66bb8eae6482
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2804
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
37d573479b feat(panettone): Add a user settings table
Add a new user-settings table and dao class, with a flag that allows an
individual user to disable receiving email notifications

Change-Id: I537bfca74490941934c0adc7328bcd6ed5c9c0b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2803
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
2021-04-04 14:17:25 +00:00
Griffin Smith
db62866d82 feat(web/panettone): Noping issue authors' usernames
When sending irc notifications, insert a zero-width space after the
first character of the username of the author of issues, to prevent that
user from receiving a ping.

Fixes: b/95
Change-Id: Ibcacb45129b2cb99b587744eb61f4f1dbc0060d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2693
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-03-28 17:07:01 +00:00
Griffin Smith
1f250e374d chore(web/panettone): Add sterni to OWNERS
Sterni has been doing a lot of good mainenance work, and I'd like to
enable that in as unblocked a fashion as possible.

Change-Id: I5bbd2459864c3d4b7e6b9927fc5d4824efc854e6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2692
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-03-28 17:07:01 +00:00
sterni
0176a9e300 fix(panettone): handle missing DNs when looking up displaynames
* Fix find-user-by-dn raising an error condition if the search returns
  no results, return nil instead.
* Adopt strategy of defaulting to “someone” as displayname if lookup
  fails for all usage of displaynames in panettone.

I've tested this change for issues and comments created by missing
users. Adjusting the displayname seems to fix all 500 being created
by missing users both logged out and logged in.

Change-Id: I0a84eb0631c4a49f1664bed6d03afa60dce6eb47
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2448
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-29 17:38:41 +00:00
sterni
82e07fc046 feat(panettone): render a subset of markdown in issue subjects
This is achieved by implementing a simple markdown renderer in CL which
has the following limitations:

* Only supports inline `code`, *emphasize 1*, _emphasize 2_ and
  ~~strikethrough~~.
* Does not support nested markup.

This allows for a relatively simple renderer which doesn't need to parse
markdown into a in-memory data structure first. The rendered result is
directly written to a stream to integrate well with cl-who which is also
reused for rendering tags and xml-escaping strings.

Fixes #90.

Change-Id: Ice88ed770b1fab6365f3b93e8663e25077befa0b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2389
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2021-01-25 21:02:38 +00:00
sterni
7e408c874a fix(panettone): escape value attr of inputs if dynamic content
I checked all :value attributes in panettone.lisp and wrapped them with
who:escape-string if its value comes from user-influenced places. Static
values or values from panettone internals are left as is.

I did not do a comprehensive check for other places where something
similar could happen though.

Fixes #92.

Change-Id: I134acc0d2f025f173588b37c19a93589365e879b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2401
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-25 20:11:58 +00:00
Alyssa Ross
73ea049037 fix(panettone): only scroll if content is too wide
Guessing Griffin uses a Mac with invisible scroll bars. ;-)

Change-Id: I1771f941f149d5ab5816e67861b6bcd91001e652
Cc: Griffin Smith <grfn@gws.fyi>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2163
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-11-27 18:13:09 +00:00
Griffin Smith
58efa6df5b fix(panettone): Prefix all IRC messages with a ZWSP
Prefix all IRC notifications from panettone with a unicode
zero-width-space so that they don't get picked up by other IRC
bots (notably bslsk05).

Change-Id: I350fd1b6d2145e496c22a8f56ba3530fc9f1a978
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2127
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2020-11-22 21:59:58 +00:00
Griffin Smith
92a1f72f41 feat(panettone): Send notifications when issues are closed
Send an irc notification when issues are marked closed, in a similar
format to the notifications sent when new issues are created.

Change-Id: I2fdde33f0dedc223a5c2265eed778161938f8e9a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2126
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-11-22 21:59:58 +00:00
Griffin Smith
1e43982c92 feat(panettone): Bring back + fix irccat issue creation announcement
This reverts commit e1067b1497.

The original issue here was misusing ISSUE-ID instead of ID, but also
the associated username for the message should've been CN instead of DN

Change-Id: I1629c0cb7597ff2ee2867f27870378eecdafe126
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2125
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-11-22 18:57:44 +00:00
glittershark
e1067b1497 revert(panettone): announce newly created issues using irccat
This reverts commit 2e2bdf9c6c.

Reason for revert: this is not working, and is resulting in newly created issues just showing a blank page (b/74)

Change-Id: I3f06afc52d6c5289269402fc75bb32ad9c376bf4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2082
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-11-19 00:29:28 +00:00
eta
2e2bdf9c6c feat(panettone): announce newly created issues using irccat
- The new PANETTONE.IRC package contains the SEND-IRC-NOTIFICATION function,
  which opens a new TCP socket to irccat (if it's running and configured) in
  order to announce the creation of new issues.
- The IRCCATHOST and IRCCATPORT environment variables must be set for this to
  work.
- Additionally, the ISSUECHANNEL environment variable may be used to direct
  announcements at a given channel (otherwise it'll just use the first one).

Change-Id: I429a66f24d0f80ed10db173d6af7105fb1d3d023
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2077
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-11-08 19:02:46 +00:00
Griffin Smith
31b06516f3 fix(panettone): Make pre blocks overflow-x scroll
This prevents wide code blocks from displaying over the container
element.

Fixes: b/53
Change-Id: I44cb5ff4eddf4c01bb706069a68618382b0dc7ba
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1934
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-09-14 21:37:47 +00:00
Griffin Smith
21690c644b fix(panettone): Automatically reconnect to ldap
Wrap all ldap access in a macro that automatically reconnects and
retries operations that fail due to a connection error, to handle the
case where the ldap server restarts while we still have an open
connection.

Fixes: #44
Change-Id: I4859cf509106e480f97fed17e7f08e0eea909352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1871
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-08-31 23:03:45 +00:00
Griffin Smith
de851ec08b feat(panettone): Add nav to the top of the page as well
The absence of the navbar containing the "all issues" and "log out"
links from the top of the page has been a common complaint - initially I
disagreed, but after some time thinking about it I've come around. This
adds the same nav - with the "All Issues" link and the "Log Out" link -
to the top of every page, and also fixes a bug where query params would
prevent the "All Issues" link from being hidden on the "All Issues"
page, which looked especially weird when they were right next to each other.

Change-Id: I1d07175fa07aee057ddd140a6864d01342fbb7ef
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1868
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
2020-08-29 16:43:59 +00:00
Griffin Smith
96ea76bd59 feat(panettone): Add styling for blockquotes
Style blockquotes (which show up in rendered markdown) similarly to how
github does, by rendering a 5px-wide margin to the left with some
padding.

Fixes: #48
Change-Id: I79aa3b6cda5d928885c2cc36f504009232252c17
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1869
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-08-29 01:47:33 +00:00
Griffin Smith
74a6a9c817 feat(panettone): Increase session timeout to 90 days
The default was really annoyingly short - 90 days feels perfectly fine
for what we want, though we may want to increase even further.

Fixes: #19
Change-Id: I917abd95c4925f8491cd2be7cd87d91bb6621153
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1867
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-28 21:51:23 +00:00
Griffin Smith
1d9a2cac09 feat(panettone): Configure a session secret
Load a SESSION_SECRET env var and set it as the hunchentoot session
secret if present, so that restarting panettone doesn't destroy all
sessions due to the secret getting regenerated.

Refs: #19
Change-Id: Ia2c633fa998e128ecece66e824df01c430da8235
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1866
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
2020-08-28 21:51:23 +00:00
glittershark
1fd633dffd fix(web/panettone): revert "implement shorthand issue URLs"
This reverts commit 3115113854.

Reason for revert: this is causing all issues to return a 404 - reverting until we can get it working.

Change-Id: I5f3c5ec3b24f245a1f7ef12645200d16ed0f1b35
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1721
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
2020-08-09 19:02:07 +00:00
edef
3115113854 feat(web/panettone): implement shorthand issue URLs
Fix #32

Change-Id: I6ccec959201673850b4b56a44734a2874aad5856
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1648
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
2020-08-08 18:23:53 +00:00
Griffin Smith
117e7316a0 fix(web/panettone): Fix more calls to (id nil) in new issue form
Change-Id: Id514d80e00005b7b7eb2f305e92af33ca70d6964
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1594
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
2020-08-03 13:40:47 +00:00
Griffin Smith
708e94532d fix(web/panettone): Fix new issue form
Passing a nil issue to this was breaking because you can't get the id of
nil. I am too used to clojure.

Change-Id: Icf76cbb23d902ec59fa97c21b134936fa40eb43e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1593
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-08-03 13:25:22 +00:00
Griffin Smith
7aebba7531 feat(web/panettone): Add direct anchor links to comments
Fixes: #31
Change-Id: I5a8228229eb2b68bdfc5addd305ab055443aa5a6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1581
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
2020-08-02 02:57:41 +00:00
Griffin Smith
b6bab664db feat(web/panettone): Allow editing issues
Allow editing both the subject and the body of issues, recording events
indicating the edit and displaying those events in the issue history.

Fixes: #14
Change-Id: I9ed05271ce9bf6bda4e56f15e249c0f28c862b27
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1517
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-08-02 02:08:39 +00:00