Coder Social home page Coder Social logo

nwawrzyniak / mtc Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 247 KB

mtc (minimal-tor-chat) is an extremely minimalistic chat server for chatting without a user control system. It is preconfigured to be accessable only via the Tor network or locally.

Home Page: https://www.nwawsoft.com/mtc

License: GNU General Public License v3.0

Shell 0.35% PureScript 29.48% JavaScript 69.37% HTML 0.47% CSS 0.32%
chat purescript server tor

mtc's People

Contributors

dependabot[bot] avatar nwawrzyniak avatar ygottschalk avatar

Watchers

 avatar

mtc's Issues

[FEATURE] config file

Specifications of the file config in the project root.
This may be excluded in .gitignore.

  • If there is no config file when running the server a default config file is created.
  • When command line arguments are passed when starting the server and there is no config file they are automatically written into the config file and the server starts.
  • When command line arguments are passed when starting the server and there is already a config file the corresponding settings in the config file are ignored and the passed arguments are used instead. The config file remains unchanged.

[FEATURE] Mobile UI

Optimize UI for mobile devices.

  • Depend on screen resolution instead of domain prefix "m." (as in m.xyz.onion). Resizing your desktop Tor Browser to a width narrow enough would trigger mobile mode.
  • Fit text font size so ~120-160 characters fit in one line.
  • Fit text font size in input field to be readable without zooming.

[BUG] Messages are not deleted

Describe the bug
Messages are not deleted after the specified amount of time (default 7 days).

To Reproduce
Steps to reproduce the behavior:

  1. Send a message and include a manual timestamp (e.g. 2019_12_25).
  2. Wait.

Expected behavior
Messages older than 7 days are deleted.

[FEATURE] Scroll on new messages

When a message is received and the chat-box is scrolled down, it shall be automatically scrolled down to display the new message.
If it is not completely scrolled down, the scroll bar position shall stay as it is.

[BUG] Server is reachable from the local network

Describe the bug
The server is reachable from the local network

To Reproduce

  1. Be in the same local network as the server
  2. In a web browser, navigate to hostname:8080

Expected behavior
The connection is refused because you aren't accessing it through localhost:8080 or the tor network.

[BUILD] install_deps not working for Raspberry Pi 4

Seems like the same error we had a few weeks ago. git submodule update was run before. install_deps.sh and full_run.sh are currently broken. Since run.sh also builds before running, it is broken aswell so not even the latest working build is started.
install_deps.sh seems to try to build a new version of purescript instad of using the purs that is already in PATH.
which purs and purs --version grant the expected results.

~/Projects/simple-text-html $ ./install_deps.sh

> [email protected] postinstall /home/pi/Projects/simple-text-html/node/node_modules/purescript
> install-purescript --purs-ver=0.13.5

✖ Check if a prebuilt 0.13.5 binary is provided for linux
  No prebuilt PureScript binary is provided for x86 architecture.
▬ Download the prebuilt PureScript binary
▬ Verify the prebuilt binary works correctly
▬ Save the downloaded binary to the npm cache directory

↓ Fallback: building from source

/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:65
      throw e;
      ^

TypeError: Cannot read property 'has' of undefined
    at getCurrentTask (/home/pi/Projects/simple-text-html/node/node_modules/purescript-installer/index.js:308:24)
    at Object.next (/home/pi/Projects/simple-text-html/node/node_modules/purescript-installer/index.js:374:16)
    at notifySubscription (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:135:18)
    at onNotify (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:179:3)
    at SubscriptionObserver.next (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:235:7)
    at Object.next (/home/pi/Projects/simple-text-html/node/node_modules/purescript-installer/install-purescript/index.js:90:15)
    at notifySubscription (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:135:18)
    at onNotify (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:179:3)
    at SubscriptionObserver.next (/home/pi/Projects/simple-text-html/node/node_modules/zen-observable/lib/Observable.js:235:7)
    at /home/pi/Projects/simple-text-html/node/node_modules/purescript-installer/download-or-build-purescript/index.js:246:13
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `install-purescript --purs-ver=0.13.5`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-12-10T23_35_35_953Z-debug.log
bower extra-resolution      Unnecessary resolution: purescript-web-events#^2.0.0

These errors occur when trying to build anyway:

