Up-to-date with v2.4; Nov. '21
Clu
is the Gopherbot development robot that runs wherever I need him, and tracks with ongoing development of Gopherbot. This repository represents almost everything I need to run Clu; the only other bits:
- Clu's
.env
file with his brain decryption key and other required env vars; this is kept in a password manager - robot-state branch - Separate branch of this repository for backing up Clu's memories; should always remain separate from
master
, etc. - Clu's repository has two deploy keys configured:
deploy_rsa.pub
is a read-only deploy key for bootstrapping Clu in to a new running environment, such as a newly built VM or containermanage_rsa.pub
is a dedicated encrypted key that Clu uses for managing his own repository; used, for instance, for backing up long-term memories to therobot-state
branch
Clu
's custom configuration formed the basis for new robot configuration, the contents of robot.skel.
This is the directory structure of a well-formed robot, when run directly on a host:
clu/
- Top-level directory, not a git repogopherbot
- symlink to/opt/gopherbot/gopherbot
custom/
- clone ofparsley42/clu-gopherbot
, custom configuration repository populated during bootstrappingstate/
- clone ofparsley42/clu-gopherbot
,robot-state
branch, where clu saves state, e.g. memories - also populated during bootstrapping.env
- environment variables required for Clu to bootstrap and run
The environment file is only:
GOPHER_ENCRYPTION_KEY=<redacted>
GOPHER_PROTOCOL=slack
#GOPHER_CUSTOM_REPOSITORY=https://github.com/parsley42/clu-gopherbot.git
GOPHER_CUSTOM_REPOSITORY=git@github.com:parsley42/clu-gopherbot.git
GOPHER_DEPLOY_KEY=-----BEGIN_OPENSSH_PRIVATE_KEY-----:b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn:NhAAAAAwEAAQAAAYEA7nXaHD1uZ9cZbI/szT74uOUwDTlihejMKKGPRcTRXbnnFkdLlcg+:fIJ09q8oIt33xvUQmmupnK65dqasQfna0jQeTFiJSdiXOjtH1kFmwiN7VyzrGu3Y8Yk2/i:tJ3By5TqsuqkoRDPxDGE6RnVrYYK3XTiVGPTNskkXctsJ2Ip9/W1rP5MY8oACgh1B8R24+:bXLwU0XzWDlrcVM9/l78AcSUEo6277cbBEwetVO5rR6dZJw+k/9Kfgyv+J4OucEXR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ub88IdwAAABhwYXJzZUBoYWt1aW4ubG9jYWxkb21haW4B:-----END_OPENSSH_PRIVATE_KEY-----:
NOTE: You can use 'tr' to create the above GOPHER_DEPLOY_KEY=...
, e.g.:
$ cat deploy_rsa | tr ' \n' '_:'
-----BEGIN_OPENSSH_PRIVATE_KEY-----:b3Bl...W4B:-----END_OPENSSH_PRIVATE_KEY-----:
One of the main goals for Gopherbot version 2 was robot portability and first-class container support. Given the new feature set, there are a couple ways I can start Clu.
Worth noting here is how Gopherbot get's it's environment. The first and most obvious is from the environment exported from the parent process, as is the case when starting in a container. Second, on startup, Gopherbot looks for .env
, overwriting the current environment.
This is the most common way I run Clu when doing development on Gopherbot. I create an empty directory (normally just called 'clu'), and drop a .env
file in it with the contents from the password manager. Then I symlink the gopherbot
binary there, and run ./gopherbot
. The bootstrap plugin does the rest.
This is how I start Clu when I'm actually working on Clu's configuration - the way a Gopherbot user would normally configure and write extensions for their robot.
- The
gb-dev-profile
script generates a customclu.env
file that includes an encoded version of my local ssh private key
$ gb-dev-profile clu/.env > clu.env
- The
gb-start-dev
script starts the gopherbot-theia container. Once the robot has started, I tell Clu!start-theia
, then connect to localhost:3000.