Commit Graph

778 Commits

Author SHA1 Message Date
Kartik K. Agaram e552571b1e standardize key order in .tlv files
This will eliminate some spurious git diffs I keep having to clean up.
2022-02-09 09:18:05 -08:00
Kartik K. Agaram b328ffc5e5 zet.tlv: simpler UI, simpler editor 2022-02-09 08:31:20 -08:00
Kartik K. Agaram c3422e101f bugfix in rendering non-top zettels 2022-02-08 19:20:13 -08:00
Kartik K. Agaram e397220f9d Lua gotcha: iterating over strings yields strings 2022-02-08 19:19:08 -08:00
Kartik K. Agaram 33ab842ffd zet.tlv: expand editor to accomodate more text
Still won't show up in view mode for now. Soon we'll be able to adjust
zettel dimensions.
2022-02-08 18:40:59 -08:00
Kartik K. Agaram 3180e3e4fb typo 2022-02-08 18:30:02 -08:00
Kartik K. Agaram fb251c2819 zet.tlv: editing a single zettel 2022-02-08 00:28:20 -08:00
Kartik K. Agaram a8fb6d4002 gemini.tlv: consistent menu 2022-02-08 00:28:04 -08:00
Kartik K. Agaram b639f8e68c zet.tlv: clean up history 2022-02-07 23:17:03 -08:00
Kartik K. Agaram 504573a0de move most Teliva menus to the right
The problem I'm running into is that apps might want to perform their
own editing. So I can't take up prime estate like the ctrl-e hotkey or a
menu name of 'edit'.

I'm still prioritizing rendering Teliva's edit and permissions menu. If
the window is too narrow the app's settings will be overwritten and
Teliva's hotkeys will be preferentially displayed. Seems safer.
2022-02-07 22:54:17 -08:00
Kartik K. Agaram 0d16c7c690 more Readme polish 2022-02-07 22:32:06 -08:00
Kartik K. Agaram 6d2dce51db remove dropped functions from docs 2022-02-07 22:22:57 -08:00
Kartik K. Agaram 57d4710f98 question raised during FOSDEM '22
https://fosdem.org/2022/schedule/event/lastmilesandboxing
2022-02-07 21:52:04 -08:00
Kartik K. Agaram 7122a06466 lisp.tlv: clean up history
Also a minor edit in doc:main.
2022-02-07 16:22:04 -08:00
Kartik K. Agaram 21a3200c6a some more dead code 2022-02-06 13:48:46 -08:00
Kartik K. Agaram 3cfb8f7812 in fact, loadlib.c is all dead code now
Now we can be sure apps can't call `require`.
2022-02-06 13:34:16 -08:00
Kartik K. Agaram 63e3ba62c2 now all our supported platforms are POSIX 2022-02-06 13:30:32 -08:00
Kartik K. Agaram 6860a02396 drop all support for loading dynamic libraries 2022-02-06 13:29:38 -08:00
Kartik K. Agaram 8a9efc1b91 drop module 'package'
Just like with `require`, we don't we don't know how to sandbox it.

