Commit Graph

45 Commits

Author SHA1 Message Date
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 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 91d47faf23 disable Lua colors in prose 2022-01-25 21:44:01 -08:00
Kartik K. Agaram 84d76b11fa rename 2022-01-25 21:23:20 -08:00
Kartik K. Agaram 283d4dba59 new section in big picture: prose (non-code)
I've always found "Documentation" too pretentious.
2022-01-25 21:07:52 -08:00
Kartik K. Agaram 2fc48626b5 optimization: stop saving identical definitions
This is long overdue.
2022-01-25 20:53:46 -08:00
Kartik K. Agaram 2e38583da2 save doc: buffers to .tlv images 2022-01-25 20:45:00 -08:00
Kartik K. Agaram 39781351ee delete a redundant function prototype 2022-01-25 20:39:49 -08:00
Kartik K. Agaram d20e6a415f rename a function 2022-01-25 20:36:26 -08:00
Kartik K. Agaram c5f6e30042 start supporting non-code "buffers"
First step: when a "definition" starts with "doc:" it's not a
definition, just a buffer. Stop trying to interpret it as Lua.
2022-01-25 20:29:35 -08:00
Kartik K. Agaram 6a33284b07 get Teliva running on NetBSD
NetBSD still uses curses by default. One _could_ install ncurses, but I
don't have access to a NetBSD box with permissions to install ncurses,
so I'm experimenting to see how far we can get with just curses. So far
most of the apps seem to work, with the exception of one bug that I'll
commit next.
2022-01-24 20:15:43 -08:00
Kartik K. Agaram 5258fbec7c file permissions: clear stale errors 2022-01-16 22:34:21 -08:00
Kartik K. Agaram 4eb4bc4f58 some heuristic guidance on permissions screen 2022-01-04 23:42:01 -08:00
Kartik K. Agaram ffd600b111 try running permissions advice after editing
This implies it must be side-effect free. We still need to figure out
how to convey that to the computer owner.
2022-01-04 22:33:07 -08:00
Kartik K. Agaram 855eafd1d9 slightly better error message 2022-01-04 22:09:42 -08:00
Kartik K. Agaram 64f8a1e15d reorg 2022-01-04 22:09:23 -08:00
Kartik K. Agaram 08c1ea8fc4 extract function 2022-01-04 21:48:55 -08:00
Kartik K. Agaram 3d6b9b0adc load permissions properly in a third place 2022-01-04 21:41:41 -08:00
Kartik K. Agaram 4018c2e8e2 when editing a function, show its callers
No way to select between them. That complicates the UI too much when we
do so much with the cursor. But it's still useful to suggest things to
type in after ctrl-g.
2022-01-03 23:36:44 -08:00
Kartik K. Agaram 7812ebc5f1 start saving callers of functions
I think this is significantly slowing things down. Perhaps we should
sample or something.
2022-01-03 13:26:38 -08:00
Kartik K. Agaram 1c78ab3d2e comment 2022-01-03 13:24:21 -08:00
Kartik K. Agaram 14ab0729c9 extract a function 2022-01-03 10:23:25 -08:00
Kartik K. Agaram 1261f3f3c9 events view: jump to a function 2022-01-03 09:58:34 -08:00
Kartik K. Agaram 0abd09dc05 rendering improvement 2022-01-02 22:52:57 -08:00
Kartik K. Agaram e3cef7ee56 bugfix: policies must end in newline
I believe kilo kinda naturally enforces that. We'll see.
2022-01-02 22:38:28 -08:00
Kartik K. Agaram a901203227 start on a view of audit events 2022-01-02 22:13:47 -08:00
Kartik K. Agaram 2d0bb4438c editing file permissions 2022-01-02 21:33:49 -08:00
Kartik K. Agaram d0111f1839 editable file permissions
Extremely cruddy implementation:
- I'm still unclear on how to represent the advice function:
  - How to handle errors when loading user configuration?
    Currently I refuse to start.
  - Whole function? More errors to handle in header and so on. What if
    the function is renamed?
  - Just body? Needs more structured editing support.
- Lots of duplication, particularly between the permissions in the menu
  and the permissions screen.

I don't know how to show the hostname at the time of connect() or
bind(), so networking is going to remain a boolean for now. It's also
unclear what effective constraints we can impose on what gets discussed
with a specific hostname. Everything outside the computer is out of
one's control.

One trick I learned is for consistently grabbing ASan logs on abort:
It's always safe to redirect stderr with ncurses!
2022-01-02 19:59:30 -08:00
Kartik K. Agaram a2081ee612 fork a new editor widget for non-code 2022-01-02 16:55:23 -08:00
Kartik K. Agaram f6aaf2fd1d better follow kilo's naming conventions 2022-01-02 16:52:36 -08:00
Kartik K. Agaram 2b1609f09b copy tweak 2022-01-02 15:52:02 -08:00
Kartik K. Agaram df5cd41637 rename 2022-01-02 15:46:46 -08:00
Kartik K. Agaram 762b77f68b sandbox: tweaks to warning copy 2022-01-02 12:49:31 -08:00
Kartik K. Agaram 40a0aca6e3 spacing 2021-12-26 00:04:28 -08:00
Kartik K. Agaram 04a062e94d start persisting sandboxing settings
Zero guarantees of compatibility at this point.
2021-12-25 21:36:31 -08:00
Kartik K. Agaram e7dc519c40 reorg 2021-12-25 21:26:47 -08:00
Kartik K. Agaram 16d949e259 file open() is now sandboxed
In the process we now also have a mechanism for Teliva to overlay errors
while apps run. Might make sense to make that available to apps as well.
But I'm starting to realize that any app access to the Teliva areas of
the screen is fraught with risk.
2021-12-25 18:55:01 -08:00
Kartik K. Agaram f5ab71b4e1 flesh out very preliminary UI
Our sandboxing model is a blunt caricature, just two booleans. But let's
see how far this gets us.

Still doesn't persist, and definitely has no effect.
2021-12-25 18:51:05 -08:00
Kartik K. Agaram 12cb565077 delete a couple more hacky function prototypes 2021-12-25 16:21:40 -08:00
Kartik K. Agaram dbbb396003 . 2021-12-25 16:16:48 -08:00
Kartik K. Agaram a36edb74f0 mock sandbox status and some initial colors
Current plan:
  - two booleans to gate file and network access, respectively
  - false shows as green, true shows as orange
  - if _both_ booleans are true, then both show as red to indicate that
    there are no protections.
2021-12-25 16:08:31 -08:00
Kartik K. Agaram 526d37e4ac fix menu colors in all color schemes
It looks like attron doesn't actually enable colors near 256, even
though https://linux.die.net/man/3/attron suggests it does.

  > COLOR_PAIR values can only be OR'd with attributes if the pair
  > number is less than 256.
2021-12-25 14:59:18 -08:00
Kartik K. Agaram bb6e79aa0d reorg: pull Teliva-specific stuff out of lua.c
It should now be easier to diff against the Lua 5.1 sources upstream.
2021-12-25 13:33:37 -08:00