Repository navigation
Claude/fix GitHub actions ax7ky #1354
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
Changes from all commits
edea85b
539589c
a8645c8
4fe689d
31ca229
c6fc2bc
fc6261f
277c5e4
34dacb6
3304d5e
f358ab0
8319a74
d85039d
38b3b45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ in | |
| ./llm | ||
| ./openclaw | ||
| ./omp | ||
| ./paperclip | ||
| ./opencode | ||
| ./pi | ||
| ./serena | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$meta": { | ||
| "version": 1, | ||
| "updatedAt": "2026-04-04T00:00:00.000Z", | ||
| "source": "configure" | ||
| }, | ||
| "database": { | ||
| "mode": "__DATABASE_MODE__", | ||
| "connectionString": "__DATABASE_CONNECTION_STRING__" | ||
| }, | ||
| "logging": { | ||
| "mode": "file" | ||
| }, | ||
| "server": { | ||
| "deploymentMode": "__DEPLOYMENT_MODE__", | ||
| "exposure": "private", | ||
| "host": "__HOST__", | ||
| "port": 3100, | ||
| "allowedHostnames": [ | ||
| "__ALLOWED_HOSTNAME__" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| config, | ||
| pkgs, | ||
| inputs, | ||
| ... | ||
| }: | ||
| let | ||
| inherit (inputs) host; | ||
| homeDir = config.home.homeDirectory; | ||
| instanceDir = "${homeDir}/.paperclip/instances/default"; | ||
|
|
||
| setupScript = pkgs.replaceVars ./hydrate.sh { | ||
| instance_dir = instanceDir; | ||
| template = "${./config.template.json}"; | ||
| sed = "${pkgs.gnused}/bin/sed"; | ||
| database_mode = if host.isKyber then "postgres" else "embedded-postgres"; | ||
| database_connection_string = ""; | ||
| deployment_mode = if host.isKyber then "authenticated" else "local_trusted"; | ||
| host = if host.isKyber then "0.0.0.0" else "127.0.0.1"; | ||
| allowed_hostname = if host.isKyber then "paperclip.shunkakinoki.com" else ""; | ||
| is_kyber = if host.isKyber then "true" else "false"; | ||
|
Comment on lines
+15
to
+21
|
||
| }; | ||
| in | ||
| { | ||
| home.activation.paperclipConfig = config.lib.dag.entryAfter [ "writeBoundary" ] '' | ||
| ${pkgs.bash}/bin/bash ${setupScript} || true | ||
| ''; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| INSTANCE_DIR="@instance_dir@" | ||
| CONFIG="${INSTANCE_DIR}/config.json" | ||
| TEMPLATE="@template@" | ||
| ENV_FILE="${HOME}/dotfiles/.env" | ||
|
|
||
| # Source .env if it exists (for DATABASE_URL) | ||
| if [ -f "$ENV_FILE" ]; then | ||
| set -a | ||
| # shellcheck source=/dev/null | ||
| . "$ENV_FILE" | ||
| set +a | ||
| fi | ||
|
|
||
| mkdir -p "${INSTANCE_DIR}" | ||
|
|
||
| # Use DATABASE_URL from env if set, otherwise use the Nix default | ||
| DB_CONNECTION="${DATABASE_URL:-@database_connection_string@}" | ||
|
|
||
| @sed@ \ | ||
| -e "s|__DATABASE_MODE__|@database_mode@|g" \ | ||
| -e "s|__DATABASE_CONNECTION_STRING__|${DB_CONNECTION}|g" \ | ||
| -e "s|__DEPLOYMENT_MODE__|@deployment_mode@|g" \ | ||
| -e "s|__HOST__|@host@|g" \ | ||
| -e "s|__ALLOWED_HOSTNAME__|@allowed_hostname@|g" \ | ||
| "$TEMPLATE" >"$CONFIG" | ||
|
Comment on lines
+20
to
+28
|
||
| chmod 600 "$CONFIG" | ||
|
|
||
| # Create paperclip database on k8s postgres if needed | ||
| # @is_kyber@ is substituted by Nix replaceVars | ||
| # shellcheck disable=SC2050 | ||
| if [ "@is_kyber@" = "true" ] && [ -n "$DB_CONNECTION" ]; then | ||
| if command -v psql >/dev/null 2>&1; then | ||
| DB_BASE="${DB_CONNECTION%/*}/postgres" | ||
| if ! psql "$DB_BASE" -tAc "SELECT 1 FROM pg_database WHERE datname='paperclip'" 2>/dev/null | grep -q 1; then | ||
| psql "$DB_BASE" -c "CREATE DATABASE paperclip" 2>/dev/null && echo "Created paperclip database" >&2 | ||
| fi | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| ./bin-shells | ||
| ./cargo-globals | ||
| ./openclaw | ||
| ./paperclip | ||
| ./local-binaries | ||
| ./local-scripts | ||
| ./npm-globals | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||
| { | ||||||
| config, | ||||||
| lib, | ||||||
| inputs, | ||||||
| ... | ||||||
| }: | ||||||
| let | ||||||
| inherit (inputs) host; | ||||||
| homeDir = config.home.homeDirectory; | ||||||
| in | ||||||
| # Only enable on kyber (server host) | ||||||
| lib.mkIf host.isKyber { | ||||||
| # Ensure Paperclip directories exist with correct permissions | ||||||
| home.activation.paperclipSetup = config.lib.dag.entryAfter [ "writeBoundary" ] '' | ||||||
| mkdir -p /tmp/paperclip | ||||||
|
Contributor
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. |
||||||
| mkdir -p ${homeDir}/.paperclip | ||||||
| chmod 700 ${homeDir}/.paperclip | ||||||
|
Comment on lines
+13
to
+17
|
||||||
| ''; | ||||||
|
|
||||||
| # Systemd service for Paperclip | ||||||
| systemd.user.services.paperclip = { | ||||||
| Unit = { | ||||||
| Description = "Paperclip AI agent orchestration platform"; | ||||||
| After = [ "network-online.target" ]; | ||||||
| Wants = [ "network-online.target" ]; | ||||||
| }; | ||||||
| Service = { | ||||||
| Type = "simple"; | ||||||
| ExecStart = "${homeDir}/.bun/bin/paperclipai run --no-repair"; | ||||||
| Restart = "always"; | ||||||
| RestartSec = "5s"; | ||||||
| Environment = [ | ||||||
| "HOME=${homeDir}" | ||||||
| "HOST=0.0.0.0" | ||||||
| "PAPERCLIP_DEPLOYMENT_MODE=authenticated" | ||||||
| "PAPERCLIP_ALLOWED_HOSTNAMES=paperclip.shunkakinoki.com,172.17.0.1" | ||||||
| "PATH=${homeDir}/.local/bin:${homeDir}/.bun/bin:${homeDir}/.nix-profile/bin:${homeDir}/.local/share/pnpm:${homeDir}/.local/share/fnm/current/bin:${homeDir}/.npm-global/bin:/usr/local/bin:/usr/bin:/bin" | ||||||
| ]; | ||||||
| EnvironmentFile = [ | ||||||
| "${homeDir}/dotfiles/.env" | ||||||
| "${homeDir}/.paperclip/instances/default/.env" | ||||||
|
||||||
| "${homeDir}/.paperclip/instances/default/.env" | |
| "-${homeDir}/.paperclip/instances/default/.env" |
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.
Instead of manually creating /tmp/paperclip and hardcoding log paths there, you can use systemd's RuntimeDirectory and the %t specifier (which resolves to $XDG_RUNTIME_DIR for user services). This is cleaner, avoids permission issues in shared /tmp environments, and ensures the directory is managed by systemd.
Service = {
Type = "simple";
ExecStart = "${homeDir}/.bun/bin/paperclipai run --no-repair";
Restart = "always";
RestartSec = "5s";
Environment = [
"HOME=${homeDir}"
"HOST=0.0.0.0"
"PAPERCLIP_DEPLOYMENT_MODE=authenticated"
"PAPERCLIP_ALLOWED_HOSTNAMES=paperclip.shunkakinoki.com,172.17.0.1"
"PATH=${homeDir}/.local/bin:${homeDir}/.bun/bin:${homeDir}/.nix-profile/bin:${homeDir}/.local/share/pnpm:${homeDir}/.local/share/fnm/current/bin:${homeDir}/.npm-global/bin:/usr/local/bin:/usr/bin:/bin"
];
EnvironmentFile = [
"${homeDir}/dotfiles/.env"
"${homeDir}/.paperclip/instances/default/.env"
];
WorkingDirectory = "${homeDir}/.paperclip";
RuntimeDirectory = "paperclip";
StandardOutput = "append:%t/paperclip/paperclip.log";
StandardError = "append:%t/paperclip/paperclip.log";
};
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,7 @@ ensure_container() { | |||||||||||||||
| -p "${HOST_PORT}:${CONTAINER_PORT}" \ | ||||||||||||||||
| -e POSTGRES_DB=trails_api \ | ||||||||||||||||
| -e POSTGRES_PASSWORD=postgres \ | ||||||||||||||||
| -e POSTGRES_HOST_AUTH_METHOD=trust \ | ||||||||||||||||
|
Contributor
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. Enabling POSTGRES_HOST_AUTH_METHOD=trust is a security risk when the database port is exposed to the host (line 47). It allows any user on the system to connect to the database without a password, effectively ignoring the POSTGRES_PASSWORD requirement. It is safer to remove this line and rely on password authentication.
Comment on lines
47
to
+50
|
||||||||||||||||
| -p "${HOST_PORT}:${CONTAINER_PORT}" \ | |
| -e POSTGRES_DB=trails_api \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_HOST_AUTH_METHOD=trust \ | |
| -p "127.0.0.1:${HOST_PORT}:${CONTAINER_PORT}" \ | |
| -e POSTGRES_DB=trails_api \ | |
| -e POSTGRES_PASSWORD=postgres \ |
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.
grep -cprints0even when it exits with status 1 (no matches). With|| printf '0', that can yield a value like0\n0, which then breaks the numeric-lttest underset -e. PreferACCOUNT_COUNT=$(cswap --list 2>/dev/null | grep -c '^[[:space:]]*[0-9]' || true)and then defaultACCOUNT_COUNT=${ACCOUNT_COUNT:-0}if needed.