(Though we still have `require` because standard libraries outside apps
need it. I need to make sure apps can't invoke `require`..)
2022-02-06 13:12:46 -08:00
Kartik K. Agaram b79d6be383 drop some more untested platforms 2022-02-06 13:08:46 -08:00
Kartik K. Agaram 467ce31371 drop USE_LINUX and similar defines
How many levels of macros do we need. Also stop lying that we're using
Linux in BSD.
2022-02-06 13:06:27 -08:00
Kartik K. Agaram c101d1a3c5 drop MinGW
I've never tested with it, and it is likely broken after all my changes
to base Lua 5.1. Might as well be transparent about that.

If you care about this platform, please let me know:
  http://akkartik.name/contact
2022-02-06 12:44:51 -08:00
Kartik K. Agaram a6addb8e42 unused #define 2022-02-06 12:42:46 -08:00
Kartik K. Agaram be7da76696 more thoughts on sandboxing 2022-02-05 13:10:39 -08:00
Kartik K. Agaram a5cb7381a8 experimental app: zettelkasten
https://merveilles.town/@akkartik/107742821323590471

What we have so far:
  a representation (see 'zettels')
    parent/child
    next/prev sibling
    (todo: misc cross-links)
  ability to render zettels in multiple columns based on 'view_settings'
    all zettels render with same size
    alternate backgrounds between zettels for legibility
    skip rendering duplicates (if we ever hit cycles)
  a highlighted 'current zettel'
  ability to move current zettel
    by screen location (arrow keys)
    by network structure (h/j/k/l)

Still can't edit zettels or load/save from/to disk.
2022-02-04 23:57:05 -08:00
Kartik K. Agaram 5e4ca1d470 don't perturb cursor when drawing menu 2022-02-04 23:55:28 -08:00
Kartik K. Agaram 5c1a7b6b12 fix a couple of warnings
It's not clear to me where my Linux gets strlcpy and strlcat from
¯\_(ツ)_/¯
2022-02-03 20:59:08 -08:00
Kartik K. Agaram f5be8e1955 prose typos and edits 2022-02-03 17:51:08 -08:00
Kartik K. Agaram 02104952d2 fix a bug in kilo
Submitted upstream at https://github.com/antirez/kilo/pull/81.
2022-02-03 17:48:01 -08:00
Kartik K. Agaram a8dfea1d3c drop io.lines()
I'd already dropped the variant without a filename. But even the variant
with a filename is very easy to use in a way that is confusing to use in
the presence of sandboxing:

* call io.lines()
* Sandboxing saves an error, io.lines() returns nil
* Caller (usually a loop) raises an error.
* We show the error and not the sandboxing failure.
* Worse, there's no way to adjust permissions from within Teliva,
  because we can't ever get to that menu while there's an error.

Best solution I can come up with: encourage a separate step for
translating filename to file handle. That way it's more obvious that we
need to check for errors.
2022-02-02 23:44:25 -08:00
Kartik K. Agaram 8f8a0e5a18 tweak an entry in the audit log 2022-02-02 23:38:45 -08:00
Kartik K. Agaram f5a1c22dc5 sandbox: no way to run arbitrary Lua code strings 2022-02-02 22:21:38 -08:00
Kartik K. Agaram 664b94f414 include keys typed into audit log
This will help people cross-correlate when the app performs specific
calls.
2022-02-01 21:19:51 -08:00
Kartik K. Agaram 7968134246 new potential threat vector 2022-02-01 21:06:17 -08:00
Kartik K. Agaram 90904f344a file permissions: decide based on calling function 2022-02-01 20:59:53 -08:00
Kartik K. Agaram 88404d41ea copy realpath() from FreeBSD repo
To sandbox apps robustly, we're going to need to always work with
canonical absolute paths.
2022-01-30 12:22:42 -08:00
Kartik K. Agaram 7a13adb52c try to get by with one feature macro
I fucking hate feature macros. Egregious discharge of our
division-of-labor-obsessed society. People should be able to introduce
names. People should be able to give up names to lower levels of
abstraction when they encounter conflicts.

Feature macros seem to exist[1] to support more than two levels of
abstraction. You try to build, one of your libraries fails to build
because of a conflict between it and one level down. You don't want to
modify this library. Just fucking https://catern.com/change_code.html
already. But no, I have to litter my code with feature macros even
though I just want the abstraction the original library provides.

[1] https://man7.org/linux/man-pages/man7/feature_test_macros.7.html
    https://lwn.net/Articles/590381
2022-01-29 12:41:20 -08:00
Kartik K. Agaram 24f0781d2b new library: luafilesystem (lfs)
https://github.com/keplerproject/luafilesystem

The new commander.tlv app demonstrates it working.
2022-01-29 12:39:53 -08:00
Kartik K. Agaram 90fc24ed04 fixup! redo lua vs prose
Forgot to include some hunks.
2022-01-29 12:22:32 -08:00
Kartik K. Agaram 1f620a28d7 more precise dependencies 2022-01-29 11:36:00 -08:00
Kartik K. Agaram 6478e6b149 incomplete lisp interpreter app
I'm not sure what I'm doing here just yet. This is just an experiment of
the editing experience. The .tlv app doesn't actually do anything yet.
2022-01-27 08:30:50 -08:00
Kartik K. Agaram e782cb1ead bugfix: editor was no longer saving anything
I made the changes reverted here out of a mistaken sense that
big-picture edits would interfere with Teliva's memory of what is
currently being edited (teliva_editor_state).
2022-01-27 00:40:33 -08:00
Kartik K. Agaram ce186e85f4 redo lua vs prose
Previously we weren't dynamically selecting how to highlight a buffer
after navigating with ctrl-g. That should work now.
2022-01-26 15:22:55 -08:00
Kartik K. Agaram 18183f3e4b indent 2022-01-26 15:20:55 -08:00
Kartik K. Agaram b493ed32b8 get Teliva working on FreeBSD 2022-01-26 09:36:06 -08:00
Kartik K. Agaram cbe85a18c7 rename the custom big picture view to doc:main 2022-01-25 23:25:05 -08:00
Kartik K. Agaram 32d86bfc7f override big picture view with doc:bp if it exists
Going to big picture from doc:bp still goes to the default
auto-generated big picture view.

While doc:bp provides some programmability, it's also far klunkier than
the default view. Rendering is worse, and it's always in edit mode
because I'm trying to avoid complicating the UX with a notion of
rendered markup. That means cursor movement is less convenient. It's
also easy to accidentally edit the big-picture view.
2022-01-25 23:07:43 -08:00
Kartik K. Agaram 7fd434a692 better default word at cursor for prose 2022-01-25 22:34:38 -08:00
Kartik K. Agaram e205057ff2 highlight [[wikiwords]] in prose
These are just hints that there's something worth jumping to. The
jumping still happens using ctrl-g.
2022-01-25 22:31:53 -08:00
Kartik K. Agaram 91d47faf23 disable Lua colors in prose 2022-01-25 21:44:01 -08:00