diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..202dd41 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,25 @@ +name: Docker CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: docker.arimelody.me + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: docker.arimelody.me/openterminal:latest diff --git a/docker-compose-example.yml b/docker-compose-example.yml index 6eff74c..a30e074 100644 --- a/docker-compose-example.yml +++ b/docker-compose-example.yml @@ -2,7 +2,7 @@ version: "3.9" services: web: build: . - image: openterminal + image: docker.arimelody.me/openterminal container_name: openterminal ports: - 8080:8080 diff --git a/package-lock.json b/package-lock.json index f4eb5af..4c63a85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,22 @@ { "name": "openterminal", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openterminal", - "version": "1.0.0", + "version": "1.1.0", "license": "ISC", "dependencies": { - "ws": "^8.14.2" + "ws": "^8.17.1" } }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -35,9 +36,9 @@ }, "dependencies": { "ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "requires": {} } } diff --git a/package.json b/package.json index c6eb13f..b786206 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,24 @@ { "name": "openterminal", - "version": "1.0.0", + "version": "1.1.0", "description": "", "main": "./server/main.js", + "type": "module", "scripts": { "start": "node ./server/main.js", "dev": "nodemon ./server/main.js" }, "repository": { "type": "git", - "url": "git+https://github.com/mellodoot/openterminal.git" + "url": "git+https://github.com/arimelody/openterminal.git" }, "author": "ari melody", "license": "ISC", "bugs": { - "url": "https://github.com/mellodoot/openterminal/issues" + "url": "https://github.com/arimelody/openterminal/issues" }, - "homepage": "https://github.com/mellodoot/openterminal#readme", + "homepage": "https://github.com/arimelody/openterminal#readme", "dependencies": { - "ws": "^8.14.2" + "ws": "^8.17.1" } } diff --git a/public/favicon.png b/public/favicon.png index ebb0c36..eef2fd3 100644 Binary files a/public/favicon.png and b/public/favicon.png differ diff --git a/res/favicon.afdesign b/res/favicon.afdesign index 688ece8..10b52a3 100644 Binary files a/res/favicon.afdesign and b/res/favicon.afdesign differ diff --git a/server/main.js b/server/main.js index 30ddba1..e5a69dd 100644 --- a/server/main.js +++ b/server/main.js @@ -1,7 +1,7 @@ -const fs = require('fs'); -const http = require('http'); -const path = require('path'); -const Websocket = require('ws'); +import fs from 'fs'; +import http from 'http'; +import path from 'path'; +import WebSocket from 'ws'; const VERSION = "1.1.0"; @@ -136,7 +136,7 @@ function get_real_address(req) { return req.connection.remoteAddress; } -const wss = new Websocket.Server({ server }); +const wss = new WebSocket.Server({ server }); wss.on('connection', (socket, req) => { console.log(`${new Date().toISOString()} - WS OPEN - ${get_real_address(req)} (active connections: ${sockets.length + 1})`); /* @@ -271,7 +271,7 @@ function generate_colour() { } server.listen(PORT, HOST, () => { - console.log(`OpenTerminal is now LIVE on http://${HOST === '0.0.0.0' ? '127.0.0.1' : HOST}:${PORT}`); + console.log(`OpenTerminal is now LIVE on http://${HOST}:${PORT}`); if (TRUSTED_PROXIES.length > 0) console.log(`Using X-Forwarded-For headers for hosts: ${TRUSTED_PROXIES.join(", ")}`); });