| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contains a FireJail security profile for running OpenCode in a sandboxed environment, providing additional security isolation.
Copy the opencode.profile file to your FireJail configuration directory:
# Create the firejail config directory if it doesn't exist
mkdir -p ~/.config/firejail
# Copy the profile
cp opencode.profile ~/.config/firejail/opencode.profileYou need to create an alias in your shell startup script to use the FireJail profile with OpenCode. The setup depends on your shell:
Add this line to your ~/.zshrc file:
# Add FireJail alias for OpenCode
echo 'alias opencode="firejail --profile=opencode --whitelist=/path/to/your/workspace opencode"' >> ~/.zshrc
# Reload your shell configuration
source ~/.zshrcAdd this line to your ~/.bashrc file:
# Add FireJail alias for OpenCode
echo 'alias opencode="firejail --profile=opencode --whitelist=/path/to/your/workspace opencode"' >> ~/.bashrc
# Reload your shell configuration
source ~/.bashrcAdd this line to your ~/.config/fish/config.fish file:
# Add FireJail alias for OpenCode
echo 'alias opencode="firejail --profile=opencode --whitelist=/path/to/your/workspace opencode"' >> ~/.config/fish/config.fish
# Reload your shell configuration
source ~/.config/fish/config.fishImportant: Replace /path/to/your/workspace in the alias with the actual path where your code projects are stored. For example:
# Example for a typical workspace in home directory
alias opencode="firejail --profile=opencode --whitelist=$HOME/workspace opencode"
# Example for multiple workspace directories
alias opencode="firejail --profile=opencode --whitelist=$HOME/projects --whitelist=$HOME/workspace opencode"To verify the setup is working correctly:
You can verify FireJail is active by checking the process:
ps aux | grep firejailThis FireJail profile provides:
You can modify the opencode.profile to:
If you encounter issues:
For more advanced configuration, refer to the FireJail documentation.
| Back | FazBrowse Home | New Git URL |