{"id":22502610,"url":"https://github.com/jleung51/service_proxy","last_synced_at":"2026-04-30T06:36:49.271Z","repository":{"id":94897601,"uuid":"69145856","full_name":"jleung51/service_proxy","owner":"jleung51","description":"NodeJS proxy server to route HTTP webhooks from Heroku to Travis CI.","archived":false,"fork":false,"pushed_at":"2019-03-03T02:33:40.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T01:11:20.030Z","etag":null,"topics":["heroku","javascript","node","nodejs","server","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jleung51.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-25T05:34:30.000Z","updated_at":"2019-03-03T02:33:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"c60053f3-cd50-433c-90cf-853c4307db16","html_url":"https://github.com/jleung51/service_proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleung51%2Fservice_proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleung51%2Fservice_proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleung51%2Fservice_proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleung51%2Fservice_proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jleung51","download_url":"https://codeload.github.com/jleung51/service_proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245937974,"owners_count":20696989,"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":["heroku","javascript","node","nodejs","server","travis-ci"],"created_at":"2024-12-06T23:19:59.981Z","updated_at":"2026-04-30T06:36:48.678Z","avatar_url":"https://github.com/jleung51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Service Proxy\n\nNodeJS proxy server to route HTTP webhooks from Heroku to Travis CI.\n\nWhen a specific endpoint on this service proxy receives a request (in our use case, from a Heroku post-deployment hook), another HTTP request will be sent with a hidden authentication token (known only to the user(s) deploying this proxy server) to trigger a Travis CI build. Essentially, this creates a post-deployment hook from a Heroku app to a Travis CI build with a secret authentication token.\n\n## Setup\n\nFirst, make sure you have a Heroku app deployed and a repository set up and ready to build with Travis CI.\n\nInstall both NodeJS and NPM.\n\n### Travis CI Access Token\n\nInstall the Travis CI command line interface with [these instructions](https://github.com/travis-ci/travis.rb#installation).\n\nRetrieve your Travis CI access token by running the following commands:\n```\ntravis login --org\ntravis token --org\n```\n\n(If you are using a private Travis CI repository, use `--pro` rather than `--org`.)\n\nKeep this token; you will need it for setup.\n\n### Repository\n\nClone the repository and navigate into the directory:\n```\ngit clone https://github.com/jleung51/service_proxy\ncd service-proxy/\n```\n\nRun the environment setup script:\n```\n./setup.sh\n```\n\nNavigate into the new directory `env-setup/`. This directory is ignored by Git, so you can modify its files however you like and add sensitive access tokens.\n\n### Deploying the Server Locally\n\nSeveral environment variables will need to be set before the server can be run.\n\nIn the directory `env-setup/`, there will be a file named `vars.sh`. Edit this file and set the following values:\n\n* `PROXY_MAPPING`: The URL mapping at which the proxy's HTTP endpoint is located (e.g. `/server/trigger`); this should begin with a slash (`/`)\n* `REPO_OWNER`: The user/organization of the GitHub repository which will be built by Travis CI\n* `REPO_NAME`: The name of the GitHub repository which will be built by Travis CI\n* `TOKEN`: The Travis CI access token obtained from a previous step (see **Travis CI Access Token**)\n\nExport the environment variables you just set in `vars.sh`:\n```\nsource ./vars.sh\n```\n\nCheck that the environment variables were modified correctly:\n```\n./printvars.sh\n```\n\nInstall the necessary NPM packages:\n```\nnpm install\n```\n\nStart the server locally:\n```\nnpm start\n```\n\nIf setup was successful, you should see the message `Service Proxy is currently running on http://localhost:8080.`\n\n### Deploying the Server on Heroku\n\nInstall the Heroku command line interface with [these instructions](https://devcenter.heroku.com/articles/heroku-command-line).\n\nLogin to Heroku:\n```\nheroku login\n```\n\n#### Service Proxy Configuration\n\nCreate a Heroku application for the service proxy with whatever name you like:\n```\nheroku apps:create SERVICE_PROXY_APP_NAME_HERE\n```\n\nUse that app name as the value `PROXY_HEROKU_APP` in `vars.sh` and refresh the environment variables:\n```\nsource ./vars.sh\n./printvars.sh\n```\n\nDeploy the service proxy:\n```\ngit push heroku master\n```\n\nSet the local environment variables as the Heroku application's environment variables:\n```\n./heroku-deployment.sh\n```\n\n#### Post-Deploy Hook (Heroku Dashboard)\n\nIf you prefer to manually set up the post-deploy hook through the command line, skip to the next section.\n\nGo to the [Heroku Dashboard](https://dashboard.heroku.com/) and choose the Heroku app which should send a post-deploy notification to the service proxy. Select the *Resources* tab, go down to *Add-ons*, type *Deploy Hooks* in the search bar, and select *HTTP Post Hook*. Click on the new deploy hook to go to the alternate dashboard.\n\nUsing this dashboard, you can set the URL to `http://SERVICE_PROXY_APP_NAME.herokuapp.com/SERVICE_PROXY_MAPPING`, which should be the values you set in `vars.sh`.\n\n#### Post-Deploy Hook (Manual)\n\nIf you prefer to manually set up the post-deploy hook through the Heroku GUI, return to the previous section.\n\nNavigate into the repository of the Heroku application which should send a post-deploy notification to the service proxy. Create a post-deploy hook:\n```\nheroku addons:create deployhooks:http url=http://SERVICE_PROXY_APP_NAME.herokuapp.com/SERVICE_PROXY_MAPPING\n```\n\nWhere `SERVICE_PROXY_APP_NAME` and `SERVICE_PROXY_MAPPING` should be the values you set in `vars.sh`.\n\n#### Heroku Management\n\nOnce you have reached this step, the complete system should be fully up and running.\n\nThere are scripts in the `heroku-management/` directory for general Heroku application management.\n\nBefore using them, you must have the environment variables `PROXY_HEROKU_APP` and `PROXY_MAPPING` set in `env-setup/vars.sh`, and have run `source ./env-setup/vars.sh`.\n\n| Script | Description |\n| --- | --- |\n| `heroku-endpoint.sh` | Triggers the proxy to send the request to Travis CI |\n| `heroku-logs.sh` | Views the application logs on Heroku |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleung51%2Fservice_proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjleung51%2Fservice_proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleung51%2Fservice_proxy/lists"}