### Basic Reposilite Installation on Kubernetes Source: https://reposilite.com/guide/kubernetes Installs Reposilite using the default Helm chart values. This is a quick way to get Reposilite running, but custom values are recommended for production. ```bash # Create the 'reposilite' namespace $ kubectl create namespace reposilite # Install the Helm chart into the namespace 'reposilite' $ helm install reposilite reposilite/reposilite -n reposilite ``` -------------------------------- ### Example Badge Generation URL Source: https://reposilite.com/guide/badges An example of how to construct the badge URL, including query parameters for customization. This example fetches the latest version from the 'releases' repository for the artifact 'com.reposilite' and customizes the badge's appearance. ```bash /api/badge/latest/releases/com/reposilite?color=40c14a&name=Reposilite&prefix=v&filter=3 ``` -------------------------------- ### Systemd Service File for Reposilite Source: https://reposilite.com/guide/systemd Example configuration for `/etc/systemd/system/reposilite.service`. Ensure the user and paths are adjusted to your environment. This setup includes non-root user execution, workspace directory definition, and restart policies. ```systemd [Unit] Description=Reposilite Service [Service] # Non-root user User=reposilite-user # Reposilite workspace directory WorkingDirectory=/opt/reposilite # Path to Reposilite executable/script and its configuration. ExecStart=java -jar reposilite.jar --local-configuration=/etc/reposilite/reposilite.cdn --working-directory=/opt/reposilite # Policy SuccessExitStatus=0 TimeoutStopSec=10 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target ``` -------------------------------- ### List All Tokens Source: https://reposilite.com/guide/tokens Displays a list of all available tokens and their associated routes. Use this to get an overview of your current token setup. ```bash $ tokens 14:13:41.456 INFO | Tokens (1) 14:13:41.456 INFO | - root: 14:13:41.456 INFO | > ~ no routes ~ ``` -------------------------------- ### Install Reposilite using Paru Source: https://reposilite.com/guide/archlinux Install Reposilite automatically by using the Paru AUR helper. This command will clone, build, and install the package. ```bash paru -Syu reposilite ``` -------------------------------- ### Build and Install Paru Source: https://reposilite.com/guide/archlinux Build and install the Paru AUR helper package. This command requires sudo privileges. ```bash cd paru && makepkg -si ``` -------------------------------- ### Certbot Installation using Snap Source: https://reposilite.com/guide/nginx Instructions for installing Certbot, a tool for obtaining and renewing SSL certificates, using snapd. This is a prerequisite for setting up SSL with Nginx. ```bash $ sudo snap install certbot --classic $ sudo ln -s /snap/bin/certbot /usr/bin/certbot ``` -------------------------------- ### Get and Build Nexus 3 Export Tool Source: https://reposilite.com/guide/nexus-3 Clone the nexus3-export tool from GitHub and build it using Maven. Ensure you have Maven installed. ```bash git clone https://github.com/lbar/nexus3-export.git cd nexus3-export mvn package -DskipTests ``` -------------------------------- ### Build and Install Reposilite Manually Source: https://reposilite.com/guide/archlinux Build and install the Reposilite package manually from the AUR. This command requires sudo privileges and needs to be repeated for updates. ```bash cd reposilite && makepkg -si ``` -------------------------------- ### Manage Reposilite Service and CLI Example Source: https://reposilite.com/guide/nixos Demonstrates how to stop the Reposilite service using systemctl and how to run Reposilite from the command line as a specific user. This is useful for manual control and debugging. ```bash systemctl stop reposilite.service runuser -u reposilite -g reposilite -- reposilite --working-directory /var/lib/reposilite --port 8084 ``` -------------------------------- ### Advanced Reposilite Installation with Custom Values Source: https://reposilite.com/guide/kubernetes Installs Reposilite with custom configuration by modifying the chart's default values. This allows for fine-tuning disk space, memory, and other settings. ```bash # Save the default chart values to 'values.yaml' $ helm show values reposilite/reposilite > values.yaml # Modify the chart values ('values.yaml') using VI (or your preferred text editor) $ vi values.yaml # Create the 'reposilite' namespace $ kubectl create namespace reposilite # Install the Helm chart into the namespace 'reposilite', using the custom values $ helm install reposilite reposilite/reposilite -n reposilite -f values.yaml ``` -------------------------------- ### Example Local Configuration (CDN Format) Source: https://reposilite.com/guide/general A sample local configuration file for Reposilite written in CDN format. This file defines instance-specific settings like hostname and port. It's typically located relative to the working directory. ```cdn # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Reposilite :: Local # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Local configuration contains init params for current Reposilite instance. # For more options, shared between instances, login to the dashboard with management token and visit 'Configuration' tab. # Hostname # The hostname can be used to limit which connections are accepted. # Use 0.0.0.0 to accept connections from anywhere. ``` -------------------------------- ### Reposilite Configuration Example Source: https://reposilite.com/guide/general This JSON object shows a comprehensive configuration for Reposilite, including LDAP authentication, statistics, frontend branding, web server settings, and defining multiple Maven repositories (releases, snapshots, private). ```json { "authentication": { "ldap": { "enabled": false, "hostname": "ldap.domain.com", "port": 389, "baseDn": "dc=company,dc=com", "searchUserDn": "cn=reposilite,ou=admins,dc=domain,dc=com", "searchUserPassword": "reposilite-admin-secret", "typeAttribute": "person", "userAttribute": "cn", "userFilter": "(&(objectClass=person)(ou=Maven Users))", "userType": "PERSISTENT" } }, "statistics": { "enabled": true, "resolvedRequestsInterval": "MONTHLY" }, "frontend": { "id": "reposilite-repository", "title": "Reposilite Repository", "description": "Public Maven repository hosted through the Reposilite", "organizationWebsite": "https://reposilite.com", "organizationLogo": "https://avatars.githubusercontent.com/u/88636591", "icpLicense": "" }, "web": { "forwardedIp": "X-Forwarded-For" }, "maven": { "repositories": [ { "id": "releases", "visibility": "PUBLIC", "storageProvider": { "type": "fs", "quota": "100%", "mount": "" }, "redeployment": false, "preserveSnapshots": false, "proxied": [] }, { "id": "snapshots", "visibility": "PUBLIC", "storageProvider": { "type": "fs", "quota": "100%", "mount": "" }, "redeployment": false, "preserveSnapshots": false, "proxied": [] }, { "id": "private", "visibility": "PRIVATE", "storageProvider": { "type": "fs", "quota": "100%", "mount": "" }, "redeployment": false, "preserveSnapshots": false, "proxied": [] } ] } } ``` -------------------------------- ### GET /api/settings/domains Source: https://reposilite.com/guide/endpoints Lists all available domain configurations. Requires moderation permissions for access. ```APIDOC ## GET /api/settings/domains ### Description List all configurations. ### Method GET ### Endpoint /api/settings/domains ### Response #### Success Response (200) - Returns list of configuration names #### Error Response - **401**: Returns 401 if token without moderation permission has been used to access this resource ``` -------------------------------- ### Java Plugin Implementation Source: https://reposilite.com/guide/plugin-api Example of a Reposilite plugin implemented in Java. It extends the ReposilitePlugin class and overrides the initialize method to log a message upon plugin initialization. ```java @Plugin(name = "test") public final class ExamplePlugin extends ReposilitePlugin { @Override public @Nullable Facade initialize() { extensions().registerEvent(ReposiliteInitializeEvent.class, event -> { getLogger().info(""); getLogger().info("--- Example plugin"); getLogger().info("Example plugin has been properly loaded"); }); return null; } } ``` -------------------------------- ### Clone Paru AUR Package Source: https://reposilite.com/guide/archlinux Clone the Paru AUR package repository to prepare for building and installation. ```bash git clone https://aur.archlinux.org/packages/paru ``` -------------------------------- ### GET /api/status/instance Source: https://reposilite.com/guide/endpoints Retrieves the current status of the Reposilite instance. ```APIDOC ## GET /api/status/instance ### Description Returns the current status of the Reposilite instance. ### Method GET ### Endpoint /api/status/instance ### Response #### Success Response (200) - **schema** - InstanceStatusResponse ``` -------------------------------- ### Kotlin Plugin Implementation Source: https://reposilite.com/guide/plugin-api Example of a Reposilite plugin implemented in Kotlin. It extends the ReposilitePlugin class and overrides the initialize method to log a message upon plugin initialization. ```kotlin @Plugin(name = "example") class ExamplePlugin : ReposilitePlugin { override fun initialize(): Facade? { event { event: ReposiliteInitializeEvent -> logger.info("") logger.info("--- Example plugin") logger.info("Example plugin has been properly loaded") } return null } } ``` -------------------------------- ### GET /api/status/snapshots Source: https://reposilite.com/guide/endpoints Fetches a list of status snapshots for the Reposilite instance. ```APIDOC ## GET /api/status/snapshots ### Description Returns a list of status snapshots for the Reposilite instance. ### Method GET ### Endpoint /api/status/snapshots ### Response #### Success Response (200) - **array** - List of StatusSnapshot objects ``` -------------------------------- ### Clone Reposilite AUR Package Source: https://reposilite.com/guide/archlinux Clone the Reposilite AUR package repository for manual building and installation. ```bash git clone https://aur.archlinux.org/packages/reposilite ``` -------------------------------- ### Get Token Details Source: https://reposilite.com/guide/endpoints Retrieves details about the authenticated token. Requires 'Authorization' header with basic auth credentials. ```json { "openapi": "3.0.3", "info": { "title": "Reposilite Repository", "version": "3.5.19-SNAPSHOT", "description": "Official public Maven repository powered by Reposilite 💜" }, "paths": { "/api/auth/me": { "get": { "tags": [ "Auth" ], "summary": "Get token details", "description": "Returns details about the requested token", "parameters": [ { "name": "Authorization", "in": "header", "description": "Name and secret provided as basic auth credentials", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Details about the token for succeeded authentication", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionDetails" } } } }, "401": { "description": "Error message related to the unauthorized access in case of any failure", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "deprecated": false, "security": [] } } ``` -------------------------------- ### Get Badge Source: https://reposilite.com/guide/endpoints Retrieves a badge for a specific artifact. Requires repository and GAV coordinates. ```json { "/api/badge/latest/{repository}/{gav}": { "get": { "tags": [ "Maven", "Badge" ], "parameters": [ { "name": "repository", "in": "path", "description": "Artifact's repository", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { "type": "string" } }, { "name": "gav", "in": "path", "description": "Artifacts' GAV", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { "type": "string" } } ], "responses": {}, "deprecated": false, "security": [] } } ``` -------------------------------- ### Kotlin Class Definition with Constructor Fields Source: https://reposilite.com/guide/kotlin Define a Kotlin class with fields initialized directly in the constructor. This example shows default values and property access. ```kotlin class User( val username: String, var balance: Double = 0.00 ) { override fun toString(): String = "$username ($balance USD)" } val user = User("Michael Scott") // no 'new' keyword user.balance = 4.20 // Kotlin translates `setBalance` to `balance` ``` -------------------------------- ### Add Reposilite Helm Chart Repository Source: https://reposilite.com/guide/kubernetes Adds the official Reposilite Helm chart repository to your local Helm configuration. This is a prerequisite for installing Reposilite via Helm. ```bash # Add the repository $ helm repo add reposilite https://helm.reposilite.com/ # Update local repository information $ helm repo update ``` -------------------------------- ### Set File Ownership and Move Artifacts (Optional) Source: https://reposilite.com/guide/nexus-3 Optionally, change the recursive ownership of the exported files to the 'reposilite' user and group, and then move the artifacts to the Reposilite repository directory. This step is dependent on your Reposilite setup. ```bash cd exported-data chown --recursive reposilite:reposilite * mv * /var/lib/reposilite/repositories/releases/ ``` -------------------------------- ### Deploy Artifact using Maven Source: https://reposilite.com/guide/maven Execute the Maven deploy command to upload your artifact to the configured repository after setting up pom.xml and settings.xml. ```bash $ mvn deploy ``` -------------------------------- ### GET /api/maven/details/{repository}/{gav} Source: https://reposilite.com/guide/endpoints Retrieves details about a specific file or directory within a Maven repository. This endpoint allows browsing repository contents and getting metadata for artifacts. ```APIDOC ## GET /api/maven/details/{repository}/{gav} ### Description Get details about the requested file as JSON response. Browse the contents of repositories using API. ### Method GET ### Endpoint /api/maven/details/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier #### Response #### Success Response (200) - Returns document (different for directory and file) that describes requested resource #### Error Response - **401**: Returns 401 in case of unauthorized attempt of access to private repository - **404**: Returns 404 (for Maven) if requested artifact is not in the repository ``` -------------------------------- ### Run Reposilite with Parameters Source: https://reposilite.com/guide/general Execute the Reposilite JAR file and pass configuration properties as program arguments. This is useful for overriding default settings or providing instance-specific parameters. ```bash java -jar reposilite.jar --parameter=value ``` -------------------------------- ### Launching Reposilite from the Terminal Source: https://reposilite.com/guide/jar This command launches the Reposilite application from the terminal. Ensure the reposilite.jar file is in the current directory or provide the correct path. ```bash user@host ~/workspace: java -jar reposilite.jar ``` -------------------------------- ### GET /api/statistics/resolved/unique Source: https://reposilite.com/guide/endpoints Returns the total count of unique resolved requests made to the repository. ```APIDOC ## GET /api/statistics/resolved/unique ### Description Number of all unique requests. ### Method GET ### Endpoint /api/statistics/resolved/unique ### Response #### Success Response (200) - **integer** (int64) - Number of all unique requests #### Error Response (401) - **schema** - ErrorResponse - When non-manager token is used ``` -------------------------------- ### GET /api/statistics/resolved/all Source: https://reposilite.com/guide/endpoints Retrieves aggregated statistics for all repositories. Requires manager token for access. ```APIDOC ## GET /api/statistics/resolved/all ### Description Aggregated list of statistics per each repository. ### Method GET ### Endpoint /api/statistics/resolved/all ### Response #### Success Response (200) - Aggregated list of statistics per each repository #### Error Response - **401**: When non-manager token is used ``` -------------------------------- ### Run Reposilite Docker with External Configuration File Source: https://reposilite.com/guide/docker Mount an external configuration file from the Docker host to be used by Reposilite. This requires the configuration file to exist on the host and be specified via REPOSILITE_OPTS. ```bash $ docker run -it \ --mount type=bind,source=/etc/reposilite/configuration.cdn,target=/app/configuration.cdn \ -e REPOSILITE_OPTS='--local-configuration=/app/configuration.cdn' \ -v reposilite-data:/app/data \ -p 80:8080 \ dzikoysk/reposilite ``` -------------------------------- ### Nginx Configuration Verification and Restart Source: https://reposilite.com/guide/nginx Commands to test Nginx configuration syntax and restart the Nginx service. These are essential steps after making configuration changes. ```bash sudo nginx -t ``` ```bash sudo systemctl restart nginx ``` -------------------------------- ### Java Map Creation and Null Handling Source: https://reposilite.com/guide/kotlin Demonstrates creating a HashMap in Java and highlights the manual null handling required when retrieving values, contrasting with Kotlin's approach. ```java Map map = new HashMap<>(); map.put("key1", "value1"); map.put("key2", "value2"); // Not really handled, you have to remember about its nullability String nullable = map.get("key3"); // Usually we need to wrap a lot of such values Option handled = Option.of(map.get("key3")); // We could use map.getOrDefault() in this case, // but it's still quite rare scenario to see such extra methods. // Usually, modern API returns Optional for nullable responses, // but Java can't change its API to keep compatibility, // so it'll never get better at this point. Option value = Option.of(map.get("key3")).orElseGet("default"); ``` -------------------------------- ### Publishing to Single Repository via Command Line Source: https://reposilite.com/guide/gradle Use command line properties to publish artifacts when credentials are not in gradle.properties. ```bash $ ./gradlew publish \ -PmyDomainRepositoryUsername={token} \ -PmyDomainRepositoryPassword={secret} ``` -------------------------------- ### GET /api/tokens Source: https://reposilite.com/guide/endpoints Retrieves all existing tokens along with their associated permissions. This endpoint requires Manager privileges. ```APIDOC ## GET /api/tokens ### Description Returns all existing tokens and data such as their permissions. Note: Requires Manager. ### Method GET ### Endpoint /api/tokens ``` -------------------------------- ### Running Reposilite with Specific RAM Allocation Source: https://reposilite.com/guide/jar Use the -Xmx parameter with the java command to allocate a specific amount of RAM to the Reposilite JAR. This is crucial for performance tuning. ```bash $ java -Xmx32M -jar reposilite.jar ``` -------------------------------- ### Run Reposilite Docker with Custom JVM Heap Size Source: https://reposilite.com/guide/docker Configure the JVM heap size by passing custom Java options via the JAVA_OPTS environment variable. ```bash $ docker run -e JAVA_OPTS='-Xmx128M' -p 80:8080 dzikoysk/reposilite ``` -------------------------------- ### GET /api/settings/schema/{name} Source: https://reposilite.com/guide/endpoints Retrieves the schema for a specific configuration by its name. Requires moderation permissions for access. ```APIDOC ## GET /api/settings/schema/{name} ### Description Get schema by its name. ### Method GET ### Endpoint /api/settings/schema/{name} ### Parameters #### Path Parameters - **name** (string) - Required - Name of schema to get ### Response #### Success Response (200) - Returns dto representing configuration schema #### Error Response - **401**: Returns 401 if token without moderation permission has been used to access this resource - **404**: Returns 404 if non-existing configuration schema is requested ``` -------------------------------- ### GET /api/settings/domain/{name} Source: https://reposilite.com/guide/endpoints Retrieves a specific domain configuration by its name. Requires moderation permissions for access. ```APIDOC ## GET /api/settings/domain/{name} ### Description Find configuration by its name. ### Method GET ### Endpoint /api/settings/domain/{name} ### Parameters #### Path Parameters - **name** (string) - Required - Name of configuration to fetch ### Response #### Success Response (200) - Returns dto representing configuration #### Error Response - **401**: Returns 401 if token without moderation permission has been used to access this resource - **404**: Returns 404 if non-existing configuration is requested ``` -------------------------------- ### Generate First Reposilite Access Token via kubectl Source: https://reposilite.com/guide/kubernetes Creates the initial access token for Reposilite using the `token-generate` command within the running pod. This requires attaching to the pod's console. ```bash # Get the pod name $ kubectl get pods -n reposilite NAME READY STATUS RESTARTS AGE reposilite-75997659f4-mfszl 1/1 Running 0 18 # Attach to the pod $ kubectl attach -i reposilite-75997659f4-mfszl -n reposilite If you don't see a command prompt, try pressing enter. token-generate admin m 10:26:27.423 INFO | Generated new access token for admin with 'm' permissions. Secret: 10:26:27.423 INFO | biK3dtcNLtm7klb/h7uGXFyUQxStfkSOUIo/LSZSX5nB/+D8ImyXj6LaJ9vZrDIZ ``` -------------------------------- ### Basic Authentication Credentials Source: https://reposilite.com/guide/mirrors Configure basic username and password for accessing a mirrored repository that requires authentication. ```properties Login: Admin Password: Secret ``` -------------------------------- ### Gradle Publishing Configuration (KTS) Source: https://reposilite.com/guide/gradle Configure the publishing plugin and maven repository for a single repository deployment using Kotlin DSL. ```kotlin plugins { `maven-publish` } publishing { repositories { maven { name = "myDomainRepository" url = uri("https://repo.my-domain.com/releases") credentials(PasswordCredentials::class) authentication { create("basic") } } } publications { create("maven") { groupId = "com.example" artifactId = "library" version = "1.0.0" from(components["java"]) } } } ``` -------------------------------- ### GET /api/tokens/{name} Source: https://reposilite.com/guide/endpoints Retrieves information about a specific token identified by its name. Access is restricted to managers or the owner of the token. ```APIDOC ## GET /api/tokens/{name} ### Description Returns data about the token given via its name. Note: Requires manager or you must be the token owner. ### Method GET ### Endpoint /api/tokens/{name} ### Parameters #### Path Parameters - **name** (string) - Required - Name of the token to be retrieved ``` -------------------------------- ### GET /api/maven/latest/details/{repository}/{gav} Source: https://reposilite.com/guide/endpoints Retrieves details for the latest version of a specified artifact. Allows filtering by extension and classifier. ```APIDOC ## GET /api/maven/latest/details/{repository}/{gav} ### Method GET ### Endpoint /api/maven/latest/details/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier #### Query Parameters - **extension** (string) - Optional - Changes extension of matched file (by default matches 'jar') - **classifier** (string) - Optional - Appends classifier suffix to matched file - **filter** (string) - Optional - Version (prefix) filter to apply ``` -------------------------------- ### Configure Maven Server Credentials in settings.xml Source: https://reposilite.com/guide/maven Add server credentials to your ~/.m2/settings.xml file to authenticate with the repository. The server ID must match the one defined in your pom.xml. ```xml my-domain-repository {token} {secret} ``` -------------------------------- ### GET /api/console/log Source: https://reposilite.com/guide/endpoints Streams log output through a Server-Sent Events (SSE) connection. This endpoint provides real-time log updates. ```APIDOC ## GET /api/console/log ### Description Streams the output of logs through an SSE Connection. ### Method GET ### Endpoint /api/console/log ### Parameters #### Header Parameters - **Authorization** (string) - Required - Name and secret provided as basic auth credentials ### Response #### Success Response (200) - **Continuously sends out the log as messages under the `log` event. Sends a keepalive ping through comments.** ``` -------------------------------- ### Traditional Exception-Based User Creation Source: https://reposilite.com/guide/kotlin This snippet demonstrates a traditional approach to user creation that relies on throwing exceptions for invalid input. It is not recommended for use with Reposilite. ```kotlin fun createUser(username: String): User { if (username.isEmpty()) { throw IllegalArgumentException("Name cannot be empty") } return User(username) } ``` -------------------------------- ### Get Maven Version Source: https://reposilite.com/guide/endpoints Retrieves the latest version of a Maven artifact. This endpoint is useful for checking the most recent version available in the repository. ```APIDOC ## GET /api/maven/latest/version/{repository}/{gav} ### Description Retrieves the latest version of a Maven artifact. This endpoint is useful for checking the most recent version available in the repository. ### Method GET ### Endpoint /api/maven/latest/version/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier #### Query Parameters - **extension** (string) - Optional - Changes extension of matched file (by default matches 'jar') - **classifier** (string) - Optional - Appends classifier suffix to matched file - **filter** (string) - Optional - Version (prefix) filter to apply - **type** (string) - Optional - Format of expected response type: empty (default) for json; 'raw' for plain text ### Response #### Success Response (200) - **Latest version information** (string) - The latest version of the artifact. ``` -------------------------------- ### Simple ibiblio Resolver Configuration for Ivy Source: https://reposilite.com/guide/ivy Use a simple ibiblio resolver if supporting Ivy configurations is not required. This configuration supports dynamic revisions but not module configurations. Replace 'hostname' with your Reposilite instance's address. ```xml ``` -------------------------------- ### Get Maven File Source: https://reposilite.com/guide/endpoints Retrieves a specific file from a Maven repository. This endpoint is useful for downloading artifacts or specific file versions. ```APIDOC ## GET /api/maven/latest/file/{repository}/{gav} ### Description Retrieves a specific file from a Maven repository. This endpoint is useful for downloading artifacts or specific file versions. ### Method GET ### Endpoint /api/maven/latest/file/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier #### Query Parameters - **extension** (string) - Optional - Changes extension of matched file (by default matches 'jar') - **classifier** (string) - Optional - Appends classifier suffix to matched file - **filter** (string) - Optional - Version (prefix) filter to apply ### Response #### Success Response (200) - **File content** (binary) - The content of the requested file. ``` -------------------------------- ### Run Reposilite Docker with Custom Reposilite Properties Source: https://reposilite.com/guide/docker Pass custom Reposilite parameters, such as a local configuration file path, using the REPOSILITE_OPTS environment variable. ```bash $ docker run -e REPOSILITE_OPTS='--local-configuration=/app/data/custom.cdn' -p 80:8080 dzikoysk/reposilite ``` -------------------------------- ### GET /api/auth/me Source: https://reposilite.com/guide/endpoints Retrieves details about the currently authenticated token. This endpoint is useful for verifying authentication status and obtaining information about the session. ```APIDOC ## GET /api/auth/me ### Description Returns details about the requested token. This endpoint is useful for verifying authentication status and obtaining information about the session. ### Method GET ### Endpoint /api/auth/me ### Parameters #### Header Parameters - **Authorization** (string) - Required - Name and secret provided as basic auth credentials ### Response #### Success Response (200) - **Details about the token for succeeded authentication** #### Error Response (401) - **Error message related to the unauthorized access in case of any failure** ``` -------------------------------- ### Get Maven Versions Source: https://reposilite.com/guide/endpoints Retrieves a list of all available versions for a given Maven artifact. This endpoint is useful for discovering all published versions of an artifact. ```APIDOC ## GET /api/maven/versions/{repository}/{gav} ### Description Retrieves a list of all available versions for a given Maven artifact. This endpoint is useful for discovering all published versions of an artifact. ### Method GET ### Endpoint /api/maven/versions/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier ### Response #### Success Response (200) - **List of versions** (array of strings) - An array containing all available versions of the artifact. ``` -------------------------------- ### Multiple Repository Configuration (Groovy) Source: https://reposilite.com/guide/gradle Declare multiple target repositories in the build file using Groovy DSL for publishing. ```groovy maven { name = "myDomainRepositoryReleases" url = "https://repo.my-domain.com/releases" credentials(PasswordCredentials) authentication { basic(BasicAuthentication) } } maven { name = "myCoolRepositorySnapshots" url = uri("https://repo.my-cool.com/snapshots") credentials(PasswordCredentials) authentication { basic(BasicAuthentication) } } ``` -------------------------------- ### Gradle Publishing Configuration (Groovy) Source: https://reposilite.com/guide/gradle Configure the publishing plugin and maven repository for a single repository deployment using Groovy DSL. ```groovy plugins { id 'maven-publish' } publishing { repositories { maven { name = "myDomainRepository" url = "https://repo.my-domain.com/releases" credentials(PasswordCredentials) authentication { basic(BasicAuthentication) } } } publications { maven(MavenPublication) { groupId = "com.example" artifactId = "library" version = "1.0.0" from components.java } } } ``` -------------------------------- ### GET /api/badge/latest/{repository}/{gav} Source: https://reposilite.com/guide/endpoints Fetches the latest badge for a specified artifact within a repository. This endpoint is used to display build status or version information. ```APIDOC ## GET /api/badge/latest/{repository}/{gav} ### Description Fetches the latest badge for a specified artifact within a repository. This endpoint is used to display build status or version information. ### Method GET ### Endpoint /api/badge/latest/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Artifact's repository - **gav** (string) - Required - Artifacts' GAV ``` -------------------------------- ### Multiple Repository Configuration (KTS) Source: https://reposilite.com/guide/gradle Declare multiple target repositories in the build file using Kotlin DSL for publishing. ```kotlin maven { name = "myDomainRepositoryReleases" url = uri("https://repo.my-domain.com/releases") credentials(PasswordCredentials::class) authentication { create("basic") } } maven { name = "myCoolRepositorySnapshots" url = uri("https://repo.my-cool.com/snapshots") credentials(PasswordCredentials::class) authentication { create("basic") } } ``` -------------------------------- ### Gradle Build Configuration for Reposilite Plugin Source: https://reposilite.com/guide/plugin-api This Gradle build script configures a plugin project using Kotlin DSL, including shadowJar for creating a fat JAR and specifying the main class. It also declares a compile-only dependency on the Reposilite core library. ```gradle import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar group = "example.plugin" plugins { id("com.gradleup.shadow") version "8.3.5" } application { mainClass.set("example.plugin.TestPluginKt") } dependencies { compileOnly("com.reposilite:reposilite:3.0.2") } tasks.withType { archiveFileName.set("example-plugin.jar") destinationDirectory.set(file("$rootDir/reposilite-backend/src/test/workspace/plugins")) mergeServiceFiles() } ``` -------------------------------- ### Enable Path-Style Access for MinIO Source: https://reposilite.com/guide/s3 When using MinIO, enable path-style access by setting this JVM flag. This is required because MinIO only supports path-style access. ```properties -Dreposilite.s3.pathStyleAccessEnabled=true ``` -------------------------------- ### Configure Maven Settings with s4u/maven-settings-action Source: https://reposilite.com/guide/github This action generates a Maven settings.xml file to provide server credentials for repository access. It's useful when Maven does not support server credentials directly in the pom.xml. ```yaml - uses: s4u/maven-settings-action@v2.6.0 with: servers: | [{ "id": "reposilite-repository", "username": "${{ secrets.MAVEN_NAME }}", "password": "${{ secrets.MAVEN_SECRET }}" }] ``` -------------------------------- ### Nginx HTTP Strict Transport Security (HSTS) Source: https://reposilite.com/guide/nginx Enables HSTS to enforce secure HTTPS connections to the client. This directive should be used with caution and proper SSL setup. ```nginx add_header Strict-Transport-Security "max-age=63072000;includeSubdomains="; ``` -------------------------------- ### Apache SSL Reverse Proxy Configuration for Reposilite Source: https://reposilite.com/guide/apache Configures Apache to serve Reposilite over HTTPS, including WebSocket support. This example assumes SSL certificates are managed by Certbot. ```apache # Your Domain, needed for SSL ServerName repo.example.com # probably configured by Certbot or whatever you're using. Include /etc/letsencrypt/options-ssl-apache.conf # Use HTTP/2, not required but improves performance Protocols h2 http/1.1 RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule ^/api/(.*) ws://127.0.0.1:8081/api/$1 [P,L] ProxyPass / http://127.0.0.1:8081/ ProxyPassReverse / http://127.0.0.1:8081/ # probably configured by Certbot or whatever you're using. SSLCertificateFile /etc/letsencrypt/live/repo.example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/repo.example.com/privkey.pem ``` -------------------------------- ### SBT Localhost Repository Configuration Source: https://reposilite.com/guide/sbt Configure SBT to publish artifacts to a local Reposilite instance running on localhost. ```scala // For localhost publishTo := Some("Reposilite" at "http://localhost:8080/releases") credentials += Credentials("Reposilite", "localhost", "token", "secret") ``` -------------------------------- ### Result-Wrapped User Creation in Reposilite Source: https://reposilite.com/guide/kotlin This snippet shows the recommended Reposilite approach using Result for safe error handling. It filters invalid input and maps valid input to a User object. ```kotlin fun createUser(username: String): Result = username.asSuccess() .filter({ it.isEmpty() }) { ErrorResponse(BAD_REQUEST, "Name cannot be empty") } .map { User(it) } ``` -------------------------------- ### GET /api/statistics/resolved/phrase/{limit}/{repository}/{gav} Source: https://reposilite.com/guide/endpoints Retrieves an aggregated sum of resolved requests for a given phrase within a specific repository. It also provides a list of all matching resolved requests. ```APIDOC ## GET /api/statistics/resolved/phrase/{limit}/{repository}/{gav} ### Description Aggregated sum of resolved requests with a list of them all. ### Method GET ### Endpoint /api/statistics/resolved/phrase/{limit}/{repository}/{gav} ### Parameters #### Path Parameters - **limit** (string) - Required - Amount of records to find (Maximum: 100 - **repository** (string) - Required - Repository to search in - **gav** (string) - Required - Phrase to search for ### Response #### Success Response (200) - **schema** - ResolvedCountResponse #### Error Response (401) - **schema** - ErrorResponse - When invalid token is used ``` -------------------------------- ### Get Maven File Details Source: https://reposilite.com/guide/endpoints Retrieves details about a specific file within a Maven repository. This endpoint allows fetching information about artifacts using their group, artifact, and version identifiers. ```APIDOC ## GET /api/maven/latest/file/{repository}/{gav} ### Description Retrieves details about a specific file within a Maven repository. This endpoint allows fetching information about artifacts using their group, artifact, and version identifiers. ### Method GET ### Endpoint /api/maven/latest/file/{repository}/{gav} ### Parameters #### Path Parameters - **repository** (string) - Required - Destination repository - **gav** (string) - Required - Artifact path qualifier #### Query Parameters - **extension** (string) - Optional - Changes extension of matched file (by default matches 'jar') - **classifier** (string) - Optional - Appends classifier suffix to matched file - **filter** (string) - Optional - Version (prefix) filter to apply ### Response #### Success Response (200) - **Details about the given file** (object) - Description of the file details schema ``` -------------------------------- ### Basic Nginx Reverse Proxy Configuration Source: https://reposilite.com/guide/nginx This is a fundamental Nginx configuration for setting up a reverse proxy to Reposilite. It includes load balancing and essential proxy headers for proper communication. ```nginx map $http_upgrade $connection_upgrade { default upgrade; '' close; } # Load balancing pool for Reposilite upstream reposilite { # Reposilite IP and port, see below for explanation server domain.com:8081; } server { server_name domain.com; listen 80; listen [::]:80; access_log /var/log/nginx/reverse-access.log; error_log /var/log/nginx/reverse-error.log; client_max_body_size 50m; # maximum allowed artifact upload size location / { proxy_pass http://reposilite; # the name of Reposilite's upstream specified above proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; } } ``` -------------------------------- ### Merge Releases into Snapshots Source: https://reposilite.com/guide/artifactory Safely merges release artifacts into a snapshots folder using rsync. This is useful for consolidating separated release and snapshot repositories into a single Reposilite repository. Ensure you have rsync installed. ```bash # Merge all files in releases into the snapshots folder $ rsync -avhu --progress ./releases/ ./snapshots/ # Remove the releases folder $ rm -rf ./releases # Move the contents of the snapshots folder to your final target repository $ mv ./snapshots/* /data/reposilite/repositories/my-migrated-repository/ ``` -------------------------------- ### Default Reposilite Data Structure Source: https://reposilite.com/guide/jar This illustrates the default directory structure created by Reposilite in its working directory. It includes logs, plugins, repositories, static content, and configuration files. ```text ~workspace/ +--logs/ List of 10 latest log files +--plugins/ Directory with all external plugins to load +--repositories/ The root directory for all declared repositories +--private/ Default private repository +--releases/ Default repository for releases +--snapshots/ Default repository for snapshot releases +--static/ Static website content +--configuration.cdn Configuration file +--latest.log Log from the latest launch of Reposilite instance +--reposilite.jar Application file +--reposilite.db Data file containing stats and tokens (only if embedded database enabled) ``` -------------------------------- ### Basic Apache Reverse Proxy Configuration for Reposilite Source: https://reposilite.com/guide/apache A minimal Apache configuration to proxy all requests to Reposilite, including WebSocket support. Assumes Reposilite is running on 127.0.0.1:8081. ```apache RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule ^/api/(.*) ws://127.0.0.1:8081/api/$1 [P,L] ProxyPass / http://127.0.0.1:8081/ ProxyPassReverse / http://127.0.0.1:8081/ ``` -------------------------------- ### Publish Project with Gradle via GitHub Actions Source: https://reposilite.com/guide/github This workflow automates the building and publishing of a project to a Maven repository using Gradle. It requires Maven credentials to be set as GitHub secrets. ```yaml name: Publish project to Maven repository # Publish manually on: workflow_dispatch # OR, publish per each commit on: push: branches: [ main ] jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up JDK uses: actions/setup-java@v1 with: java-version: 18 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Publish with Gradle run: ./gradlew build publish env: MAVEN_NAME: ${{ secrets.MAVEN_NAME }} # token name MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }} # token secret (password) ``` -------------------------------- ### Nginx Ingress Configuration for Reposilite Source: https://reposilite.com/guide/kubernetes Defines an Ingress resource for Nginx Ingress Controller to expose Reposilite. Ensure you replace 'repo.example.com' with your desired domain. ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: reposilite-ingress namespace: reposilite spec: rules: - host: repo.example.com # Replace the domain you wish to use. http: paths: - path: / pathType: Prefix backend: service: name: reposilite port: name: http ``` -------------------------------- ### Java Lambda Equivalents Source: https://reposilite.com/guide/kotlin Shows the equivalent lambda expressions in Java for comparison with Kotlin's syntax. ```java Runnable runnable = () -> out.println("Reposilite"); Consumer consumer = value -> out.println(value); Function function = value -> Integer.toString(value); BiFunction biFunction = (a, b) -> a + b; ``` -------------------------------- ### HTTP Proxy Configuration Source: https://reposilite.com/guide/mirrors Configure an HTTP proxy for Reposilite to use when accessing remote repositories. ```properties HTTP 127.0.0.1:1081 ``` -------------------------------- ### Import Tokens from JSON Source: https://reposilite.com/guide/tokens This command imports tokens from a specified JSON file. It will list the tokens being imported and confirm their successful import. ```bash $ token-import tokens.json Importing 3 token(s) from $working-directory/tokens.json file: Access token 'token-0' has been imported. Access token 'token-1' has been imported. Access token 'token-2' has been imported. ``` -------------------------------- ### Enable SSL and Rewrite Modules in Apache Source: https://reposilite.com/guide/apache Enables the SSL and rewrite modules in Apache, which are required for SSL configuration and advanced proxying. ```bash sudo a2enmod ssl rewrite ``` -------------------------------- ### Run Reposilite Docker with Named Volume for Data Persistence Source: https://reposilite.com/guide/docker Ensures data persistence by running the Reposilite Docker image with a named volume mounted to the default data directory. ```bash $ docker run -it -v reposilite-data:/app/data -p 80:8080 dzikoysk/reposilite ``` -------------------------------- ### Service File Declaration for Plugin Source: https://reposilite.com/guide/plugin-api This file, located in `resources/META-INF/services/`, declares the main class of the plugin, which is required for Reposilite to load it. ```properties example.ExamplePlugin ``` -------------------------------- ### SOCKS Proxy Configuration Source: https://reposilite.com/guide/mirrors Configure a SOCKS proxy, optionally including login and password credentials, for Reposilite. ```properties SOCKS 127.0.0.1:1080 login password ``` -------------------------------- ### Traefik IngressRoute Configuration for Reposilite Source: https://reposilite.com/guide/kubernetes Defines an IngressRoute for Traefik to expose Reposilite. Customize the entrypoint and host ('repo.example.com') as needed. ```yaml apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: reposilite-ingress namespace: reposilite spec: entryPoints: - web # Replace this with the entrypoint you wish to expose Reposilite on. routes: - match: Host(`repo.example.com`) # Replace the domain you wish to use. kind: Rule services: - name: reposilite port: http ``` -------------------------------- ### Integrate Reposilite into NixOS Configuration Source: https://reposilite.com/guide/nixos Includes the Reposilite configuration file into the main NixOS configuration. This step is necessary to activate the Reposilite service. ```nix { config, pkgs, ... }: { imports = [ # ... ./reposilite.nix ]; # ... } ``` -------------------------------- ### Gradle Properties for Single Repository Source: https://reposilite.com/guide/gradle Add your access token to your ~/.gradle/gradle.properties file for single repository deployment. ```properties myDomainRepositoryUsername={token} myDomainRepositoryPassword={secret} ```