Repository navigation
New Script: agentgateway LXC #2464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andy-vdg
wants to merge
5
commits into
community-scripts:main
Choose a base branch
from
andy-vdg:agentgateway
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d66e570
agentgateway: add ct/agentgateway.sh
andy-vdg 10ef9ff
agentgateway: add install/agentgateway-install.sh
andy-vdg 0afaf91
agentgateway: add json/agentgateway.json
andy-vdg be2b6f7
agentgateway: restore and restart the previous binary if the update d…
andy-vdg 434624d
agentgateway: keep the previous binary until the new version is runni…
andy-vdg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env bash | ||
| _CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" | ||
| _cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" | ||
| source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: andy-vdg | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://agentgateway.dev/ | ||
|
|
||
| APP="agentgateway" | ||
| var_tags="${var_tags:-ai;proxy;mcp}" | ||
| var_cpu="${var_cpu:-1}" | ||
| var_ram="${var_ram:-512}" | ||
| var_disk="${var_disk:-2}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| var_arm64="${var_arm64:-yes}" | ||
| var_unprivileged="${var_unprivileged:-1}" | ||
|
|
||
| header_info "$APP" | ||
| variables | ||
| color | ||
| catch_errors | ||
|
|
||
| function update_script() { | ||
| header_info | ||
| check_container_storage | ||
| check_container_resources | ||
|
|
||
| if [[ ! -f /opt/agentgateway/agentgateway ]]; then | ||
| msg_error "No agentgateway Installation Found!" | ||
| exit | ||
| fi | ||
|
|
||
| if check_for_gh_release "agentgateway" "agentgateway/agentgateway"; then | ||
| cp -a /opt/agentgateway/agentgateway /opt/agentgateway/agentgateway.bak | ||
| cp -a ~/.agentgateway ~/.agentgateway.bak | ||
|
|
||
| msg_info "Stopping Service" | ||
| systemctl stop agentgateway | ||
| msg_ok "Stopped Service" | ||
|
|
||
| # Any failure from here on, including a new version that will not start, puts the | ||
| # previous binary back and restarts it. | ||
| if fetch_and_deploy_gh_release "agentgateway" "agentgateway/agentgateway" "singlefile" "latest" "/opt/agentgateway" "agentgateway-linux-$(arch_resolve "amd64" "arm64")" && | ||
| AGW_SUM=$(curl -fsSL "https://github.com/agentgateway/agentgateway/releases/download/v$(cat ~/.agentgateway)/agentgateway-linux-$(arch_resolve "amd64" "arm64").sha256" | awk '{print $1}') && | ||
| [[ -n "$AGW_SUM" && "$AGW_SUM" == "$(sha256sum /opt/agentgateway/agentgateway | awk '{print $1}')" ]] && | ||
| chmod +x /opt/agentgateway/agentgateway && | ||
| systemctl start agentgateway && sleep 5 && systemctl is-active -q agentgateway; then | ||
| rm -f /opt/agentgateway/agentgateway.bak ~/.agentgateway.bak | ||
| msg_ok "Started agentgateway $(cat ~/.agentgateway)" | ||
| else | ||
| systemctl stop agentgateway 2>/dev/null | ||
| mv /opt/agentgateway/agentgateway.bak /opt/agentgateway/agentgateway | ||
| mv ~/.agentgateway.bak ~/.agentgateway | ||
| systemctl start agentgateway | ||
| msg_error "agentgateway update failed (download, checksum or start); the previous version was restored and restarted" | ||
| exit 1 | ||
| fi | ||
| msg_ok "Updated successfully!" | ||
| fi | ||
|
Comment on lines
+44
to
+62
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove comments and the if check |
||
| exit | ||
| } | ||
|
|
||
| start | ||
| build_container | ||
| description | ||
|
|
||
| msg_ok "Completed Successfully!\n" | ||
| echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" | ||
| echo -e "${INFO}${YW}Access it using the following URL:${CL}" | ||
| echo -e "${GATEWAY}${BGN}http://${IP}:4000/ui${CL}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: andy-vdg | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://agentgateway.dev/ | ||
|
|
||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
| color | ||
| verb_ip6 | ||
| catch_errors | ||
| setting_up_container | ||
| network_check | ||
| update_os | ||
|
|
||
| fetch_and_deploy_gh_release "agentgateway" "agentgateway/agentgateway" "singlefile" "latest" "/opt/agentgateway" "agentgateway-linux-$(arch_resolve "amd64" "arm64")" | ||
|
|
||
| msg_info "Verifying agentgateway Checksum" | ||
| AGW_SUM=$(curl -fsSL "https://github.com/agentgateway/agentgateway/releases/download/v$(cat ~/.agentgateway)/agentgateway-linux-$(arch_resolve "amd64" "arm64").sha256" | awk '{print $1}') | ||
| if [[ -z "$AGW_SUM" || "$AGW_SUM" != "$(sha256sum /opt/agentgateway/agentgateway | awk '{print $1}')" ]]; then | ||
| msg_error "agentgateway checksum does not match the release" | ||
| exit 1 | ||
| fi | ||
| chmod +x /opt/agentgateway/agentgateway | ||
| msg_ok "Verified agentgateway Checksum" | ||
|
|
||
| msg_info "Configuring agentgateway" | ||
| mkdir -p /etc/agentgateway /opt/agentgateway_data | ||
| cat <<EOF >/etc/agentgateway/config.yaml | ||
| # yaml-language-server: \$schema=https://agentgateway.dev/schema/config | ||
| # The config agentgateway bootstraps on first run: traffic and the UI on port 4000, | ||
| # state in SQLite. The UI has no login until you add policies: | ||
| # https://agentgateway.dev/docs/standalone/latest/documentation/setup/ui/secure-ui/ | ||
| config: | ||
| database: | ||
| url: sqlite:///opt/agentgateway_data/data.db | ||
| gateways: | ||
| default: | ||
| port: 4000 | ||
| ui: | ||
| gateways: default | ||
| EOF | ||
| chmod 600 /etc/agentgateway/config.yaml | ||
| msg_ok "Configured agentgateway" | ||
|
|
||
| msg_info "Creating Service" | ||
| cat <<EOF >/etc/systemd/system/agentgateway.service | ||
| [Unit] | ||
| Description=agentgateway | ||
| After=network-online.target | ||
| Wants=network-online.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=root | ||
| ExecStart=/opt/agentgateway/agentgateway -f /etc/agentgateway/config.yaml | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
| systemctl enable -q --now agentgateway | ||
| msg_ok "Created Service" | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "name": "agentgateway", | ||
| "slug": "agentgateway", | ||
| "categories": [ | ||
| 20, | ||
| 21 | ||
| ], | ||
| "date_created": "2026-10-23", | ||
| "type": "ct", | ||
| "updateable": true, | ||
| "privileged": false, | ||
| "interface_port": 4000, | ||
| "documentation": "https://agentgateway.dev/docs/", | ||
| "website": "https://agentgateway.dev/", | ||
| "repository": "https://github.com/agentgateway/agentgateway", | ||
| "architectures": [ | ||
| "amd64", | ||
| "arm64" | ||
| ], | ||
| "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/agentgateway.webp", | ||
| "description": "agentgateway is an open-source proxy for AI agents, from the Linux Foundation. It sits in front of MCP servers, LLM providers and HTTP APIs, and adds authentication, authorization, rate limits and observability, so agents can reach tools without holding the upstream credentials.", | ||
| "install_methods": [ | ||
| { | ||
| "type": "default", | ||
| "script": "ct/agentgateway.sh", | ||
| "config_path": "/etc/agentgateway/config.yaml", | ||
| "resources": { | ||
| "cpu": 1, | ||
| "ram": 512, | ||
| "hdd": 2, | ||
| "os": "Debian", | ||
| "version": "13" | ||
| } | ||
| } | ||
| ], | ||
| "default_credentials": { | ||
| "username": null, | ||
| "password": null | ||
| }, | ||
| "notes": [ | ||
| { | ||
| "text": "Open http://<IP>:4000/ui and the Welcome to Agentgateway wizard guides the first setup.", | ||
| "type": "info" | ||
| }, | ||
| { | ||
| "text": "The UI and gateway on port 4000 have no login until you add policies (ui.policies: basicAuth, OIDC, JWT). See https://agentgateway.dev/docs/standalone/latest/documentation/setup/ui/secure-ui/", | ||
| "type": "warning" | ||
| }, | ||
| { | ||
| "text": "Config: /etc/agentgateway/config.yaml, data: /opt/agentgateway_data. The admin interface stays on 127.0.0.1:15000, as upstream ships it.", | ||
| "type": "info" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a backup and restore function. can you use that like other scripts do?