https://github.com/claceio/clace Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} claceio / clace Public * Notifications You must be signed in to change notification settings * Fork 5 * Star 227 AppServer for containerized web app development and deployment clace.io License Apache-2.0 license 227 stars 5 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Discussions * Actions * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Security * Insights claceio/clace This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 472 Commits .github/workflows .github/ workflows cmd/clace cmd/clace examples examples internal internal pkg/api pkg/api plugins plugins tests tests .gitignore .gitignore .goreleaser.yaml .goreleaser.yaml LICENSE LICENSE Makefile Makefile README.md README.md SECURITY.md SECURITY.md go.mod go.mod go.sum go.sum View all files Repository files navigation * README * Apache-2.0 license * Security Clace-logo Web App Deployment Platform Latest Release Build Status Menu * Overview * Features + Development Features + Deployment Features * Roadmap * Setup + Build from source + Initial Configuration + Start Service + Loading Apps * Documentation * Getting help * Contributing Overview Clace is an Apache-2.0 licensed project building a web app development and deployment platform for internal tools. Clace allows easy and secure hosting of multiple web apps, in any language/ framework, on a single machine. Clace is cross-platform (Linux/ Windows/OSX) and provides a GitOps workflow for managing web apps. Clace combines the functionality of a reverse proxy, a hypermedia based micro-framework and a container orchestrator (using Docker or Podman) in a single lightweight binary. After starting the Clace server and ensuring Docker or Podman is running, new apps can be installed in one command from GitHub source repo. Clace builds the image and starts the container lazily, on the first API call. Clace can be used to develop any containerized web app on a development machine and then deploy the app on a shared server. Apps are deployed directly from the git repo, no build step required. Clace can be used to deploy Streamlit apps, adding OAuth authentication for access control across a team. This repo hosts the source code for Clace server and client. The source for the documentation site clace.io is in the docs repo. App specifications, which are templates to build apps, are defined in the appspecs repo. Clace intro gif Features Clace can be used to: * Deploy containerized applications, Clace will build and manage the container lifecycle * Build Hypermedia based applications using Starlark (no containers required) * Hybrid approach, where the backend APIs are implemented in a container and a Hypermedia based UI is implemented in Clace Clace supports the following for all apps: * Atomic updates (all or none) across multiple apps * Staging mode for app updates, to verify whether code and config changes work on prod before making them live. * Preview app creation support, for trying out code changes. * Support for github integration, apps being directly deployed from github code. * OAuth and SSO based authentication * Support for domain based and path based routing at the app level. For containerized apps, Clace supports: * Managing image builds, in dev and prod mode * Passing parameters for the container * Building apps from spec, no code changes required in repo for supported frameworks (Flask, Streamlit and repos having a Containerfile) For building Hypermedia based apps, Clace supports: * Automatic error handling support * Automatic creation of ECMAScript modules using esbuild. * Support for TailwindCSS and DaisyUI watcher integration. * Automatic SSL certificate creation based on certmagic. * Backend app code runs in a security sandbox, with allowlist based permissions. * No build step, the development artifacts are ready for production use. * Support for application data persistance using SQLite * Virtual filesystem with content hash based file names backed by SQLite database, enabling aggressive static content caching. * Brotli compression for static artifacts, HTTP early hints support for performance. Roadmap The feature roadmap for Clace is: * SQLite is used for metadata storage currently. Support for postgres is planned. This will be used to allow for horizontal scaling. * Integration with secrets managers, to securely access secrets. * Support for pausing app containers which are idle Setup Install To install on OSX/Linux, run curl -L https://clace.io/install.sh | sh source $HOME/clhome/bin/clace.env clace server start & To install on Windows, run pwsh -Command "iwr https://clace.io/install.ps1 -useb | iex" Use powershell if pwsh is not available. Start a new command window (to get the updated ENV values) and run clace server start to start the service. To install apps, run clace app create --approve github.com/claceio/apps/system/disk_usage /disk_usage clace app create --approve github.com/claceio/apps/utils/bookmarks /book The disk usage app is available at https://localhost:25223/disk_usage (use port 25222 for HTTP). admin is the username, use the password printed by the install script. The bookmark manager is available at https://localhost:25223/book. Add --auth none to the app create command to disable auth. To install a containerized app, ensure either Docker or Podman is running and run clace app create --spec python-streamlit --param app_file=hello --approve - /streamlit_hello clace app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit If the source repo has a Dockerfile or Containerfile, run clace app create --spec container --approve /myapp to install the app. Build from source To install a release build, follow steps in the installation docs. To install from source: * Ensure that a recent version of Go is available, version 1.21.0 or newer * Checkout the Clace repo, cd to the checked out folder * Build the clace binary and place in desired location, like $HOME # Ensure go is in the $PATH mkdir $HOME/clace_source && cd $HOME/clace_source git clone -b main https://github.com/claceio/clace && cd clace go build -o $HOME/clace ./cmd/clace/ Initial Configuration For Source Install To use the clace service, you need an initial config file with the service password and a work directory. The below instructions assume you are using $HOME/clhome/clace.toml as the config file and $HOME/ clhome as the work directory location. * Create the clhome directory * Create the clace.toml file, and create a randomly generate password for the admin user account export CL_HOME=$HOME/clhome && mkdir $CL_HOME cd $CL_HOME mkdir config git clone -C config https://github.com/claceio/appspecs $HOME/clace password > $CL_HOME/clace.toml This will print a random password on the screen, note that down as the password to use for accessing the applications. Start Service To start the service, the CL_HOME environment variable has to point to the work directory location. export CL_HOME=$HOME/clhome $HOME/clace server start Add the exports to your shell profile file. The service logs will be going to $CL_HOME/logs. The service will be started on https://localhost:25223 by default (HTTP port 25222). Loading Apps To create an app, run the Clace client $HOME/clace app create --approve $HOME/clace_source/clace/examples/disk_usage/ /disk_usage This will create an app at /disk_usage with the example disk_usage app. The disk_usage app provides a web interface for looking at file system disk usage, allowing the user to explore the sub-folders which are consuming most disk space. To access the app, go to https://127.0.0.1:25223/disk_usage. Use admin as the username and use the password previously generated. Allow the browser to connect to the self-signed certificate page. Or connect to http://127.0.0.1:25222/disk_usage to avoid the certificate related warning. Sample App To create an app with a custom HTML page which shows a listing of files, create an directory ~/fileapp with file app.star file containing: load("exec.in", "exec") def handler(req): ret = exec.run("ls", ["-l"]) if ret.error: return {"Error": ret.error, "Lines": []} return {"Error": "", "Lines": ret.value} app = ace.app("File Listing", custom_layout=True, routes = [ace.html("/")], permissions = [ace.permission("exec.in", "run", ["ls"])] ) and file index.go.html containing: File List

