{"id":16369550,"url":"https://github.com/chomosuke/chomosuke.com","last_synced_at":"2026-03-03T16:30:16.650Z","repository":{"id":65537518,"uuid":"529552367","full_name":"chomosuke/chomosuke.com","owner":"chomosuke","description":"a reverse proxy using nginx and certbot to do automatic certificate management","archived":false,"fork":false,"pushed_at":"2023-08-07T06:52:41.000Z","size":678,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T07:17:45.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chomosuke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-08-27T10:27:15.000Z","updated_at":"2023-02-09T09:04:09.000Z","dependencies_parsed_at":"2024-11-08T08:54:10.841Z","dependency_job_id":"1384bc5d-60fc-4c3e-8cde-d6947b92346b","html_url":"https://github.com/chomosuke/chomosuke.com","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/chomosuke%2Fchomosuke.com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chomosuke%2Fchomosuke.com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chomosuke%2Fchomosuke.com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chomosuke%2Fchomosuke.com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chomosuke","download_url":"https://codeload.github.com/chomosuke/chomosuke.com/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239885330,"owners_count":19713283,"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-11T02:55:37.361Z","updated_at":"2026-03-03T16:30:16.582Z","avatar_url":"https://github.com/chomosuke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chomosuke.com\nMy personal website that also host all my personal project under *.chomosuke.com subdomains.\n\nA single EC2 t4g.nano instance make up the ECS cluster that hosts all chomosuke.com and its subdomains.\n\nThis repository contains the definition for the container that is the reverse proxy for the whole cluster.\n\n## How it works\nOn git push, a [CircleCI pipeline](./.circleci/config.yml) runs that build the Dockerfile, push it to AWS ECR public repository `m4l5t7p6/chomosuke-com`, update task definition of `chomosuke-com` family with the new image, and update ECS service `chomosuke-com` with the new task-definition.\n\nFor this to work on a new AWS account, the following needs to exist:\n- ECR repository.\n- ECS cluster.\n- An IAM user with appropriate permissions.\n- Environment variables in CircleCI:\n\t- AWS_ACCESS_KEY_ID\n\t- AWS_SECRET_ACCESS_KEY\n\t- AWS_ECR_REGISTRY_ID\n\t- AWS_REGION\n\n## How to add a repo to a subdomain\n- Copy [templates/nginx.conf](./templates/nginx.conf) into [nginx_conf.d](./nginx_conf.d) and rename it with an appropriate name.\n\t- Replace `\u003cSUBDOMAIN\u003e` with the desirable subdomain.\n\t\t- Optionally, add the subdomain to the [notfound page](./pages/notfound/src/App.tsx) `validSubdomains`.\n\t- Replace `\u003cPORT\u003e` with a port that isn't used by any other subdomain in [nginx_conf.d](./nginx_conf.d).\n- Add an AWS access key for an IAM user with the appropriate permission on CircleCI as project environment variables.\n- Create a new repository in the AWS ECR registry `m4l5t7p6`\n\t- The convention is to have the repo name same as `\u003cSUBDOMAIN\u003e`.\n\t- It's recommended to set Content types.\n\t- Add the permission to push to this repository to the IAM user mentioned before.\n- Copy [templates/config.yml](./templates/config.yml) into `.circleci` directory of the project.\n\t- Replace `\u003cCONTAINER_NAME\u003e` with a suitable name. The convention is to make it the same as `\u003cSUBDOMAIN\u003e`.\n\t- Replace `\u003cREPO\u003e` with the repository name created earlier.\n- Comment out the second jobs at the bottom and run it on CircleCI. This should push the docker image to the previously created ECR repository.\n- Create task definition with the newly pushed image.\n\t- [templates/task-definition.json](./templates/task-definition.json) can be used as a starting point.\n\t- Make sure that container name and family name match the `\u003cCONTAINER_NAME\u003e` chosen earlier\n\t- Make sure that `\"portMappings\"` map to the previously chosen `\u003cPORT\u003e`.\n\t- Make sure that `\"image\"` is the URI of the newly pushed image.\n\t- Make sure all `\"environment\"` and `\"secrets\"` that the container need is filled out.\n\t\t- To add a secret. Go to AWS secret manager to add the secret and then create a role with the permission to get the secret and set that as the `\"executionRoleArn\"`. Remember to add pass role permission to the IAM user mentioned above later.\n- Deploy the task definition to `chomosuke-com` cluster.\n\t- Set launch type to `EC2`.\n\t- Make sure application type is `Service`.\n\t- Set Service name to be the same as `\u003cCONTAINER_NAME\u003e`.\n\t- Set Service type to `Daemon`.\n- Modify IAM user mentioned above with permission to deploy to the new service and pass any role that might be needed by the service.\n- Uncomment the second part, commit and push the changes.\n\nNote that all image share `chomosuke-com` public repository. Make sure no secret are in the image\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchomosuke%2Fchomosuke.com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchomosuke%2Fchomosuke.com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchomosuke%2Fchomosuke.com/lists"}