Commit graph

1831 commits

Author SHA1 Message Date
Vincent Ambo
f0dfc8b06d feat(functions): Add ivy-browse-repositories function
Quick helper to switch between all relevant projects.
2018-06-18 16:39:57 +02:00
Vincent Ambo
9f29992d03 refactor(main): Split LOG_NAME & LOG_STREAM variables
Splitting these in two lets users better configure how the logs show
up in Stackdriver Logging.
2018-06-17 22:36:01 +02:00
Vincent Ambo
208b5dec2c chore: Bump to 1.0-rc1 2018-06-17 18:22:13 +02:00
Vincent Ambo
7b6f4cb89b docs(README): Add non-GCP instructions to README 2018-06-17 17:43:33 +02:00
Vincent Ambo
79afc5f474 feat(main): Support manually configured resource descriptors
Lets users specify environment variables to configure the monitored
resource descriptor. In combination with service account support this
can be used to configure journaldriver on non-GCP machines.

The supported environment variables are:

* `GOOGLE_CLOUD_PROJECT`: Project ID of the project to which to report
  logs
* `LOG_NAME`: Name of the Stackdriver Logging log into which to write
  entries
2018-06-17 17:43:33 +02:00
Vincent Ambo
62745db1a0 feat(main): Support static service account credentials
Adds support for authenticating towards Google's APIs by using static
service account credentials which can be retrieved from the GCP
console.

Users can toggle the behaviour by specifying the
`GOOGLE_APPLICATION_CREDENTIALS` environment variable.
2018-06-17 17:43:33 +02:00
Vincent Ambo
d56fedbe8d chore(cargo): Add dependency on medallion JWT library 2018-06-17 17:43:33 +02:00
Vincent Ambo
c2308b5ba1 chore(main): Bump chunk size to 750
Still slightly below the Stackdriver limit. However, previous errors
seem to have mostly been related to JSON payloads - which has been
fixed in the previous commit.
2018-06-17 15:46:05 +02:00
Vincent Ambo
05fa476929 fix(main): Correct name of JSON payload field 2018-06-17 15:46:05 +02:00
Vincent Ambo
68189d4872 refactor(main): Log error responses from Stackdriver
In some cases Stackdriver seems to return error responses for batched
inserts.

This change will log the error response body and status from
Stackdriver for all insertion errors.
2018-06-17 15:46:05 +02:00
Vincent Ambo
87ab3c806c feat(main): Parse timestamps out of journald entries
Instead of relying on Stackdriver's ingestion timestamps, parse
timestamps out of journal entries and provide those to Stackdriver.

If a timestamp could not be parsed out of a log entry, the ingestion
time is used as the fallback.
2018-06-17 15:46:05 +02:00
Vincent Ambo
f626d88438 chore(cargo): Enable chrono with serde as a dependency 2018-06-17 15:46:05 +02:00
Vincent Ambo
bd19132eff chore(main): Send logs in smaller chunks of 250 entries
In some cases sending 1000 entries seemingly results in a vague "Bad
request" error.

This reduces the chunk size to something that should be more
manageable.
2018-06-16 21:38:53 +02:00
Vincent Ambo
54b03a8dad fix(main): Attempt to read with next_record before waiting
Without this fix new records are only "pushed out" when something
appends to the journal.
2018-06-16 21:38:53 +02:00
Vincent Ambo
b6c0610278 feat(build): Add toggle for tests to Nix derivation 2018-06-16 21:38:53 +02:00
Vincent Ambo
e4b4830a04 feat(main): Persist & load persisted cursor positions
Adds support for persisting the cursor position in a file (by default
`/var/journaldriver/cursor.pos`, overridable via the environment
variable `CURSOR_POSITION_FILE`).

This lets journaldriver resume from a known journal position after
service restarts.

This closes #3
2018-06-16 21:38:53 +02:00
Vincent Ambo
03a6ea742c
Merge pull request #5 from aprilabank/feat/json-payloads
feat(main): Implement parsing of JSON payloads
2018-06-16 18:28:49 +02:00
Vincent Ambo
10f23a9dfb feat(main): Implement parsing of JSON payloads
Stackdriver supports structured JSON payloads in addition to simple
plain-text payloads.

This commit introduces a new feature in which journaldriver will
attempt to parse incoming log messages into JSON vaues and forward
them as structured payloads if they are JSON objects.

Messages that can not be parsed into JSON objects will continue to be
forwarded as plain text messages.
2018-06-16 17:57:11 +02:00
Vincent Ambo
2e2e8379e9 fix(emacs): Fix ivy & prescient integration by manually pinning ivy
In the previous configuration the dependency on `ivy-pass` added a
second version of ivy to the load-path.

It is fixed by manually pinning ivy and its related packages and using
those to build ivy-pass.

This configuration should be temporary until the next time the MELPA
package set is updated in nixpkgs.

This caused the symptoms in raxod502/prescient.el#10
2018-06-16 16:37:17 +02:00
Vincent Ambo
8cc7d8da79 feat(packages): Pick VLC 3 from unstable
Finally!
2018-06-16 11:48:18 +02:00
Vincent Ambo
71f0afe4b5 fix(build): Update cargo dependency hash after deps change 2018-06-15 17:08:06 +02:00
Vincent Ambo
23286d13b9 docs: Add contribution guidelines
Adds contribution guidelines. These are a slightly modified version of
the guidelines I use for my personal projects.
2018-06-15 17:03:38 +02:00
Vincent Ambo
bb968ed8ed docs: Add code of conduct 2018-06-15 17:02:04 +02:00
Vincent Ambo
01ef180cff feat(build): Enable Nix builds in Travis.CI 2018-06-15 17:00:48 +02:00
Vincent Ambo
a47bd5675f chore: License under GPL 3.0 2018-06-15 17:00:26 +02:00
Vincent Ambo
e2504a2da9 docs(README): Add usage instructions & other information to README 2018-06-15 16:58:35 +02:00
Vincent Ambo
7258f31d29 feat(build): Add initial Nix build derivation 2018-06-15 16:47:48 +02:00
Vincent Ambo
4ef98fc2ba feat(main): Implement record conversion & flushing to API
This implements the "meat" of the initial version of journaldriver.

