Compare commits

...

8 commits
v1.1.0 ... main

7 changed files with 48 additions and 21 deletions

25
.github/workflows/docker-image.yml vendored Normal file
View file

@ -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

View file

@ -2,7 +2,7 @@ version: "3.9"
services: services:
web: web:
build: . build: .
image: openterminal image: docker.arimelody.me/openterminal
container_name: openterminal container_name: openterminal
ports: ports:
- 8080:8080 - 8080:8080

19
package-lock.json generated
View file

@ -1,21 +1,22 @@
{ {
"name": "openterminal", "name": "openterminal",
"version": "1.0.0", "version": "1.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "openterminal", "name": "openterminal",
"version": "1.0.0", "version": "1.1.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"ws": "^8.14.2" "ws": "^8.17.1"
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.14.2", "version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"license": "MIT",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
}, },
@ -35,9 +36,9 @@
}, },
"dependencies": { "dependencies": {
"ws": { "ws": {
"version": "8.14.2", "version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"requires": {} "requires": {}
} }
} }

View file

@ -1,23 +1,24 @@
{ {
"name": "openterminal", "name": "openterminal",
"version": "1.0.0", "version": "1.1.0",
"description": "", "description": "",
"main": "./server/main.js", "main": "./server/main.js",
"type": "module",
"scripts": { "scripts": {
"start": "node ./server/main.js", "start": "node ./server/main.js",
"dev": "nodemon ./server/main.js" "dev": "nodemon ./server/main.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/mellodoot/openterminal.git" "url": "git+https://github.com/arimelody/openterminal.git"
}, },
"author": "ari melody", "author": "ari melody",
"license": "ISC", "license": "ISC",
"bugs": { "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": { "dependencies": {
"ws": "^8.14.2" "ws": "^8.17.1"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

Binary file not shown.

View file

@ -1,7 +1,7 @@
const fs = require('fs'); import fs from 'fs';
const http = require('http'); import http from 'http';
const path = require('path'); import path from 'path';
const Websocket = require('ws'); import WebSocket from 'ws';
const VERSION = "1.1.0"; const VERSION = "1.1.0";
@ -136,7 +136,7 @@ function get_real_address(req) {
return req.connection.remoteAddress; return req.connection.remoteAddress;
} }
const wss = new Websocket.Server({ server }); const wss = new WebSocket.Server({ server });
wss.on('connection', (socket, req) => { wss.on('connection', (socket, req) => {
console.log(`${new Date().toISOString()} - WS OPEN - ${get_real_address(req)} (active connections: ${sockets.length + 1})`); 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, () => { 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(", ")}`); if (TRUSTED_PROXIES.length > 0) console.log(`Using X-Forwarded-For headers for hosts: ${TRUSTED_PROXIES.join(", ")}`);
}); });