aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-06_wui: use the output for displaying notificationShulhan
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.
2023-12-06all: use the same date format between log and mlog packageShulhan
In this way, the date-time output from log.Xxx and mlog.Xxx are consistent.
2023-12-06cmd/awwan: add line feed to all [fmt.Printf] stringShulhan
This is to allow the output of command break into new line.
2023-12-06go.mod: update all dependenciesShulhan
2023-12-05all: remove duplicate errors logged on Copy, Put, and SudoCopyShulhan
While at it, replace all call of [log.Printf] with [Request.mlog] so error both written to stderr and to [Request.Output].
2023-12-04_ops/awwan-test: set the build cache to _ops/mkosi.cacheShulhan
When we create another container using the same distribution, we can use the same cache.
2023-12-04all: move _mkosi to _ops/awwan-testShulhan
This is to group all containers into one directory.
2023-12-04all: refactoring container for integration testsShulhan
Instead of building the container multiple times, create it one time only that importable to the system /var/lib/machines. So future development can enable or start them manually and run the test-integration or test-all tasks without rebuilding them again. This changes require moving the image output to /data/awwan because if the test image is located under the sub directory of the source directory and we bind the source directory into container it will cause recursive mount that makes its impossible to use the image inside /var/lib/machines. We also set the network zone to "awwan", to allow multiple containers shared the same subnet on the host later.
2023-12-04all: write the output as is when sending with server-sent eventsShulhan
Previously, if the command output is "line1\n\nline2\n", the web output it as line1 line2 it should be line1 line2 This fix the empty line not displayed in wui output.
2023-12-04_wui: do not clear output when executing another commandShulhan
This allow user to see the output of previous command without opening the log file.
2023-12-01_wui: store and load the vfs width in local storageShulhan
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. Implements: https://todo.sr.ht/~shulhan/awwan/6
2023-12-01all: move wrapping BEGIN and END outside of sessionShulhan
2023-12-01all: remove script name in the log prefixShulhan
Since each execution now logged in the file with ".log" extension, there is no need to prefix it with script name again, because its redundant.
2023-12-01_wui: disable button "Local" and "Play" when clickedShulhan
Once the execution completed, both buttons will be enabled again. While at it, add an icon to show the execution status.
2023-12-01_wui: rename "Remote" to "Play"Shulhan
This is to make command between the CLI and WUI consistent.
2023-12-01all: handle reconnecting when streaming executionShulhan
In "/awwan/api/execute/tail" SSE endpoint, in order for client to be able to reconnect and start streaming from the last know output, we need to send the ID for each message that we send. The ID is the index of Output in slice. If client does not send Last-Event-ID, we send all Output from beginning, otherwise, we send only message start from index in Last-Event-ID.
2023-12-01_ops: add awwan scripts to manage awwan.org websiteShulhan
Previously, this scripts is stored on my personal awwan workspace. As part of dog feeding, we expose how we manage awwan.org here, so people can see it as example of how awwan works.
2023-12-01all: fix link to Repository in the READMEShulhan
2023-12-01all: implement HTTP API to fetch execution output by IDShulhan
The new API is "GET /awwan/api/execute/tail" that implement Server-sent events, not a normal GET request. Its accept the query parameter "id" with value is 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. Implements: https://todo.sr.ht/~shulhan/awwan/5 Signed-off-by: Shulhan <ms@kilabit.info>
2023-12-01all: refactoring HTTP endpoint for ExecuteShulhan
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 an timeout error to client. In this changes, we generate an execution ID for each request and return it immediately. The next commit will implement HTTP endpoint to fetch the latest status and/or output by execution ID. References: https://todo.sr.ht/~shulhan/awwan/5
2023-11-25all: print non error information using package log instead of fmtShulhan
Although log print to stderr, this allow user to filter between awwan output and command output, for example by piping stderr to /dev/null $ awwan env-get "key" dir/ 2>/dev/null The output env-get is not poluted by other logs.
2023-11-22cmd/www-awwan: replace download links by requesting to server directlyShulhan
The contabostorage have an issues with cache. The file that we upload today, when downloaded by user may not the latest one. This changes require update on share module to use the latest [memfs.MemFS#Merge] method.
2023-11-22all: change deployment directly to serverShulhan
2023-11-21go.mod: update share moduleShulhan
This fix scanning directory that contains broken symlink.
2023-11-21_wui: update editor componentShulhan
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
2023-11-20_wui: refactoring the layout once and for allShulhan
Last weeked, I spent one day to fix the resizer to works with flex layout, and its hard and not optimal.
2023-11-20all: do not changes the Script path in the response of HTTP ExecuteShulhan
Previously, the ExecRequest from HTTP Execute endpoint changes the Script value to the absolute script path in the system. This changes fix this issue to minimize inconsistency between request and response.
2023-11-19_wui: various improvementsShulhan
Changes, * Add fixed height on output wrapper * Add space between Encrypt and Decrypt button * Add padding in Execute actions component * Change the wording of "Execute" to "Execute line"
2023-11-19_wui: wrap path if its overflow instead of using scrollShulhan
If we dive into many sub directories, the path in VFS may have horizontal scroll in it. To minimize scroll, make the crumbs wrapped to bottom.
2023-11-19_wui: fix build using tscShulhan
2023-11-19_wui: fix editor content grow outside browser widthShulhan
When file opened and the content length is greater than browser length, the editor width also growth based on the content. This changes fix this issue by using flex-basis (similar to setting width) and "overflow:auto" on the class awwan-content.
2023-11-19all: fix excludes on HTTP server related to .gitShulhan
The HTTP server should excludes ".git" directory only, not the other files, like .gitignore or .gitconfig.
2023-11-19all: update share moduleShulhan
The latest share module, in lib/crypto, handle loading SSH private key with passphrase interactively using a program defined in SSH_ASKPASS. This allow "awwan serve" that run without stdin, for example under systemd service, works seamlessly by setting environment variable SSH_ASKPASS to /usr/lib/ssh/x11-ssh-askpass. Implements: https://todo.sr.ht/~shulhan/awwan/3 Signed-off-by: Shulhan <ms@kilabit.info>
2023-11-19all: return 403 Forbidden when requesting awwan.key and awwan.passShulhan
When user run "awwan serve", using web-user interface, any request to fetch the content of "awwan.key" and "awwan.pass" should not allowed for security reason, in case user want to serve awwan with others.
2023-11-18make: set the lint-www task optionalShulhan
For regular machine that only need to install awwan using "make install" we can ignore this task if its failed.
2023-11-18_wui/doc: add missing documentation for env-get in awwan manualShulhan
2023-11-17_wui: add vertical resizer, to resize between VFS and editorShulhan
While at it, refactoring the layout using flex.
2023-11-17all: move the file argument in env-set to the last argumentShulhan
The "file" argument is optional, its define path to environment file. If its empty it will be set to "awwan.env" in the current directory.
2023-11-17_wui: increase max file size to 1MiBShulhan
This is to allow viewing log from editor.
2023-11-17all: log each time section createdShulhan
2023-11-17all: implement command "env-get" to get value from environment filesShulhan
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.
2023-11-17all: implement command to set environment value with "env-set"Shulhan
The env-set command set the value of environment file. Syntax, <file> <key> <value> The "file" argument define path to environment file. The "key" argument define the key to be set using "section:sub:name" format. The "value" argument define the value key. For example, to set the value for "name" under section "host" to "myhost" in file "awwan.env" run $ awwan env-set awwan.env host::name myhost To set the value for key "pass" under section "user" subsection "database" to value "s3cret" in file "awwan.env" run $ awwan env-set awwan.env user:database:pass s3cret
2023-11-17internal: use the node SysPath to convert markup fileShulhan
This fix an error NewFileMarkup: stat /doc/awwan.adoc: no such file or directory When adoc file changes.
2023-11-17go.mod: update share moduleShulhan
The latest update on share module create file in lib/ini.Open when file does not exist.
2023-11-16all: refactoring, rename HttpResponse to ExecResponseShulhan
2023-11-16all: refactoring, rename Request to ExecRequestShulhan
2023-11-16all: always load SSH config when running PlayShulhan
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 everytime the Play method executed so the user CLI and WUI has the same experiences.
2023-11-16_wui: allow all content type but decrease max file size to 100KBShulhan
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 100KB.
2023-11-16_wui: update wui/vfs to fix crumb overflowShulhan
In case the directory name is too long, the name can span multi line, break automatically by browser and overlap with previous crumbs.
2023-11-16_wui: implement DecryptShulhan
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).