summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-08Release awwan v0.12.0 (2024-02-08)v0.12.0Shulhan
=== Breaking changes * all: refactoring "env-set" arguments Previously, the "env-set" take the file argument as the last argument and optional. This changes move the file argument to the first argument so the bash completion can detect and print the completion for list of keys. While at it, fix handling key with quoted in EnvSet and EnvGet. * all: refactoring env-get command This changes the order of arguments of env-get command to pass the directory first before the key. The reason is to simplify auto-completion later from the command line. === New features * all: add command env-keys The "env-keys" command print list of environment variables under a directory. This command is internal, not documented, used by bash completion. * all: add bash completion script Using awwan from CLI now can automatically complete the arguments based on the command and current parameter number.
2024-02-08go.mod: update share moduleShulhan
2024-01-22bash-completion: add completion for range in local and play argumentShulhan
When user type the "local" or "play" command and the current input is the range, read the script file and print each line prefixed with line number. Implements: https://todo.sr.ht/~shulhan/awwan/10
2024-01-20completions: enable completion on first parameter in local and playShulhan
The first parameter of "local" and "play" command is the path to file to execute.
2024-01-16all: refactoring "env-set" argumentsShulhan
Previously, the "env-set" take the file argument as the last argument and optional. This changes move the file argument to the first argument so the bash completion can detect and print the completion for list of keys. While at it, fix handling key with quoted in EnvSet and EnvGet. Closes: https://todo.sr.ht/~shulhan/awwan/10
2024-01-16bash-completion: use command env-keys to show completion for env-getShulhan
After the env-get first parameter is filled, the file or directory, we can show possible completion for the second parameter by printing all keys under the path. References: https://todo.sr.ht/~shulhan/awwan/10
2024-01-16all: add command env-keysShulhan
The "env-keys" command print list of environment variables under a directory. This command is internal, not documented, used by bash completion.
2024-01-16all: refactoring env-get commandShulhan
This changes the order of arguments of env-get command to pass the directory first before the key. The reason is to simplify auto-completion later from the command line.
2024-01-16all: add bash completion scriptShulhan
While at it, set the AUR architecture to 'any' since Go can be build on all ArchLinux supported architecture; and update the url variable to official awwan website. References: https://todo.sr.ht/~shulhan/awwan/10
2024-01-06internal: update memfs for www-awwan and wuiShulhan
2024-01-06Release awwan v0.11.0 (2024-01-06)v0.11.0Shulhan
In this release we create https://tour.awwan.org where user can try and learn awwan using step-by-step tutorial. In the web-user interface (WUI) we add functionality to stop the local or SSH execution. === Breaking changes * all: make the magic line "#put:" use explicit source for encrypted file === New features * _wui: implement button to stop execution * all: implement HTTP API to stop local or play execution === Bug fixes * all: check script file is a directory * all: fix panic due to out of range when running "#require" statement === Enhancements * all: delete the execution response and context cancellation on finished * all: change the remote temporary directory to "~/.cache/awwan"
2024-01-06go.mod: update all dependenciesShulhan
2023-12-26go.mod: update share moduleShulhan
The update on share module fix several issues in "lib/ssh/config". Including, * Fix on SSH Config the default values. Using Host with different Port now working as expected. * Refactoring the Config merge. Using IdentityFile or UserKnownHostsFile with relative path in ".ssh/config", for example UserKnownHostsFile known_hosts will now load the known_hosts in the same directory as config file.
2023-12-26_ops/tour: enable and start the awwan-tour containerShulhan
Enablnig them allow the container to auto started when machine started.
2023-12-22all: support cancellation when running command using SSH clientShulhan
This changes require us to replace golang.org/x/crypto with our fork, since the [ssh.Session.Run] with context is not available yet in upstream. Implements: https://todo.sr.ht/~shulhan/awwan/9
2023-12-22go.mod: update share and x/crypto moduleShulhan
This update is for security fixes in x/crypto on related to Prefix Truncation Attack.
2023-12-22all: fix double "vv" in usage version stringShulhan
2023-12-22all: delete the execution response and context cancellation on finishedShulhan
Once the ExecResponse EndAt is not empty or event queue has been closed, clear the map that store the execution response and context cancellation to minimize resources usage.
2023-12-22_wui: implement button to stop executionShulhan
The Stop button call "DELETE /awwan/api/execute?id=" with id is the previous execution ID. Implements: https://todo.sr.ht/~shulhan/awwan/9
2023-12-22all: implement HTTP API to stop local or play executionShulhan
The HTTP API for stopping execution have the following signature, DELETE /awwan/api/execute?id=<string> If the ID is exist, the execution will be cancelled and return HTTP status 200 with the following body, Content-Type: application/json { "code": 200, } Otherwise it will return HTTP status 404 with error message. References: https://todo.sr.ht/~shulhan/awwan/9
2023-12-22all: add [context.Context] to Local and PlayShulhan
Passing context allow the command Local or Play to be cancelled when running in asynchronous mode, in this case when awwan run with WUI.
2023-12-22all: check script file is a directoryShulhan
This changes we make sure that the passed script path is not a directory to prevent error when running play with unknown host name.
2023-12-22all: update comment on relativePath functionShulhan
2023-12-22all: save the current working directory to minimize call to [os.Getwd]Shulhan
2023-12-21all: changes default date-time prefix on testShulhan
Using "-" as dummy date-time prefix make the test output quite hard to read, especially since we use the same prefix "===" and "---" with Go test output.
2023-12-21all: setup tour.awwan.orgShulhan
Now that the _tour is ready we can deploy it to tour.awwan.org. The website is updated to include link to tour domain. Implements: https://todo.sr.ht/~shulhan/awwan/4
2023-12-21_tour: update README for readabilityShulhan
2023-12-20testdata/http_server: fix missing .ssh directory on executeShulhan
The execute directory is used as base directory of awwan during testing APIExecute.
2023-12-19go.mod: update share moduleShulhan
This fix fetching SSH config where Hostname is not set but host name may match with Host with wildcard.
2023-12-18all: fix panic due to out of range when running "#require" statementShulhan
2023-12-17all: rename _play, _ops/awwan-play to _tour, _ops/awwan-tourShulhan
The name "play" imply that the service is to run awwan script, while the "tour" is to guide the new user to use awwan WUI, since its contains the tutorial.
2023-12-17all: change the remote temporary directory to "~/.cache/awwan"Shulhan
If the file to be copied contains sensitive data, putting them in "/tmp" considered a security risk, even though it will be moved to destination later. The issue is when the "#put" command failed, the plain file is left on "/tmp" directory. This changes add additional advantage where we did not need to remove the temporary directory on remote when execution completed, since the temporary directory should be accessible by user only. Implements: https://todo.sr.ht/~shulhan/awwan/8
2023-12-16all: make the magic line "#put:" use explicit source for encrypted fileShulhan
Previously, the magic line "#put" detect whether the source file is encrypted or not automatically, so we did not need to put ".vault" suffix in the source path. This changes make it to be always explicit. If we want to copy encrypted file than the source file must be the path to encrypted file. Implements: https://todo.sr.ht/~shulhan/awwan/7
2023-12-16_AUR: update to v0.10.0 and fix package functionShulhan
The build output for awwan binary has been moved to directory "_bin".
2023-12-16Release awwan v0.10.0 (2023-12-16)v0.10.0Shulhan
=== New features internal/cmd: add flag "address" for command www-awwan:: This is to allow using different address when running on local, without conflict with "serve-www" task in Makefile. all: implement command "env-get" to get value from environment files:: The env-get command get the value from environment files. Syntax, <key> [dir] The "key" argument define the key where value is stored in environment using "section:sub:name" format. The "dir" argument is optional, its define the directory where environment files will be loaded, recursively, from BaseDir to dir. If its empty default to the current directory. all: implement command to set environment value with "env-set":: The env-set command set the value of environment file. Syntax, <key> <value> <file> The "key" argument define the key to be set using "section:sub:name" format. The "value" argument define the value key. The "file" argument define path to environment file. For example, to set the value for "name" under section "host" to "myhost" in file "awwan.env" run ---- $ awwan env-set host::name myhost awwan.env ---- To set the value for key "pass" under section "user" subsection "database" to value "s3cret" in file "awwan.env" run ---- $ awwan env-set user:database:pass s3cret awwan.env ---- _wui: implement Encrypt:: In the right side of Save button we now have a button Encrypt that allow user to Encrypt opened file. This require the workspace has been setup with private key (.ssh/awwan.key) and pass file (.ssh/awwan.pass). _wui: implement Decrypt:: In the right side of Save button we now have a button Decrypt that allow user to Decrypt file with ".vault" extension only. This require the workspace has been setup with private key (.ssh/awwan.key) and pass file (.ssh/awwan.pass). === Breaking changes all: make the magic line "#local" works on "local" command too:: In case we have a script that manage local host and remote server, calling "play" on "#local" lines only always open the connection to remote server. To minimize opening unused connections, let the "#local" command works on both commands. Its up to user which part of lines that they want to execute on remote or local. _wui: use CTRL+Enter to trigger save instead of CTRL+s on editor:: Using CTRL+s sometimes cause pressing s only trigger the save, due to fast typing (or keyboard error?). === Bug fixes all: close the SSH connection once Play finished:: Previously, we used to run awwan as CLI so each connection is open and closed once the command completed. Since we now use awwan WUI frequently, any command that execute Play does not close the session immediately once finished. This cause many connections open in remote server. This changes close the SSH connections immediately once the Play command finished. all: fix memfs excludes regex:: Previously, the regex does not contains "^" and "$" which makes file like "multi-user.target.wants" considered as ".tar" file and being excluded. _wui: update editor component:: Changes, - fix paste that always end with newline - fix editor content that got wrapped due to width - update layout without using float - replace execCommand with Selection all: fix excludes on HTTP server related to .git:: The HTTP server should excludes ".git" directory only, not the other files, like ".gitignore" or ".gitconfig". all: always load SSH config when running Play:: In case awwan run with "serve" and we modify the ".ssh/config", the changes does not detected by awwan because we only read ".ssh/config" once we Awwan instance created. This changes fix this issue by always loading SSH config every time the Play method executed so the user CLI and WUI has the same experiences. === Enhancements all: reduce the response on HTTP endpoint on GET fs:: Previously, the HTTP endpoint for "GET /awwan/api/fs" return the content of files when the requested node is a directory. This is cause unnecessary load because when requesting directory we only need list of file names not the content. This changes reduce the response by returning only list of node child without its content, which require update on share module on [Node.JSON]. _wui: use the output for displaying notification:: Previously, we use a quick "pop-up" to display notification for each information or error from WUI. Sometimes this is annoying, it overlap the buttons, make it hard to Save and Encrypt at the same time. In this changes we move the nofication message to be displayed in the output, same with output of execution. all: use the same date format between log and mlog package:: In this way, the date-time output from log.Xxx and mlog.Xxx are consistent. all: remove duplicate errors logged on Copy, Put, and SudoCopy:: While at it, replace all call of [log.Printf] with [Request.mlog] so error both written to stderr and to [Request.Output]. _wui: do not clear output when executing another command:: This allow user to see the output of previous command without opening the log file. _wui: store and load the vfs width in local storage:: This is allow user to resize vfs width in one window and when new window is opened the vfs width is restored with the same size. _wui: disable button "Local" and "Play" when clicked:: Once the execution completed, both buttons will be enabled again. While at it, add an icon to show the execution status. _wui: rename "Remote" to "Play":: This is to make command between the CLI and WUI consistent. all: refactoring HTTP endpoint for Execute:: Previously, the Execute endpoint wait for command execution to finish. In case the command takes longer than proxy or server write timeout, it will return with a timeout error to client. In this changes, we generate an execution ID for each request and return it immediately. The new API "GET /awwan/api/execute/tail" implement Server-sent events, accept the execution ID from "/awwan/api/execute". Once called with valid ID, it will streaming the command output to client. By using this new API, the WUI can receive the output of command immediately without waiting for all commands to be completed. _wui: add vertical resizer, to resize between VFS and editor:: _wui: allow all content type but decrease max file size to 1 MB:: Previously, only file with type json, message, octet-stream, script, text, or XML that can be opened by editor. In this changes we allow all files as long as the size is less than 1MB. _wui: update vfs component:: 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. _wui: implement file filter:: 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-12-16_wui/doc: change the HTML element "dt" to have bold fontShulhan
This is for CHANGELOG so the subject of changes highlighted make it different with the changes description.
2023-12-14all: make the magic line "#local" works on "local" command tooShulhan
In case we have a script that manage local host and remote server, calling "play" on "#local" lines only always open the connection to remote server. To minimize opening unused connections, let the "#local" command works on both commands. Its up to user which part of lines that they want to execute on remote or local.
2023-12-14internal/cmd: add flag "address" for command www-awwanShulhan
This is to allow using different address when running on local, without conflict with "serve-www" task in Makefile.
2023-12-14all: close the SSH connection once Play finishedShulhan
Previously, we used to run awwan as CLI so each connection is open and closed (forcefully). Since we now use awwan WUI frequently, any command that execute Play does not close the session immediately once finished. This cause many connections open in remote server. This changes close the SSH connections immediately once the Play command finished.
2023-12-14go.mod: update module ciigo and shareShulhan
2023-12-14all: fix memfs excludes regexShulhan
Previously, the regex does not contains "^" and "$" which makes file like "multi-user.target.wants" considered as ".tar" file and being excluded.
2023-12-14go.mod: replace esbuild with our own fork to fix rebuildShulhan
See https://github.com/evanw/esbuild/pull/3534
2023-12-14all: changes based on reports from linter reviveShulhan
Better to fix and follow the reported warnings rather than adding configuration file to add an exception.
2023-12-10go.mod: update module ciigoShulhan
2023-12-09all: reduce the response on HTTP endpoint on GET fsShulhan
Previously, the HTTP endpoint for "GET /awwan/api/fs" return the content of files when the requested node is a directory. This is cause unnecessary load because when requesting directory we only need list of file names not the content. This changes reduce the response by returning only list of node child without its content, which require update on share module on [Node.JSON].
2023-12-08_wui: update wui sub moduleShulhan
Changes, * Reduce the left padding on the editor so space and padding not to similar * Set the caret color to red in editor * Prevent "Enter" without pressing Control trigger the Save
2023-12-08_wui/doc: detach the index from READMEShulhan
The links in the index should be relative, so we can test and deploy it anywhere. Also the README contains link to website which is redundant if rendered on website itself.
2023-12-07_ops/awwan-play: use Ephemeral instead of ReadOnlyShulhan
Using sudo or SSH in ReadOnly container is really slow.
2023-12-07_play: populate the content for play.awwan.orgShulhan
2023-12-07_ops: setup awwan-playShulhan
The _ops/awwan-play is the seed for the awwan playground that will be live on "play.awwan.org" later. The image name is awwan-play, to allow us to serve play.awwan.local on local proxy and test it without port number. It use the _play directory as workspace. References: https://todo.sr.ht/~shulhan/awwan/4