Files
start-os/container-runtime
Dominion5254 800b0763e4 More svc effect handlers (#2610)
* complete get_primary_url fn

* complete clear_network_interfaces fn

* formatting

* complete remove_address fn

* get_system_smtp wip

* complete get_system_smtp and set_system_smtp

* add SetSystemSmtpParams struct

* add set_system_smtp subcommand

* Remove 'Copy' implementation from `HostAddress`

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Refactor `get_host_primary` fn and clone  resulting `HostAddress`

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* misc fixes and debug info

* seed hosts with a tor address

---------

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
Co-authored-by: Aiden McClelland <me@drbonez.dev>
2024-05-10 19:20:24 +00:00
..
2024-05-10 19:20:24 +00:00
2024-04-17 21:46:10 +00:00
2024-04-22 17:40:10 +00:00
2024-04-17 21:46:10 +00:00
2024-04-22 17:40:10 +00:00
2024-04-15 16:00:56 +00:00

Testing

So, we are going to

  1. create a fake server
  2. pretend socket server os (while the fake server is running)
  3. Run a fake effects system (while 1/2 are running)

In order to simulate that we created a server like the start-os and a fake server (in this case I am using syncthing-wrapper)

TODO

Undo the packing that I have done earlier, and hijack the embassy.js to use the bundle service + code

Converting embassy.js -> service.js

startOs ->> startInit.js: Rpc Call
startInit.js ->> service.js: Rpc Converted into js code

Create a fake server

run_test () {
    (
        set -e
        libs=/home/jh/Projects/start-os/libs/start_init
        sockets=/tmp/start9
        service=/home/jh/Projects/syncthing-wrapper

        docker run  \
            -v $libs:/libs \
            -v $service:/service \
            -w /libs \
            --rm node:18-alpine \
            sh -c "
                npm i &&
                npm run bundle:esbuild  &&
                npm run bundle:service
            "



        docker run  \
            -v ./libs/start_init/:/libs \
            -w /libs \
            --rm node:18-alpine \
            sh -c "
                npm i &&
                npm run bundle:esbuild
            "



        rm -rf $sockets  || true
        mkdir -p $sockets/sockets
        cd $service
        docker run \
            -v $libs:/start-init \
            -v $sockets:/start9 \
            --rm -it $(docker build -q .) sh -c "
                apk add nodejs &&
                node /start-init/bundleEs.js
            "
    )
}
run_test

Pretend Socket Server OS

First we are going to create our fake server client with the bash then send it the json possible data

sudo socat - unix-client:/tmp/start9/sockets/rpc.sock
{"id":"a","method":"run","params":{"methodName":"/dependencyMounts","methodArgs":[]}}
{"id":"a","method":"run","params":{"methodName":"/actions/test","methodArgs":{"input":{"id": 1}}}}
{"id":"b","method":"run","params":{"methodName":"/actions/test","methodArgs":{"id": 1}}}