{"id":16032719,"url":"https://github.com/threez/appway","last_synced_at":"2025-04-01T13:16:22.252Z","repository":{"id":7956183,"uuid":"9352574","full_name":"threez/appway","owner":"threez","description":"The procfile server.","archived":false,"fork":false,"pushed_at":"2013-05-17T17:39:50.000Z","size":246,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-07T08:12:33.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Stamplay/stamplay-realitme-collaborative-todo","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-10T18:10:27.000Z","updated_at":"2014-01-22T15:57:31.000Z","dependencies_parsed_at":"2022-07-12T15:03:14.232Z","dependency_job_id":null,"html_url":"https://github.com/threez/appway","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fappway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fappway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fappway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fappway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threez","download_url":"https://codeload.github.com/threez/appway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644097,"owners_count":20810687,"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":[],"created_at":"2024-10-08T21:40:26.470Z","updated_at":"2025-04-01T13:16:22.205Z","avatar_url":"https://github.com/threez.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appway (DRAFT / WORK IN PROGRESS)\n\nThe procfile server. [![Travis-CI Build Status](https://secure.travis-ci.org/threez/appway.png)](https://secure.travis-ci.org/threez/appway)\n\n\nThe proserver is inspired by heroku a deployment mechanism and is designed for rubynas but may also work for others.\n\nThe main design goal is to have a simple deployment mechanism for multiple procfile based applications. Because the procfile allows applications based on ruby, nodejs, python.\n\nSpecial with this server is, that it has a build in reverse-proxy and therefore has no need for something like nginx or apache. The procfile server runs as `root` and listens on port `80`.\n\nBecause the **appway** will host multiple applications on the same host it supports different types of virtual application/webserver proxying:\n\n1. **Host** based: Like `example.appserver.local`\n2. **X-App** based: Like `X-App: example`. This is an alternative to make requests using AJAX to multiple applications on the same host without changing the host really.\n3. **Request Path** based: Like `appserver.local/example`\n4. **Port based** based: Like `appserver.local:8001`. Actually this is not a proxy request, it is connecting to the application directly.\n\n## Deployment\n\nThe deployment of the procfile server usually happens as a debian package or something similar. Which than uses git repositories to deploy services.\n\n## Configuration\n\nThe main requirement for the deployed application is a `Procfile`. The `Procfile` works as the main application manifest, but not all information can be gatherd by it, the rest will be passed when the application is installed. The second requirement is a git repository where the application code can be fetched.\n\nExample Procfile:\n\n    web: puma -p $PORT\n\nThe rest of the application is configured by the application environment.\n\n### Procfile\n\nThe `Procfile` ist standard an works as described in foreman. Special is the treatment of environemnt variabes, which get overwritten in some parts:\n\n1. The default process environment is used\n2. The .env file is applyed\n3. The application server based config options are set (db config etc.)\n4. Process specific variables like port numbers are applyed\n\n## API\n\nThe profile-server has a restful api to install new applications and so stuff with them.\n\n### Add new application\n\n    POST /applications\n\nContent:\n\n    {\n      \"name\": \"example\",\n      \"repo\": {\n        \"url\": \"git://github.com/threez/appway-example.git\",\n        \"branch\": \"master\"\n      },\n      \"packages\": {\n        \"apt-get\": [\n          \"build-essential\",\n          \"nodejs\",\n          \"npm\"\n        ]\n      },\n      \"user\": \"www-data\",\n      \"group\": \"www-data\",\n      \"domain\": [\n        \"^example.*\",\n        \"^example.local$\"\n      ],\n      \"install\": [\n        \"npm install\"\n      ],\n      \"scale\": {\n        \"web\": 2\n      }\n    }\n\nParts of the request:\n\n* **name**: The name with that the application will be referenced later\n* **repo**: The location of the git repository\n  * **url**: The path to a git repository\n  * **branch** (optional): The branch to checkout (default master)\n* **packages**: Required packages (e.g. on ubuntu debian) that need to be installed before\n* **user**: The user under which the application should be started\n* **group**: The group under which the application should be started\n* **domain**: A list of regular expressions that declare, under which requests the application should respond.\n* **install** (optional): A list of commands that should be executed to prepare the application start.\n* **scale** (optional): A list of profile processes and there scaling factor.\n\nThis request will:\n\n1. Install the required pakages using `apt-get`on ubuntu\n2. Clone the git repository (git pull/clone) and start the application\n3. Execute the install commands\n4. Run (execute procfile)\n\nLimitation: The application has no write access to the file system in the checkout folder.\n\nFor the application server itself there is a configuration directory that includes all applications that should be deployed: The the directory is by default `/etc/appway/config`.\n\n#### Default application\n\nThere is a special application name `default`. If the name of an application is\n`default` the X-App header doesn't need to be passed to get to the application. This is true if no X-App header is passed or the X-App header references an application that doesn't exist. \n\n### View logs\n\n    GET /applications/exmaple/logs/\u003clogname\u003e\n    \nThe logname can be either:\n\n1. `stdout`: Normal application output informational level\n2. `stderr`: Errors and exceptions reported by the application\n3. `install`: A recording of the actions happening during the installation. This includes stderr and stdout of the output of all commands executed.\n  \n### Start/Stop/Restart/Redeploy\n\n    POST /applications/example/\u003caction\u003e\n    \nThe action can either be:\n\n1. `start`\n2. `restart`\n3. `stop`\n4. `redeploy`: A redeploy will do stop the service update the code and run the install step. Finally it starts the application.\n    \n### Undeploy the application\n\n    DELETE /applications/example\n\n### List all installed applications\n\n    GET /applications\n\nResult:\n\n    [\n      { name: \"example\" }\n    ]\n\n### Inspect application configuration\n\n    GET /applications/example\n\nThis will return the configuration of the application.\n\n### Update the configuration of a service\n\n    PUT /applications/example\n\nThis request accepts the same input as the *Add new application* request. After changing the config, all installation steps, like with the creation of a new service take place.\n\n## Dependencies:\n\n* [http://expressjs.com/](http://expressjs.com/) for the api requests\n* [https://github.com/substack/bouncy](https://github.com/substack/bouncy) for proxying\n* [https://github.com/visionmedia/send](https://github.com/visionmedia/send) for static content hosting\n\n## Acknowledgements\n\nSome of the code is inspired by [norman](https://github.com/josh/norman/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fappway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreez%2Fappway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fappway/lists"}