{"id":17801034,"url":"https://github.com/refi64/bluecap","last_synced_at":"2025-04-02T04:40:44.709Z","repository":{"id":69429084,"uuid":"147134790","full_name":"refi64/bluecap","owner":"refi64","description":" A lightweight wrapper over podman that makes it easier to have container-based workflows","archived":false,"fork":false,"pushed_at":"2019-03-06T22:47:19.000Z","size":43,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T05:06:45.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refi64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-03T01:05:20.000Z","updated_at":"2019-03-16T12:53:22.000Z","dependencies_parsed_at":"2023-09-15T22:01:51.299Z","dependency_job_id":null,"html_url":"https://github.com/refi64/bluecap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fbluecap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fbluecap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fbluecap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fbluecap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/bluecap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758278,"owners_count":20828919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T12:33:14.828Z","updated_at":"2025-04-02T04:40:44.690Z","avatar_url":"https://github.com/refi64.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bluecap\n\nA lightweight wrapper over podman that makes it easier to have container-based workflows.\nThe idea was conceived when I switched to Fedora Silverblue and realized I didn't particularly\nlike the way my development workflow was working out...\n\nThe general idea behind bluecap is to create temporary containers that are immediately\ndiscarded immediately after use. It's not quite the best code I've ever written, nor is it\nthe most powerful/general-purpose...but hey, it works!\n\n## Features\n\n- Easy to create \"capsules\", which are specifications for a container that will be created\n  and immediately destroyed after use.\n- Possible to associate a capsule with the current directory.\n- Automatically binds the current directory.\n- Handles persisting paths across container creations.\n- Allows you to \"trust\" a capsule, meaning that a root password won't be required to run it.\n\nThat being said, note that this may have security issues when trusted containers!! If you'd\nrather not risk it, don't use `bluecap trust`.\n\n## Installation\n\n### Fedora Workstation\n\n```bash\ndnf copr enable refi64/bluecap\ndnf install bluecap\n```\n\n### Fedora Silverblue\n\nYou can install `dnf` and then run:\n\n```bash\ndnf copr enable refi64/bluecap\nrpm-ostree install bluecap\n```\n\nOtherwise, you can add the repo manually:\n\n```bash\ncurl -L \"https://copr.fedorainfracloud.org/coprs/refi64/bluecap/repo/fedora-`lsb_release -rs`/refi64-bluecap-fedora-`lsb_release -rs`.repo\" | sudo tee /etc/yum.repos.d/_copr_refi64-bluecap.repo\nrpm-ostree install bluecap\n```\n\n## Building from source\n\nUse `nimble config` to configure bluecap:\n\n```\n# Default prefix (/usr), bindir (/usr/bin), datadir (/usr/share), and sysconfdir (/etc).\n$ nimble config\n# Set the prefix (this will also set bindir=/usr/local/bin and datadir=/usr/local/share)\n$ nimble config destdir=my-build-directory prefix=/usr/local\n# All the others can be set in a similar manner\n```\n\nThen, run `nimble build` and `nimble sysinstall`:\n\n```\n$ nimble build\n$ nimble sysinstall\n# Install into a different destdir:\n$ nimble sysinstall my-custom-destdir\n```\n\n## Examples\n\n**NOTE:** This is for the 0.3 alpha. For v0.2, see the README on that Git tag.\n\n```bash\n# Create a new capsule\n$ bluecap create dart google/dart\n# Link the capsule into the current directory (in .bluecap/default.json)\n$ bluecap link dart\n# \"Trust\" the container\n$ bluecap trust dart\n# Same as above (since we linked it)\n$ bluecap trust .\n# Untrust it\n$ bluecap trust -u dart\n# Set run default options (same as podman run arguments, but without --)\n$ bluecap options-modify . 'tmpfs=/my-tmp'\n# Show all options\n$ bluecap options-dump .\n# Remove an option\n$ bluecap options-modify -r dart 'net=host'\n# Persist the given directory\n$ bluecap persistence '/var/data/.pub-cache'\n# Remove it\n$ bluecap persistence -r '/var/data/.pub-cache'\n# Run it!\n$ bluecap run dart echo -e '1\\n2\\n3'\n# Export a command from inside the capsule\n$ bluecap export dart pub\n# Now we can do:\n$ export PATH=\"$PATH:/var/lib/bluecap/exports/bin\"\n$ pub -h  # Same as 'bluecap run dart pub -h'\n# Exports can be removed via a simple rm\n$ sudo rm /var/lib/bluecap/exports/bin/pub\n# Delete the capsule\n$ bluecap delete dart\n# Delete the capsule, but keep its persisted files (/var/lib/bluecap/persistence/CAPSULE-NAME)\n$ bluecap delete -k dart\n```\n\n## Upgrading from bluecap 0.2 to 0.3\n\nbluecap 0.3 with a large amount of internal changes, largely due to a rewrite in Nim, which\nresulted in drastically increased speed. However, as a side effect of this, you may have to\nmake some modifications to your capsules.\n\nHopefully, a major change like this won't come again, but it was overdue in a large number of\nways.\n\n### Moved data storage directory\n\nOriginally, persisted data was stored in `/var/lib/bluecap/persistence`. However, that has been\nmoved to `$XDG_DATA_HOME/bluecap/persistence`. To move your data as well, run:\n\n```\n$ mkdir -p ${XDG_DATA_HOME:-$HOME/.local/share}/bluecap/persistence\n$ mv /var/lib/bluecap/persistence/* ${XDG_DATA_HOME:-$HOME/.local/share}/bluecap/persistence\n$ sudo chown -R $USER:$USER ${XDG_DATA_HOME:-$HOME/.local/share}/bluecap/persistence\n```\n\n### Persistence\n\nAfter upgrading, you will probably get the following error when running your capsules:\n\n```\nError: unhandled exception: key not found: persistence [KeyError]\n```\n\nThis is due to a change in the way they are stored. To update the capsule files, run:\n\n```\nsudo sed -si '/\"image\": /a\"persistence\": [],' /var/lib/bluecap/capsules/*.json\n```\n\nIn addition:\n\n- The in-capsule home directory has been changed to `/var/data`, instead of `/home/cappy`.\n  You can change this via:\n\n  ```\n  sudo sed -si 's|/home/cappy|/var/data' /var/lib/bluecap/capsules/*.json\n  ```\n\n  If you want to preserve your old data, also run:\n\n  ```\n  sudo find /var/lib/bluecap/persistence -maxdepth 1 -mindepth 1 -exec bash -O dotglob -ec 'if [ -d $1/home/cappy ]; then mkdir -p $1/var/data; mv $1/home/cappy/* $1/var/data; fi' -- '{}' \\;\n  ```\n\n- You won't be able to remove old persistence directories via `bluecap persistence -r`, due to\n  a change in the format. Instead, manually remove the `volume=` option that was added via\n  `bluecap options-modify -r` (you can find the option via `bluecap options-dump`).\n\n### Trusted capsules\n\nUpon upgrade, all your trusted capsules will become untrusted. To fix this, run:\n\n```\nsudo mv /var/lib/bluecap/polkit-{list,trusted}.json\nsudo sed -i 's/internal-run/su-run/' /etc/polkit-1/rules.d/49-bluecap.rules\n```\n\nIf your capsules are still untrusted, you may need to restart polkit:\n\n```\nsudo systemctl restart polkit\n```\n\n## Exports\n\nYou'll need to change any references to `/home/cappy` in your exports by editing them manually\n(located in `/var/lib/bluecap/exports`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fbluecap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Fbluecap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fbluecap/lists"}