{"id":13540929,"url":"https://github.com/beakerbrowser/hashbase","last_synced_at":"2025-04-02T08:30:54.231Z","repository":{"id":21693139,"uuid":"93671760","full_name":"beakerbrowser/hashbase","owner":"beakerbrowser","description":"A Dat-hosting service for multiple users","archived":true,"fork":false,"pushed_at":"2022-04-07T17:12:29.000Z","size":2829,"stargazers_count":239,"open_issues_count":44,"forks_count":38,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-03T06:32:59.997Z","etag":null,"topics":["beaker","dat"],"latest_commit_sha":null,"homepage":"https://hashbase.io","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/beakerbrowser.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-07T19:26:44.000Z","updated_at":"2024-07-30T10:39:20.000Z","dependencies_parsed_at":"2022-08-07T10:01:06.649Z","dependency_job_id":null,"html_url":"https://github.com/beakerbrowser/hashbase","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/beakerbrowser%2Fhashbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerbrowser%2Fhashbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerbrowser%2Fhashbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerbrowser%2Fhashbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beakerbrowser","download_url":"https://codeload.github.com/beakerbrowser/hashbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781884,"owners_count":20832925,"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":["beaker","dat"],"created_at":"2024-08-01T10:00:36.202Z","updated_at":"2025-04-02T08:30:52.933Z","avatar_url":"https://github.com/beakerbrowser.png","language":"JavaScript","readme":"# Hashbase\n\nHashbase is a public peer service for [Dat](https://datproject.org) archives. It provides a HTTP-accessible interface for creating an account and uploading Dats. It was created to power a content-community for the [Beaker Browser](https://beakerbrowser.com)\n\nLinks:\n\n - **[Hashbase.io](https://hashbase.io)**\n - **[Documentation](./docs)**\n\n## Setup\n\nOn some platforms, you will need to have the following dependencies installed:\n```\nmake\ng++\npython\nautoconf\nlibtool\n```\n\nClone this repository, then run\n\n```\nnpm install\ncp config.defaults.yml config.development.yml\n```\n\nModify `config.development.yml` to fit your needs, then start the server with `npm start`.\n\n## Configuration\n\nBefore deploying the service, you absolutely *must* modify the following config.\n\n#### Basics\n\n```yaml\ndir: ./.hashbase              # where to store the data\nbrandname: Hashbase           # the title of your service\nhostname: hashbase.local      # the hostname of your service\nproxy: true                   # is there a reverse proxy (eg nginx) in front of the server?\nport: 8080                    # the port to run the service on\nrateLimiting: true            # rate limit the HTTP requests?\ncsrf: true                    # use csrf tokens?\ndefaultDiskUsageLimit: 100mb  # default maximum disk usage for each user\ndefaultNamedArchivesLimit: 25 # how many names can a user take?\nbandwidthLimit:\n  up: 1mb                     # maximum bytes/s upload speed\n  down: 1mb                   # maximum bytes/s download speed\n```\n\n#### Lets Encrypt\n\nYou can enable lets-encrypt to automatically provision TLS certs using this config:\n\n```yaml\nletsencrypt:\n  debug: false          # debug mode? must be set to 'false' to use live config\n  agreeTos: true\n  email: 'foo@bar.com'  # email to register domains under\n```\n\nIf enabled, `port` will be ignored and the server will register at ports 80 and 443.\n\n#### Admin Account\n\nThe admin user has its credentials set by the config yaml at load. If you change the password while the server is running, then restart the server, the password will be reset to whatever is in the config.\n\n```yaml\nadmin:\n  email: 'foo@bar.com'\n  password: myverysecretpassword\n```\n\n#### HTTP Sites\n\nHashbase can host the archives as HTTP sites. This has the added benefit of enabling [dat-dns shortnames](https://npm.im/dat-dns) for the archives.\n\n```yaml\nsites: per-archive\n```\n\nThis will host archives at `archivename.hostname`. By default, HTTP Sites are disabled.\n\n#### Closed Registration\n\nFor a private instance, use closed registration with a whitelist of allowed emails:\n\n```yaml\nregistration:\n  open: false\n  allowed:\n    - alice@mail.com\n    - bob@mail.com\n```\n\n#### Reserved Usernames\n\nUse reserved usernames to blacklist usernames which collide with frontend routes, or which might be used maliciously.\n\n```yaml\nregistration:\n  reservedNames:\n    - admin\n    - root\n    - support\n    - noreply\n    - users\n    - archives\n```\n\n#### Monitoring\n\n```yaml\npm2: false         # set to true if you're using https://keymetrics.io/\nalerts:\n  diskUsage: 10gb  # when to trigger an alert on disk usage\n```\n\n#### Session Tokens\n\nHashbase uses Json Web Tokens to manage sessions. You absolutely *must* replace the `secret` with a random string before deployment.\n\n```yaml\nsessions:\n  algorithm: HS256                # probably dont update this\n  secret: THIS MUST BE REPLACED!  # put something random here\n  expiresIn: 1h                   # how long do sessions live?\n```\n\n#### Jobs\n\nHashbase runs some jobs periodically. You can configure how frequently they run.\n\n```yaml\n# processing jobs\njobs:\n  popularArchivesIndex: 30s  # compute the index of archives sorted by num peers\n  userDiskUsage: 5m          # compute how much disk space each user is using\n  deleteDeadArchives: 5m     # delete removed archives from disk\n```\n\n#### Cache sizes (advanced)\n\nYou can tweak hashbase's memory usage to trade speed against memory usage.\n\n```yaml\n# cache settings\ncache:\n  metadataStorage: 65536   # number of memory slots\n  contentStorage: 65536    # number of memory slots\n  tree: 65536              # number of memory slots\n```\n\n#### Emailer\n\nHashbase relies on [NodeMailer](https://nodemailer.com/about/) to send out mails _(for example: required to verify a new user)_. The `email` property of the configuration will be passed _as-is_ to NodeMailer.\n\nIn the [default configuration](./config.defaults.yml#L46-L49) we use the [`stub`](https://www.npmjs.com/package/nodemailer-stub) transport which [offers a code API for tests](https://github.com/LimeDeck/nodemailer-stub/blob/8f03f86828de75ee2ccc32b98c8bc3d78e6abb00/lib/stubTransport.js#L44-L46).\n\n```yaml\n# email settings\nemail:\n  transport: stub\n  sender: '\"Hashbase\" \u003cnoreply@hashbase.local\u003e'\n```\n\n`hashbase` has a dependency on the [`ses`](https://www.npmjs.com/package/nodemailer-ses-transport) and [`smtp`](https://www.npmjs.com/package/nodemailer-smtp-transport) transport, which means you can use those out-of-the-box. For other transports you need to install those first.\n\n## Tests\n\nRun the tests with\n\n```\nnpm test\n```\n\nTo run the tests against a running server, specify the env var:\n\n```\nREMOTE_URL=http://{hostname}/ npm test\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript","Using Dat","others"],"sub_categories":["Hosting \u0026 Dat Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeakerbrowser%2Fhashbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeakerbrowser%2Fhashbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeakerbrowser%2Fhashbase/lists"}