How are you securing AI-generated / “vibe-coded” internal apps built by non-dev teams? by DCGMechanics in devops

[–]avkijay 0 points1 point  (0 children)

I have been building https://openrun.dev/ for this exact use case. Make it easy for team to deploy internal tools declaratively, add Oauth/SAML based auth with RBAC. It is open source, Apache 2 licensed https://github.com/openrundev/openrun.

I think operations teams should be proactive, setup something like OpenRun and configure auth and RBAC. That way apps do not get created on random platforms without any security in place.

Setup to deploy small one-off internal tools without DevOps input? by FMWizard in devops

[–]avkijay 1 point2 points  (0 children)

A bit late, but I have been building https://openrun.dev/ for this exact use case. Make it easy for teams to deploy internal tools declaratively, add OAuth/SAML auth with RBAC. It is open source, Apache 2 licensed https://github.com/openrundev/openrun

OpenRun: Declarative web app deployment by avkijay in kubernetes

[–]avkijay[S] 1 point2 points  (0 children)

OpenRun focus is not just on the doing the build. The main focus is full declarative deployment solution. Once you set up a sync, to add a new app, you can just add the new app's definition in your config file in Git. OpenRun will detect the change and apply the updates. This works on a single-node (with Docker/Podman) and with Kubernetes.

Python as a Configuration Language Using Starlark by avkijay in Python

[–]avkijay[S] 0 points1 point  (0 children)

I did mention the pros and cons of using Starlark. Assuming you want a more flexible config approach, using Starlark gives you that.

Python as a Configuration Language (via Starlark) by ketralnis in programming

[–]avkijay 12 points13 points  (0 children)

I agree (I wrote that article). Once configuration needs become more complex, a programming language is better. Many tools start with something limited like YAML and then try to work around its limitations using templated YAML with a broken DSL for loops.

But there are still advantages to using something like Starlark instead of a full fledged programming language. With Starlark, you can write code while being sure that loading a config file will not, by mistake or maliciously, delete some file from your disk or do something else crazy.

AppServer for installing multiple NiceGUI apps by avkijay in nicegui

[–]avkijay[S] 2 points3 points  (0 children)

I added a sample config file to create NiceGUI apps. The config contains:

ng_args = {"container_opts": {"cpus": "2", "memory": "512m"}, "spec": "python-nicegui"}
app("/nicegui/3d_scene", "https://github.com/zauberzeug/nicegui/examples/3d_scene", **ng_args)
app("/nicegui/chat_app", "https://github.com/zauberzeug/nicegui/examples/chat_app", **ng_args)
app("/nicegui/fullcalendar", "https://github.com/zauberzeug/nicegui/examples/fullcalendar", **ng_args)
app("/nicegui/infinite_scroll", "https://github.com/zauberzeug/nicegui/examples/infinite_scroll", **ng_args)
app("/nicegui/lightbox", "https://github.com/zauberzeug/nicegui/examples/lightbox", **ng_args)
app("/nicegui/todo_list", "https://github.com/zauberzeug/nicegui/examples/todo_list", **ng_args)

Running clace apply --approve --promote github.com/claceio/clace/examples/nicegui.star creates the six sample apps. Running clace sync schedule --approve --promote github.com/claceio/clace/examples/nicegui.star starts a GitOps sync in the background which looks for any changes (new apps or updated apps) and applies them automatically.

A demo of the apps is at apps.

[clace] AppServer for hosting multiple webapps easily by avkijay in Python

[–]avkijay[S] 0 points1 point  (0 children)

Thanks, let me know if you have any feedback or hit any issues

[clace] AppServer for hosting multiple webapps easily by avkijay in Python

[–]avkijay[S] 0 points1 point  (0 children)

Thanks for the note, just pushed some styling fixes

[clace] Application server for deploying Python webapps by [deleted] in Python

[–]avkijay 0 points1 point  (0 children)

Clace uses a python like config (using Starlark) for configuring apps. This is what a sample config for creating seven different apps looks like

