Commit Graph

791 Commits

Author SHA1 Message Date
Kartik K. Agaram c1e4b84222 fixup! clean up top-level Makefile targets 2022-02-10 16:40:22 -08:00
Kartik K. Agaram 76984aa90f allow Teliva to show its sandboxing message 2022-02-10 16:30:00 -08:00
Kartik K. Agaram b0cc9a7451 zet.tlv: refine the initial UX some more
Conundrum:

I want the app to provide some sample data for people to interact with.

However, I also want them to be able to delete it to make it their own.

BUT I'm not yet convinced the app should allow deletion in general.

Besides, deleting stuff robustly and reliably is a whole other level of
programming.

Solution:

Make people edit the app to clear the initial sample zettels.

This has the "beneficial" side-effect of getting them editing apps on
Teliva.
2022-02-10 08:00:47 -08:00
Kartik K. Agaram c4402edc5b zet.tlv: copy in sample zettels 2022-02-10 07:40:04 -08:00
Kartik K. Agaram 1a40bc7f5f zet.tlv: saving/loading to/from disk 2022-02-10 07:35:54 -08:00
Kartik K. Agaram 10dab7ae17 zet.tlv 2022-02-10 07:35:28 -08:00
Kartik K. Agaram 31127a9152 clean up top-level Makefile targets 2022-02-10 06:53:22 -08:00
Kartik K. Agaram 5cab1c042d zet.tlv: resizing zettel card sizes 2022-02-10 00:04:12 -08:00
Kartik K. Agaram e827379950 zet.tlv: creating new zettels 2022-02-09 23:49:59 -08:00
Kartik K. Agaram cf521f9904 zet.tlv: bugfixes to editor cursor handling 2022-02-09 23:41:36 -08:00
Kartik K. Agaram 7786462a8d . 2022-02-09 23:27:26 -08:00
Kartik K. Agaram 38b15e8086 flesh out sandboxing in Readme a tad 2022-02-09 14:47:01 -08:00
Kartik K. Agaram 29d4555d04 update keyboard shortcuts in screenshots and docs 2022-02-09 14:39:31 -08:00
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