{"id":13563810,"url":"https://github.com/reddec/trusted-cgi","last_synced_at":"2025-04-09T05:12:02.947Z","repository":{"id":42716162,"uuid":"266716561","full_name":"reddec/trusted-cgi","owner":"reddec","description":"Lightweight runner for lambda functions/apps in CGI like mode","archived":false,"fork":false,"pushed_at":"2024-09-27T06:33:30.000Z","size":447,"stargazers_count":237,"open_issues_count":11,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T09:26:59.121Z","etag":null,"topics":["cgi","lambda","self-hosted","serverless"],"latest_commit_sha":null,"homepage":"https://trusted-cgi.reddec.net","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reddec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["http://reddec.net/about/#donate"]}},"created_at":"2020-05-25T07:46:37.000Z","updated_at":"2025-03-26T02:14:07.000Z","dependencies_parsed_at":"2023-12-27T09:26:20.530Z","dependency_job_id":"41a17e1b-f65d-4926-9db0-d5c9c0f26bc5","html_url":"https://github.com/reddec/trusted-cgi","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ftrusted-cgi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ftrusted-cgi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ftrusted-cgi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ftrusted-cgi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/trusted-cgi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980844,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgi","lambda","self-hosted","serverless"],"created_at":"2024-08-01T13:01:23.517Z","updated_at":"2025-04-09T05:12:02.924Z","avatar_url":"https://github.com/reddec.png","language":"Go","funding_links":["http://reddec.net/about/#donate"],"categories":["Go","Software"],"sub_categories":["Software Development - FaaS \u0026 Serverless","PaaS"],"readme":"# Trusted-CGI\n\n[![license](https://img.shields.io/github/license/reddec/trusted-cgi.svg)](https://github.com/reddec/trusted-cgi)\n[![](https://godoc.org/github.com/reddec/trusted-cgi?status.svg)](http://godoc.org/github.com/reddec/trusted-cgi/application)\n[![donate](https://img.shields.io/badge/help_by️-donate❤-ff69b4)](http://reddec.net/about/#donate)\n\nLightweight self-hosted lambda/applications/cgi/serverless-functions engine. \n\n[see docs](https://trusted-cgi.reddec.net)\n\nFeatures:\n\n* No specific requirements: just one binary. Working \"as-is\"\n* One-click new lambda with public link and handler. Available immediately.\n* Rich API\n* Security: user switch, IP restrictions, Origin restrictions, tokens ....\n* Time limits\n* Permanent links (aliases)\n* Actions - independent instruction that could be run via UI/API on server\n* Scheduler: run actions in cron-tab like style\n* Queues and retries\n* ... etc - [see docs](https://trusted-cgi.reddec.net) \n\n\nP.S\n\nThere is minimal version of trusted-cgi: [nano-run](https://github.com/reddec/nano-run). Check it out - it DevOps friendly with configuration-first approach (ie easier to use for infrastructure-as-a-code).\n\n# Installation\n\nSince `0.3.3` Linux, Darwin and even Windows OS supported: pre-built binaries could be found in [releases](https://github.com/reddec/trusted-cgi/releases)\n\nTL;DR;\n\n* for production for debian servers - use `apt.reddec.dev` (see docs)\n* locally or non-debian server - [download binary](https://github.com/reddec/trusted-cgi/releases) and run\n* for quick tests or for limited production - use docker image (`docker run --rm -p 3434:3434 reddec/trusted-cgi`)\n\nSee [installation manual](https://trusted-cgi.reddec.net/administrating/installation/)\n\n# Overview \n\nThe process flow is quite straightforward: one light daemon in background listens for requests and launches scripts/apps\non demand. An executable shall read standard input (stdin) for request data and write a response to standard output (stdout).\n\nTechnically any script/application that can parse STDIN and write something to STDOUT should be capable of the execution.\n\nTrusted-cgi designed keeping in mind that input and output data is quite small and contains structured data (json/xml),\nhowever, there are no restrictions on the platform itself.\n\nKey differences with classic CGI:\n\n* Only request body is being piped to scripts input (CGI pipes everything, and application has to parse it by itself - it could be very not trivial and slow (it depends))\n* Request headers, form fields, and query params are pre-parsed by the platform and can be passed as an environment variable (see mapping)\n* Response headers are pre-defined in manifest\n\nDue to changes, it's possible to make the simplest script with JSON input and output like this:\n\n```python\nimport sys\nimport json\n\nrequest = json.load(sys.stdin) # read and parse request\nresponse = ['hello', 'world']  # do some logic and make response\njson.dump(response, sys.stdout)  # send it to client\n```  \n\nKeep in mind, the platform also adds a growing number of new features - see features.\n\n**target audience**\n\nIt's best (but not limited) for\n\n* for hobby projects\n* for experiments\n* for projects with a low number of requests: webhooks, scheduled processing, etc..\n* for a project working on low-end machines: raspberry pi, cheapest VPS, etc..\n\nHowever, if your projects have overgrown the platform limitations, it should be quite easy to migrate to any other solutions, because\nmost low-level details are hidden and could be replaced in a few days (basically - just wrap script to HTTP service)  \n\nAlso, it is possible to scale the platform performance by just launching the same instances of the platform\nwith a shared file system (or docker images) with a balancer in front of it.\n\n\n# Contributing\n\nThe platform is quite simple Golang project with Vue + Quasar frontend \nand should be easy for newcomers. Caveats and tips for backend check [here](https://trusted-cgi.reddec.net/development)\n\nFor UI check [sub-repo](https://github.com/reddec/trusted-cgi-ui)\n\nAny PR (docs, code, styles, features, ...) will be very helpful!\n\nPlease note, that Linux (including WSL2) or Darwin is mainly used for developing, therefore most helper scripts\ndesigned for those OS.\n\nRequirements:\n- go 1.21 (actual version check in `go.mod`)\n- python3\n- pandoc\n- docker\n\n\nFor [multiplatform build](https://docs.docker.com/build/building/multi-platform/) you may need bintools:\n\n    docker run --privileged --rm tonistiigi/binfmt --install all","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Ftrusted-cgi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Ftrusted-cgi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Ftrusted-cgi/lists"}