Skip to content

Update workflow to embed app assets#1039

Merged
jlewi merged 12 commits intomainfrom
dev/jlewi/image
Feb 12, 2026
Merged

Update workflow to embed app assets#1039
jlewi merged 12 commits intomainfrom
dev/jlewi/image

Conversation

@jlewi
Copy link
Contributor

@jlewi jlewi commented Feb 10, 2026

  • Support downloading the static assets from the published OCI image since thats how runmedev/web is publishing them

  • We want to be able to support serving additional YAML/JSON files from the server e.g.
    https://acme.dev/configs/app-configs.yaml

  • This YAML can contain application configuration that the webapp fetches and configures itself with

    • e.g. it can contain the OIDC and Google Drive configuration.
  • Then in the web app we can just do

     app.setConfig("http://localhost:9966/configs/app-configs.yaml")
    
  • Allow CORS to be partially set on static assets. During development we might still serve app-configs from the server even though the frontend is running on a different development server.

@jlewi jlewi marked this pull request as ready for review February 10, 2026 16:29
@jlewi jlewi marked this pull request as draft February 10, 2026 21:02
jlewi added 11 commits February 10, 2026 19:52
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
…sets. Fix oauth for OpenAI.

Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
@jlewi jlewi marked this pull request as ready for review February 11, 2026 03:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds functionality to download static web app assets from an OCI image and embed them into the Go binary, while enhancing CORS support for serving these assets and additional configuration files.

Changes:

  • Implements OCI image downloader to fetch and extract web app assets from published images
  • Refactors CORS handling into a reusable wrapper function and extends it to static asset serving
  • Adds OpenAI Organization and Project configuration fields to support OAuth-based authentication flows

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
pkg/agent/assets/downloader.go New package implementing OCI image pull and tar.gz extraction for static assets
pkg/agent/cmd/download_assets.go New CLI command to download assets from OCI images
pkg/agent/cmd/agent.go Registers the new download-assets command
pkg/agent/server/cors.go Extracts CORS configuration into reusable wrapWithCORS function
pkg/agent/server/auth.go Refactored to use the new wrapWithCORS helper, removing duplicate code
pkg/agent/server/assets.go Adds CORS support for static assets with wildcard origin filtering
pkg/agent/config/config.go Adds Organization and Project fields for OpenAI OAuth configuration
pkg/agent/cmd/serve.go Passes OpenAI org/project config to the agent
pkg/agent/ai/client.go Allows creating OpenAI client without API key for OAuth flows
pkg/agent/ai/agent.go Enhanced logging of agent initialization parameters
.github/workflows/runme-image.yml Adds workflow_dispatch trigger and downloads assets during build
go.mod/go.sum Adds oras.land/oras-go/v2 dependency for OCI operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sourishkrout
Copy link
Contributor

Add DCOs, please, @jlewi. The LF/CNCF requires it.

@jlewi
Copy link
Contributor Author

jlewi commented Feb 12, 2026

@sourishkrout FYI looks like github copilot doesn't signoff correctly when you accept its suggestions.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jeremy Lewi <jeremy+github@lewi.us>
Commit sha: [db7f144](https://github.com/runmedev/runme/pull/1039/commits/db7f14467e91a10bbc66221be4fbc64480ac1a87), Author: Jeremy Lewi, Committer: GitHub; Expected "Jeremy Lewi [jeremy@lewi.us](mailto:jeremy@lewi.us)", but got "Jeremy Lewi [jeremy+github@lewi.us](mailto:jeremy+github@lewi.us)".

Signed-off-by: Jeremy lewi <jeremy@lewi.us>

Update pkg/agent/assets/downloader.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>

Address AI reviewer comments

Signed-off-by: Jeremy lewi <jeremy@lewi.us>
)

//go:embed dist/index.*
// TODO(jlewi): I think we should get rid of embedded assets. Now that we publish and download assets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to remove it in this PR, @jlewi. It's unused.

@jlewi jlewi merged commit cb2eceb into main Feb 12, 2026
8 checks passed
@jlewi jlewi deleted the dev/jlewi/image branch February 12, 2026 14:56
sourishkrout pushed a commit that referenced this pull request Feb 20, 2026
* Support downloading the static assets from the published OCI image
since thats how runmedev/web is publishing them
* We want to be able to support serving additional YAML/JSON files from
the server e.g.
  https://acme.dev/configs/app-configs.yaml
* This YAML can contain application configuration that the webapp
fetches and configures itself with
   * e.g. it can contain the OIDC and Google Drive configuration.
  
* Then in the web app we can just do 

   ```
    app.setConfig("http://localhost:9966/configs/app-configs.yaml")
   ```

* Allow CORS to be partially set on static assets. During development we
might still serve app-configs from the server even though the frontend
is running on a different development server.

---------

Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants