From 57ae8843767eb412ed12b7a5d2db52f7eda61183 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Sat, 14 Sep 2024 09:01:20 +0200 Subject: [PATCH] [call-me] - add templates, workflows, update docs --- .github/ISSUE_TEMPLATE/1-bug.yml | 86 ++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/2-feature.yml | 26 +++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/workflows/build.yml | 34 +++++++++++ .gitignore | 5 ++ README.md | 8 ++- app/server.js | 2 + doc/self-hosting.md | 30 ++++++---- package.json | 4 +- 9 files changed, 183 insertions(+), 17 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/1-bug.yml create mode 100644 .github/ISSUE_TEMPLATE/2-feature.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml new file mode 100644 index 0000000..321fc42 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug.yml @@ -0,0 +1,86 @@ +name: "Bug report" +description: File a bug report and help us improve +#labels: ["bug"] +body: + - type: markdown + attributes: + value: | + This issue tracker is only for reporting bugs and tracking issues related to the source code. + + **Before posting, please make sure to check if the same or similar bugs have already been reported.** + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: Steps to reproduce the behavior. + validations: + required: true + - type: textarea + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: markdown + attributes: + value: "**Please select at least one device where the problem occurs.**" + + - type: checkboxes + attributes: + label: Device + description: Please provide the device where the problem manifests. + options: + - label: Android + - label: iPhone + - label: Linux + - label: Mac + - label: Windows + - type: markdown + attributes: + value: "**Please select at least one browser where the problem occurs.**" + + - type: checkboxes + attributes: + label: Browser + description: Please provide the browser where the problem manifests. + options: + - label: Chrome (or Chromium based) + - label: Firefox + - label: Safari + - label: Android browser + - label: iOS browser + - label: Other desktop browser + - type: textarea + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. The browser console logs (if applicable) are a good start. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: markdown + attributes: + value: "**Please indicate whether the problem is reproducible on cme.mirotalk.com.**" + + - type: dropdown + attributes: + label: Reproducibility + description: Is the bug reproducible on cme.mirotalk.com? + options: + - '--' + - 'Yes' + - 'No' + validations: + required: true + - type: textarea + attributes: + label: Additional context + description: Please provide more details in case they apply (such as the Call-me version you are running, if you are hosting your own server). + - type: markdown + attributes: + value: | + **Attach images or screenshots** + + If applicable, you can drag and drop images directly into this issue. Screenshots or videos can help illustrate the problem clearly. diff --git a/.github/ISSUE_TEMPLATE/2-feature.yml b/.github/ISSUE_TEMPLATE/2-feature.yml new file mode 100644 index 0000000..58bfe83 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature.yml @@ -0,0 +1,26 @@ +name: "Feature request" +description: Suggest an idea for Call-me +labels: ["feature-request"] +body: + - type: markdown + attributes: + value: | + Thank you for suggesting an idea to make Call-me better. + + **Note**: the ultimate decision for implementing features lies on the Author, not all feature requests shall be accepted. + - type: textarea + attributes: + label: Feature request + description: A clear and concise description of the feature request. + validations: + required: true + - type: textarea + attributes: + label: Pros + description: A clear and concise description of the feature request pros. + validations: + required: true + - type: textarea + attributes: + label: Additional context + description: Add any other context about the feature request here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c2e9263 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: "Author" + url: https://www.linkedin.com/in/miroslav-pejic-976a07101/ + about: miroslav.pejic.85@gmail.com diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..14f81f2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: build + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + + - name: Build and publish + uses: docker/build-push-action@v3 + with: + context: ./ + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: call/me:latest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 941d536..ebb1439 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +.DS_Store +.cache +.git .env + node_modules +npm-debug.log package-lock.json \ No newline at end of file diff --git a/README.md b/README.md index c4907d8..86ceff2 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ This project allows you to: **[Install Node.js and npm](https://nodejs.org/en/download)** ```shell -# Copy .env.template to .env and customize it according to your needs if needed +# Copy .env.template to .env cp .env.template .env -# Install dependencies: +# Install dependencies npm install -# Start the application: +# Start the application npm start ``` @@ -47,6 +47,8 @@ Get all connected users curl -X GET "http://localhost:8000/api/v1/users" -H "authorization: call_me_api_key_secret" -H "Content-Type: application/json" ``` +Docs: http://localhost:8000/api/v1/docs/ or you can check it out live [here](https://cme.mirotalk.com/api/v1/docs/). + ## Self-Hosting To install this on your VPS, VDS, or personal server, please follow the instructions in **[the self-hosting documentation](./doc/self-hosting.md)**. diff --git a/app/server.js b/app/server.js index 9acc3f0..9454737 100755 --- a/app/server.js +++ b/app/server.js @@ -10,6 +10,7 @@ const socketIO = require('socket.io'); const path = require('path'); const yaml = require('js-yaml'); const swaggerUi = require('swagger-ui-express'); +const packageJson = require('../package.json'); // Public directory location const PUBLIC_DIR = path.join(__dirname, '../', 'public'); @@ -82,6 +83,7 @@ const io = socketIO(server); // Start the server and listen on the specified port server.listen(port, () => { console.log('Server', { + version: packageJson.version, running_at: host, ice: config.iceServers, api_key_secret: config.apiKeySecret, diff --git a/doc/self-hosting.md b/doc/self-hosting.md index af7c200..96b14e9 100644 --- a/doc/self-hosting.md +++ b/doc/self-hosting.md @@ -6,7 +6,7 @@ - Server Selection: - [Hetzner](https://www.hetzner.com/cloud) (CX11) - Use [this link](https://hetzner.cloud/?ref=XdRifCzCK3bn) to receive `€⁠20 in cloud credits` - - [Contabo](https://www.dpbolvw.net/click-101027391-14462707) (VPS-0) + - [Contabo](https://www.dpbolvw.net/click-101027391-14462707) (VPS-1) - OS: Ubuntu 22.04 LTS. - [Node.js](https://nodejs.org/en/) (LTS) and npm - Domain or Subdomain Name (e.g., `YOUR.DOMAIN.NAME`) with a DNS A record pointing to your server's IPv4 address. @@ -16,14 +16,17 @@ ## Installation -Install `NodeJS 18.X` and `npm` using [Node Version Manager](https://docs.mirotalk.com/nvm/nvm/) +Install `NodeJS 18.X` and `npm` using [Node Version Manager](https://docs.mirotalk.com/utility/nvm/) --- ## Quick start ```bash -# Copy .env.template to .env and customize it according to your needs if needed +# Clone call-me repo +$ git clone https://github.com/miroslavpejic85/call-me.git + +# Copy .env.template to .env $ cp .env.template .env # Install dependencies @@ -68,11 +71,11 @@ $ sudo apt install -y docker.io # Instal docker-compose $ sudo apt install -y docker-compose -# Copy .env.template to .env and customize it according to your needs if needed +# Copy .env.template to .env $ cp .env.template .env -# Build the docker image -$ docker build -t call/me . # --load +# Pull the official Docker image +$ docker pull call/me:latest # Create and start containers (-d as daemon) $ docker-compose up @@ -256,6 +259,7 @@ For `PM2`: #!/bin/bash cd callme +git pull pm2 stop app/server.js sudo npm install pm2 start app/server.js @@ -270,7 +274,7 @@ For `Docker`: cd callme docker-compose down -docker build -t call/me . # --load +docker pull call/me:latest docker images |grep '' |awk '{print $3}' |xargs docker rmi docker-compose up -d ``` @@ -283,14 +287,16 @@ Make the script executable $ chmod +x callmeUpdate.sh ``` -To update your CallMe instance to the latest version, follow these steps: - -1. Replace the existing `callme` folder with the newest version +To update your Call-me instance to the latest version, run the script: ```bash -scp -r /path/to/local/folder username@remote_host:/path/to/remote/folder +./callmeUpdate.sh ``` -2. Run the update script `./callmeUpdate.sh` +--- + +## Changelogs + +Stay informed about project updates by following the commits of the Call-me project [here](https://github.com/miroslavpejic85/call-me/commits/main/) --- diff --git a/package.json b/package.json index 38b6fa1..763c164 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "callme", - "version": "1.0.2", - "description": "callme", + "version": "1.0.3", + "description": "Your Go-To for Instant Video Calls", "author": "Miroslav Pejic - miroslav.pejic.85@gmail.com", "license": "AGPLv3", "scripts": {