Skip to content

Latest commit

 

History

History
executable file
·
114 lines (91 loc) · 11.1 KB

TODO.md

File metadata and controls

executable file
·
114 lines (91 loc) · 11.1 KB

In no particular order:

TODO

portal

  • As an experiment, write libportal to wrap the portal feature in a way that any C program can interact with it without translating native Go types (like strings and ints).
    • Adding features will have to be done via a binding using events. As a small helper, libportal will add the binprobe and modprobe features upon request if you still depend on the timers in the portal for events.

feature_*

  • Split all features' logic into exposed methods ready to be used for Go plugins or C-style Go wrapper libraries, including finally the portal.

feature_handles

  • Write handles feature to serve unique handles with ability to lock/unlock them and restrict which producers can use their controls. Requesting a lock will "block" by not responding until either an unlock or a specified timeout, FIFO-style.

feature_binprobe, feature_modprobe, ...

  • Write binprobe feature to use stdpipes as event I/O for all binaries found in binprobe.list file relative to current workdir (updates from workdir events) when running binprobe -a/--all command.
  • Update binprobe feature to support a found bin folder relative to the first workdir (no updates) as relative dir for binprobe -i/--in <binary>, where binary could also be an absolute path.
  • Write modprobe feature to use a custom binary as proxy to load C-style libraries from modules similar to binprobe.
  • Write gomodprobe feature to do the same as modprobe, but to load Go-style libraries from gomodules instead without needing to translate C types.
  • Write gosrcbinprobe and gosrcmodprobe features to use the Go toolchain found in PATH to attempt to build either binaries or modules to be loaded from src if found, preserving the cached build in gosrcbin/gosrcmodules until closed.

feature_wires

  • Write feature to expose wire as a custom structure interface via commands, using handles to provide unique handles if present.
  • Update wires feature to expose crunchio methods on underlying values and offer malloc-style events and commands as aliases to wire management.

