├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── dmca └── dmca.go ├── main.go ├── package.json └── versions ├── current └── history /.gitignore: -------------------------------------------------------------------------------- 1 | auth.token 2 | node_modules 3 | dmca/notices/ 4 | dmca/bindata.go 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Protocol Labs, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | local="http://localhost:8080/ipfs/" 2 | gway="https://ipfs.io/ipfs/" 3 | domain="refs.ipfs.io" 4 | record="@" 5 | 6 | publish: 7 | rm -rf dmca/notices 8 | git clone https://github.com/ipfs/refs-denylists-dmca.git dmca/notices 9 | go-bindata -pkg dmca -o dmca/bindata.go -ignore '^dmca/notices/\.git' dmca/notices/... 10 | 11 | go run main.go -current=$(shell cat versions/current) | tail -n1 >versions/current 12 | cat versions/current >>versions/history 13 | @export hash=`cat versions/current`; \ 14 | echo ""; \ 15 | echo "new version:"; \ 16 | echo "- $(local)$$hash"; \ 17 | echo "- $(gway)$$hash"; \ 18 | echo ""; \ 19 | echo "next:"; \ 20 | echo "- pin $$hash"; \ 21 | echo "- make dnslink"; 22 | 23 | # Only run after publish, or there won't be a path to set. 24 | dnslink: node_modules 25 | DIGITAL_OCEAN=$(shell cat $(HOME)/.protocol/digitalocean.key) node_modules/.bin/dnslink-deploy \ 26 | --domain=$(domain) --record=$(record) --path=/ipfs/$(shell cat versions/current) 27 | 28 | node_modules: package.json 29 | npm install 30 | touch node_modules 31 | 32 | .PHONY: build dnslink 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This repository has been archived! 2 | *This IPFS-related repository has been archived, and all issues are therefore frozen.* If you want to ask a question or open/continue a discussion related to this repo, please visit the [official IPFS forums](https://discuss.ipfs.io). 3 | 4 | We archive repos for one or more of the following reasons: 5 | - Code or content is unmaintained, and therefore might be broken 6 | - Content is outdated, and therefore may mislead readers 7 | - Code or content evolved into something else and/or has lived on in a different place 8 | - The repository or project is not active in general 9 | 10 | Please note that in order to keep the primary IPFS GitHub org tidy, most archived repos are moved into the [ipfs-inactive](https://github.com/ipfs-inactive) org. 11 | 12 | If you feel this repo should **not** be archived (or portions of it should be moved to a non-archived repo), please [reach out](https://ipfs.io/help) and let us know. Archiving can always be reversed if needed. 13 | 14 | # refs 15 | 16 | > DMCA notices, and tools for publishing them 17 | 18 | [](http://ipn.io) 19 | [](http://ipfs.io/) 20 | [](http://webchat.freenode.net/?channels=%23ipfs) 21 | [](https://github.com/RichardLitt/standard-readme) 22 | 23 | Tool for building and publishing the DAG at https://ipfs.io/refs 24 | 25 | Renders a DAG from various data sources: 26 | 27 | - DMCA notices served for the gateway at ipfs.io -- https://github.com/ipfs/refs-denylists-dmca 28 | - TODO: Content archived on our storage hosts -- https://github.com/ipfs/refs-solarnet-storage 29 | 30 | ## Table of Contents 31 | 32 | - [Install](#install) 33 | - [Usage](#usage) 34 | - [Contribute](#contribute) 35 | - [License](#license) 36 | 37 | ## Install 38 | 39 | Clone this repo. Depends on [npm](https://npmjs.com) and [node.js](https://nodejs.com). 40 | 41 | ## Usage 42 | 43 | ```sh 44 | # render, add, and publish the denylist 45 | $ make build && make publish 46 | $ git add versions/ && git commit -m Publish && git push 47 | 48 | # update the TXT record for refs.ipfs.io 49 | $ npm install && make dnslink 50 | # wait for it to propagate 51 | $ watch dig TXT refs.ipfs.io 52 | ``` 53 | 54 | ## Contribute 55 | 56 | Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/refs/issues)! 57 | 58 | This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). 59 | 60 | [](https://github.com/ipfs/community/blob/master/contributing.md) 61 | 62 | ## License 63 | 64 | [MIT](LICENSE) 65 | -------------------------------------------------------------------------------- /dmca/dmca.go: -------------------------------------------------------------------------------- 1 | package dmca 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | shell "github.com/whyrusleeping/ipfs-shell" 7 | "html/template" 8 | "io" 9 | "strings" 10 | ) 11 | 12 | type noticeData struct { 13 | Body string 14 | Keys []string 15 | } 16 | 17 | var noticeTemplate *template.Template 18 | var noticeBytes = ` 19 | 20 | 21 |
22 | 23 |