Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ COPY --from=build /rails /rails

# Install Claude Code (native binary)
RUN curl -fsSL https://claude.ai/install.sh | bash && \
mv /root/.local/bin/claude /usr/local/bin/claude
mv /root/.local/bin/claude /usr/local/bin/claude && \
chmod 755 /usr/local/bin/claude

# Run and own only the runtime files as a non-root user for security
RUN groupadd --system --gid 1000 rails && \
Expand Down
1 change: 1 addition & 0 deletions app/jobs/agent_evaluate_commitment_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def api_context

def agent_env(commitment_id: nil, entry_id: nil)
{
"PATH" => ENV["PATH"],
"CLAUDE_CODE_OAUTH_TOKEN" => ENV["CLAUDE_CODE_OAUTH_TOKEN"],
"RAILS_API_URL" => ENV.fetch("RAILS_API_URL", "http://localhost:3000"),
"RAILS_API_KEY" => Rails.application.credentials.dig(:agent, :api_key) || ENV["AGENT_API_KEY"],
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
config.current_user_method = :current_user
config.authenticate_with do
warden.authenticate! scope: :user
unless current_user&.admin?
redirect_to main_app.root_path, alert: "Not authorized."
end
end

## == Authorization ==
Expand Down
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Rails.application.routes.draw do
authenticate :user, lambda { |u| u.admin? } do
mount GoodJob::Engine => "/admin/good_job"
end

authenticate :user do
mount Avo::Engine => "/admin"
end

Expand Down
Loading