{"id":22180196,"url":"https://github.com/block-core/ariton-server","last_synced_at":"2025-07-16T06:38:10.082Z","repository":{"id":262440400,"uuid":"887148399","full_name":"block-core/ariton-server","owner":"block-core","description":"Repo for a future managed server that hosts DWNs and other features for Ariton users","archived":false,"fork":false,"pushed_at":"2024-11-12T14:05:35.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-30T09:15:39.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/block-core.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":"2024-11-12T08:51:53.000Z","updated_at":"2024-11-12T14:05:39.000Z","dependencies_parsed_at":"2024-11-12T13:23:58.279Z","dependency_job_id":"3ff5da7f-3d04-4f7e-9282-71bea2785c95","html_url":"https://github.com/block-core/ariton-server","commit_stats":null,"previous_names":["block-core/ariton-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/block-core/ariton-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fariton-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fariton-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fariton-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fariton-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block-core","download_url":"https://codeload.github.com/block-core/ariton-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fariton-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264090912,"owners_count":23555997,"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-12-02T09:17:24.817Z","updated_at":"2025-07-16T06:38:10.042Z","avatar_url":"https://github.com/block-core.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ariton-server\nRepo for a future managed server that hosts DWNs and other features for Ariton users\n\n\n## nginx\n\nThe DWN Server software will add certain HTTP headers to the response, including the Allow-Origin. Hence this should not be\nadded by nginx.\n\nExample nxing site config:\n\n```nginx\n    location / {\n        proxy_pass http://localhost:3000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\n        # Add CORS headers\n        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';\n        add_header 'Access-Control-Allow-Headers' 'dwn-request, Origin, X-Requested-With, Content-Type, Accept, Authorization';\n\n        # Handle preflight requests\n        if ($request_method = 'OPTIONS') {\n            add_header 'Access-Control-Allow-Origin' '*';\n            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';\n            add_header 'Access-Control-Allow-Headers' 'dwn-request, Origin, X-Requested-With, Content-Type, Accept, Authorization';\n            add_header 'Access-Control-Max-Age' 1728000;\n            add_header 'Content-Type' 'text/plain charset=UTF-8';\n            add_header 'Content-Length' 0;\n            return 204;\n        }\n    }\n```\n\n## Running from source\n\nThe best option is to run from source:\n\n```sh\ngit clone REPO\n\nnpm install\n\nnpm run server\n```\n\n## Hosting DWN\n\nRunning a DWN Server is a simple process. You can run the server on your local machine or on a remote server.\n\n```sh\nnpm init\n\nnpm install @web5/dwn-server\n```\n\nCreate a file called `server.js` and add the following code:\n\n```js\nimport { DwnServer } from '@web5/dwn-server';\n\nconst server = new DwnServer();\n\nserver.start();\n```\n\nIf you get an error during npm install, like an error installing `better-sqlite3`, you can fix this by:\n\n# Install build dependencies\n```sh\nsudo apt-get update\nsudo apt-get install -y python3 build-essential gcc make\n```\n# Clear npm cache\n```sh\nnpm cache clean --force\n```\n\n# Retry installation\n```sh\nnpm install better-sqlite3 --build-from-source\n```\n\nThen run again:\n\n```sh\nnpm install @web5/dwn-server\n```\n\nIf you're still getting errors, try installing additional dependencies:\n```sh\nsudo apt-get install -y python3-pip python3-dev\n```\n\nThe issue might also be related to the Node version, then perform the following steps:\n\n# Switch to Node.js LTS (18.x)\n```sh\nnvm install 18\nnvm use 18\n```\n\n# Install build dependencies\n```sh\nsudo apt-get update\nsudo apt-get install -y python3 build-essential gcc g++ make\n```\n\n# Clear previous build artifacts and cache\n```sh\nrm -rf node_modules\nrm package-lock.json\nnpm cache clean --force\n```\n\n# Reinstall packages\n```sh\nnpm install @web/dwn-server\n```\n\n\n## Linux Service\n\n### Create daemon file\n\n```sh\ntouch /etc/system/system/ariton-dwn.service\n\nnano /etc/system/system/ariton-dwn.service\n```\n\n```\n[Unit]\nDescription=Ariton DWN Daemon\nAfter=network.target\nWants=network-online.target\n\n[Service]\nAfter=network-online.target\nWants=network-online.target\nExecStart=/bin/bash -c 'source /root/.nvm/nvm.sh \u0026\u0026 nvm install 18.20.4 \u0026\u0026 nvm use 18.20.4 \u0026\u0026 export PATH=$PATH \u0026\u0026 npm run host'\nEnvironment=PATH=/usr/bin\nEnvironment=NODE_ENV=production\nWorkingDirectory=/root/dwn-server\nUser=root\nTimeoutSec=120\nRestartSec=30\n\n[Install]\nWantedBy=multi-user.target\n```\n\n```sh\nsudo systemctl daemon-reload\n\nsudo systemctl enable ariton-dwn.service\n\nsudo systemctl restart ariton-dwn.service\n\n# See logs\nsudo journalctl -u ariton-dwn.service -xe\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fariton-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock-core%2Fariton-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fariton-server/lists"}