feature_files

  • Update files feature to support creating files, removing files, moving files, getting sizes of files, growing/truncating files from either side, and I/O for parts/wholes of files, into/from wires via wires feature if present.
    • File I/O requires opening a handle and closing it when you're finished. Using an open handle will not lock/unlock it, you must separately make that call targeting either files or handles (the host of the handle).
    • File I/O will at least provide concepts of offsets and (appending/truncating) prefixes/suffixes by passing around the raw data. Use an event/command to set the max buffer size of any transaction, dividing the operation up into steps by it.
    • If wires feature is present, the returned handle will be provided by it instead. You should still use the files interface for file I/O, but extra methods will be available (you must still use grow/truncate separately or you'll lose data):
      • buffer_next -e big -o 0x100 -l 32 # Loads 32 bytes from big-endian offset 256 to the end of the wire.
      • flush_next --endian little --offset 256 --len 0x20 # Flushes 32 bytes to little-endian offset 0x0001 from the start of the wire.
      • insert_next --endianness b --off 256 --length 32 # Shifts all content to the right of big-endian offset 0x100 right by 32 bytes, then fills the new gap with 32 bytes from the start of the wire.
      • cut_next -e l -o 0x0001 -l 0x20 # Loads 32 bytes from little-endian offset 256 to the end of the wire, then shifts all content after that byte range left by 32 bytes.
      • -l 4096 -b/--buffer 1024 # Limit the max buffer size of a 4KB operation to 1KB, resulting in 4 calls to complete the transaction. Using insert/cut will shift in blocks of this size.
  • Update files file listing to display permissions correctly as rwx-style string, with -b/--bits switch in command to display their raw numbers.
  • Update files feature to only display full listing when using the -l/--list switch, defaulting to names only (including a / suffix for directories).

feature_states

  • Create a states feature to allow the saving and loading of a named state from a states folder relative to the workdir on startup, providing a handle from files to manipulate it.

feature_version

  • Write simple version feature to compare the direction between two of the same-typed versions, like semantic versions or revisions if not build numbers.

feature_archive

  • Write simple archive feature that uses files to extract files to a folder, compress files into an archive, or recursively compress the contents of a folder to the root of an archive.
  • Require -a/--append switch to avoid overwriting archives by inserting into them instead, including appending data to any existing files.
    • Using this switch during extraction is helpful for split archives, where the output files will be appended to rather than wholly overwritten.

feature_compress

  • Write simple compress feature that can compress/decompress a wide range of formats.
  • Support handles from wires to manage a byte buffer instead of passing raw data for requests.

feature_updater

  • Write self-updater feature with initial Linux and Windows support for hot-swapping the running executable after building via gosrcbinprobe.
    • Must be natively inserted and configured with the path to a source under src.
    • Updates are checked for in the following ways (in order until one is found):
      • Loads a URL from a file named URL_VERSION and asks the version feature to compare it against the value read from VERSION
        • Newer means to download the archive from URL_SOURCE and ask the archive feature to unpack it into a temp directory; successful builds will swap the directories and delete the old source directory.
      • Checks for the existence of a .git folder, if found will run git pull (trying a temp directory with the current remote and branch) and compare the old commit to the current; if changed, failed builds will revert to the old commit.
  • Support updating individual binaries/modules with gosrcbinprobe/gosrcmodprobe.

feature_pixelstat

  • Move the portal's looper logic to timer feature.
  • Forward port the node polling framework from pixelstat to poll feature that depends on timer, handles and files. Support sending custom events at a given rate with a returned handle matching the polling interface.
  • Write pixelstat example as a port of pixelstat using the poll feature to initialize all nodes. Insert a native (avoiding latency) pixelstat feature whose sole purpose is to aggregate polled values and render them to ncurses/stdout/file.

feature_formatter

  • Write formatter feature that can process lists of mapped items from wires and export in pretty or CSV (for now!~).
    • Field 0 should contain header names, while field 1+ should contain arrays of values matching length up to the last non-null. The field number - 1 will be used in an optional n field at the start.

feature_discord, feature_telegram, feature_guilded

  • Update telegram feature to integrate more cleanly with commands feature, such as preloading available commands and listening for new commands to prompt inline queries.
  • Create discord and guilded features with parity to telegram feature, including re-registering available command list to Discord before feature is ready.
  • Update supported methods based on available logic from the Clinet bot framework.
  • Create clinet feature w/ self-creating portal

GOALS:

feature_clinet

  • Forward port every remaining feature possible from Clinet, excluding audio handling since that will be satisfied by libremedia and ffmpeg in the near future (where features like clinet and discord can make use of their presence).

feature_inventory, feature_web, feature_template

  • Forward port the product inventory, web server, and dynamic templating engine concepts from the TSW iteration of the portal.
    • Configured with a feature ID that will provide the layout and styling for the requested pages and handle API endpoints. Defaults to webpage if it's found, otherwise the feature fails to open without one.

feature_webpage

  • Refactor the TSW web design to become the default handler for providing layouts and styling based on available command structures, where a command defines a page and a subcommand defines a subpage to be navigated to.

feature_firewall

  • Write firewall feature to create roles with custom permissions (true/false, an index into a list, or a bitflag comprising of matched list entries)

feature_identity

  • Write identity feature depending on firewall to create concepts of users and groups, where roles can be assigned to either. Depends on storage to provide database.
  • Provide ability to send events from the context of an authenticated user, where an event producer must "login" to identity as the given user to then be allowed to use identity as a proxy for its events, with the username as the event channel.
  • The default user is root with no password and part of the root group.
    • This user will always be able to bypass firewall guards!
  • Provide multiple commands for identity management:
    • Use user_mk -u/--user user <-p/--pass pass -g/--group group1,group2,...> to create a user at your earliest convenience if a security concern. Must be in the root group. Groups which don't exist yet will be made for you.
    • Use user_rm -u user to remove a user. Must be in the root group. Cannot remove user root.
    • Use group_mk -g/--group group <-r/--role role1,role2,...> to create a group. Must be in the root group. Roles which don't exist yet will be made for you.
    • Use group_rm -g group to remove a group. Must be in the root group, which cannot be removed.
    • Use group_add -g group -u user1,user2,... to add users to a group. Must be in the root group.
    • Use group_drop -g group -u user1,user2,... to remove users from a group. Must be in the root group, which cannot be removed from the root user.
    • Use passwd <-u user -o/--old pass -p pass> to set a password. Must be in the root group to change passwords of users other than yourself. When changing your own password (except as root), you must confirm the current password.
  • Provide sudo-like command to run a command as the specified user (or default to root), requiring that the user be part of the sudoers group.
  • Provide ability to manage keyrings for each user, which can contain SSH keys, GPG keys, communication keys for handling encrypted portal events, ...

Framework

  • Officially start on Framework, only after all of the above is finished.

CANCEL

  • Use a future binproxy feature with a subportal for the same effect: Prepare for potential future where a request event may wish to continue streaming from our input, and we could respond with custom streaming events.
  • Features can request the metadata of other features before they mark themselves as ready: Add Feature.Dependencies() ? to fail Feature.Open() when a dependency and optional version range is missing.