aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-16go.mod: update share moduleShulhan
The update fix lib/memfs.Get with empty path.
2023-11-16all: implement HTTP API to decrypt fileShulhan
Similar to the CLI, the HTTP API accept the path of vault file and return the path to decrypted file.
2023-11-15_wui: use CTRL+Enter to trigger save instead of CTRL+s on editorShulhan
Using CTRL+s sometimes cause pressing s only trigger the save, due to fast typing (or keyboard error?).
2023-11-15_wui: add placeholder for input execute and link to documentationShulhan
2023-11-15_wui: allow opening file with content type as "octet-stream"Shulhan
Most file with this type is binary, we allow it to see if its file has content or not.
2023-11-15internal: use mlog for all loggingShulhan
While at it, format the log string to be consistent.
2023-11-15_wui: update vfs componentShulhan
This changes allow user browse the crumb in path and item in the list using tab key. While at it, fix the layout to make VFS and editor aligned.
2023-11-15_wui: implement EncryptShulhan
In the right side of Save button we now have a button Encrypt that allow user to Encrypt openend file. This require the workspace has been setup with private key (.ssh/awwan.key) and pass file (.ssh/awwan.pass).
2023-11-15all: implement HTTP API to encrypt fileShulhan
Similar to the CLI, the HTTP API accept the path of file and return the path to encrypted file.
2023-11-12_wui: reset the input field when directory changesShulhan
2023-11-11_wui: implement file filterShulhan
This changes move the text input for creating new file above the list. Filling the text field will filter the list based on the node name using regular expression. Another changes is for node with type directory now suffixed with "/".
2023-11-11Release awwan v0.9.0 (2023-11-11)v0.9.0Shulhan
Awwan now have a website at https://awwan.org. === New features * all: implement remote "#get!" and "#put!" with owner and mode The magic command "#get" and "#put" now have an inline options to set the owner and permission of copied file. Example of usage are, #get:$USER:$GROUP+$PERM src dst #put!$USER:$GROUP+$PERM src dst The $USER, $GROUP and $PERM are optionals. If $USER and/or $GROUP is set, a copied file will have owner set to user $USER and/or group to $GROUP. If $PERM is set, a copied file will have the mode permission set to $MODE. * all: add magic command "#local" The magic command "#local" define the command to be executed using shell in local environment. Its have effect and can only be used in script that executed using "play". In script that is executed using "local" it does nothing. * _www: replace button "Clear selection" with text input for line range Instead of using mouse to select which lines to be executed, let user input it manually like in the CLI. * all: log all execution into file For each script execution, a file suffixed with ".log" will be created in the same directory with the same name as script file. For example, if the script is path is "a/b/c.aww" then the log file would named "a/b/c.aww.log". This is to provides history and audit in the future. * cmd/awwan: add option "-address" to command serve The "-address" option allow defining the HTTP server address to serve the web-user interface. === Bug fixes * all: trim spaces in passphrase when its read from file Using vim, or UNIX in general, the file always end with "\n". If we read the whole file then the passphrase will end with it, this cause the decryption may fail (or wrong encryption passphrase used). * _www: fix saving file content using CTRL+s The issue is using "this.editorOnSave" result on undefined "this" inside the editorOnSave. * all: remove the node when requested from HTTP API /awwan/api/fs Previously, the HTTP API for deleting node only remove the file but not the node in the memfs. This changes remove the child node from memfs, so the next refresh on directory will not contains the removed file. * all: return the error as reponse in HTTP API execute Previously, when the command execution failed, we check the error and return it as HTTP status code 500. In this way, user cannot view the log and actual error. In this changes, if the command failed, we store the error in separate field "Error" and return to the caller with HTTP status code 200. === Enhancements * all: fix printing the statement to be executed This fix missing magic command not printed in stdout. * all: use "mlog.MultiLogger" to log Request output and error By using "mlog.MultiLogger" every output or error can be written to stdout/stderr and additional log writer that can collect both of them, buffered and returned to the caller. This changes simplify the HttpResponse to use only single output that combine both stdout and stderr. * _www: add button to resize editor and output The button can be dragged up and down to resize both the editor and output panes. * _www: show confirmation when user open other file with unsaved changes If user modify the current file without saving it and then open another file, it will show confirmation dialog to continue opening file or cancel it. * all: on file save, make sure file end with line-feed On some application, like haproxy configuration, line-feed (LF or "n") are required, otherwise the application would not start. * script: respect spaces when joining multi lines command If a multi lines command does not have spaces or have multiple spaces, join them as is. For example, a\\ b should return the value as ab, while a \\ b should return "a<space><space>b". * _wui: various enhancements Changes, - The "File" tag now highlighted to distinguish with file name - The "Execute" action moved to replace the Output, so we have some additional horizontal space - The "Output" tag removed - Fix layout on mobile devices where height is set to static - editor: re-render content after save - editor: handle paste event manually
2023-11-11go.mod: update module ciigoShulhan
2023-11-11internal: use separate DirWatcher instead of using instance of MemfsWuiShulhan
In MemfsWui we exclude the "adoc" files but when calling Watch we pass it as to be included. When the adoc file changes, sometimes the changes not detected, probably there is a bug in the memfs.Watch. For now, we use separate instance of DirWatcher to watch any changes on adoc, html, js, md, and files.
2023-11-11_wui: update editor libraryShulhan
Changes, * editor: re-render content after save * editor: handle paste event manually
2023-11-11_wui: various enhancementsShulhan
Changes, * The "File" tag now highlighted to distinguish with file name. * The "Execute" action moved to replace the Output, so we have some additional horizontal space. * The "Output" tag removed. * Fix layout on mobile devices where height is set to static.
2023-11-11script: respect spaces when joining multi lines commandShulhan
If a multi lines command does not have spaces or have multiple spaces, join them as is. For example, a\ b should return the value as "ab", while a \ b should return "a b".
2023-11-09all: on file save, make sure file end with line-feedShulhan
On some application, like haproxy configuration, line-feed (LF or "\n") are required, otherwise the application would not start.
2023-11-09cmd/awwan: add option "-address" to command serveShulhan
The "-address" option allow defining the HTTP server address to serve the web-user interface.
2023-11-09_wui: update submodule wuiShulhan
This changes simplify the editor and make it more user friendly that allow delete, copy, and paste with selection.
2023-11-09go.mod: update share module to tipShulhan
2023-11-07all: add build and installation for ARM64Shulhan
2023-10-30make: add task "test-all-mkosi"Shulhan
The task "test-all-mkosi" run both unit and integration tests without manually login inside to container first.
2023-10-30all: pass Request when creating new SSH clientShulhan
Instead of passing stdout and stderr as "io.Writer", pass the Request, so we can log using the Request mlog. While at it, return error from sshClient rmdirAll so the caller can log the error.
2023-10-30all: refactoring Local and Play so that error get loggedShulhan
Previously, if there is any error from Local or Play before any statement get executed it will not logged to log, also the Request close() is not called since we put it as defer in the middle. This changes fix this by moving down error handler into single exit goto label.
2023-10-30Makefile: add task "lint" as prerequisite of task "install"Shulhan
2023-10-30all: add begin and end for each script executionShulhan
When the script executed, log the script and line number to be executed with "=== BEGIN", and when its finished, log the end of it with "=== END". This is to make the log more traceable.
2023-10-30all: log all execution into fileShulhan
For each script execution, a file suffixed with ".log" will be created in the same directory with the same name as script file. For example, if the script is path is "a/b/c.aww" then the log file would named "a/b/c.aww.log". This is to provides history and audit in the future.
2023-10-30all: move the awwan unit test to separate filesShulhan
For testing "local" command move the unit tests to file "awwan_local_test.go", for testing "encrypt" command move the unit tests to file "awwan_encrypt_test.go", and so on.
2023-10-30all: return the error as reponse in HTTP API executeShulhan
Previously, when the command execution failed, we check the error and return it as HTTP status code 500. In this way, user cannot view the log and actual error. In this changes, if the command failed, we store the error in separate field "Error" and return to the caller with HTTP status code 200.
2023-10-30_wui: fix mouse listener on down and up for resizing buttonShulhan
2023-10-30_wui: fix saving on control+s on editorShulhan
2023-10-29cmd/www-awwan: move command "embed" as part of internal buildShulhan
2023-10-29go.mod: update share module to tipShulhan
The latest share module fix the generated embedded Go regarding regex for Includes and Excludes not compiled, which causes some files get included when running the instance with Watch method.
2023-10-29all: rename directory "_www" to "_wui"Shulhan
Since we now have website, the directory name "_www" become misleading. The actual website files is located under "_www/doc", the "_www" directory is for web-user interface which includes documentation that has the same content as our websites.
2023-10-29internal: use separate DirWatcher instead of using memfs instanceShulhan
Using separate DirWatcher will prevent the watched files being included during embed.
2023-10-29_www/doc: update todo and READMEShulhan
In todo we remove completed and unknown tasks which makes the current awwan implementation is feature complete in CLI perspective. While at it, fix missing index.css not included in internal memfs.
2023-10-29_www/doc: update HTML templateShulhan
Use relative path for "index.css" so documentation can rendered correctly from awwan WUI. While at it, reformat the file using js-beautify.
2023-10-29internal: set the template file when converting markupShulhan
2023-10-29_www: show confirmation when user open other file with unsaved changesShulhan
If user modify the current file without saving it and then open another file, it will show confirmation dialog to continue opening file or cancel it.
2023-10-29all: remove global variable newLineShulhan
2023-10-29internal: add missing copyright headersShulhan
2023-10-29all: replace environment AWWAN_DEVELOPMENT with flag "-dev"Shulhan
Using flag "-dev" is more explicit than using environment variable.
2023-10-29_www: refresh the vfs list when file successfully removedShulhan
When the call to "DELETE /awwan/api/fs" success, re-open the directory to fetch the new directory list.
2023-10-29all: remove the node when requested from HTTP API /awwan/api/fsShulhan
Previously, the HTTP API for deleting node only remove the file but not the node in the memfs. This changes remove the child node from memfs, so the next refresh on directory will not contains the removed file.
2023-10-28Makefile: run task "lint-www" as precondition of "install" taskShulhan
2023-10-28_www: fix saving file content using CTRL+sShulhan
The issue is using "this.editorOnSave" result on undefined "this" inside the editorOnSave.
2023-10-28_www: fix resizing editor/output by using wrapper on outputShulhan
Previously, we changes the height of "#output" element which cause the height sometimes out of range if its content is not empty. This changes add a wrapper for all output elements and use it as component for resizing.
2023-10-28_www: add button to resize editor and outputShulhan
The button can be dragged up and down to resize both the editor and output panes.
2023-10-27_www: set the height of editor and output fixedShulhan
This is to provide consistent layout when the file content changes.