Error 1 of 10:

  in module Main
  at src/Main.purs:17:1 - 17:60 (line 17, column 1 - line 17, column 60)

    Module Node.Express.App was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 2 of 10:

  in module Main
  at src/Main.purs:19:1 - 19:47 (line 19, column 1 - line 19, column 47)

    Module Node.Express.Middleware.Static was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 3 of 10:

  in module Middleware.Middleware
  at src/Middleware/Middleware.purs:7:1 - 7:52 (line 7, column 1 - line 7, column 52)

    Module Node.Express.Handler was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 4 of 10:

  in module Middleware.Middleware
  at src/Middleware/Middleware.purs:8:1 - 8:46 (line 8, column 1 - line 8, column 46)

    Module Node.Express.Types was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 5 of 10:

  in module Handlers
  at src/Handlers.purs:19:1 - 19:67 (line 19, column 1 - line 19, column 67)

    Module Node.Express.Request was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 6 of 10:

  in module Handlers
  at src/Handlers.purs:20:1 - 20:51 (line 20, column 1 - line 20, column 51)

    Module Node.Express.Response was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 7 of 10:

  in module Handlers
  at src/Handlers.purs:21:1 - 21:44 (line 21, column 1 - line 21, column 44)

    Module Node.Express.Handler was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 8 of 10:

  in module Handlers
  at src/Handlers.purs:22:1 - 22:42 (line 22, column 1 - line 22, column 42)

    Module Node.Express.Types was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 9 of 10:

  in module Node.Express.Ws
  at src/Node/Express/Ws.purs:14:1 - 14:47 (line 14, column 1 - line 14, column 47)

    Module Node.Express.App was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 10 of 10:

  in module Node.Express.Ws
  at src/Node/Express/Ws.purs:15:1 - 15:88 (line 15, column 1 - line 15, column 88)

    Module Node.Express.Types was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.


* ERROR: Subcommand terminated with exit code 1

[BUG] Empty messages are not shown correctly

Describe the bug
When you send an empty message it does not create an empty line.

To Reproduce
Steps to reproduce the behavior:

  1. Open the site
  2. Hit "send" or press Enter

Expected behavior
An empty line is appended to the chat log.

[WARNING] Unused reference in import in Test.Database

In GitHub Actions -> Build and Test -> run pulp test

Warning found:
in module Test.Database
at test/Database.purs:10:1 - 10:32 (line 10, column 1 - line 10, column 32)

  The import of module SQLite3 contains the following unused references:

    closeDB

  It could be replaced with:

    import SQLite3 (newDB)

[BUG] Messages with multiple lines are stored incorrectly

When writing a message with multiple lines, most of the times only the first one is saved, even though it is shown for other online clients correctly until the page is reloaded. When reloaded, lines after the first seem to disappear.

Further investigation needed.

[FEATURE] Silent mode

Suppress timestamp output with the flags
--silent, --shut-up (requested by ygottschalk), --non-verbose, -s

[VULNERABILITY] Update minimist to 0.2.1 or higher

Update package minimist in node/package-lock.json to 0.2.1 or higher.

Reason:

CVE-2020-7598 - high severity
Vulnerable versions: < 0.2.1
Patched version: 0.2.1
minimist before 1.2.2 could be tricked into adding or modifying properties of Object.prototype using a "constructor" or "proto" payload.

Remediation:

Upgrade minimist to version 0.2.1 or later. For example:

"dependencies": {
  "minimist": ">=0.2.1"
}

or

"devDependencies": {
  "minimist": ">=0.2.1"
}

Always verify the validity and compatibility of suggestions with your codebase.

[WARNING] unused reference setProp in FrontendMain.purs

Warning found:
in module FrontendMain
at src/FrontendMain.purs:16:1 - 17:75 (line 16, column 1 - line 17, column 75)

The import of module JQuery contains the following unused references:

setProp

It could be replaced with:

import JQuery (JQuery, JQueryEvent, append, clear, clone, create, on, preventDefault, ready, select, setHtml, setText, setValue)

See https://github.com/purescript/documentation/blob/master/errors/UnusedExplicitImport.md for more information,
or to contribute content related to this warning.

[BUG] Only first message sent is displayed instantly

When sending messages only the first message after loading the page is shown for the author and/or other clients. Every further message is only displayed after reloading the page.

Side node: POST requests never seem to be answered by the server.

[FEATURE] Better logging

Improve logging. Right now logging is pretty much none existing or related to small bugs at various places. There should be logging with controllable levels and a logfile.

This is somehow related to #9 and #19

[DESIGN] Set up page design

Changes to .css:

  • Remove header "Simple chat"
  • make textarea non-resizable and page filling
  • make textfield non-resizable and footer filling

[IMPROVEMENT] Fix warnings while building

Remove redundant imports

Warning 1 of 3:

  in module Handlers
  at src/Handlers.purs:7:1 - 7:41 (line 7, column 1 - line 7, column 41)

    The import of Data.DateTime.Instant is redundant


  See https://github.com/purescript/documentation/blob/master/errors/UnusedImport.md for more information,
  or to contribute content related to this warning.

Warning 2 of 3:

  in module Handlers
  at src/Handlers.purs:4:1 - 4:24 (line 4, column 1 - line 4, column 24)

    The import of Data.Int is redundant


  See https://github.com/purescript/documentation/blob/master/errors/UnusedImport.md for more information,
  or to contribute content related to this warning.

Warning 3 of 3:

  in module Handlers
  at src/Handlers.purs:8:1 - 8:35 (line 8, column 1 - line 8, column 35)

    The import of Data.Newtype is redundant


  See https://github.com/purescript/documentation/blob/master/errors/UnusedImport.md for more information,
  or to contribute content related to this warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.