Records from journald are converted into the representation required
by Stackdriver and forwarded to the API.

In this initial version journaldriver is only supported on instances
running on GCP.
2018-06-15 16:45:17 +02:00
Vincent Ambo
b1d45f5b76 refactor(emacs): Use unstable channel directly in emacs module
Stores the unstable channel in the global package set to make it
available in the emacs module.

All emacs-related packages are now taken from the unstable channel.

Related changes:

* prescient is now built directly from git
* sly has been (temporarily) removed because the MELPA recipe is
  failing

Unfortunately the version bumps to prescient and ivy (& its related
packages) don't seem to help with raxod502/prescient.el#10
2018-06-15 13:56:47 +02:00
Vincent Ambo
24314a61d6 chore(packages): Remove unused Haskell packages 2018-06-15 13:55:27 +02:00
Vincent Ambo
2bc9d09eb7 chore(packages): Bump channel versions
emacs 26 is now included in unstable, so the extra pin has been
removed.
2018-06-15 13:54:51 +02:00
Vincent Ambo
e743ea28c5 feat(look-and-feel): Display EXWM workspace index in mode-line
Been waiting to do this since forever!
2018-06-15 01:32:34 +02:00
Vincent Ambo
9da4606162 style(look-and-feel): Use more compact battery display layout 2018-06-15 01:32:15 +02:00
Vincent Ambo
454cb9e506 feat(look-and-feel): Display unread mail telephone line segment
Defines a new highlight face and configures the telephone line
segments to display the unread count if there are unread mails.
2018-06-15 01:15:13 +02:00
Vincent Ambo
e543ddff2e style(look-and-feel): Use tan-shaped separators for telephone-line 2018-06-15 01:15:13 +02:00
Vincent Ambo
59aa338932 feat(mail): Implement unread count telephone-line segment
Implements a periodically updated telephone-line segment that displays
the current unread count for the two most important inboxes in the
mode-line, if there are unread mails.
2018-06-15 01:15:13 +02:00
Vincent Ambo
9665318115 feat(look-and-feel): Display battery % in mode-line on adho 2018-06-15 01:15:13 +02:00
Vincent Ambo
5442d6c0fb refactor(look-and-feel): Simplify frame configuration
When using EXWM new frames don't just show up the way they used to.
2018-06-15 01:15:13 +02:00
Vincent Ambo
e941e6b836 feat(look-and-feel): Enable winner-mode 2018-06-15 01:15:13 +02:00
Vincent Ambo
221c60e448 refactor(look-and-feel): Replace SML with telephone-line
Telephone line has a slightly easier to configure segment system. This
commit also uses the commit introduced in the previous function to
conditionally display miscellaneous modeline information in the last
window of a frame.

More configuration for this will come over time.
2018-06-15 01:15:13 +02:00
Vincent Ambo
608cd6226a feat(emacs): Replace smart-mode-line with telephone-line 2018-06-15 00:12:06 +02:00
Vincent Ambo
75749b68b0 fix(settings): Add counsel-rg to ivy-prescient-excluded-commands
History should not be remembered for counsel-rg
2018-06-15 00:03:11 +02:00
Vincent Ambo
ecf68e357c feat(functions): Add predicate function to determine last window
Adds a function that can be used to check whether the current buffer
is displayed in the "last" window of the active frame.

The intention is to use this predicate to modify the modeline display
to only show miscellaneous information (time, battery percentage etc.)
on the last window instead of duplicating it.
2018-06-15 00:02:04 +02:00
Vincent Ambo
2d8e057118 feat(main): Add fetching of tokens from metadata server 2018-06-14 16:48:43 +02:00
Vincent Ambo
a6a0e28e11 refactor(settings): Use prescient together with ivy
Ivy's regex-based fuzzy matching can occasionally be slow, which was
getting on my nerves.

This switches the completion engine to prescient[1] which promises to
be faster. Experimental testing in large files like the
`configuration.nix` man page looks promissing.

[1]: https://github.com/raxod502/prescient.el
2018-06-13 00:09:16 +02:00
Vincent Ambo
fc6126f579 feat(emacs): Install prescient & ivy-prescient
These packages are not in nixpkgs yet (will most likely be added after
the next MELPA import), so they're added here manually.

As both originate from the same source they're added to the same
derivation here by using a custom recipe.
2018-06-13 00:08:23 +02:00
Vincent Ambo
ebc1dd1a18 chore(mail): Switch to citing messages without signature 2018-06-12 09:12:39 +02:00
Vincent Ambo
7781a059b3 fix(mail): Fix setup of drafts & cache folder 2018-06-12 09:12:39 +02:00
Vincent Ambo
711afd3bd5 chore(mail): Unbind notmuch-save-draft
I don't use drafts and they're kind of annoying.
2018-06-12 09:10:25 +02:00
Vincent Ambo
ad5fff55a2 feat(mail): Tag nix-devel mailing list 2018-06-10 21:45:27 +02:00