aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)Author
2026-02-15all: fix data race in Play and in integration testsShulhan
When the Play command executed from the web user interface, there is a possibility that concurrent requests set the sshConfig field in Awwan struct at the same time. In the integration tests for TestAwwan_Play_withLocal and TestExecLocal_sudo, the data race happens when writing to the same buffer for stdout and stderr, so we split them into separate buffers. There is also data race in SSE connection, when handler for ExecuteTail write to the same buffer with worker keep alive. This has been fixed on pakakeh.go module.
2026-02-03_ops/awwan-tour: fix build with latest mkosiShulhan
2026-02-03all: fix data race in tests and [httpServer.ExecuteTail]Shulhan
In the test for AwwanLocal, use buffer with lock, so each write and read is safe. In the httpServer, the test found data race during ExecuteTail when accessing [ExecResponse.EndAt]. We fix it by locking the resource during call to end() and when accessing the EndAt field.
2025-06-29all: add task to deploy www-awwan from webhookShulhan
2025-02-08all: another fix for integration testsShulhan
In the mkosi 25.3 the environment variable $MKOSI_UID now using subuid, which return 0 if we have subuid "<user>:100000:65536". The mkosi.nspawn is not imported to the build directory, so we need to copy it from source.
2025-02-07internal/cmd/gocheck: internal lintersShulhan
The fieldalignment and shadow is a linter from golang.org/x/tools. This program actually have an API that can be used. The pakakeh.go/lib/goanalysis wrap those APIs into a single function call that can be run inside a main. This minimize and simplified our tools dependencies.
2025-01-12all: update machine container setup with latest ArchShulhan
The latest mkosi use importctl instead of machinectl to import the image. There is an issue in mkosi.conf where build with Format=tar always get compressed using zstd, but importctl unable to import it, so we need to set CompressOutput=false. The home directory mode needs to be set to open 0755, because now its default to 0700, which makes the test failed to read file on others user's home. The pacman mirror changes to public one that is always available, geo.mirror.pkgbuild.com. The BUG_REPORT_URL in os-release for Arch changes which we need to modify because its included in the test-container.
2025-01-12make: replace linter golangci-lint with "go vet"Shulhan
We are not happy with this linter, it create an illussion of works rather than fixing real issues. The golangci-lint does not works on gotip and its become red herring and subjective rather than correctness.
2024-04-06all: comply with linter recommendationsShulhan
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-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-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
2023-12-07all: add tasks to release binaries automatically using karajoShulhan
The karajo server is live at build.kilabit.info, triggered by github webhook.
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-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-11-22all: change deployment directly to serverShulhan
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-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-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-30Makefile: add task "lint" as prerequisite of task "install"Shulhan
2023-10-29cmd/www-awwan: move command "embed" as part of internal buildShulhan
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-29all: replace environment AWWAN_DEVELOPMENT with flag "-dev"Shulhan
Using flag "-dev" is more explicit than using environment variable.
2023-10-28Makefile: run task "lint-www" as precondition of "install" taskShulhan
2023-10-25_www: setup eslint to lint the TypeScript fileShulhan
ESLint help us to make the code consistent and possible errors in the future changes.
2023-10-21all: add make tasks to run unit and integration testsShulhan
The "test-integration" run only test with tags "integration", while the "test-all" run all tests. This changes also rewrite how we collect test coverage, by storing them into a single directory "_coverage" and generate the report using "go tool covdata" and "go tool cover".
2023-10-21_mkosi: populate SSH keys manually using "mkosi.extra"Shulhan
Previously, when building container, the SSH keys for server and user are generated automatically. This makes the SSH keys unpredictable when we need to test SSH function later (the known_hosts for source and authorized_keys in target). This changes set the host and user SSH keys manually using "mkosi.extra" skeleton, so every container build, will have predictable keys.
2023-10-18all: add make task to release based on main branchShulhan
The release-tip task build the binary on the current tip of main branch and upload it to external storage to be consumed by public.
2023-10-15internal/cmd/www-awwan: new static web server for awwan.orgShulhan
the www-awwan is static web server, built using ciigo, to serve the website at awwan.org.
2023-10-14all: remove option "-race" when running testShulhan
Since adding support for encryption, running test with "-race" become quite slow. All of our code is sequential, no goroutine involved except in HTTP APIs, so there is no need to run the test with "-race" option, for now.
2023-10-11_mkosi: rewrite the mkosi scriptsShulhan
2023-10-10all: setup integration tests using mkosi with systemd-nspawnShulhan
This is the initial setup as experiments. All of the steps and settings are documented in https://kilabit.info/journal/2023/using_systemd_mkosi/ .
2023-09-17Makefile: replace linter golangci-lintShulhan
The golangci-lint become unusable. It does not provide any useful hints on how to write better Go code. This changes replace golangci-lint with go vet, fieldalignment and shadow from x/tools, and revive. The fieldalignment tool provide hints on better struct size. The shadow tool provide hints on overwriting or shadowed variables. The revive tool provide hints on many code analysis that does not covered by go vet, fieldalignment, and shadow.
2023-03-26all: move code for development to package internalShulhan
2022-08-02all: simplify the MakefileShulhan
What am I thinking?
2022-08-02all: watch and convert .adoc files during developmentShulhan
2022-07-30all: fix "test" task and make the "lint" task optionalShulhan
2022-03-14all: change the awwan software license to GPL 3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl for more information.
2022-02-05Makefile: set CGO_ENABLED to true when running testShulhan
Since we run test using -race, we should set CGO_ENABLED=1, because user may set this to 0 and cause the test not running.
2021-10-20all: add sub-command "build" to awwanShulhan
Previously, we depends external commands to watch, build, and embed the files in _www directory for development. This changes simplify all of this into single command. To compile the TypeScript files and embed them we just run, go run ./cmd/awwan build To run the development server that watch any changes on .ts/.js/.html files inside _www and rebuild them AWWAN_DEVELOPMENT=1 go run ./cmd/awwan serve ${AWWAN_WORKSPACE}
2021-08-29_www: add header and link to documentationShulhan
2021-08-29all: rewrite the web-user interface using TypeScriptShulhan
In order to minimize error when developing with JavaScript we include the "wui" project as git submodule under "_www/wui". The _www/awwan.ts and _www/main.ts then import all required libraries directly which will be compiled into single JavaScript under _www/main.js.
2021-08-23all: implement HTTP API and function to Save file on web-user interfaceShulhan
The web-user interface now have button "Save" that save the edited content of file to storage.
2021-08-22all: implement serve commandShulhan
The serve comman will run a HTTP server that provide web-user interface to edit and execute script. Currently, the web-user interface provide the following features, * Browsing the workspace * Running the script on local or remote
2021-08-22all: generate the coverage when running the testShulhan
The coverage output will be converted to HTML when all test success.
2021-03-07Makefile: run test with "-race" option and task to run linterShulhan
2020-05-30all: update the project links to sourcehutShulhan
* Makefile: make the default task to build the command