### Install blastula Package and Prepare Example Files for Custom Emails
Source: https://docs.posit.co/connect/2024.08.0/user/rmarkdown
These R commands facilitate the initial setup for creating custom emails using the `blastula` package. It installs the package from CRAN and then generates a set of example files in your workspace to help you get started with email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create Repository and Subscribe to Source
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
Commands to create a new Python repository and then subscribe it to a curated PyPI source. This makes the packages defined in the source available to users through the repository.
```bash
# Create a repository:
$ rspm create repo --name=pypi --type=python --description='Access curated PyPI packages'
# Subscribe a repository to the curated-pypi source:
$ rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Launch Posit Connect Setup Assistant
Source: https://docs.posit.co/connect/2024.09.0/admin/getting-started/local-install/setup-assistant/index
This specific example illustrates how to launch the Posit Connect Setup Assistant after the initial installation, using the '-x' flag. This allows users to configure Connect's initial settings through a guided interface.
```bash
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Manage rspm Sources, Packages, and Repositories
Source: https://docs.posit.co/rspm/2024.08.0/admin/getting-started/configuration
This set of commands demonstrates how to create a local source, add source and pre-compiled binary packages to it, list available binary distributions, create a repository, and subscribe the repository to the source. This workflow enables serving internal packages with binaries.
```Terminal
# Create a local source:
$ rspm create source --name=internal-src
# Add the local package tar file to the source:
$ rspm add --source=internal-src --path='/path/to/package_1.0.tar.gz'
# List available binary distributions
$ rspm list distributions
# Add the precompiled binary packages to the source:
$ rspm add binary --source=internal-src --distribution=jammy --path='/path/to/package-binary.tar.gz'
$ rspm add binary --source=internal-src --distribution=windows --path='/path/to/package-binary.zip'
# Create a repository:
$ rspm create repo --name=internal --description='Stable releases of our internal packages with binaries'
# Subscribe the repository to the source:
$ rspm subscribe --repo=internal --source=internal-src
```
--------------------------------
### Example PyPI requirements.txt File
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
This snippet shows an example of a `requirements.txt` file used to define specific Python packages and their versions for a curated PyPI source. It demonstrates exact version pinning, minimum version, and fetching all available versions.
```plaintext
shiny
tensorflow >= 2.4.0
numpy == 1.24.2
```
--------------------------------
### Launch Posit Connect Setup Assistant
Source: https://docs.posit.co/connect/2024.01.0/admin/getting-started/local-install/setup-assistant/index
This specific example shows how to use the Posit Connect installer script with the `-x` flag to launch the Setup Assistant. This is typically done after a manual installation to proceed with initial configuration.
```bash
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Install blastula and prepare example files
Source: https://docs.posit.co/connect/2024.12.0/user/rmarkdown/index
Installs the `blastula` R package, which is recommended for creating custom emails, and then prepares a set of example R Markdown files in your workspace to help you get started with custom email generation.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Serve Example Page with Python SimpleHTTPServer
Source: https://docs.posit.co/ide/server-pro/2025.05.0/admin/tutorial_api/configuration
These commands demonstrate how to serve the `/usr/lib/rstudio-server/extras/tutorial` folder using Python's built-in SimpleHTTPServer module. This allows you to access the example page (e.g., `demo.htm`) via a web browser at `http://localhost:8080/demo.htm`.
```Python
python2 -m SimpleHTTPServer 8080
```
```Python
python3 -m http.server 8080
```
--------------------------------
### Package Manager Source and Repository Overview Diagram
Source: https://docs.posit.co/rspm/2024.08.0/admin/getting-started/configuration
Illustrates the fundamental architecture of Posit Package Manager, showing how a repository subscribes to one or more sources (e.g., CRAN, local packages) to expose packages to clients.
```mermaid
graph BT
cranlike("repository:
/all")
cran(source:
cran)
local(source:
internal R packages)
cranlike -->|subscribe| cran
cranlike --> |subscribe| local
```
--------------------------------
### Deploy Shiny Server Multi-Process Example Configuration
Source: https://docs.posit.co/shiny-server/index
This command deploys the example configuration for a multi-process Shiny Server setup. It places the `shiny-server.conf` file in `/etc/shiny-server/` and installs a directory of example applications. Users should back up their current configuration before running this command.
```bash
sudo /opt/shiny-server/bin/deploy-example multi-proc
```
--------------------------------
### Deploy Default Shiny Server Example Configuration
Source: https://docs.posit.co/shiny-server/index
This command copies the default example configuration file for Shiny Server to `/etc/shiny-server/shiny-server.conf` and installs a directory of example applications. It's used for a quick initial setup, expecting applications to be hosted in `/srv/shiny-server/`.
```bash
sudo /opt/shiny-server/bin/deploy-example default
```
--------------------------------
### Posit Connect Initial Configuration File Example
Source: https://docs.posit.co/connect/admin/getting-started/local-install/server-install/index
An example of the `/etc/rstudio-connect/rstudio-connect.gcfg` configuration file, demonstrating how to set up essential server properties like the public address, sender email, and SMTP details for email delivery. Proper configuration of these settings is vital for full functionality.
```gcfg
[Server]
Address = "https://rstudio-connect.company.com"
EmailProvider = "SMTP"
SenderEmail = "account@company.com"
[SMTP]
Host = "smtp.example.com"
Port = 587
User = "service-user"
Password = "service-password"
```
--------------------------------
### Install blastula and prepare example files
Source: https://docs.posit.co/connect/2025.01.0/user/rmarkdown/index
Installs the `blastula` R package and prepares example files for custom email generation in Posit Connect, creating a new folder with templates to help users get started quickly.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Full Content Promotion Example (R)
Source: https://docs.posit.co/connect/2025.01.0/cookbook/operations/promoting-content-from-staging-to-production/index
This comprehensive R example combines all steps for promoting content from a staging to a production Posit Connect server. It includes client initialization, content retrieval, bundle download, deployment, and task monitoring, providing a complete workflow.
```r
library(connectapi)
SOURCE_API_KEY <- "0d23c00de05a787ec2079ef75a881cdb"
SOURCE_URL <- "https://staging.connect.example.com/"
TARGET_API_KEY <- "f19eb24c1fde2370e621ccdaf347f15e"
TARGET_URL <- "https://connect.example.com/"
source_client <- connect(
server = SOURCE_URL,
api_key = SOURCE_API_KEY
)
target_client <- connect(
server = TARGET_URL,
api_key = TARGET_API_KEY
)
SOURCE_CONTENT_GUID <- "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"
source_content <- content_item(source_client, SOURCE_CONTENT_GUID)
BUNDLE_FILE_NAME <- 'bundle.tar.gz'
source_bundle <- download_bundle(source_content, filename = BUNDLE_FILE_NAME)
deployment_task <- deploy(target_client, source_bundle, guid = TARGET_CONTENT_GUID)
poll_task(deployment_task)
```
--------------------------------
### Launch Posit Connect Setup Assistant via CLI
Source: https://docs.posit.co/connect/2024.05.0/admin/getting-started/local-install/setup-assistant/index
This specific command is used to launch the Posit Connect Setup Assistant after the initial installation. The `-x` flag instructs the installer script to start the interactive web-based configuration process, allowing users to set up licensing, authentication, and other initial settings.
```bash
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Example Python requirements.txt File
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
A sample `requirements.txt` file demonstrating how to specify Python package dependencies, including exact versions, minimum versions, and any available versions. This file is used to define packages for curated PyPI sources.
```python-requirements
shiny
tensorflow >= 2.4.0
numpy == 1.24.2
```
--------------------------------
### Create Repository and Subscribe to Source
Source: https://docs.posit.co/rspm/2024.04.4/admin/getting-started/configuration
These commands demonstrate how to create a new repository in Posit Package Manager and then subscribe it to an existing source. This makes the packages from the source available to users through the newly created repository.
```Bash
# Create a repository:
$ rspm create repo --name=cran --type=r --description='Access Curated CRAN packages'
# Subscribe a repository to the curated-cran source:
$ rspm subscribe --repo=cran --source=subset
```
--------------------------------
### Install blastula and Prepare Example Files
Source: https://docs.posit.co/connect/2024.11.0/user/rmarkdown/index
Installs the `blastula` R package and prepares example files for custom email generation in Posit Connect, creating a new folder with templates to get started quickly.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create and Subscribe Repository for Curated PyPI Source
Source: https://docs.posit.co/rspm/2024.08.2/admin/getting-started/configuration
These commands create a new Python repository and then subscribe it to an existing Curated PyPI source. The repository makes the packages from the source available to users.
```Shell
$ rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
$ rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Install blastula and prepare example files
Source: https://docs.posit.co/connect/2025.04.0/user/rmarkdown/index
Installs the `blastula` R package, a recommended tool for crafting custom emails in Posit Connect, and prepares a set of example files to help users get started with email generation.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create Python Repository and Subscribe Source
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
These commands create a new Python repository and then link it to an existing local Python source. This setup enables the repository to serve packages uploaded to the specified source, making them accessible to users.
```bash
# Create a Python repository:
$ rspm create repo --name=local-python-repo --type=python --description='Access local Python packages'
# Subscribe the repository to the local Python source:
$ rspm subscribe --repo=local-python-repo --source=local-python-src
```
--------------------------------
### Posit Connect Installer Script CLI Flags
Source: https://docs.posit.co/connect/2024.01.0/admin/getting-started/local-install/setup-assistant/index
Documentation for the command-line interface flags supported by the Posit Connect installer script (`rsc-installer.sh`). These flags provide options for interacting with the installer, such as getting help or directly launching the Setup Assistant.
```APIDOC
rsc-installer.sh
-h: Print help information for the installer script.
-x: Launches the Setup Assistant, which requires a prior Connect installation to function.
```
--------------------------------
### Create and Subscribe Repository to Curated PyPI Source
Source: https://docs.posit.co/rspm/2024.04.2/admin/getting-started/configuration
These commands demonstrate how to create a new repository in Posit Package Manager and then subscribe it to a Curated PyPI source. This makes the packages from the source available to users through the newly created repository.
```Shell
# Create a repository:
$ rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
# Subscribe a repository to the curated-pypi source:
$ rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Setup Python Virtual Environment and Install Dependencies
Source: https://docs.posit.co/connect/2025.05.0/user/fastapi/index
These shell commands guide the user through creating a Python virtual environment, activating it, upgrading pip, and installing the dependencies listed in requirements.txt.
```Shell
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r requirements.txt
```
--------------------------------
### Install blastula Package and Prepare Example Files
Source: https://docs.posit.co/connect/2024.08.0/user/rmarkdown/index
This R code snippet provides the commands to install the `blastula` package, which is recommended for custom email generation in Posit Connect, and to prepare a set of example files to help users get started with email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Manage RStudio Package Manager Repositories and Packages
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
This snippet demonstrates fundamental `rspm` commands for adding individual packages to a source, creating new repositories, and subscribing a repository to a source. These operations are essential for setting up and populating your package manager instance.
```bash
rspm add --source=internal-src --path='/path/to/package_1.0.tar.gz'
rspm create repo --name=internal --description='Stable releases of our internal packages'
rspm subscribe --repo=internal --source=internal-src
```
```APIDOC
rspm add --source --path
- Adds a package to a specified source.
- Parameters:
- --source: (string, required) The name of the source to add the package to.
- --path: (string, required) The file path to the .tar.gz package archive.
rspm create repo --name --description
- Creates a new package repository.
- Parameters:
- --name: (string, required) The unique name for the new repository.
- --description: (string, required) A descriptive text for the repository.
rspm subscribe --repo --source
- Subscribes an existing repository to a source, making packages from that source available in the repository.
- Parameters:
- --repo: (string, required) The name of the repository to subscribe.
- --source: (string, required) The name of the source to subscribe to.
```
--------------------------------
### Install and Prepare Blastula Email Example in R
Source: https://docs.posit.co/connect/2024.04.1/user/rmarkdown/index
These R commands facilitate the initial setup for custom email creation using the `blastula` package. It installs the package and then prepares example files in your workspace, providing a starting point for crafting custom email content.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Serve Example Tutorial Page with Python SimpleHTTPServer
Source: https://docs.posit.co/ide/server-pro/2023.03.1/1352/tutorial_api/configuration
Provides commands to quickly serve the example tutorial page located at `/usr/lib/rstudio-server/extras/tutorial` using Python's built-in HTTP server modules. This allows for local testing and viewing of the `demo.htm` file in a web browser.
```python
python2 -m SimpleHTTPServer 8080
```
```python
python3 -m http.server 8080
```
--------------------------------
### Install blastula Package and Prepare Example Files in R
Source: https://docs.posit.co/connect/2024.04.0/user/rmarkdown
This R code snippet provides the commands to install the `blastula` package, which is recommended for customizing emails in Posit Connect. It also shows how to prepare example files provided by the package to get started with custom email creation.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create Python Repository and Subscribe Local Source
Source: https://docs.posit.co/rspm/2024.04.2/admin/getting-started/configuration
These commands set up a new Python repository in Posit Package Manager and then subscribe the previously created local Python source to it. This links the source of packages to a repository where they can be accessed.
```Terminal
# Create a Python repository:
$ rspm create repo --name=local-python-repo --type=python --description='Access local Python packages'
# Subscribe the repository to the local Python source:
$ rspm subscribe --repo=local-python-repo --source=local-python-src
```
--------------------------------
### Posit Package Manager CLI Commands
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
Comprehensive documentation for key commands of the Posit Package Manager CLI (`rspm`), including `add`, `create repo`, and `subscribe`. These commands are used for managing packages, creating repositories, and configuring sources like PyPI mirrors.
```APIDOC
rspm add --source= --path=
- Adds a local package archive to a specified source.
- Parameters:
- --source: (string, required) The name of the source to add the package to.
- --path: (string, required) The file path to the package archive (e.g., .tar.gz).
rspm add binary --source= --distribution= --path=
- Adds a local binary package archive to a specified source, targeting a specific distribution.
- Parameters:
- --source: (string, required) The name of the source to add the binary package to.
- --distribution: (string, required) The target Linux distribution (e.g., 'bionic').
- --path: (string, required) The file path to the binary package archive.
rspm create repo --name= --type= [--description=]
- Creates a new repository within Posit Package Manager.
- Parameters:
- --name: (string, required) The unique name for the new repository.
- --type: (string, required) The type of packages the repository will hold (e.g., 'python').
- --description: (string, optional) A descriptive text for the repository.
- Returns: Confirmation message including repository name and type.
rspm subscribe --repo= --source=
- Subscribes an existing repository to a specified source.
- Parameters:
- --repo: (string, required) The name of the repository to subscribe.
- --source: (string, required) The name of the source to subscribe the repository to (e.g., 'pypi').
- Returns: Confirmation message including repository and subscribed sources.
```
--------------------------------
### Install blastula and prepare example files
Source: https://docs.posit.co/connect/2024.11.0/user/rmarkdown
This R code installs the `blastula` package from CRAN and then executes a function to prepare example files for custom email generation within Posit Connect. This creates a new folder in the workspace containing templates and scripts to help users get started with custom email workflows.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create and subscribe repository to Curated PyPI source
Source: https://docs.posit.co/rspm/2024.04.4/admin/getting-started/configuration
These commands demonstrate how to create a new repository in Posit Package Manager and then subscribe it to a Curated PyPI source. This makes the packages available within that source accessible to users through the newly created repository.
```bash
$ rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
$ rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Install blastula Package and Prepare Example Files
Source: https://docs.posit.co/connect/2024.06.0/user/rmarkdown
This R code snippet provides the commands to install the 'blastula' package, which is recommended for creating custom emails in Posit Connect. It also shows how to prepare example files provided by the package to help users get started with email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Install blastula Package and Prepare Email Examples
Source: https://docs.posit.co/connect/2024.02.0/user/rmarkdown/index
This R code installs the `blastula` package, which is recommended for customizing emails in Posit Connect. It then runs a function to create a folder with example email files to help users get started with custom email workflows.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Manage Posit Package Manager Repositories and Sources
Source: https://docs.posit.co/rspm/2024.08.2/admin/getting-started/configuration
Comprehensive API documentation for `rspm` commands used to manage repositories, sources, and synchronization within Posit Package Manager. This includes creating and subscribing repositories, listing available versions and snapshots, and forcing synchronization.
```APIDOC
rspm subscribe --repo= --source= [--version=]
- Subscribes a repository to a specified package source.
- Parameters:
- --repo: The name of the repository to subscribe (e.g., 'pypi', 'cran', 'bioconductor-3.11').
- --source: The name of the source to subscribe to (e.g., 'pypi', 'cran', 'bioconductor').
- --version: (Optional) Specifies a particular version for the source, applicable for Bioconductor.
- Examples:
- Subscribe 'pypi' repository to 'pypi' source:
$ rspm subscribe --repo=pypi --source=pypi
- Subscribe 'cran' repository to 'cran' source:
$ rspm subscribe --repo=cran --source=cran
- Subscribe 'bioconductor-3.11' repository to 'bioconductor' source for version 3.11:
$ rspm subscribe --repo=bioconductor-3.11 --source=bioconductor --version=3.11
rspm create repo --name= [--type=] [--description=]
- Creates a new repository with a specified name and optional type and description.
- Parameters:
- --name: The name of the new repository.
- --type: (Optional) The type of the repository (e.g., 'bioconductor'). Defaults to 'R' if not specified.
- --description: (Optional) A description for the repository.
- Examples:
- Create a Bioconductor repository named 'bioconductor':
$ rspm create repo --type=bioconductor --name=bioconductor
- Create a CRAN repository named 'cran' with a description:
$ rspm create repo --name=cran --description='Access CRAN packages'
- Create an R repository for Bioconductor 3.11:
$ rspm create repo --name=bioconductor-3.11 --description='Access Bioconductor 3.11 packages'
rspm sync --type=
- Forces an immediate synchronization for a specific source type.
- Parameters:
- --type: The type of source to synchronize (e.g., 'bioconductor').
- Example:
- Force synchronization for Bioconductor source:
$ rspm sync --type=bioconductor
rspm list [command_target]
- Lists available entities such as repositories, Bioconductor versions, or CRAN snapshots.
- Parameters:
- command_target: (Optional) Specifies what to list (e.g., 'bioconductor versions', 'cran snapshots'). If omitted, lists repositories.
- Examples:
- List all existing repositories:
$ rspm list
- List available Bioconductor versions:
$ rspm list bioconductor versions
- List available CRAN snapshots:
$ rspm list cran snapshots
rspm create source --type= --name= [--snapshot=]
- Creates a new source, typically for specific snapshots like CRAN.
- Parameters:
- --type: The type of source to create (e.g., 'cran-snapshot').
- --name: The name for the new source.
- --snapshot: (Required for 'cran-snapshot' type) The date of the CRAN snapshot in YYYY-MM-DD format.
- Example:
- Create a CRAN Snapshot source for October 28, 2020:
$ rspm create source --type=cran-snapshot --snapshot=2020-10-28 --name=cran-2020-10-28
```
--------------------------------
### Serve Example Tutorial Page using Python SimpleHTTPServer
Source: https://docs.posit.co/ide/server-pro/2024.09.0/tutorial_api/configuration
These commands demonstrate how to serve the `/usr/lib/rstudio-server/extras/tutorial` folder using Python's built-in HTTP server modules. This allows access to the example page (e.g., `demo.htm`) via a web browser for testing the Tutorial API.
```Python
python2 -m SimpleHTTPServer 8080
```
```Python
python3 -m http.server 8080
```
--------------------------------
### Install blastula Package and Prepare Example Email Files
Source: https://docs.posit.co/connect/2024.09.0/user/rmarkdown/index
These R commands facilitate the setup for custom email creation using the `blastula` package. The first command installs the package, and the second generates a set of example files in your workspace, providing a starting point for crafting custom email content.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Full Content Promotion Workflow Example
Source: https://docs.posit.co/connect/2024.08.0/cookbook/operations/promoting-content-from-staging-to-production/index
This comprehensive example combines all the steps for promoting content from a staging to a production Posit Connect server into a single script. It includes client initialization, content and bundle retrieval, bundle creation, deployment, and verification, providing a complete end-to-end workflow.
```Python
from posit import connect
BUNDLE_FILE_NAME = 'bundle.tar.gz'
BUNDLE_ID = '1000'
SOURCE_API_KEY = "0d23c00de05a787ec2079ef75a881cdb"
SOURCE_CONTENT_GUID = "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"
SOURCE_URL = "https://staging.connect.example.com/"
TARGET_API_KEY = "f19eb24c1fde2370e621ccdaf347f15e"
TARGET_CONTENT_GUID = "2d178c46-4dca-40b0-bf22-a21e1cfb5b46"
TARGET_URL = "https://connect.example.com/"
source_client = connect.Client(api_key=SOURCE_API_KEY, url=SOURCE_URL)
target_client = connect.Client(api_key=TARGET_API_KEY, url=TARGET_URL)
source_content = source_client.content.get(SOURCE_CONTENT_GUID)
target_content = target_client.content.get(TARGET_CONTENT_GUID)
source_bundle = source_content.bundles.get(BUNDLE_ID)
source_bundle.download(BUNDLE_FILE_NAME)
target_bundle = target_content.bundles.create(BUNDLE_FILE_NAME)
deployment_task = target_bundle.deploy()
deployment_task.wait_for()
assert deployment_task.exit_code == 0
```
--------------------------------
### Install Blastula Package and Prepare Example Files
Source: https://docs.posit.co/connect/2024.05.0/user/rmarkdown/index
These R commands facilitate the initial setup for custom email creation using the `blastula` package. The first command installs the package from CRAN, while the second prepares a set of example files in your workspace, providing a practical starting point for developing custom email templates.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Execute Posit Connect Installer with Setup Assistant Flags
Source: https://docs.posit.co/connect/2024.03.0/admin/getting-started/local-install/setup-assistant/index
This command demonstrates the general syntax for running the Posit Connect installer script with a command-line flag. These flags are used to control specific behaviors of the installer or to directly invoke the Setup Assistant.
```bash
sudo -E bash ./rsc-installer.sh
```
--------------------------------
### Subscribe Repository to Local Source with Binaries
Source: https://docs.posit.co/rspm/2024.04.2/admin/getting-started/configuration
This final step shows how to create a new repository and then subscribe it to the local source that now contains both source and binary packages. This makes the packages available for consumption through the `rspm` repository.
```bash
# Create a repository:
rspm create repo --name=internal --description='Stable releases of our internal packages with binaries'
# Subscribe the repository to the source:
rspm subscribe --repo=internal --source=internal-src
```
--------------------------------
### Install blastula R Package and Prepare Example Files
Source: https://docs.posit.co/connect/2024.03.0/user/rmarkdown/index
These R commands facilitate the initial setup for custom email generation using the 'blastula' package. 'install.packages("blastula")' installs the package, while 'blastula::prepare_rsc_example_files()' creates a directory with example R Markdown files to guide email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Serve Example Page with Python SimpleHTTPServer
Source: https://docs.posit.co/ide/server-pro/2024.12.0/tutorial_api/configuration
This command demonstrates how to serve the `/usr/lib/rstudio-server/extras/tutorial` folder using Python's built-in HTTP server module. It provides examples for both Python 2 and Python 3 to quickly set up a local web server.
```Python
python2 -m SimpleHTTPServer 8080
```
```Python
python3 -m http.server 8080
```
--------------------------------
### Create a Curated PyPI Source
Source: https://docs.posit.co/rspm/2024.04.4/admin/getting-started/configuration
This command initializes a new curated PyPI source within Posit Package Manager. A curated PyPI source allows organizations to control and serve a specific subset of PyPI packages, enhancing security and consistency.
```Bash
# Create the curated-pypi source:
$ rspm create source --name=pypi-subset --type=curated-pypi
```
--------------------------------
### Launch Posit Connect Setup Assistant
Source: https://docs.posit.co/connect/2024.06.0/admin/getting-started/local-install/setup-assistant/index
This specific command launches the interactive Setup Assistant for Posit Connect. The `-x` flag instructs the installer script to open the assistant, which guides the user through initial configuration steps like licensing and authentication after the core installation is complete.
```bash
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Configure Shiny Server for User-Managed Applications
Source: https://docs.posit.co/shiny-server/index
This command uses the `deploy-example` script to configure Shiny Server to enable user-managed applications by placing a specific configuration file (`shiny-server.conf`) in `/etc/shiny-server/` and installing example applications. This setup allows users to host their own Shiny applications in their home directories.
```bash
sudo /opt/shiny-server/bin/deploy-example user-dirs
```
--------------------------------
### Full Content Promotion Example (Python)
Source: https://docs.posit.co/connect/2024.09.0/cookbook/operations/promoting-content-from-staging-to-production/index
This comprehensive Python example demonstrates the entire workflow for promoting content from a staging to a production Posit Connect server. It includes client initialization, content retrieval, bundle download, bundle creation on target, deployment, and status verification.
```Python
from posit import connect
BUNDLE_FILE_NAME = 'bundle.tar.gz'
BUNDLE_ID = '1000'
SOURCE_API_KEY = "0d23c00de05a787ec2079ef75a881cdb"
SOURCE_CONTENT_GUID = "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"
SOURCE_URL = "https://staging.connect.example.com/"
TARGET_API_KEY = "f19eb24c1fde2370e621ccdaf347f15e"
TARGET_CONTENT_GUID = "2d178c46-4dca-40b0-bf22-a21e1cfb5b46"
TARGET_URL = "https://connect.example.com/"
source_client = connect.Client(api_key=SOURCE_API_KEY, url=SOURCE_URL)
target_client = connect.Client(api_key=TARGET_API_KEY, url=TARGET_URL)
source_content = source_client.content.get(SOURCE_CONTENT_GUID)
target_content = target_client.content.get(TARGET_CONTENT_GUID)
source_bundle = source_content.bundles.get(SOURCE_BUNDLE_ID)
source_bundle.download(BUNDLE_FILE_NAME)
target_bundle = target_content.bundles.create(BUNDLE_FILE_NAME)
deployment_task = target_bundle.deploy()
deployment_task.wait_for()
assert deployment_task.exit_code == 0
```
--------------------------------
### Posit Connect Setup Assistant Command-Line Interface
Source: https://docs.posit.co/connect/2024.05.0/admin/getting-started/local-install/setup-assistant/index
This section documents the command-line interface (CLI) flags supported by the Posit Connect installer script, specifically for interacting with the Setup Assistant. These flags allow for direct control over the Setup Assistant's behavior.
```APIDOC
rsc-installer.sh
-h: Print help information for the installer script.
-x: Launches the Setup Assistant. This flag requires that Posit Connect has already been installed on the system.
```
--------------------------------
### Create a Python repository and subscribe a local source
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
These commands establish a new Python repository in Package Manager and then link it to the previously created local Python source. This allows packages uploaded to the 'local-python-src' to be accessed through the 'local-python-repo'.
```Terminal
rspm create repo --name=local-python-repo --type=python --description='Access local Python packages'
rspm subscribe --repo=local-python-repo --source=local-python-src
```
--------------------------------
### Launch Posit Connect Setup Assistant
Source: https://docs.posit.co/connect/2024.03.0/admin/getting-started/local-install/setup-assistant/index
This specific command launches the Posit Connect Setup Assistant after the initial installation. The `-x` flag is used to invoke the assistant, providing an interactive interface for initial configuration tasks.
```bash
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Create and Subscribe RSPM Repository for PyPI
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
These commands create a new repository and subscribe it to a curated PyPI source. This makes the packages from the source available to users through the newly created repository.
```bash
rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Example R Installation Paths Automatically Detected by Posit Workbench
Source: https://docs.posit.co/ide/server-pro/admin/r/installing_r
These examples illustrate how specific R version installations within the recommended base directories (e.g., `/opt/R`) are automatically detected by Posit Workbench, simplifying environment setup.
```Text
/opt/R/4.2.2
/opt/R/4.3.0
/opt/local/R/4.2.2
/opt/local/R/4.3.0
```
--------------------------------
### Manage RStudio Package Manager Repositories (rspm APIDOC)
Source: https://docs.posit.co/rspm/2023.08.0/admin/getting-started/configuration
This section describes `rspm` commands for creating new repositories and subscribing them to existing sources, making the packages available to users.
```APIDOC
rspm create repo --name= --description=''
- Creates a new repository in RStudio Package Manager.
- Parameters:
- --name: The name for the new repository (e.g., 'cran').
- --description: A descriptive string for the repository.
rspm subscribe --repo= --source=
- Subscribes an existing repository to a source, making its packages accessible.
- Parameters:
- --repo: The name of the repository to subscribe.
- --source: The name of the source to subscribe the repository to.
```
--------------------------------
### Execute Posit Connect Installer with Generic CLI Flag
Source: https://docs.posit.co/connect/2024.05.0/admin/getting-started/local-install/setup-assistant/index
This command illustrates the general syntax for running the Posit Connect installer script with a command-line flag. This pattern is used to invoke specific functionalities or modes of the installer, such as printing help or launching the Setup Assistant.
```bash
sudo -E bash ./rsc-installer.sh
```
--------------------------------
### Serve Example Tutorial Page with Python HTTP Server
Source: https://docs.posit.co/ide/server-pro/2023.03.1/tutorial_api/configuration
These commands demonstrate how to serve the `/usr/lib/rstudio-server/extras/tutorial` folder using Python's built-in HTTP server. This allows you to access the `demo.htm` example page in a web browser at `http://localhost:8080/demo.htm`.
```Python
python2 -m SimpleHTTPServer 8080
```
```Python
python3 -m http.server 8080
```
--------------------------------
### Create a Curated PyPI Source
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
This command initializes a new curated PyPI source within RStudio Package Manager. This source will allow you to define a specific subset of PyPI packages to be made available.
```bash
rspm create source --name=pypi-subset --type=curated-pypi
```
--------------------------------
### Posit Connect Jump Start Examples API
Source: https://docs.posit.co/connect/2024.05.0/news
These API endpoints allow programmatic enumeration and downloading of the Jump Start Examples distributed with Posit Connect, facilitating automated setup and content provisioning.
```APIDOC
API Endpoints for Jump Start Examples:
GET /v1/examples
- Description: Enumerates available Jump Start Examples.
- Parameters: None.
- Returns: A JSON array of example metadata (e.g., name, description, download URL).
GET /v1/examples/{example_id}/download
- Description: Downloads a specific Jump Start Example bundle.
- Parameters:
- example_id (string, path, required): The identifier of the example to download.
- Returns: A file stream (e.g., .zip archive) containing the example content.
```
--------------------------------
### Posit Connect Setup Assistant Command-Line Interface Flags
Source: https://docs.posit.co/connect/2024.03.0/admin/getting-started/local-install/setup-assistant/index
Documentation for the command-line interface flags supported by the Posit Connect Setup Assistant. These flags allow users to control the behavior of the assistant, such as printing help or launching the assistant directly after installation.
```APIDOC
Setup Assistant CLI Flags:
-h
- Function: Print help
- Description: Displays a help message with available options and usage instructions for the Setup Assistant.
-x
- Function: Launches the Setup Assistant (requires Connect installation)
- Description: Initiates the interactive Setup Assistant process, guiding the user through initial configuration steps. This flag requires Posit Connect to be already installed.
Usage Example:
sudo -E bash ./rsc-installer.sh
sudo -E bash ./rsc-installer.sh -x
```
--------------------------------
### Configure a General CRAN Snapshot Repository
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
Shows how to list available CRAN snapshots, create a new CRAN snapshot source, define a new repository, and subscribe the repository to the snapshot source. This allows serving CRAN packages from specific dates, providing control over package versions.
```bash
# List available snapshot dates (increase the count to see more options)
rspm list cran snapshots --count=25
# Create source from desired date:
rspm create source --name=cran-by-date --type=cran-snapshot --snapshot=2020-07-09
# Create a repository:
rspm create repo --name=cran --description='Access CRAN packages by date'
# Subscribe a repository to the cran-snapshot source:
rspm subscribe --repo=cran --source=cran-by-date
```
--------------------------------
### Example Positron Pro Configuration File
Source: https://docs.posit.co/ide/server-pro/2024.12.1/positron_sessions/configuration
An example of a `positron.conf` file demonstrating how to set the executable path, enable sessions, and specify a default session cluster.
```Plain Text
# /etc/rstudio/positron.conf
exe=/usr/lib/rstudio-server/bin/positron-server/bin/positron-server
enabled=1
default-session-cluster=Kubernetes
```
--------------------------------
### Execute Posit Connect Setup Assistant with Flags
Source: https://docs.posit.co/connect/2024.06.0/admin/getting-started/local-install/setup-assistant/index
This command demonstrates the general syntax for running the Posit Connect installer script with a command-line flag. This is typically used to invoke specific functionalities of the installer, such as launching the Setup Assistant, and requires `sudo` privileges.
```bash
sudo -E bash ./rsc-installer.sh
```
--------------------------------
### NFS Export Configuration for Shared Storage
Source: https://docs.posit.co/ide/server-pro/2025.05.0/admin/getting_started/installation/multi_server_installation
This snippet shows an example configuration for `/etc/exports` on an NFS server, defining shared directories for user home directories and project sharing, along with necessary NFS options for a Workbench load-balanced setup.
```shell
# Shared storage for user home directories
/var/nfs/workbench/home *(rw,sync,no_subtree_check,no_root_squash)
# Shared storage for project sharing
/var/nfs/workbench/shared-storage *(rw,sync,no_subtree_check,no_root_squash)
```
--------------------------------
### Create and Subscribe Repository for Curated PyPI
Source: https://docs.posit.co/rspm/2024.08.0/admin/getting-started/configuration
These commands create a new Python repository named 'pypi' in Posit Package Manager and then subscribe it to the 'pypi-subset' source. This makes the packages from the curated PyPI source available through the newly created repository.
```bash
rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
rspm subscribe --repo=pypi --source=pypi-subset
```
--------------------------------
### Install blastula and Prepare Example Files
Source: https://docs.posit.co/connect/2025.05.0/user/rmarkdown/index
Installs the `blastula` package and prepares example R Markdown files for custom email generation in Posit Connect. This command creates a new folder with example files in the workspace, providing a starting point for email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Quickstart PyPI Repository Setup with Posit Package Manager CLI
Source: https://docs.posit.co/rspm/2024.11.0/admin/python-packaging/python
This snippet provides the quickstart commands to create and subscribe to a PyPI repository using the Posit Package Manager (RSPM) command-line interface. It sets up a new Python repository named 'pypi' and configures it to mirror the official PyPI source, enabling local caching and reproducible dependency management.
```Bash
rspm create repo --name=pypi --type=python --description='Access PyPI packages'
rspm subscribe --repo=pypi --source=pypi
```
--------------------------------
### Manage Local R Binary Packages with RSPM
Source: https://docs.posit.co/rspm/2024.08.2/admin/getting-started/configuration
These commands demonstrate the workflow for setting up a local source in Posit Package Manager, adding a source package, listing available binary distributions, and then adding pre-compiled binary packages for specific distributions (e.g., Jammy, Windows) to that source.
```Shell
# Create a local source:
$ rspm create source --name=internal-src
# Add the local package tar file to the source:
$ rspm add --source=internal-src --path='/path/to/package_1.0.tar.gz'
# List available binary distributions
$ rspm list distributions
# Add the precompiled binary packages to the source:
$ rspm add binary --source=internal-src --distribution=jammy --path='/path/to/package-binary.tar.gz'
$ rspm add binary --source=internal-src --distribution=windows --path='/path/to/package-binary.zip'
```
--------------------------------
### Verify Posit Workbench Installation
Source: https://docs.posit.co/ide/server-pro/2023.06.2/getting_started/accessing_the_server
This command runs diagnostics to check the correct installation of Posit Workbench, including RStudio Pro and its connection to a locally installed R version. It helps identify issues with the server setup but does not cover networking or authentication problems.
```bash
sudo rstudio-server verify-installation
```
--------------------------------
### Posit Connect API for Programmatic Provisioning and Jump Start Examples
Source: https://docs.posit.co/connect/2024.05.0/news/index
API endpoints for programmatic provisioning of initial Posit Connect installations and for enumerating/downloading Jump Start Examples. The `v1/experimental/bootstrap` endpoint is deprecated in favor of `v1/bootstrap`.
```APIDOC
v1/bootstrap APIs
- Description: Used for programmatic provisioning of initial Posit Connect installations.
- Note: This replaces the deprecated `v1/experimental/bootstrap` endpoint.
API endpoints to enumerate and download the Jump Start Examples
- Description: Provides access to the bundled Jump Start Examples within Posit Connect.
- Usage: Allows listing available examples and downloading their content programmatically.
```
--------------------------------
### Subscribe Repository to Local Source
Source: https://docs.posit.co/rspm/2024.04.0/admin/getting-started/configuration
Shows how to create a new repository and subscribe it to a previously configured local source containing custom R packages and binaries. This makes the packages available through the Package Manager.
```bash
# Create a repository:
$ rspm create repo --name=internal --description='Stable releases of our internal packages with binaries'
# Subscribe the repository to the source:
$ rspm subscribe --repo=internal --source=internal-src
```
--------------------------------
### Serve Example Page with Python Simple HTTP Server
Source: https://docs.posit.co/ide/server-pro/2023.06.2/tutorial_api/configuration
These commands demonstrate how to serve the Posit Workbench Tutorial API example page using Python's built-in simple HTTP server. This allows local testing of the integration by making the `demo.htm` file accessible via a web browser.
```Python
python2 -m SimpleHTTPServer 8080
```
```Python
python3 -m http.server 8080
```
--------------------------------
### Install blastula and prepare example files
Source: https://docs.posit.co/connect/user/rmarkdown/index
Installs the `blastula` R package and prepares example R Markdown files for custom email generation in Posit Connect, providing a starting point for email customization.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Install blastula and Prepare Email Examples
Source: https://docs.posit.co/connect/2024.05.0/user/rmarkdown
This R code installs the `blastula` package, which is recommended for customizing emails in Posit Connect, and then runs a function to create example email files in your workspace. These examples provide a starting point for developing custom email templates.
```R
install.packages("blastula")
blastula::prepare_rsc_example_files()
```
--------------------------------
### Create Local Python Source and Repository
Source: https://docs.posit.co/rspm/2024.11.0/admin/getting-started/configuration
Commands to create a dedicated local Python source for uploading internal Python packages and then set up a Python repository, subscribing it to the newly created local source for package distribution.
```Terminal
# Create a local Python source:
$ rspm create source --name=local-python-src --type=local-python
<< Source 'local-python-src':
<< Type: Local Python
```
```Terminal
# Create a Python repository:
$ rspm create repo --name=local-python-repo --type=python --description='Access local Python packages'
<< Repository: local-python-repo - Access local Python packages - Python
# Subscribe the repository to the local Python source:
$ rspm subscribe --repo=local-python-repo --source=local-python-src
<< Repository: local-python-repo
<< Sources:
<< --local-python-src (Local Python)
```
--------------------------------
### Execute Posit Connect Setup Assistant with Flags
Source: https://docs.posit.co/connect/2024.09.0/admin/getting-started/local-install/setup-assistant/index
This command shows the general syntax for running the Posit Connect installer script with a command-line flag. This is typically used to interact with the Setup Assistant or retrieve help information.
```bash
sudo -E bash ./rsc-installer.sh
```
--------------------------------
### Serve Tutorial API Example Page with Python HTTP Server
Source: https://docs.posit.co/ide/server-pro/admin/tutorial_api/configuration
These commands demonstrate how to serve the Tutorial API example page locally using Python's built-in HTTP server modules. The page can then be accessed via a web browser at `http://localhost:8080/demo.htm`.
```python
python2 -m SimpleHTTPServer 8080
```
```python
python3 -m http.server 8080
```
--------------------------------
### Create and Subscribe Repository for Curated PyPI
Source: https://docs.posit.co/rspm/2024.11.0/admin/getting-started/configuration
These commands establish a new repository and link it to a Curated PyPI source. First, a Python-type repository named 'pypi' is created with a descriptive label. Subsequently, this newly created repository is subscribed to the 'pypi-subset' source, making the packages from that source available to users through the repository.
```Shell
$ rspm create repo --name=pypi --type=python --description='Access Curated PyPI packages'
$ rspm subscribe --repo=pypi --source=pypi-subset
```