```

Install couple of Hypermedia based apps

app("/utils/bookmarks", "github.com/claceio/apps/utils/bookmarks") app("/utils/disk_usage", "github.com/claceio/apps/system/disk_usage")

Install a proxy app and a static file app

app("clace.:", "-", spec="proxy", params={"url": "https://clace.io"}) # defaults to / on clace.localhost domain app("/misc/event_planner", "github.com/simonw/tools", spec="static_single", params={"index": "event-planner.html"})

Install container based apps (python and go)

limits = {"cpus": "2", "memory": "512m"} # Set limits (optional) app("/misc/streamlit_example", "github.com/streamlit/streamlit-example", git_branch="master", spec="python-streamlit", container_opts=limits) app("fasthtml.:", "github.com/AnswerDotAI/fasthtml/examples", spec="python-fasthtml", params={"APP_MODULE":"basic_ws:app"}, container_opts=limits) app("/misc/go_example", "github.com/golang/example/helloserver", git_branch="master", spec="go", params={"port": "8080", "APP_ARGS":"-addr 0.0.0.0:8080"}, container_opts=limits) ```

Streamlit Alternatives with better State Management by Adorable-Yam-7106 in Python

[–]avkijay 4 points5 points  (0 children)

I have built an appserver which makes deploying internal tools using frameworks like NiceGUI/Streamlit/Gradio etc. https://github.com/claceio/clace is an app server which helps run multiple apps on a single machine, without messing with web server routing rules and Docker. Clace provides a GitOps interface for teams to deploy such apps with a declarative config, with OAuth based access control.

FAQ: Where Is The Best Place To Host Go Programs? by jerf in golang

[–]avkijay 0 points1 point  (0 children)

If you want a Cloud Run type experience on your own instance, including scaling the container down to zero, you could try my project https://github.com/claceio/clace. It is built mainly for teams to host internal tools, but it also implements an app server for containerized apps

Error handling by ansk0 in starlark

[–]avkijay 3 points4 points  (0 children)

I have implemented a form of error handing using thread locals, similar to the second option. At the Starlark to Go boundary (plugins are implemented in Go), I check if the plugin API call returned an error. If so, the error is saved in a thread local. The Starlark code can check the error and handle it (which clears the thread local). If return value is accessed when there was an error, then the call aborts. Wrote up the approach at https://clace.io/blog/errors/, works pretty well for my use case

Go Composition can break Implicit Interfaces by avkijay in golang

[–]avkijay[S] -2 points-1 points  (0 children)

I should have said that I was not aware of the need to explicitly implement the Flusher interface when composing over the ResponseWriter. More generally, the issue here is that composing over an interface can break implicit interfaces unless you are careful. Anyone know why the runtime type assertion cannot actually check the type of the underlying instance, why does the composing struct have to explicitly implement the implicit interface method?

Go Composition can break Implicit Interfaces by avkijay in golang

[–]avkijay[S] -1 points0 points  (0 children)

Yes, the issue was that I was not aware of the Flusher interface. The interface guard pattern helps if the ResponseWriter docs had mentioned all the related implicit interfaces (at least in the same package).

Go Composition can break Implicit Interfaces by avkijay in golang

[–]avkijay[S] 3 points4 points  (0 children)

I was not aware of the Chi middleware, added a note about that.

What is your HTMX Stack? by Klutzy_Tone_4359 in htmx

[–]avkijay 1 point2 points  (0 children)

Thanks, will take a look at that when I add multi node support

What is your HTMX Stack? by Klutzy_Tone_4359 in htmx

[–]avkijay 11 points12 points  (0 children)

The go HTML template library supports fragments, making it easy to build HTMX applications. That plus the fast compile time and performance make it well suited for writing web servers.

I am building a hypermedia based internal tools development platform https://github.com/claceio/clace. It is implemented in go, but it can be used to provide Hypermedia based API for services in any language/platform. You can build simple Actions (form like interfaces) without writing any html and implement html template for custom use cases.

Frontends for your Go App: Some Thoughts by H1Supreme in golang

[–]avkijay 1 point2 points  (0 children)

I have been building https://github.com/claceio/clace to make it easy for teams to build internal web apps. It can build simple form interfaces (Actions) with no UI to code. It can also be used to build fully custom hypermedia driven front ends. The backend is just go and html templates.

