### Reposilite CLI Example Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/infrastructure/nixos.md Example of managing the Reposilite service and running it from the terminal. ```bash systemctl stop reposilite.service runuser -u reposilite -g reposilite -- reposilite --working-directory /var/lib/reposilite --port 8084 ``` -------------------------------- ### Install Certbot Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/infrastructure/nginx.md Install Certbot and create a symbolic link to the binary using snapd. ```bash $ sudo snap install certbot --classic $ sudo ln -s /snap/bin/certbot /usr/bin/certbot ``` -------------------------------- ### Basic installation Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/installation/kubernetes.md Installs the Reposilite Helm chart with default values. ```bash # Create the 'reposilite' namespace $ kubectl create namespace reposilite # Install the Helm chart into the namespace 'reposilite' $ helm install reposilite reposilite/reposilite -n reposilite ``` -------------------------------- ### Starting Reposilite JAR Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/installation/jar.md Command to start the Reposilite JAR from the terminal. ```shell-session user@host ~/workspace: java -jar reposilite.jar ``` -------------------------------- ### DSL Example Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/developers/kotlin.md Demonstrates Kotlin's Domain Specific Language (DSL) capabilities with a Request handler example. ```kotlin data class Request(val url: String, val ip: String) // 'Request.' declares that we'll change context of given labda // So 'this' will point to `Request` instance fun handleRequest(callable: Request.() -> Unit) = // Context argument is now the fist parameter in 'callable' function callable.invoke(Request("reposilite.com", "127.0.0.1")) // Usage of our DSL function handleRequest { println(this.url) // Explicit call using 'this.' println(ip) // We can now use Request's properties directly } ``` -------------------------------- ### Running Reposilite with Parameters Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/installation/general.md Example of how to run Reposilite with a parameter using the command line. ```bash $ java -jar reposilite.jar --parameter=value ``` -------------------------------- ### SBT Publishing Configuration Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/deployment/sbt.md Configuration examples for publishing to Reposilite using SBT, including standard and localhost setups. ```groovy // Standard publishTo := Some("Reposilite" at "https://maven.reposilite.com/releases") credentials += Credentials("Reposilite", "maven.reposilite.com", "token", "secret") // For localhost publishTo := Some("Reposilite" at "http://localhost:8080/releases") credentials += Credentials("Reposilite", "localhost", "token", "secret") ``` -------------------------------- ### Example local configuration file in CDN format Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/installation/general.md This snippet shows an example of a local configuration file for Reposilite using the CDN format. It covers various settings like hostname, port, database connection, SSL, thread pools, and more. ```yaml # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # 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. # 127.0.0.1 will only allow connections from localhost. hostname: 0.0.0.0 # Port to bind port: 8080 # Database configuration. Supported storage providers: # - mysql localhost:3306 database user password # - sqlite reposilite.db # - sqlite --temporary # Experimental providers (not covered with tests): # - postgresql localhost:5432 database user password # - h2 reposilite database: sqlite reposilite.db # Support encrypted connections sslEnabled: true # SSL port to bind sslPort: 443 # Key file to use. # You can specify absolute path to the given file or use ${WORKING_DIRECTORY} variable. # If you want to use .pem certificate you need to specify its path next to the key path. # Example .pem paths setup: # keyPath: ${WORKING_DIRECTORY}/cert.pem ${WORKING_DIRECTORY}/key.pem # Example .jks path setup: # keyPath: ${WORKING_DIRECTORY}/keystore.jks keyPath: ${WORKING_DIRECTORY}/cert.pem ${WORKING_DIRECTORY}/key.pem # Key password to use keyPassword: reposilite # Redirect http traffic to https enforceSsl: false # Max amount of threads used by core thread pool (min: 5) # The web thread pool handles first few steps of incoming http connections, as soon as possible all tasks are redirected to IO thread pool. webThreadPool: 16 # IO thread pool handles all tasks that may benefit from non-blocking IO (min: 2) # Because most of tasks are redirected to IO thread pool, it might be a good idea to keep it at least equal to web thread pool. ioThreadPool: 8 # Database thread pool manages open connections to database (min: 1) # Embedded databases such as SQLite or H2 don't support truly concurrent connections, so the value will be always 1 for them if selected. databaseThreadPool: 1 # Select compression strategy used by this instance. # Using 'none' reduces usage of CPU & memory, but ends up with higher transfer usage. # GZIP is better option if you're not limiting resources that much to increase overall request times. # Available strategies: none, gzip compressionStrategy: none # Default idle timeout used by Jetty idleTimeout: 30000 # Adds cache bypass headers to each request from /api/* scope served by this instance. # Helps to avoid various random issues caused by proxy provides (e.g. Cloudflare) and browsers. bypassExternalCache: true # Amount of messages stored in cached logger. cachedLogSize: 50 # Enable default frontend with dashboard defaultFrontend: true # Set custom base path for Reposilite instance. # It's not recommended to mount Reposilite under custom base path # and you should always prioritize subdomain over this option. basePath: / # Debug mode debugEnabled: false ``` -------------------------------- ### Prometheus Metric Example Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/plugins/prometheus.md Example of a Prometheus metric exposed by the plugin. ```text TYPE jetty_queued_thread_pool_jobs gauge jetty_queued_thread_pool_jobs 0.0 ``` -------------------------------- ### Example Prometheus Metrics Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/plugins/prometheus.md Example of metrics exposed by the Prometheus plugin. ```text # HELP jetty_requests_total Number of requests # TYPE jetty_requests_total counter jetty_requests_total 21.0 # HELP jetty_requests_active Number of requests currently active # TYPE jetty_requests_active gauge jetty_requests_active 1.0 # HELP jetty_requests_active_max Maximum number of requests that have been active at once # TYPE jetty_requests_active_max gauge jetty_requests_active_max 1.0 # HELP jetty_request_time_max_seconds Maximum time spent handling requests # TYPE jetty_request_time_max_seconds gauge jetty_request_time_max_seconds 0.087 # HELP jetty_request_time_seconds_total Total time spent in all request handling # TYPE jetty_request_time_seconds_total counter jetty_request_time_seconds_total 0.126 # HELP jetty_dispatched_total Number of dispatches # TYPE jetty_dispatched_total counter jetty_dispatched_total 21.0 # HELP jetty_dispatched_active Number of dispatches currently active # TYPE jetty_dispatched_active gauge jetty_dispatched_active 1.0 # HELP jetty_dispatched_active_max Maximum number of active dispatches being handled # TYPE jetty_dispatched_active_max gauge jetty_dispatched_active_max 1.0 # HELP jetty_dispatched_time_max Maximum time spent in dispatch handling # TYPE jetty_dispatched_time_max gauge jetty_dispatched_time_max 87.0 # HELP jetty_dispatched_time_seconds_total Total time spent in dispatch handling # TYPE jetty_dispatched_time_seconds_total counter jetty_dispatched_time_seconds_total 0.126 # HELP jetty_async_requests_total Total number of async requests # TYPE jetty_async_requests_total counter jetty_async_requests_total 0.0 # HELP jetty_async_requests_waiting Currently waiting async requests # TYPE jetty_async_requests_waiting gauge jetty_async_requests_waiting 0.0 # HELP jetty_async_requests_waiting_max Maximum number of waiting async requests # TYPE jetty_async_requests_waiting_max gauge jetty_async_requests_waiting_max 0.0 # HELP jetty_async_dispatches_total Number of requested that have been asynchronously dispatched # TYPE jetty_async_dispatches_total counter jetty_async_dispatches_total 0.0 # HELP jetty_expires_total Number of async requests requests that have expired # TYPE jetty_expires_total counter jetty_expires_total 0.0 # HELP jetty_responses_total Number of requests with response status # TYPE jetty_responses_total counter jetty_responses_total{code="1xx",} 0.0 jetty_responses_total{code="2xx",} 18.0 jetty_responses_total{code="3xx",} 0.0 jetty_responses_total{code="4xx",} 2.0 jetty_responses_total{code="5xx",} 0.0 # HELP jetty_stats_seconds Time in seconds stats have been collected for # TYPE jetty_stats_seconds gauge jetty_stats_seconds 8.821 # HELP jetty_responses_bytes_total Total number of bytes across all responses # TYPE jetty_responses_bytes_total counter jetty_responses_bytes_total 62374.0 # HELP jetty_queued_thread_pool_threads Number of total threads # TYPE jetty_queued_thread_pool_threads gauge jetty_queued_thread_pool_threads 16.0 # HELP jetty_queued_thread_pool_utilization Percentage of threads in use # TYPE jetty_queued_thread_pool_utilization gauge jetty_queued_thread_pool_utilization 1.0 # HELP jetty_queued_thread_pool_threads_idle Number of idle threads # TYPE jetty_queued_thread_pool_threads_idle gauge jetty_queued_thread_pool_threads_idle 8.0 # HELP jetty_queued_thread_pool_jobs Number of total jobs ``` -------------------------------- ### Shared Configuration File Example Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/installation/general.md An example of a shared configuration file in JSON format, illustrating various settings for authentication, statistics, frontend, web, and Maven repositories. ```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": [] } ] } } ``` -------------------------------- ### Allowed Groups Example Source: https://github.com/dzikoysk/reposilite/blob/main/reposilite-site/data/guides/features/mirrors.md An example of how to specify allowed groups for proxied artifacts. ```bash org.reposilite ```