<commit_before>Usage
=====

Composer
--------

To add a new repository, for instance, the official one:

        [Composer]
            [Composer.packagist]
            Server = "https://packagist.org"
            Enabled = true

Next, you need to declare the mirror in your ``composer.json`` file:

        {
            "repositories":[
                { "packagist": false },
                { "type": "composer", "url": "https://localhost/composer/packagist"}
            ],
        
            "require": {
                "sonata-project/exporter": "*"
            }
        }

The ``packagist`` key is used here as an example.

Npm
---

To add new repository, for instance, https://registry.npmjs.org

        [Npm]
            [Npm.npm]
            Server = "https://registry.npmjs.org"
            
Next, you need to declare the registry in npm

        npm registry set https://localhost/npm/npm

Git
---

To add new servers:

        [Git]
            [Git.github]
            Server = "github.com"
            Clone = "<EMAIL>:{path}"
            Enabled = true
        
            [Git.drupal]
            Server = "drupal.org"
            Clone = "https://git.drupal.org/{path}"
            Enabled = true


You need to manually add git repository:

 1. Connect to the server
 2. Clone a repository
        
        git clone --mirror <EMAIL>:rande/gonode.git ./data/git/github.com/rande/gonode.git<commit_msg>fix(doc): fix usage sample<commit_after>Usage
=====

Main configuration
------------------

    DataDir = "/var/lib/pkgmirror/data"
    CacheDir = "/var/lib/pkgmirror/cache"
    PublicServer = "https://mirrors.example.com"
    InternalServer = ":8000"

Composer
--------

To add a new repository, for instance, the official one:

    [Composer]
        [Composer.packagist]
        Server = "https://packagist.org"
        Enabled = true

Next, you need to declare the mirror in your ``composer.json`` file:

    {
        "repositories":[
            { "packagist": false },
            { "type": "composer", "url": "https://localhost/composer/packagist"}
        ],
    
        "require": {
            "sonata-project/exporter": "*"
        }
    }

The ``packagist`` key is used here as an example.

Npm
---

To add new repository, for instance, https://registry.npmjs.org

    [Npm]
        [Npm.npm]
        Server = "https://registry.npmjs.org"
        Enabled = true
            
Next, you need to declare the registry in npm

        npm registry set https://localhost/npm/npm

Git
---

To add new servers:

    [Git]
        [Git.github]
        Server = "github.com"
        Clone = "<EMAIL>:{path}"
        Enabled = true
    
        [Git.drupal]
        Server = "drupal.org"
        Clone = "https://git.drupal.org/{path}"
        Enabled = true


You need to manually add git repository:

 1. Connect to the server
 2. Clone a repository
        
        git clone --mirror <EMAIL>:rande/gonode.git ./data/git/github.com/rande/gonode.git
{'fraction_non_alphanumeric': 0.1348993288590604, 'fraction_numerical': 0.0026845637583892616, 'mean_word_length': 1.7248628884826325, 'pattern_counts': {'":': 13, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7434715', 'n_tokens_mistral': 943, 'n_tokens_neox': 878, 'n_words': 240}