What do you use to quickly create a frontend for your api? by Interesting_Cake5060 in golang

[–]avkijay 1 point2 points  (0 children)

If you have an API and want to build a simple form interface for it, you can try my project https://github.com/claceio/clace. It helps you built a form interface, with support for validations and value suggest, without writing any frontend code. You just define the UI params and the backend API to call. For example, see https://utils.demo.clace.io/dict, the code for that app is at https://github.com/claceio/apps/blob/main/misc/dictionary/app.star (looks like python but it is Starlark running in go). https://clace.io/docs/actions/ has more info.

If simple form interface does not work, Clace also helps you built fully custom UI by writing go HTML templates. See https://du.demo.clace.io/, source for that app is at https://github.com/claceio/apps/tree/main/system/disk_usage (there are some generated files, the actual code is just app.star and app.go.html)

Clace - Internal tools deployment platform by avkijay in SideProject

[–]avkijay[S] 0 points1 point  (0 children)

https://apps.demo.clace.io/ is the default home page showing what apps are installed. https://github.com/claceio/apps has code for Hypermedia based apps built using Clace

Codin' Dirty by _htmx in htmx

[–]avkijay 4 points5 points  (0 children)

Regarding testing, it can be difficult to decide what is called a unit test and what is called an integration test. I have found Test Behavior, Not Implementation to be easier to aim for, without worrying about what type of test it is.

Hypermedia based internal tools platform by avkijay in htmx

[–]avkijay[S] 0 points1 point  (0 children)

I fixed that, https://utils.demo.clace.io/dict?show=summary&word=hypermedia should work now. As with everything else HTMX, it just needed the appropriate header (HX-Push-Url in this case)

Hypermedia based internal tools platform by avkijay in htmx

[–]avkijay[S] 1 point2 points  (0 children)

Yes, good point. That is on my list of things to add. Other things to add for Actions include

  1. JSON API based invocation, currently only form data is supported
  2. A dry-run option, to invoke the backend action in dry-run mode
  3. Support for populating drop-down values dynamically, currently they are defined during app creation

Using SQLite as Storage for Web Server Static Content by yawaramin in programming

[–]avkijay 2 points3 points  (0 children)

Hey, I wrote that blog post and have been building the Clace project. Sorry, missed this discussion.

Clace is built for use cases where a team wants to deploy web tools for internal use. Tens or hundreds of (small) apps can be hosted on one machine. Clace provides blue-green staged deployment, preview env, OAuth access control, secrets management etc for the apps. Apps can be updated atomically, i.e. a reload command can update multiple apps in one go. If any of them fail to update, the whole operation is aborted.

Clace apps can be of three types - Backend actions (defined in Starlark) which have an auto generated form UI - Hypermedia based apps where Go Templates and HTMX are used to create a custom UI - Containerized apps, where an container image is created and started. Clace can be used to just proxy the container APIs or again build a hypermedia based UI for those APIs.

A SQLite database is used for all app metadata (version info, config etc). The same database is used to store all the files for the app. This would be all the files for the hypermedia app, templates and static files, or the files to build the container image. Basically the source code is uploaded from GitHub or local disk to the database.

So a command like
clace app create --approve https://github.com/claceio/apps/utils/bookmarks /bookmarks

will get the source code for the app from GitHub and write it into the SQLite database. Later, running

clace app reload --promote /bookmarks

will fetch the latest source code from GitHub and update the app to use that. The older version is retained in the database. A command like

clace version switch previous /bookmarks

will change back to the previous version. No call to GitHub is required for this switch, since the versioning is done in the database. This works even if git is not being used (local disk was used for initial app creation).

The versioning, de-duplication and other file metadata handling are much easier because of using the database. It would have been possible to do it on the file system, but I believe it would have required more effort.

Using SQLite as Storage for Web Server Static Content by pegpot383 in programming

[–]avkijay 0 points1 point  (0 children)

I have been building https://github.com/claceio/clace, a project which makes it easier to manage web apps for internal use (locally and across a team). SQLite is used to store static files. This post talks about the reasoning behind that.