GithubHelp home page GithubHelp logo

gijsk / amo2kinto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla-services/amo2kinto

0.0 2.0 0.0 377 KB

Tools to import/export Mozilla Addons XML blocklist into Kinto

Home Page: https://kinto-reader.dev.mozaws.net/v1/blocklist/3/%7Bec8030f7-c20a-464f-9b0e-13a3a9e97384%7D/46.0/

License: Apache License 2.0

Makefile 3.00% Python 90.58% Smarty 6.42%

amo2kinto's Introduction

amo2kinto

https://coveralls.io/repos/mozilla-services/amo2kinto/badge.svg?branch=master
  • kinto2xml: Export the blocklist in the legacy XML format
  • blockpages-generator: Generate the blocklist documentation pages.

Installation

To install the release:

pip install amo2kinto

To install the development environment:

make install

System dependencies

In order to build amo2kinto dependencies you may need the following libraries:

  • Building lxml will require: libxml2-dev libxslt-dev python-dev

Otherwise you will run into errors like:

  • libxml/xmlversion.h: File not found

Generate a blocklist.xml file from Kinto collections

If you want to export blocklists stored in Kinto in the addons server XML export format, you can use the kinto2xml script:

kinto2xml -s http://localhost:8888/v1

kinto2xml gives you the ability to configure what you want to export and in which bucket and collection are the data stored.

usage: kinto2xml [-h] [-s SERVER] [-a AUTH] [-v] [-q] [-D]
                 [--certificates-bucket CERTIFICATES_BUCKET]
                 [--certificates-collection CERTIFICATES_COLLECTION]
                 [--gfx-bucket GFX_BUCKET] [--gfx-collection GFX_COLLECTION]
                 [--addons-bucket ADDONS_BUCKET]
                 [--addons-collection ADDONS_COLLECTION]
                 [--plugins-bucket PLUGINS_BUCKET]
                 [--plugins-collection PLUGINS_COLLECTION]
                 [--api-version API_VERSION] [--app APP]
                 [--app-version APP_VERSION] [-o OUT]

Build a blocklists.xml file from Kinto blocklists.

optional arguments:
  -h, --help            show this help message and exit
  -s SERVER, --server SERVER
                        The location of the remote server (with prefix)
  -a AUTH, --auth AUTH  BasicAuth token:my-secret
  -v, --verbose         Show all messages.
  -q, --quiet           Show only critical errors.
  -D, --debug           Show all messages, including debug messages.
  --certificates-bucket CERTIFICATES_BUCKET
                        Bucket name for certificates
  --certificates-collection CERTIFICATES_COLLECTION
                        Collection name for certificates
  --gfx-bucket GFX_BUCKET
                        Bucket name for gfx
  --gfx-collection GFX_COLLECTION
                        Collection name for gfx
  --addons-bucket ADDONS_BUCKET
                        Bucket name for addons
  --addons-collection ADDONS_COLLECTION
                        Collection name for addon
  --plugins-bucket PLUGINS_BUCKET
                        Bucket name for plugins
  --plugins-collection PLUGINS_COLLECTION
                        Collection name for plugin
  --api-version API_VERSION
                        Targeted blocklists.xml APP id
  --app APP             Targeted blocklists.xml APP id
  --app-version APP_VERSION
                        The targetted app version
  -o OUT, --out OUT     Output XML file.

Generate blocked addons and plugins description pages

You might want to export the human readable list and description of add-ons and plugins that were blocked.

You can do that using the blockpages-generator cli tool:

usage: blockpages-generator [-h] [-s SERVER] [-a AUTH] [-b BUCKET] [-v] [-q]
                            [-D] [--addons-collection ADDONS_COLLECTION]
                            [--plugins-collection PLUGINS_COLLECTION]
                            [-d TARGET_DIR]

Generate blocked item description files.

optional arguments:
  -h, --help            show this help message and exit
  -s SERVER, --server SERVER
                        The location of the remote server (with prefix)
  -a AUTH, --auth AUTH  BasicAuth token:my-secret
  -b BUCKET, --bucket BUCKET
                        Bucket name.
  -v, --verbose         Show all messages.
  -q, --quiet           Show only critical errors.
  -D, --debug           Show all messages, including debug messages.
  --addons-collection ADDONS_COLLECTION
                        Collection name for addon
  --plugins-collection PLUGINS_COLLECTION
                        Collection name for plugin
  -d TARGET_DIR, --target-dir TARGET_DIR
                        Destination directory to write files in.

It will generate an index.html file with the list of records present in the addons and plugins collections in the target-dir directory.

It will also generate a file per add-on and plugin using the blockID or the id. e.g i487.html or 08db5018-2c80-4c4d-aa98-dafe6aacc28c.html

amo2kinto's People

Contributors

gijsk avatar leplatrem avatar natim avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.