### Access Team Password Manager Installer Source: https://teampasswordmanager.com/docs/install This is an example URL to access the Team Password Manager installer. Replace 'teampasswordmanager.mydomain.com' with your actual domain or server address where the files have been uploaded. This step initiates the setup process. ```http http://teampasswordmanager.mydomain.com/index.php/install ``` -------------------------------- ### Directory Listing Example Source: https://teampasswordmanager.com/docs/install-ubuntu-22 This command output shows the expected directory structure and permissions after creating the necessary folders and setting ownership for the Team Password Manager installation. It confirms that the 'public_html' directory is owned by the current user and has appropriate read/write/execute permissions. ```bash myuser@myhostname:/var/www/html/tpm.mycompany.com$ ls -la total 16 drwxr-xr-x 4 root root 4096 Oct 24 18:28 . drwxr-xr-x 3 root root 4096 Oct 24 18:28 .. drwxr-xr-x 2 root root 4096 Oct 24 18:28 logs drwxr-xr-x 2 myuser myuser 4096 Oct 24 18:28 public_html ``` -------------------------------- ### Making a GET Request (Example) Source: https://teampasswordmanager.com/docs/api-v5 An example using `curl` to demonstrate making a GET request to fetch a list of passwords using HTTP Basic Authentication. ```APIDOC ## GET /passwords Example ### Description This example shows how to fetch a list of passwords using a GET request with HTTP Basic Authentication via `curl`. ### Method GET ### Endpoint ``` https://tpm.mydomain.com/index.php/api/v5/passwords.json ``` ### Request Example ```bash curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -i https://tpm.mydomain.com/index.php/api/v5/passwords.json ``` ### Notes - Replace `username` and `password` with your Team Password Manager credentials. - Replace `https://tpm.mydomain.com` with the actual URL of your Team Password Manager installation. - The `-i` flag includes response headers in the output. ``` -------------------------------- ### Install MySQL 8 Server on Ubuntu Source: https://teampasswordmanager.com/docs/install-ubuntu-22 Installs the MySQL 8 server package using apt. After installation, it's recommended to run the security script to secure the MySQL installation by setting a root password and configuring other security parameters. ```bash sudo apt install mysql-server sudo mysql_secure_installation ``` -------------------------------- ### Install SourceGuardian Loader for PHP Source: https://teampasswordmanager.com/docs/install-ubuntu-22 Steps to install the SourceGuardian Loader by copying the extension file and updating the PHP configuration. Requires downloading the loader from SourceGuardian's website. ```bash # Unzip loaders.linux-x86_64.zip # Copy ixed.8.2.lin to /usr/lib/php/20220829 # Edit /etc/php/8.2/apache2/php.ini and add: extension=ixed.8.2.lin $ sudo systemctl restart apache2 ``` -------------------------------- ### Running Docker Compose Application Source: https://teampasswordmanager.com/docs/docker-compose This command initiates the Docker Compose setup defined in the `docker-compose.yml` file. It downloads necessary images, creates and starts containers for Team Password Manager and MySQL in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Install Apache Web Server Source: https://teampasswordmanager.com/docs/install-ubuntu-22 Installs the Apache 2.4 web server on the Ubuntu system. Apache is a popular web server used to host websites and web applications. ```bash sudo apt install apache2 ``` -------------------------------- ### Install and Configure ionCube Loader for PHP Source: https://teampasswordmanager.com/docs/install-ubuntu-20 This snippet demonstrates how to install the ionCube Loader extension for PHP. It involves downloading the loader, copying the SO file to the PHP extension directory, and updating the `php.ini` configuration file. Finally, it shows how to verify the installation using `phpinfo()` and restart the Apache web server. ```shell $ sudo systemctl restart apache2 ``` ```php '; print_r($arr_body); ?> ``` -------------------------------- ### Backup Team Password Manager Database using Command Line Source: https://teampasswordmanager.com/docs/backup This command-line utility is used to create a SQL backup file of the Team Password Manager database. It requires the database user credentials and the database name. The output is a .sql file containing the entire database structure and data. ```bash mysqldump -uuser -ppassword tpm_database > backup_file.sql ``` -------------------------------- ### Install PHP 7.4 and Required Modules on Ubuntu Source: https://teampasswordmanager.com/docs/install-ubuntu-20 Installs PHP 7.4 along with essential modules required for Team Password Manager, including CLI, MySQL, LDAP, cURL, and GD support. It also guides on checking the PHP version and configuring the timezone in php.ini. ```bash $ sudo apt install php7.4 php7.4-cli php7.4-mysql php7.4-mbstring php7.4-ldap php7.4-curl php7.4-gd php7.4-xml $ php -v ``` -------------------------------- ### Quick Example using cURL Source: https://teampasswordmanager.com/docs/api-v1 Demonstrates how to fetch a list of passwords using cURL with HTTP Basic Authentication. ```APIDOC ## Quick Example This `curl` example fetches the list of passwords using HTTP Basic Authentication: ```bash curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -i https://tpm.mydomain.com/index.php/api/v1/passwords.json ``` Replace `username`, `password`, and `https://tpm.mydomain.com` with your actual credentials and installation URL. ``` -------------------------------- ### Install MySQL 5.7 Server Source: https://teampasswordmanager.com/docs/install-ubuntu-18 Installs the MySQL 5.7 server package on Ubuntu. After installation, it guides through securing the installation by setting a root password, removing anonymous users, disallowing remote root login, and removing the test database. ```bash sudo apt install mysql-server-5.7 sudo mysql_secure_installation ``` -------------------------------- ### Configure PHP 8.2 Timezone Source: https://teampasswordmanager.com/docs/install-ubuntu-22 Sets the timezone for PHP 8.2 by editing the `php.ini` file. This ensures that date and time functions in PHP applications correctly reflect the server's or application's intended timezone. The example sets the timezone to "Europe/London". ```ini ; Example line in /etc/php/8.2/apache2/php.ini date.timezone = "Europe/London" ``` -------------------------------- ### List Passwords (First Page) - PHP Example Source: https://teampasswordmanager.com/docs/api-v2 This PHP script demonstrates how to fetch the first page of passwords using cURL. It includes setting up the base URL, request URI, authentication credentials, headers, and handling the response. ```php '; print_r($arr_body); ?> ``` -------------------------------- ### Install and Configure Fail2ban on Ubuntu Source: https://teampasswordmanager.com/docs/install-ubuntu-18 Installs Fail2ban, a service that protects the server from brute-force attacks by monitoring log files and banning suspicious IP addresses. It also includes basic configuration setup. ```bash $ sudo apt install fail2ban $ sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local ``` -------------------------------- ### Example SHA256 Checksum Verification (macOS) Source: https://teampasswordmanager.com/docs/md5-checksum An example showing the verification of a SHA256 checksum for a downloaded file on macOS. This example clarifies the command syntax and the structure of the output, aiding in file integrity confirmation. ```bash $ shasum -a 256 teampasswordmanager_12.152.275.zip 5a57bcc73bda953433135c4348a63815e2acac8c9ce1d87a70ad0c73238dd4a2 teampasswordmanager_12.152.275.zip ``` -------------------------------- ### Create MySQL Database and User for Team Password Manager Source: https://teampasswordmanager.com/docs/install-ubuntu-20 This section details the SQL commands required to set up a MySQL database and a dedicated user for Team Password Manager. It includes creating the database with specific character set and collation, creating a user with a password, and granting all necessary privileges to that user on the created database. It also highlights the use of `mysql_native_password` due to PHP compatibility. ```sql $ sudo mysql mysql> CREATE DATABASE `tpm_database` CHARACTER SET utf8 COLLATE utf8_unicode_ci; mysql> CREATE USER 'tpm_user'@'%' IDENTIFIED WITH mysql_native_password BY 'tpmPass%2022'; mysql> GRANT ALL ON tpm_database.* TO 'tpm_user'@'%'; mysql> FLUSH PRIVILEGES; ``` -------------------------------- ### Install PHP 8.2 and Required Modules on Ubuntu Source: https://teampasswordmanager.com/docs/install-ubuntu-22 Installs PHP 8.2 and essential modules for Team Password Manager on Ubuntu 22.04. This involves adding a PPA for newer PHP versions, updating package lists, and then installing the specific PHP version and modules like cli, mysql, mbstring, ldap, curl, gd, and xml. ```bash sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php8.2 php8.2-cli php8.2-mysql php8.2-mbstring php8.2-ldap php8.2-curl php8.2-gd php8.2-xml ``` -------------------------------- ### Example MD5 Checksum Verification (macOS) Source: https://teampasswordmanager.com/docs/md5-checksum An example demonstrating how to check the MD5 checksum of a specific downloaded file on macOS. This illustrates the command usage and expected output format for verification. ```bash $ md5 teampasswordmanager_10.135.236.zip MD5 (teampasswordmanager_12.152.275.zip) = 2b22da4d3075f1f337d3bcfe292e1b65 ``` -------------------------------- ### PHP Example for Searching Projects API v4 Source: https://teampasswordmanager.com/docs/api-v4-projects An example demonstrating how to construct a search URL for projects using PHP, including URL encoding the search string. This is necessary for the `/projects/search/urlencoded_string.json` endpoint. ```PHP $search_string = 'website'; // Find projects that contain "website" $search_string_urlencoded = urlencode($search_string); $request_url = 'https://YOUR_TPM_URL/index.php/api/v4/projects/search/' . $search_string_urlencoded . '.json'; ``` -------------------------------- ### Bash Script for Team Password Manager Provisioning Source: https://teampasswordmanager.com/docs/install-vagrant-virtualbox The provision.sh script installs and configures all required software for Team Password Manager, including the web server, database, PHP, and Team Password Manager itself. This script is executed by Vagrant upon running 'vagrant up'. ```bash # This script is called by Vagrantfile when the `vagrant up` command is executed. # It installs and configures the software required to run Team Password Manager # and also Team Password Manager itself. ``` -------------------------------- ### Show a Specific Password (PHP & cURL) Source: https://teampasswordmanager.com/docs/api-v5 This snippet shows how to retrieve all data for a specific password using its internal ID. It involves making a GET request to the '/passwords/{id}.json' endpoint. The PHP example modifies the `$req_uri` from the previous example, while the cURL example directly specifies the password ID in the URL. ```php $req_uri = 'api/v5/passwords/1.json'; // GET /passwords/1.json ``` ```curl curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -i https://tpm.mydomain.com/index.php/api/v5/passwords/1.json ``` -------------------------------- ### Display PHP Configuration with phpinfo() Source: https://teampasswordmanager.com/docs/phpinfo This snippet demonstrates how to create a simple PHP file that utilizes the built-in phpinfo() function to display detailed information about the current PHP environment. This is useful for verifying PHP version, installed modules, and configuration settings. ```php ``` -------------------------------- ### Project List Example Response (JSON) Source: https://teampasswordmanager.com/docs/api-projects This is an example of a successful JSON response when listing projects. It includes detailed information for each project such as ID, name, full path, tags, archive status, favorite status, file count, manager details, creator, and update timestamps. ```JSON [ { "id": 5, "name": "Company projects", "full_path": [ { "id": 6, "name": "Internal", "archived": false }, { "id": 5, "name": "Company projects", "archived": false } ], "tags": "project", "archived": false, "favorite": false, "num_files": 0, "managed_by": { "id": 1, "username": "john", "email_address": "john@teampasswordmanager.com", "name": "John Boss", "role": "Admin" }, "created_by": { "id": 1 }, "created_on": "2024-12-16 14:36:08", "updated_by": { "id": 1 }, "updated_on": "2024-12-16 19:00:24" }, { "id": 18, "name": "www.fictionalgadgetsite.com", "full_path": [ { "id": 6, "name": "Internal", "archived": false }, { "id": 5, "name": "Company projects", "archived": false }, { "id": 18, "name": "www.fictionalgadgetsite.com", "archived": false } ], "tags": "client", "archived": false, "favorite": false, "num_files": 0, "managed_by": { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, "created_by": { "id": 1 }, "created_on": "2024-12-16 14:36:08", "updated_by": { "id": 1 }, "updated_on": "2024-12-16 14:36:08" }, ... ] ``` -------------------------------- ### GET /passwords.json Source: https://teampasswordmanager.com/docs/api-v1-authentication Example of retrieving a list of passwords using HTTP Basic Authentication. ```APIDOC ## GET /passwords.json ### Description Retrieves a list of passwords accessible to the authenticated user. This example demonstrates usage with HTTP Basic Authentication. ### Method GET ### Endpoint `/api/v1/passwords.json` ### Parameters None for this endpoint. ### Request Example #### curl ```bash curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -i https://tpm.mydomain.com/index.php/api/v1/passwords.json ``` #### PHP ```php '; print_r($arr_body); ?> ``` ### Response #### Success Response (200) - **Array of passwords** (array) - Contains password entries. #### Response Example ```json { "passwords": [ { "id": 1, "name": "Example Password", "description": "This is an example password entry.", "url": "http://example.com" } ] } ``` ``` -------------------------------- ### Get Groups List Source: https://teampasswordmanager.com/docs/api-v2-passwords Retrieves a list of groups within the Team Password Manager installation. ```http GET /groups.json ``` -------------------------------- ### Get Users List Source: https://teampasswordmanager.com/docs/api-v2-passwords Retrieves a list of users within the Team Password Manager installation. ```http GET /users.json ``` -------------------------------- ### Verifying Directory Structure and Permissions Source: https://teampasswordmanager.com/docs/install-ubuntu This command lists the contents of the Team Password Manager installation directory with detailed information, including ownership, permissions, and timestamps. This is used to verify that the directory creation, ownership, and permission settings were applied correctly. ```bash myuser@myhostname:/var/www/html/tpm.mycompany.com$ ls -la total 16 drwxr-xr-x 4 www-data www-data 4096 Mar 11 12:42 . drwxr-xr-x 3 root root 4096 Mar 11 12:42 .. drwxr-s--- 2 www-data www-data 4096 Mar 11 12:49 logs drwxrws--- 7 www-data www-data 4096 Mar 11 19:29 public_html ``` -------------------------------- ### Create Project using cURL and PHP Source: https://teampasswordmanager.com/docs/api-v3 Demonstrates how to create a new project in Teampasswordmanager via the API. It requires authentication credentials and project name. The response includes the status code and details of the created project. ```curl curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -d '{"name":"My new project"}' \ -i https://tpm.mydomain.com/index.php/api/v3/projects.json ``` ```php 'This is a new project' )); // Request $ch = curl_init($tpm_base_url . $req_uri); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, TRUE); // Includes the header in the output curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body); $result = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); // Get headers and body list($headers, $body) = explode("\r\n\r\n", $result, 2); $arr_headers = explode("\r\n", $headers); $arr_body = json_decode($body, TRUE); // Show status and the new project id echo 'Status: ' . $status . '
'; print_r($arr_body); ?> ``` -------------------------------- ### Verifying Directory Structure and Permissions Source: https://teampasswordmanager.com/docs/install-ubuntu-18 This command lists the contents of the Team Password Manager installation directory in a long format, showing details about ownership, permissions, and modification times. It's used to verify that the `public_html` and `logs` directories have been created correctly and that the ownership and permissions for `public_html` are set as intended. ```bash myuser@myhostname:/var/www/html/tpm.mycompany.com$ ls -la total 16 drwxr-xr-x 4 root root 4096 Mar 28 18:28 . drwxr-xr-x 3 root root 4096 Mar 28 18:28 .. drwxr-xr-x 2 root root 4096 Mar 28 18:28 logs drwxr-xr-x 2 myuser myuser 4096 Mar 28 18:28 public_html ``` -------------------------------- ### Making a GET Request to Fetch Passwords Source: https://teampasswordmanager.com/docs/api This example demonstrates how to use `curl` to make a GET request to the Team Password Manager API to fetch a list of passwords using HTTP Basic Authentication. It includes the necessary headers and URL structure. ```APIDOC ## GET /api/v6/passwords.json ### Description Fetches a list of passwords for the authenticated user. ### Method GET ### Endpoint `YOUR_TEAM_PASSWORD_MANAGER_URL/index.php/api/v6/passwords.json` ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -u username:password \ -H 'Content-Type: application/json; charset=utf-8' \ -i https://tpm.mydomain.com/index.php/api/v6/passwords.json ``` ### Response #### Success Response (200) - **Array of Password Objects**: Contains password details. #### Response Example ```json { "example": "[Your password objects here]" } ``` ```