### Start Outline Server from Source (Node.js) Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Builds and starts the Outline Server using Node.js. Ensure Docker, Node.js LTS, and NPM are installed. ```sh task shadowbox:start ``` -------------------------------- ### Start Outline Server from Source (Docker) Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Builds and starts the Outline Server using a Docker container. Ensure Docker, Node.js LTS, and NPM are installed. ```sh task shadowbox:docker:start ``` -------------------------------- ### Install Outline Server Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Installs the Outline Server using the provided script. Ensure you have sudo privileges. ```sh sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/OutlineFoundation/outline-apps/master/server_manager/install_scripts/install_server.sh)" ``` -------------------------------- ### Install Outline Server with Custom Flags Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Installs the Outline Server with custom hostname and port configurations. Use --preserve-env with sudo if environment variables are needed. ```sh sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/OutlineFoundation/outline-apps/master/server_manager/install_scripts/install_server.sh)" install_server.sh \ --hostname=myserver.com \ --keys-port=443 ``` -------------------------------- ### Start Outline Server Source: https://github.com/outlinefoundation/outline-server/blob/master/README.md Starts the Shadowbox component of the Outline Server. Refer to the Shadowbox README for more configuration options. ```sh ./task shadowbox:start ``` -------------------------------- ### Install Dependencies Source: https://github.com/outlinefoundation/outline-server/blob/master/README.md Installs the necessary project dependencies using npm. Ensure Node.js LTS and npm are installed beforehand. ```sh npm install ``` -------------------------------- ### List All Tasks Source: https://github.com/outlinefoundation/outline-server/blob/master/CONTRIBUTING.md Use this command to display all available tasks that can be run with Task. Ensure Task is installed and in your PATH. ```sh task -a ``` -------------------------------- ### Run a Task Source: https://github.com/outlinefoundation/outline-server/blob/master/CONTRIBUTING.md Use this command to execute a specific task defined in the Taskfile. Ensure Task is installed and in your PATH. ```sh task [task_name] ``` -------------------------------- ### Find Outline Server apiUrl Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Retrieves the apiUrl for the Outline Server, typically used for API management. This command is for servers deployed via the installation script. ```sh grep "apiUrl" /opt/outline/access.txt | cut -d: -f 2- ``` -------------------------------- ### Set Data Limit for Access Keys Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Sets a data transfer limit for all access keys. This example limits outbound data to 1MB over 30 days. Adjust 'bytes' value as needed. ```sh curl --insecure -X PUT -H "Content-Type: application/json" -d '{"limit": {"bytes": 1000}}' $API_URL/server/access-key-data-limit ``` -------------------------------- ### Get Specific Access Key Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Retrieves details for a specific access key identified by its ID. Replace $API_URL and '1' with your server's API URL and the key ID. ```sh curl --insecure $API_URL/access-keys/1 ``` -------------------------------- ### Delete Outline Server Test Config Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Removes the existing Shadowbox server configuration file located at /tmp/outline/persisted-state/shadowbox_server_config.json. This is necessary when changes to server config fields require a fresh start. ```sh rm /tmp/outline/persisted-state/shadowbox_server_config.json ``` -------------------------------- ### Build and Test Outline Server Image Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/integration_test/README.md Use this command to build and test the Outline Server image. ```sh task shadowbox:integration_test ``` -------------------------------- ### Test Outline Server Image with Podman Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/integration_test/README.md Use Podman instead of Docker by setting the DOCKER environment variable to 'podman'. ```sh DOCKER=podman task shadowbox:integration_test ``` -------------------------------- ### Build Metrics Server Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to build the Outline Metrics Server. Run this before deploying or running locally. ```sh task metrics_server:build ``` -------------------------------- ### Create Access Key Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Creates a new access key on the Outline Server. Replace $API_URL with your server's actual API URL. ```sh curl --insecure -X POST $API_URL/access-keys ``` -------------------------------- ### Run Unit Tests for Metrics Server Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to execute the unit tests for the Outline Metrics Server. Run this to verify individual components. ```sh task metrics_server:test ``` -------------------------------- ### Deploy Metrics Server to Prod Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to deploy the Outline Metrics Server to the production environment. Manual traffic migration is required via the Google Cloud console. ```sh task metrics_server:deploy:prod ``` -------------------------------- ### Run Local Metrics Server Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to run a local development instance of the Outline Metrics Server. Useful for testing. ```sh task metrics_server:start ``` -------------------------------- ### Deploy Metrics Server to Dev Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to deploy the Outline Metrics Server to the development environment. Traffic is not automatically migrated. ```sh task metrics_server:deploy:dev ``` -------------------------------- ### Run Integration Tests for Metrics Server Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Command to execute the integration tests for the Outline Metrics Server. Run this to verify system interactions. ```sh task metrics_server:integration_test ``` -------------------------------- ### Build Outline Sentry Webhook Source: https://github.com/outlinefoundation/outline-server/blob/master/src/sentry_webhook/README.md Builds the Outline Sentry webhook using the provided task command. Ensure Google Cloud SDK and Sentry access are configured. ```sh task sentry_webhook:build ``` -------------------------------- ### List Access Keys Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Retrieves a list of all access keys configured on the Outline Server. Replace $API_URL with your server's actual API URL. ```sh curl --insecure $API_URL/access-keys/ ``` -------------------------------- ### Deploy Outline Sentry Webhook Source: https://github.com/outlinefoundation/outline-server/blob/master/src/sentry_webhook/README.md Deploys the Outline Sentry webhook using the provided task command after authenticating with Google Cloud. ```sh task sentry_webhook:deploy ``` -------------------------------- ### Test Specific Outline Server Image Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/integration_test/README.md Run the test directly for a specific image without the build step. Specify the image name using IMAGE_NAME. ```sh ./task shadowbox:test_image IMAGE_NAME=quay.io/outline/shadowbox:stable ``` -------------------------------- ### Debug Running Docker Container Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Provides interactive shell access to a running Outline Server Docker container named 'shadowbox'. ```sh docker exec -it shadowbox sh ``` -------------------------------- ### Authenticate Google Cloud SDK Source: https://github.com/outlinefoundation/outline-server/blob/master/src/sentry_webhook/README.md Logs in to the Google Cloud SDK for authentication. This is a prerequisite for deploying Google Cloud Run functions. ```sh gcloud auth login ``` -------------------------------- ### Test Outline Server API Endpoint Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Sends a test request to the Outline Server's default API endpoint. Use --insecure if SSL certificate verification is not required. ```sh curl --insecure https://[::]:8081/TestApiPrefix/server ``` -------------------------------- ### Clean Project Files Source: https://github.com/outlinefoundation/outline-server/blob/master/README.md Removes generated build files and cleans up the project. This command is useful for ensuring a fresh build environment. ```sh ./task clean ``` -------------------------------- ### Access Keys Management API Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md The Outline Server provides a REST API for managing access keys. These endpoints allow for direct manipulation of server access keys via HTTP requests. ```APIDOC ## GET /access-keys/ ### Description Retrieves a list of all access keys configured on the server. ### Method GET ### Endpoint /access-keys/ ### Response #### Success Response (200) - **keys** (array) - A list of access key objects. - **id** (integer) - The unique identifier for the access key. - **name** (string) - The name of the access key. - **port** (integer) - The port associated with the access key. - **certSha256** (string) - The SHA256 hash of the certificate. - **methodName** (string) - The encryption method used. - **usageLimit** (object) - The data usage limit for the access key. - **bytes** (integer) - The limit in bytes. - **lastUpdated** (string) - The timestamp when the limit was last updated. ### Response Example { "keys": [ { "id": 1, "name": "My Key", "port": 12345, "certSha256": "...", "methodName": "aes-128-gcm", "usageLimit": { "bytes": 1000000000, "lastUpdated": "2023-10-27T10:00:00Z" } } ] } ## POST /access-keys/ ### Description Creates a new access key on the server. ### Method POST ### Endpoint /access-keys/ ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the newly created access key. - **name** (string) - The name of the access key. - **port** (integer) - The port associated with the access key. - **certSha256** (string) - The SHA256 hash of the certificate. - **methodName** (string) - The encryption method used. ### Response Example { "id": 2, "name": "New Key", "port": 54321, "certSha256": "...", "methodName": "aes-128-gcm" } ## GET /access-keys/{id} ### Description Retrieves a specific access key by its ID. ### Method GET ### Endpoint /access-keys/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the access key to retrieve. ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the access key. - **name** (string) - The name of the access key. - **port** (integer) - The port associated with the access key. - **certSha256** (string) - The SHA256 hash of the certificate. - **methodName** (string) - The encryption method used. - **usageLimit** (object) - The data usage limit for the access key. - **bytes** (integer) - The limit in bytes. - **lastUpdated** (string) - The timestamp when the limit was last updated. ### Response Example { "id": 1, "name": "My Key", "port": 12345, "certSha256": "...", "methodName": "aes-128-gcm", "usageLimit": { "bytes": 1000000000, "lastUpdated": "2023-10-27T10:00:00Z" } } ## PUT /access-keys/{id}/name ### Description Renames an existing access key. ### Method PUT ### Endpoint /access-keys/{id}/name ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the access key to rename. #### Request Body - **name** (string) - Required - The new name for the access key. ### Request Example { "name": "New Name for Key 1" } ## DELETE /access-keys/{id} ### Description Removes an access key from the server. ### Method DELETE ### Endpoint /access-keys/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the access key to remove. ## PUT /server/access-key-data-limit ### Description Sets a data limit for all access keys on the server. This limit applies to outbound data transfer. ### Method PUT ### Endpoint /server/access-key-data-limit ### Parameters #### Request Body - **limit** (object) - Required - The data limit configuration. - **bytes** (integer) - Required - The data limit in bytes. ### Request Example { "limit": { "bytes": 1000000 } } ## DELETE /server/access-key-data-limit ### Description Removes the data limit previously set for all access keys on the server. ### Method DELETE ### Endpoint /server/access-key-data-limit ``` -------------------------------- ### Debug Docker Image Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Runs a Docker container for debugging the Outline Server image. This command allows interactive shell access to the image. ```sh docker run --rm -it --entrypoint=sh localhost/outline/shadowbox ``` -------------------------------- ### Remove Access Key Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Deletes a specific access key from the Outline Server. Replace $API_URL and '1' with your server's API URL and the key ID. ```sh curl --insecure -X DELETE $API_URL/access-keys/1 ``` -------------------------------- ### POST /features Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Reports feature usage. This endpoint is used to send information about feature adoption and configuration, such as data limits. ```APIDOC ## POST /features ### Description Reports feature usage. This endpoint is used to send information about feature adoption and configuration, such as data limits. ### Method POST ### Endpoint /features ### Request Body - **serverId** (string) - Required - The unique identifier for the server. - **serverVersion** (string) - Required - The version of the Outline server. - **timestampUtcMs** (number) - Required - The timestamp when the feature usage was recorded, in milliseconds since the Unix epoch. - **dataLimit** (object) - Optional - Configuration details for data limits. - **enabled** (boolean) - Required - Indicates if data limiting is enabled. - **perKeyLimitCount** (number) - Required - The limit count per key. ### Response #### Success Response (200) This endpoint does not specify a success response body in the documentation. ``` -------------------------------- ### Feature Usage Metrics Schema Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Schema for reporting feature usage. Use this when sending feature metrics. ```json { "serverId": "string", "serverVersion": "string", "timestampUtcMs": number, "dataLimit": { "enabled": boolean, "perKeyLimitCount": number } } ``` -------------------------------- ### Connections Metrics Schema Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Schema for reporting server data usage broken down by user. Use this when sending connection metrics. ```json { "serverId": "string", "startUtcMs": number, "endUtcMs": number, "userReports": [{ "countries": string[], "asn": number, "bytesTransferred": number, "tunnelTimeSec": number, }] } ``` -------------------------------- ### POST /connections Source: https://github.com/outlinefoundation/outline-server/blob/master/src/metrics_server/README.md Reports server data usage broken down by user. This endpoint is used to send connection metrics, including bytes transferred and tunnel time, for individual users. ```APIDOC ## POST /connections ### Description Reports server data usage broken down by user. This endpoint is used to send connection metrics, including bytes transferred and tunnel time, for individual users. ### Method POST ### Endpoint /connections ### Request Body - **serverId** (string) - Required - The unique identifier for the server. - **startUtcMs** (number) - Required - The start timestamp of the reporting period in milliseconds since the Unix epoch. - **endUtcMs** (number) - Required - The end timestamp of the reporting period in milliseconds since the Unix epoch. - **userReports** (array) - Required - An array of user-specific reports. - **countries** (string[]) - Required - A list of countries associated with the user. - **asn** (number) - Required - The Autonomous System Number (ASN) of the user's network. - **bytesTransferred** (number) - Required - The total bytes transferred by the user during the period. - **tunnelTimeSec** (number) - Required - The total tunnel time in seconds for the user during the period. ### Response #### Success Response (200) This endpoint does not specify a success response body in the documentation. ``` -------------------------------- ### Remove Access Key Data Limit Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Removes any previously set data transfer limit for all access keys on the Outline Server. ```sh curl --insecure -X DELETE $API_URL/server/access-key-data-limit ``` -------------------------------- ### Rename Access Key Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Renames an existing access key. Replace $API_URL and '2' with your server's API URL and the key ID, and 'albion' with the desired new name. ```sh curl --insecure -X PUT -F 'name=albion' $API_URL/access-keys/2/name ``` -------------------------------- ### Cleanup Dangling Docker Images Source: https://github.com/outlinefoundation/outline-server/blob/master/src/shadowbox/README.md Removes all dangling Docker images from your system to free up disk space. ```sh docker rmi $(docker images -f dangling=true -q) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.