========
Channels
========

What is a channel?
==================

A channel is a location (a URL) where conda can search for packages to install on your machine. When you authenticate to Anaconda Cloud for the first time using your organization access :doc:`token <tokens>`, conda is automatically configured to use Anaconda’s private repository channels. These channels are curated with :doc:`Common Vulnerability and Exposure (CVE) <cve>` information for each package.

After your initial authentication, you should see the following ``default_channels:`` in your ``.condarc`` file:

* main - https://repo.anaconda.cloud/repo/main
* r - https://repo.anaconda.cloud/repo/r
* msys2 (Windows) - https://repo.anaconda.cloud/repo/msys2

Channel types
=============

Anaconda channels
   The Anaconda channels connect to the repository that is curated and maintained by Anaconda. These channels provide you with thousands of the most popular data science platform packages available today. It is possible to apply a policy filter to the Anaconda channels. That policy filter will not affect Organization channels that are created from the same source Anaconda channel.

Virtual channels
   Your organization’s channels are virtual copies of the Anaconda channels. You can apply a policy filter to a channel to restrict the packages that are available through that channel, which customizes its contents, making it unique. For example, you can have two channels that both pull from the Anaconda ``main`` channel, but the available packages they provide can be different due to the policy filter that have been applied to the channels.

External channels
   External channels will point to a location (a URL) that is outside of Anaconda to look for packages.

Hosted channels
   Anaconda hosts several additional channels that are available for your organization to subscribe to. Speak to your dedicated customer success manager for assistance with subscribing to hosted channels.

   * **conda-forge** - The conda-forge channel compiles conda recipes and packages built and maintained by the open-source community. Though this channel is not proprietary to Anaconda, you can still apply a policy filter to it using Package Security Manager. However, because these packages are not built by Anaconda, they do not include the :ref:`package signature <package-signatures>`, and all :ref:`CVE statuses <cve-status>` show as ``Reported``.

.. Reason for removal: https://anaconda.slack.com/archives/C04UDGFPG95/p1733948189280099
..   * **Anaconda-Extended Release** - The Anaconda-Extended Release channel compiles the most widely used noarch conda-forge packages according to Anaconda's rigorous standards, providing you with a repository of packages that work together seamlessly. Access to this channel gives you packages, CVEs, secure signatures, and provenance documents based on Anaconda's curation process.

.. note:: 
    
    You cannot apply :doc:`policy filters <policy-filter>` to external channels. Currently, Anaconda only supports connection to external channels located at https://conda.anaconda.org/, but we plan to support any URL soon.

Channel permissions
===================

There are two levels of permissions associated with channels in Anaconda: *internal* and *private*. 

Internal channels
   Internal channels are visible to all members of your organization who have been assigned a seat.

Private channels
   Private channels have their contents restricted to those members who are part of the group the channel is assigned to. For more information about assigning channels to a group, see :doc:`Groups <groups>`.

Creating an organization channel
================================

#. From the |satellite-dish| **Channels** page, click **Add channel** to open the Create Channel dialog.
#. Enter a unique channel name.
#. Select a channel type.
#. Select a source channel from the **Source** dropdown or enter the address for your external source channel.
#. Set the permission level for the channel.
#. Click **Save**.

Your new channel will appear on the **Channels** page. 

.. note:: 

   If you set the channel permission level as private, you will also be prompted to add the channel to a group. If you do not wish to add the newly created private channel to a group, click **Cancel** in the Assign Groups to Channel dialog.  

Assigning channel permissions
=============================

You can change the permissions level of a channel at any time: 

#. From the |satellite-dish| **Channels** page, open the |ellipsis-vertical| actions dropdown beside the channel. 
#. Select either *Make Channel Internal* or *Make Channel Private*. (Your available option depends on the current permissions level of the channel.)

.. note:: 
       
    Private channels that are not assigned to a group are only visible to organization administrators.

Viewing channel details
=======================

From the |satellite-dish| **Channels** page, select any channel to view its details.  

The channel details page provides the following information about the channel:

- The channel's address (a URL you can copy and add to your ``.condarc`` file to access the channel's packages)
- General information about the channel
- Information about the policy that is applied to the channel

.. tip:: 
   
   You can also :ref:`track your channel <tracking>` from the channel details page. 

.. thumbnail:: ../img/ab_channel_details.png
   :align: center

.. _channel_deltas:

Channel policy deltas
=====================

:doc:`Policy filters <policy-filter>`, once applied to a channel, run every four hours. Sometimes, due to newly reported CVEs or an updated CVE score or status, the contents of your channel will change when the filter performs its scheduled run. A package may become available that was not available previously, or you could find that a package you've been using is removed from your channel! 

From the channel details page, click **View Policy Deltas** to view a list of deltas. Deltas are the recorded changes to your channel's contents. Policy delta history begins from when you first applied the policy to the channel. Once the policy is removed from the channel (if you need to edit it, for example) the policy delta history is lost. A new policy delta history is established once the policy is reapplied to the channel.
Use the **Start** and **End** date filters to narrow your timeline to locate a specific delta, if necessary. Select a count under either **PACKAGES ADDED** or **PACKAGES REMOVED** to see a list of packages from a specific run. 

