Compare commits

..

No commits in common. "ce73637776f3cbff0fff0425ca817bedfc0b09cc" and "6580cb6793fd24de3269dc7c3f0534ff82345121" have entirely different histories.

4 changed files with 12 additions and 38 deletions

View file

@ -1,25 +0,0 @@
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

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "openterminal", "name": "openterminal",
"version": "1.1.0", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "openterminal", "name": "openterminal",
"version": "1.1.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"ws": "^8.17.1" "ws": "^8.17.1"

View file

@ -1,23 +1,22 @@
{ {
"name": "openterminal", "name": "openterminal",
"version": "1.1.0", "version": "1.0.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/arimelody/openterminal.git" "url": "git+https://github.com/mellodoot/openterminal.git"
}, },
"author": "ari melody", "author": "ari melody",
"license": "ISC", "license": "ISC",
"bugs": { "bugs": {
"url": "https://github.com/arimelody/openterminal/issues" "url": "https://github.com/mellodoot/openterminal/issues"
}, },
"homepage": "https://github.com/arimelody/openterminal#readme", "homepage": "https://github.com/mellodoot/openterminal#readme",
"dependencies": { "dependencies": {
"ws": "^8.17.1" "ws": "^8.17.1"
} }

View file

@ -1,7 +1,7 @@
import fs from 'fs'; const fs = require('fs');
import http from 'http'; const http = require('http');
import path from 'path'; const path = require('path');
import WebSocket from 'ws'; const Websocket = require('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}:${PORT}`); console.log(`OpenTerminal is now LIVE on http://${HOST === '0.0.0.0' ? '127.0.0.1' : 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(", ")}`);
}); });