### Install Nginx Source: https://taskview.tech/docs/guides/deploy-vps-nginx Installs the Nginx web server on the system. ```bash sudo apt install nginx -y ``` -------------------------------- ### Install Docker on Ubuntu Source: https://taskview.tech/docs/guides/deploy-vps-nginx Installs Docker and adds the current user to the docker group. Log out and back in for group changes to apply. ```bash sudo apt update && sudo apt upgrade -y curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USER # Log out and back in for the group change to take effect ``` -------------------------------- ### Full .env.taskview Example with Integrations Source: https://taskview.tech/docs/integrations/setup An example of a complete .env.taskview file demonstrating required encryption keys and optional GitHub and GitLab integration configurations. ```env # ... existing vars ... # Encryption (required for integrations) ENCRYPTION_KEY=a1b2c3d4e5f6... # 64 hex characters # GitHub Integration OAuth GITHUB_INTEGRATION_CLIENT_ID=Iv1.abc123 GITHUB_INTEGRATION_CLIENT_SECRET=secret_abc123 GITHUB_INTEGRATION_CALLBACK_URL=http://localhost:1401/module/integrations/oauth/github/callback # GitLab Integration OAuth (optional) GITLAB_INTEGRATION_CLIENT_ID=app_id_123 GITLAB_INTEGRATION_CLIENT_SECRET=secret_123 GITLAB_INTEGRATION_CALLBACK_URL=http://localhost:1401/module/integrations/oauth/gitlab/callback ``` -------------------------------- ### Verify Docker Installation Source: https://taskview.tech/docs/guides/deploy-vps-nginx Checks if Docker and Docker Compose are installed correctly by displaying their versions. ```bash docker --version docker compose version ``` -------------------------------- ### Full .env.taskview Example Source: https://taskview.tech/docs/configuration/environment-variables This is a comprehensive example of a .env.taskview file for a production deployment. It includes settings for database, application ports, JWT, SMTP, OAuth providers, and integrations. ```env DB_HOST="db" DB_USER="taskview_db_user" DB_PASSWORD="password" DB_NAME="taskview" DB_PORT=5432 APP_PORT=1401 JWT_ALG="HS256" JWT_SIGN="secret" ACCESS_LIFE_TIME="3d" REFRESH_LIFE_TIME="9d" SMTP_HOST=smtp SMTP_PORT=587 SMTP_USERNAME= SMTP_PASSWORD= SMTP_ENCRYPTION=tls SMTP_FROM_NAME=TaskView SMTP_FROM_EMAIL= # Your domain APP_URL="https://app.taskview.tech" GOOGLE_CLIENT_ID="" GOOGLE_CLIENT_SECRET="" #You domain GOOGLE_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/google/callback" GITHUB_CLIENT_ID="" GITHUB_CLIENT_SECRET="" GITHUB_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/github/callback" APPLE_CLIENT_ID="" APPLE_TEAM_ID="" APPLE_KEY_ID="" APPLE_KEY_LOCATION="/usr/src/app/AuthKey.p8" # Your domain APPLE_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/apple/callback" #integrations GITHUB_INTEGRATION_CLIENT_ID= GITHUB_INTEGRATION_CLIENT_SECRET= GITHUB_INTEGRATION_CALLBACK_URL=https://api.taskview.tech/module/integrations/oauth/github/callback GITLAB_INTEGRATION_CLIENT_ID= GITLAB_INTEGRATION_CLIENT_SECRET= GITLAB_INTEGRATION_CALLBACK_URL=https://api.taskview.tech/module/integrations/oauth/github/callback ENCRYPTION_KEY= # Messaging integrations TELEGRAM_BOT_TOKEN= TELEGRAM_BOT_USERNAME= TELEGRAM_WEBHOOK_SECRET= # SLACK_CLIENT_ID= # SLACK_CLIENT_SECRET= # SLACK_SIGNING_SECRET= # Notifications (optional) # FIREBASE_CREDENTIALS_PATH=./firebase-credentials.json # CENTRIFUGO_API_URL=http://centrifugo:8000 # CENTRIFUGO_API_KEY=your_centrifugo_api_key # CENTRIFUGO_TOKEN_SECRET=your_centrifugo_token_secret # CENTRIFUGO_PUBLIC_URL=wss://api.example.com/centrifugo/connection/websocket ``` -------------------------------- ### TaskView API Usage Example with Node.js Source: https://taskview.tech/docs/features/api-tokens This example demonstrates fetching, creating, updating tasks, and listing projects using the 'taskview-api' package and Axios. ```javascript import axios from 'axios' import { TvApi } from 'taskview-api' const GOAL_ID = 1 const $axios = axios.create({ baseURL: 'https://your-instance.com', headers: { Authorization: 'Bearer tvk_your_token_here', }, }) const api = new TvApi($axios) // Fetch all tasks in a project const tasks = await api.tasks.fetch({ goalId: GOAL_ID }) console.log(`Found ${tasks.length} tasks`) // Create a new task const newTask = await api.tasks.createTask({ goalId: GOAL_ID, description: 'Task created via API', }) console.log('Created task:', newTask.id) // Update the task description await api.tasks.updateTask({ id: newTask.id, description: 'Updated via API', }) console.log('Task updated') // Fetch projects const goals = await api.goals.fetchGoals() console.log('Projects:', goals.map((g) => g.name)) ``` -------------------------------- ### Start Docker Compose Services Source: https://taskview.tech/docs/getting-started/installation Run this command to start all services defined in your Docker Compose file in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Start TaskView Containers Source: https://taskview.tech/docs/guides/deploy-vps-nginx Starts the TaskView Docker containers in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Install Certbot for Let's Encrypt SSL Source: https://taskview.tech/docs/guides/deploy-vps-nginx Installs Certbot with the Nginx plugin to manage SSL certificates from Let's Encrypt. ```bash sudo apt install certbot python3-certbot-nginx -y ``` -------------------------------- ### Centrifugo Configuration File Example Source: https://taskview.tech/docs/configuration/environment-variables Example JSON configuration for Centrifugo v6. Ensure 'http_api.key' and 'client.token.hmac_secret_key' match your environment variables. 'client.allowed_origins' should list your frontend domain(s). ```json { "client": { "allowed_origins": ["https://app.example.com"], "token": { "hmac_secret_key": "your_centrifugo_token_secret" } }, "channel": { "namespaces": [ { "name": "personal", "presence": false, "join_leave": false, "history_size": 0, "history_ttl": "0s" } ] }, "http_api": { "key": "your_centrifugo_api_key" } } ``` -------------------------------- ### Initiate SSO Login Source: https://taskview.tech/docs/features/sso Starts the SSO login process by redirecting the user to their Identity Provider (IdP). ```APIDOC ## GET /module/sso/login/{configId} ### Description Initiates the SSO login flow by redirecting the user to the configured Identity Provider (IdP). ### Method GET ### Endpoint `/module/sso/login/{configId}` ### Parameters #### Path Parameters - **configId** (string) - Required - The unique identifier for the SSO configuration. ``` -------------------------------- ### API Token Format Example Source: https://taskview.tech/docs/features/api-tokens API tokens use the prefix 'tvk_' followed by 64 hexadecimal characters. ```text tvk_a1b2c3d4e5f6... ``` -------------------------------- ### Obtain SSL Certificates with Certbot Source: https://taskview.tech/docs/guides/deploy-vps-nginx Use Certbot to obtain and install SSL certificates from Let's Encrypt for your specified domains. Certbot will automatically verify domain ownership and configure Nginx. ```bash sudo certbot --nginx -d tasks.yourcompany.com -d api.tasks.yourcompany.com ``` -------------------------------- ### Slack Redirect URL Example Source: https://taskview.tech/docs/integrations/messaging This is the URL that Slack will redirect to after a user authorizes your application. Ensure this matches the Redirect URL configured in your Slack app settings. ```text https:///module/messaging/slack/oauth/callback ``` -------------------------------- ### Get Telegram Webhook Info Source: https://taskview.tech/docs/integrations/messaging Verify that your webhook has been successfully registered with Telegram. This command retrieves the current webhook information, allowing you to check the URL and pending update count. ```bash curl "https://api.telegram.org/bot/getWebhookInfo" ``` -------------------------------- ### Create Project Directory Source: https://taskview.tech/docs/getting-started/installation Create a new directory for your TaskView project and navigate into it. ```bash mkdir taskview && cd taskview ``` -------------------------------- ### Configure PostgreSQL Environment Variables Source: https://taskview.tech/docs/getting-started/installation Set up the environment file for PostgreSQL, defining database credentials. ```env POSTGRES_USER=taskview_db_user POSTGRES_PASSWORD=your_secure_password POSTGRES_DB=taskviewdb ``` -------------------------------- ### Enable Nginx Site Configuration Source: https://taskview.tech/docs/guides/deploy-vps-nginx Create a symbolic link to enable the Nginx site configuration. This command links the configuration file from sites-available to sites-enabled. ```bash sudo ln -s /etc/nginx/sites-available/taskview /etc/nginx/sites-enabled/ ``` -------------------------------- ### Get User Notification Preferences Source: https://taskview.tech/docs/features/notifications Retrieves the current user's notification preferences. ```APIDOC ## GET /module/notifications/preferences ### Description Retrieves the current user's notification preferences, including global and per-project settings. ### Method GET ### Endpoint /module/notifications/preferences ### Response #### Success Response (200) - **preferences** (object) - The user's notification preferences. - **global** (object) - Global notification settings. - **[notification_type]** (object) - Settings for a specific notification type (e.g., 'Deadline'). - **enabled** (boolean) - Whether notifications of this type are enabled. - **channels** (object) - Channel-specific settings. - **push** (boolean) - Whether push notifications are enabled for this type. - **in_app** (boolean) - Whether in-app notifications are enabled for this type. - **projects** (object) - Per-project overrides. - **[project_id]** (object) - Settings for a specific project. - **[notification_type]** (object) - Overridden settings for a notification type within this project. - **enabled** (boolean) - Whether notifications of this type are enabled for this project. - **channels** (object) - Channel-specific settings for this project. - **push** (boolean) - Whether push notifications are enabled for this type in this project. - **in_app** (boolean) - Whether in-app notifications are enabled for this type in this project. ``` -------------------------------- ### Test Nginx Configuration and Restart Source: https://taskview.tech/docs/guides/deploy-vps-nginx Test the Nginx configuration for syntax errors and then restart the Nginx service to apply the changes. This ensures the server is running with the correct configuration. ```bash sudo nginx -t ``` ```bash sudo systemctl restart nginx ``` -------------------------------- ### Get WebSocket Connection Token Source: https://taskview.tech/docs/features/notifications Retrieves a token required for establishing a WebSocket connection for real-time in-app notifications. ```APIDOC ## GET /module/notifications/connection-token ### Description Retrieves a token necessary for the client to establish a WebSocket connection for real-time in-app notifications. ### Method GET ### Endpoint /module/notifications/connection-token ### Response #### Success Response (200) - **token** (string) - The token to be used for WebSocket authentication. - **expires_at** (string) - The expiration time of the token (ISO 8601 format). ``` -------------------------------- ### Configure GitHub OAuth App in .env.taskview Source: https://taskview.tech/docs/integrations/setup Add your GitHub OAuth App's client ID, client secret, and callback URL to your .env.taskview file. Ensure the callback URL matches the one configured in your GitHub OAuth App settings. ```dotenv GITHUB_INTEGRATION_CLIENT_ID= GITHUB_INTEGRATION_CLIENT_SECRET= GITHUB_INTEGRATION_CALLBACK_URL=http://localhost:1401/module/integrations/oauth/github/callback ``` -------------------------------- ### Configure API Server URL Source: https://taskview.tech/docs/getting-started/installation Enter this URL in the web app's server settings to connect to the backend API. ```text http://localhost:1725 ``` -------------------------------- ### Create Nginx Configuration File Source: https://taskview.tech/docs/guides/deploy-vps-nginx Create a new Nginx configuration file for your application. This file will contain server blocks for both HTTP redirection and HTTPS serving. ```bash sudo nano /etc/nginx/sites-available/taskview ``` -------------------------------- ### Configure Encryption Key in .env.taskview Source: https://taskview.tech/docs/integrations/setup Add the generated 64-character hex encryption key to your .env.taskview file. ```dotenv ENCRYPTION_KEY= ``` -------------------------------- ### Create SSO Configuration Source: https://taskview.tech/docs/features/sso Creates a new SSO configuration for an organization. Requires administrator privileges. ```APIDOC ## POST /module/sso/admin/configs ### Description Creates a new SSO configuration for an organization. This operation requires administrator authentication and role. ### Method POST ### Endpoint `/module/sso/admin/configs` ### Parameters #### Request Body (Details of the request body for creating an SSO config would be specified here, but are not provided in the source text.) ``` -------------------------------- ### Configure TaskView API Environment Variables Source: https://taskview.tech/docs/getting-started/installation Configure the environment file for the TaskView API with database connection details, application settings, JWT configuration, SMTP server details, and OAuth client credentials. Remember to replace placeholder values with your actual data and secure secrets. ```env DB_HOST="db" DB_USER="taskview_db_user" DB_PASSWORD="your_secure_password" DB_NAME="taskviewdb" DB_PORT=5432 APP_PORT=1401 JWT_ALG="HS256" JWT_SIGN="secret" ACCESS_LIFE_TIME="3d" REFRESH_LIFE_TIME="9d" SMTP_HOST=smtp SMTP_PORT=587 SMTP_USERNAME= SMTP_PASSWORD= SMTP_ENCRYPTION=tls SMTP_FROM_NAME=TaskView SMTP_FROM_EMAIL= # Your domain APP_URL="https://app.taskview.tech" GOOGLE_CLIENT_ID="" GOOGLE_CLIENT_SECRET="" #You domain GOOGLE_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/google/callback" GITHUB_CLIENT_ID="" GITHUB_CLIENT_SECRET="" GITHUB_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/github/callback" APPLE_CLIENT_ID="" APPLE_TEAM_ID="" APPLE_KEY_ID="" APPLE_KEY_LOCATION="/usr/src/app/AuthKey.p8" # Your domain APPLE_CALLBACK_URL="https://api.taskview.tech/module/auth/provider/apple/callback" #integrations GITHUB_INTEGRATION_CLIENT_ID= GITHUB_INTEGRATION_CLIENT_SECRET= GITHUB_INTEGRATION_CALLBACK_URL=https://api.taskview.tech/module/integrations/oauth/github/callback GITLAB_INTEGRATION_CLIENT_ID= GITLAB_INTEGRATION_CLIENT_SECRET= GITLAB_INTEGRATION_CALLBACK_URL=https://api.taskview.tech/module/integrations/oauth/github/callback ENCRYPTION_KEY= #!!! ADD YOUR DOMAIN SEPARATED BY "," CORS_ALLOWED_ORIGINS="http://localhost:5173,http://127.0.0.1:5173,http://localhost:3000,http://localhost:8888,http://127.0.0.1:3000,http://127.0.0.1:8888" ``` -------------------------------- ### Docker Compose Configuration Source: https://taskview.tech/docs/getting-started/installation Defines the services, networks, and volumes for running TaskView and its dependencies using Docker Compose. Ensure environment files like .env.postgresql and .env.taskview are correctly configured. ```yaml networks: backend: services: db: image: postgres:17 restart: unless-stopped env_file: - ./.env.postgresql volumes: - pgdata:/var/lib/postgresql/data ports: - "5433:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U taskview_db_user -d taskviewdb"] interval: 5s timeout: 5s retries: 5 networks: [backend] migration: image: gimanhead/taskview-ce-db-migration:latest restart: "no" depends_on: db: condition: service_healthy env_file: - ./.env.taskview networks: [backend] taskview-api-server: image: gimanhead/taskview-ce-api-server:latest restart: "unless-stopped" sysctls: - net.ipv6.conf.all.disable_ipv6=1 - net.ipv6.conf.default.disable_ipv6=1 ports: - "1725:1401" depends_on: db: condition: service_healthy migration: condition: service_completed_successfully env_file: - ./.env.taskview volumes: - ./logs:/usr/src/app/logs networks: [backend] taskview-webapp: image: gimanhead/taskview-ce-webapp:latest restart: unless-stopped ports: - "8888:80" volumes: pgdata: ``` -------------------------------- ### Configure GitLab Integration Environment Variables Source: https://taskview.tech/docs/integrations/setup Add these variables to your .env.taskview file to enable GitLab integration. Ensure you replace placeholders with your actual GitLab application credentials. ```env GITLAB_INTEGRATION_CLIENT_ID= GITLAB_INTEGRATION_CLIENT_SECRET= GITLAB_INTEGRATION_CALLBACK_URL=http://localhost:1401/module/integrations/oauth/gitlab/callback ``` -------------------------------- ### List SSO Configurations for an Organization Source: https://taskview.tech/docs/features/sso Retrieves a list of all SSO configurations associated with a specific organization. ```APIDOC ## GET /module/sso/admin/configs?organizationId={id} ### Description Lists all SSO configurations for a given organization. This endpoint is for administrative use. ### Method GET ### Endpoint `/module/sso/admin/configs?organizationId={id}` ### Parameters #### Query Parameters - **organizationId** (string) - Required - The ID of the organization for which to list SSO configurations. ``` -------------------------------- ### Authenticate API Request with Token Source: https://taskview.tech/docs/features/api-tokens Send your API token in the 'Authorization' header using the 'Bearer' scheme. ```bash curl -H "Authorization: Bearer tvk_a1b2c3d4..." \ https://your-instance.com/module/tasks?goalId=1 ``` -------------------------------- ### Create Token Source: https://taskview.tech/docs/features/api-tokens Creates a new API token. The full token is returned only once upon creation. Fields like allowed permissions, projects, and expiration are optional. ```APIDOC ## POST /module/api-tokens ### Description Creates a new API token. All fields except `name` are optional. Returns the full plaintext token once. ### Method POST ### Endpoint /module/api-tokens ### Parameters #### Request Body - **name** (string) - Required - A name for the token (e.g., "CI pipeline", "Slack bot"). - **allowedPermissions** (array[string]) - Optional - A list of specific permissions the token can perform. - **allowedGoalIds** (array[integer]) - Optional - A list of project IDs to restrict the token's access to. - **expiresAt** (string) - Optional - The expiration date and time for the token in ISO 8601 format (e.g., "2026-12-31T23:59:59Z"). ### Request Example ```json { "name": "CI pipeline", "allowedPermissions": ["component_can_watch_content"], "allowedGoalIds": [1, 2], "expiresAt": "2026-12-31T23:59:59Z" } ``` ``` -------------------------------- ### TaskView MCP Server Configuration Source: https://taskview.tech/docs/integrations/mcp Configure the MCP server for TaskView integration. This JSON snippet defines the server details, including the command to run, arguments, and environment variables for the TaskView URL and API token. ```json { "mcpServers": { "taskview": { "command": "npx", "args": ["-y", "taskview-mcp"], "env": { "TASKVIEW_URL": "https://api.taskview.tech", "TASKVIEW_TOKEN": "tvk_your_token_here" } } } } ``` -------------------------------- ### Configure TaskView Environment Source: https://taskview.tech/docs/guides/deploy-vps-nginx Sets the application URL and allowed origins for CORS in the TaskView environment file. ```dotenv APP_URL="https://tasks.yourcompany.com" ``` ```dotenv CORS_ALLOWED_ORIGINS="https://tasks.yourcompany.com" ``` -------------------------------- ### Generate Encryption Key Source: https://taskview.tech/docs/integrations/setup Use this command to generate a 64-character hex string for the ENCRYPTION_KEY. Store this key securely and never commit it to version control. ```bash node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" ``` -------------------------------- ### Generate Encryption Key Source: https://taskview.tech/docs/configuration/environment-variables Use this command to generate a 32-byte hex string for the ENCRYPTION_KEY. This key is crucial for SSO and integrations. ```bash openssl rand -hex 32 ``` -------------------------------- ### Generate SP Signing Key Pair for SAML Source: https://taskview.tech/docs/features/sso Generate a public/private key pair for signing SAML authentication requests. This is an optional enterprise feature. ```bash openssl req -x509 -newkey rsa:2048 -keyout sp-key.pem -out sp-cert.pem -days 3650 -nodes -subj "/CN=taskview" ``` -------------------------------- ### Generate Password Hash with bcryptjs Source: https://taskview.tech/docs/getting-started/installation Use this Node.js snippet to generate a secure password hash for a new user. This is useful for directly inserting users into the database. ```javascript import { hashSync } from 'bcryptjs' const passwordHash = hashSync('your-secure-password', 12) console.log(passwordHash) ``` -------------------------------- ### Create Token Payload Source: https://taskview.tech/docs/features/api-tokens When creating a token, specify its name, optional permissions, allowed project IDs, and expiration date. ```json { "name": "CI pipeline", "allowedPermissions": ["component_can_watch_content"], "allowedGoalIds": [1, 2], "expiresAt": "2026-12-31T23:59:59Z" } ``` -------------------------------- ### List Available Permissions Source: https://taskview.tech/docs/features/api-tokens Retrieves a list of all available permissions that can be assigned to API tokens, grouped by category. ```APIDOC ## GET /module/api-tokens/permissions ### Description Returns permissions grouped by category. ### Method GET ### Endpoint /module/api-tokens/permissions ``` -------------------------------- ### Generate Password Hash (One-liner) Source: https://taskview.tech/docs/getting-started/installation A concise Node.js command to generate a password hash directly from the terminal. ```bash node -e "console.log(require('bcryptjs').hashSync('your-secure-password', 12))" ``` -------------------------------- ### Check SSO Configuration for a Domain Source: https://taskview.tech/docs/features/sso Verifies if SSO is configured for a given domain. This endpoint is useful for determining if a domain supports SSO login. ```APIDOC ## GET /module/sso/providers?domain={domain} ### Description Checks if SSO is configured for a specific domain. ### Method GET ### Endpoint `/module/sso/providers?domain={domain}` ### Parameters #### Query Parameters - **domain** (string) - Required - The domain to check for SSO configuration. ``` -------------------------------- ### Update TaskView with Docker Compose Source: https://taskview.tech/docs/getting-started/installation Pull the latest Docker images and restart the services to update TaskView to the newest version. The migration container handles database updates automatically. ```bash docker compose pull docker compose up -d ``` -------------------------------- ### Slack Environment Variables Source: https://taskview.tech/docs/integrations/messaging These environment variables are required to configure the Slack integration. Ensure that SLACK_CALLBACK_URL exactly matches the Redirect URL configured in the Slack app. ```dotenv SLACK_CLIENT_ID= SLACK_CLIENT_SECRET= SLACK_CALLBACK_URL=https:///module/messaging/slack/oauth/callback SLACK_SIGNING_SECRET= ``` -------------------------------- ### Automate TaskView Updates Source: https://taskview.tech/docs/guides/deploy-vps-nginx This script automates pulling the latest TaskView Docker images and restarting the containers. It can be scheduled with cron for regular updates. ```bash #!/bin/bash cd /path/to/taskview docker compose pull docker compose up -d ``` -------------------------------- ### Handle IdP Callback Source: https://taskview.tech/docs/features/sso Processes the callback from the Identity Provider (IdP) after successful authentication. ```APIDOC ## GET/POST /module/sso/callback/{configId} ### Description Handles the callback from the Identity Provider (IdP) after a user has authenticated. This endpoint is used to complete the SSO login process. ### Method GET, POST ### Endpoint `/module/sso/callback/{configId}` ### Parameters #### Path Parameters - **configId** (string) - Required - The unique identifier for the SSO configuration. ``` -------------------------------- ### Parse SAML Metadata XML from URL Source: https://taskview.tech/docs/features/sso Parses SAML metadata from a given URL. This is typically used by administrators to configure SSO providers. ```APIDOC ## GET /module/sso/admin/metadata?url={metadataUrl} ### Description Parses SAML metadata XML from a provided URL. This is an administrative function used to retrieve SSO provider details. ### Method GET ### Endpoint `/module/sso/admin/metadata?url={metadataUrl}` ### Parameters #### Query Parameters - **metadataUrl** (string) - Required - The URL containing the SAML metadata XML. ``` -------------------------------- ### Generate AES-256 Encryption Key Source: https://taskview.tech/docs/integrations/setup Generate a 32-byte hex key for encrypting tokens using Node.js. This key should be added to your .env.taskview file. ```bash node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" ``` -------------------------------- ### Node.js Webhook Receiver for Local Testing Source: https://taskview.tech/docs/features/webhooks A Node.js script to simulate a webhook receiver. It listens for incoming requests, verifies the signature using a secret, and logs the payload. Use this to test webhook integrations locally by setting your webhook URL to http://localhost:4545. ```javascript const http = require('http') const crypto = require('crypto') const PORT = 4545 const SECRET = 'your-secret-here' const server = http.createServer((req, res) => { const chunks = [] req.on('data', (chunk) => chunks.push(chunk)) req.on('end', () => { const body = Buffer.concat(chunks).toString() const signature = req.headers['x-webhook-signature'] || '' const expected = 'sha256=' + crypto .createHmac('sha256', SECRET) .update(body) .digest('hex') console.log(signature === expected ? 'Valid' : 'INVALID') console.log(JSON.stringify(JSON.parse(body), null, 2)) res.writeHead(200) res.end('OK') }) }) server.listen(PORT, () => console.log(`Listening on :${PORT}`)) ``` -------------------------------- ### List Active Sessions Source: https://taskview.tech/docs/features/sessions Retrieve a list of all active sessions for the current user. Each session object includes an 'isCurrent' flag to identify the user's current session. ```http GET /module/sessions ``` -------------------------------- ### List Tokens Source: https://taskview.tech/docs/features/api-tokens Retrieves a list of all API tokens associated with the current user. The token hashes are not included in the response. ```APIDOC ## GET /module/api-tokens ### Description Returns all tokens for the current user (without hashes). ### Method GET ### Endpoint /module/api-tokens ``` -------------------------------- ### Register Device for Push Notifications Source: https://taskview.tech/docs/features/notifications Registers a device with the notification service for receiving push notifications. ```APIDOC ## POST /module/notifications/device/register ### Description Registers a specific device with the notification service to enable push notifications. ### Method POST ### Endpoint /module/notifications/device/register ### Parameters #### Request Body - **device_token** (string) - Required - The unique token identifying the device (e.g., FCM token). - **platform** (string) - Required - The platform of the device (e.g., 'ios', 'android'). ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the device was registered successfully. ``` -------------------------------- ### Nginx Configuration for Web App and API with HTTPS Source: https://taskview.tech/docs/guides/deploy-vps-nginx This Nginx configuration sets up two server blocks: one for the web application and one for the API. Both are configured to redirect HTTP traffic to HTTPS and serve content over SSL. Ensure your domain names and certificate paths are correctly set. ```nginx # TaskView Web App - redirect HTTP to HTTPS server { listen 80; server_name tasks.yourcompany.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name tasks.yourcompany.com; ssl_certificate /etc/letsencrypt/live/tasks.yourcompany.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/tasks.yourcompany.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_pass http://127.0.0.1:8888; 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; } } # TaskView API - redirect HTTP to HTTPS server { listen 80; server_name api.tasks.yourcompany.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name api.tasks.yourcompany.com; ssl_certificate /etc/letsencrypt/live/api.tasks.yourcompany.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.tasks.yourcompany.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; client_max_body_size 50M; location / { proxy_pass http://127.0.0.1:1725; 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; } } ``` -------------------------------- ### List Sessions Source: https://taskview.tech/docs/features/sessions Retrieves a list of all active sessions for the current user. Each session object includes an `isCurrent` flag to identify the user's current session. ```APIDOC ## GET /module/sessions ### Description Returns all active sessions for the current user. Each session includes an `isCurrent` flag. ### Method GET ### Endpoint /module/sessions ```