{"id":13639060,"url":"https://github.com/ashelkovnykov/urbit-hosting","last_synced_at":"2025-04-19T21:35:31.063Z","repository":{"id":141931702,"uuid":"463757973","full_name":"ashelkovnykov/urbit-hosting","owner":"ashelkovnykov","description":"Files to set up VPS to host websites \u0026 Urbit planets","archived":false,"fork":false,"pushed_at":"2023-09-27T07:08:29.000Z","size":18,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T01:13:46.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/ashelkovnykov.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}},"created_at":"2022-02-26T05:00:24.000Z","updated_at":"2024-03-13T08:09:19.000Z","dependencies_parsed_at":"2024-03-14T04:51:56.495Z","dependency_job_id":null,"html_url":"https://github.com/ashelkovnykov/urbit-hosting","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/ashelkovnykov%2Furbit-hosting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashelkovnykov%2Furbit-hosting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashelkovnykov%2Furbit-hosting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashelkovnykov%2Furbit-hosting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashelkovnykov","download_url":"https://codeload.github.com/ashelkovnykov/urbit-hosting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223810254,"owners_count":17206722,"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-08-02T01:00:57.219Z","updated_at":"2024-11-09T09:30:33.732Z","avatar_url":"https://github.com/ashelkovnykov.png","language":"Shell","funding_links":[],"categories":["Operations"],"sub_categories":["SAIL"],"readme":"# Urbit Hosting\n\nThis repo contains configurable files which can used to set up a server (local or VPS) to host one or more websites and\nUrbit ships at the same time using Docker, Caddy, and MinIO.\n\nNote that it assumes you already have:\n- Access to a local server or VPS\n  - The server is assumed to be some common variant of Linux, e.g. Ubuntu 18.04\n- Access to a user account with `sudo` privileges\n- SSH set up on the server\n- One or more domain names that you will use to access the server remotely\n\n## Directory Layout\n\n```\n|- star-cmd: Raw VPS setup files\n   |- sites: Root directory for websites\n   |  |-  my-website: Dummy website folder; should be replaced by one or more\n   |                  folders, each of which is root for a website\n   |- Caddyfile: Caddy setup file; see Caddy documentation\n   |    https://caddyserver.com/docs/caddyfile\n   |- compose.yml: docker-compose setup file; see docker-compose documentation\n   |    https://docs.docker.com/compose/compose-file/compose-file-v3/#service-configuration-reference\n   |- launch.sh: Bash script for non-system user with sudo privileges to launch\n   |             Docker containers\n   |- start.sh: Docker containers startup script \n   |- stop.sh: Docker containers teardown script\n   |- thwart.sh: Bash script for non-system user with sudo privileges to stop\n   |             Docker containers\n   |- vps-setup: Bash script to setup the VPS environment (install dependencies,\n                 enable firewall, etc.)\n```\n\n## Setup\n\n1. Clone this repo to the server\n2. Fill out the required fields in the files:\n    1. `Caddyfile`\n       1. Fill in the fields with your custom domain(s)\n       2. You may need to add more fields (using the same pattern) if you're\n          hosting multiple ships or websites.\n    2. `vps-setup.sh`\n        1. line `17`\n        2. line `20`\n        3. You may need/want to modify the default values on lines `22` - `31`.\n           If you modify line `22`, you'll also need to modify the `launch.sh`\n           and `thwart.sh` scripts to match the new system user.\n        4. Note the comments on lines `18` and `23` if you plan to host\n           multiple ships\n    3. `compose.yml`\n       1. line `35`\n       2. line `60`\n       3. line `83`\n       4. If you're hosting more than one ship, you'll need to note the comments\n          on lines `38` - `55`. You will also need to clone lines `83` - `84`\n          for each additional ship.\n3. If you're not using MinIO, you can delete `minio_bucket_policy.json`, all of\n   the MinIO info in `Caddyfile`, and lines `20` - `34`, line `58`, and line\n   `67`.\n4. Run `vps-setup.sh` as root\n5. (Optional) Move the `launch.sh` and `thwart.sh` scripts somewhere in your\n   regular user account. They can be used as a shorthand for spinning your web\n   server up/down.\n\n### DNS\n\nAdd wildcard subdomain `A` rules that point to the server IP for each of the\nmappings in your `Caddyfile`. For example, if your `Caddyfile` looks like this\nafter setup:\n```\nwww.urbit.io {\n  redir https://urbit.io permanent\n}\n\nurbit.io {\n  root * /var/www/my-website\n  file_server\n}\n\nzod.urbit.io {\n  reverse_proxy web-zod-1:80\n}\n\nconsole.minio.urbit.io {\n  reverse_proxy web-minio-1:9001\n}\n\nminio.urbit.io images.minio.urbit.io {\n  reverse_proxy web-minio-1:9000\n}\n```\nthen in your domain provider settings, you will need to set the following `A`\nrecords for `urbit.io` (which you must own):\n- `www`\n- `@`\n- `zod`\n- `console.minio`\n- `minio`\n- `images.minio`\n\n## Acknowledgements\n\nThank you to [`~datder-sonnet`](https://github.com/tomholford) for base files,\nworking examples, and tech support!\n\nThank you to [`~sitful-hatred`](https://github.com/yapishu) for the\n[initial article](https://subject.network/posts/caddyserver-urbit-tls/)\nthat inspired all of this work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashelkovnykov%2Furbit-hosting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashelkovnykov%2Furbit-hosting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashelkovnykov%2Furbit-hosting/lists"}