.. thumbnail:: ../img/ab_policy_deltas_view.gif
   :align: center

.. tip::

   Click the arrow |arrow-left| to return to your channel policy deltas. 

.. _tracking:

Channel tracking
================

Track your channels to receive emails at configurable intervals to keep up-to-date with the latest changes to your channels' contents. 

From the |satellite-dish| **Channels** page, click **Channel Tracking** to view the **Track Channels** page. 

.. note:: 
   
   You can also track a channel from the channel details page.

Select your channel from the list, choose which types of emails you would like to receive, and then set the frequency at which you would like to receive them. You can receive emails in realtime, daily, or weekly. Click **Save** to retain your changes. 

.. thumbnail:: ../img/ab_channel_tracking_configs.png
   :align: center

.. tip:: 

   Because deltas are generated when the policy filter runs, the realtime option can generate a maximum of one email every four hours. 

.. _psm-cloud-organization-channel:

Adding an organization channel to your ``.condarc`` file
========================================================

In order to pull packages from any of your organizations' virtual channels, you must first configure your ``.condarc`` file to tell conda where the channel is located. Complete the following steps to add one of your organizations' channels to your ``.condarc`` file.

#. From the |satellite-dish| **Channels** page, click |copy| **Copy channel path** beside the channel you're adding to your ``.condarc`` file.
#. Open Anaconda Prompt (Terminal on macOS/Linux) and run the following command:

   .. code-block:: none
       
       # Replace <CHANNEL_PATH> with the copied channel path
       conda config --prepend channels <CHANNEL_PATH>

   This will configure conda to check the specified channel for packages first, but will still look in the ``default_channels`` if ``defaults`` is present in the channel list. If you want to restrict where you pull packages from to one specific channel in your organization—for example, one with a policy filter applied to it—update your ``.condarc`` file to only include that channel in the channels list. 

   Your ``.condarc`` file might look something like this:

   .. code-block:: none

       channels:
         - https://repo.anaconda.cloud/repo/<ORG_ID>/<CHANNEL_NAME>
         - defaults
       add_anaconda_token: true
       restore_free_channel: false
       default_channels:
         - https://repo.anaconda.cloud/repo/main
         - https://repo.anaconda.cloud/repo/r
         - https://repo.anaconda.cloud/repo/msys2

.. note:: 

    If you want to only use your organizations' channels, ensure that they are the *only* channels present in your ``.condarc`` file.

Removing a channel from your .condarc file
==========================================

To remove a channel from your ``channels:`` list, open a terminal and run the following command:

.. code-block:: none

    # Replace <CHANNEL> with the URL listed in the 
    # channels: section of the .condarc file
    conda config --remove channels <CHANNEL>

For example, if you don't want to pull packages from the default channels, you can run the following command:

.. code-block:: none
    
    conda config --remove channels defaults
     
.. note:: 
    
    * This will leave the channels listed under ``default_channels:`` in the ``.condarc`` file for later use, if needed, but won't look for packages in those locations.
    * You can add the default channels to your ``.condarc`` file's ``channels:`` list at any time by running the command: ``conda config --append channels defaults``

.. |copy| raw:: html

   <svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 448 512"><path d="M384 352H224c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32H332.1c4.2 0 8.3 1.7 11.3 4.7l67.9 67.9c3 3 4.7 7.1 4.7 11.3V320c0 17.7-14.3 32-32 32zM433.9 81.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1H224c-35.3 0-64 28.7-64 64V320c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V115.9c0-12.7-5.1-24.9-14.1-33.9zM64 128c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H224c35.3 0 64-28.7 64-64V416H256v32c0 17.7-14.3 32-32 32H64c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h64V128H64z"/></svg>

.. |ellipsis-vertical| raw:: html

   <i class="fa-solid fa-ellipsis-vertical"></i>

.. |arrow-left| raw:: html

   <i class="fa-solid fa-arrow-left"></i>

.. |satellite-dish| raw:: html

    <svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 512 512"><path d="M192 24c0 13.3 10.7 24 24 24c137 0 248 111 248 248c0 13.3 10.7 24 24 24s24-10.7 24-24C512 132.5 379.5 0 216 0c-13.3 0-24 10.7-24 24zm24 80c-13.3 0-24 10.7-24 24s10.7 24 24 24c79.5 0 144 64.5 144 144c0 13.3 10.7 24 24 24s24-10.7 24-24c0-106-86-192-192-192zm-7 233l40-40c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-40 40L71 199c-13.5-13.5-35.9-12.3-45.1 4.4C9.4 233.2 0 267.5 0 304C0 418.9 93.1 512 208 512c36.5 0 70.8-9.4 100.6-25.9c16.7-9.2 17.8-31.6 4.4-45.1L209 337zM48 304c0-18.1 3-35.5 8.5-51.6L259.6 455.5C243.5 461 226.1 464 208 464c-88.4 0-160-71.6-160-160z"/></svg>