File List

{{ .Data.Error }} {{ range .Data.Lines }} {{.}}
{{end}} Run clace app create --auth=none --approve ~/fileapp /files. The app is available at https://localhost:25223/files. Documentation Clace docs are at https://clace.io/docs/. For doc bugs, raise a GitHub issue in the docs repo. Getting help Please use Github Discussions for discussing Clace related topics. Please use the bug tracker only for bug reports and feature requests. Contributing PRs welcome for bug fixes. Commit messages should reference bugs. For feature enhancements, please first file a ticket with the feature label and discuss the change before working on the code changes. The Google go style guide is used for Clace. For application behavior related fixes, refer the app unit test cases. Those test run as part of regular unit tests go test ./.... For API related changes, Clace uses the commander-cli library for automated CLI tests. To run the CLI test, run CL_HOME=. tests/run_cli_tests.sh from the clace home directory. Thanks for all contributions! [6874747073] About AppServer for containerized web app development and deployment clace.io Topics docker golang containers application-server self-hosted webapp appserver devops-tools starlark htmx Resources Readme License Apache-2.0 license Security policy Security policy Activity Custom properties Stars 227 stars Watchers 3 watching Forks 5 forks Report repository Releases 20 Release v0.7.3 Latest Sep 11, 2024 + 19 releases Contributors 2 * @akclace akclace Ajay Kidave * @dependabot[bot] dependabot[bot] Languages * Go 97.6% * JavaScript 1.2% * Shell 0.6% * HTML 0.4% * Makefile 0.1% * Starlark 0.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.