Giter Site home page Giter Site logo

richard-austin / cloud-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.32 MB

Cloud service for one or more security-cam NVR systems

License: MIT License

Java 9.26% JavaScript 0.52% CSS 5.34% Groovy 14.81% TypeScript 43.72% HTML 20.59% SCSS 3.83% Shell 1.56% Batchfile 0.37%
cctv cloud angular grails java spring-security dpkg dpkg-deb raspberry-pi ubuntu

cloud-server's People

Contributors

richard-austin avatar

Stargazers

 avatar

Watchers

 avatar

cloud-server's Issues

Logout from one Cloud session can cause streams on another session to stall

I thought I had fixed this by making stealMessage only steal the message if the token was correct (otherwise sending the message on to respondToBrowser and trying the next message). This has indeed improved things hugely, but I have seen a stream drop out once since this change was added.

If there were two or more clients logging in or out simultaneously there would be two messages to steal. It looks like the best way to handle this is to make a map of tokens against buffers and splitMessages checks each message token against the map and assigns the buffer to that token in the map if matching, then signals stealMessage.

This is likely to be due to stolenBuffer being updated again in splitMessages before stealMessage has passed it on to its destination.

Heartbeat pings do not detect connection down when exception thrown in acceptConnectionsFromCloudProxy

In Cloud.java with throwEx set as below (firing every 5 executions), the 15 byte Ignore message appears to heve been sent correcly from the CloudProxy even though restart was called in the catch block.

private void acceptConnectionsFromCloudProxy(final int cloudProxyFacingPort) {
acceptConnectionsFromCloudProxyExecutor.execute(() -> {
while (running) {
try {
// Creating a ServerSocket to listen for connections with
ServerSocketChannel s = ServerSocketChannel.open();
s.bind(new InetSocketAddress(cloudProxyFacingPort));
while (running) {
try {
// It will wait for a connection on the local port
SocketChannel cloudProxy = s.accept();
cloudProxy.configureBlocking(true);
throwEx();
remainsOfPreviousBuffer = null;
this.cloudProxy = cloudProxy;
clearSocketMap();
startCloudProxyInputProcess();
}
catch (Exception ex) {
logger.severe("Exception in acceptConnectionsFromCloudProxy: " + ex.getClass().getName() + ": " + ex.getMessage());
Thread.sleep(5000);
restart();
}
}
} catch (Exception ioex) {
logger.severe("Exception in acceptConnectionsFromCloudProxy: " + ioex.getClass().getName() + ": " + ioex.getMessage());
restart();
}
}
});
}

Sometimes each camera can get listed more than once on the Select camera menu

I think this may be due to the _loggedIn flag in utilsService being false when the application is actually logged in, but can't see how that might happen.

CameraService.initialiseCameras is not clearing the cameraStreams and cameras arrays before pushing to them so assumes they are starting empty. Any situation where initialiseCameras is called after those arrays are already set up will cause this issue.

This occurred after logging in with, I believe, the correct credentials, getting no login error message but remaining logged out, then logging in again successfully.

Refreshing the browser restores normal operation.

Some API calls return HTML on error when NVR not connected

Establish a session with a connected NVR and browser.
Disconnect the NVR.
Try get wifi details, there will be HTML returned on the API call which shows in the error message notification.

Tried on 03/07/2022, and nothing was returned, no HTML and nothing else

05/07/2022
Error response set up for when Cloud is closed, but during the time between NVR disconnecting and the Cloud instance timing out, HTML can be returned on API calls on a production build (error status 502). 502 (bad gateway) would be from nginx and the HTML will be its own error response, so I need to override that.

Error status: 502

<title>502 Bad Gateway</title>

502 Bad Gateway


nginx

Browser often needs <CTRL> F5 when first connecting to the host via Cloud/CloudProxy

Very often API calls will return an error until the browser (Chrome) has been hard refreshed.

This is generally after just starting Linux and and the Cloud/CloudProxy. Stopping those processes and closing the browser then restarting them does not reproduce the error so it seems to need to have been down a while for this to happen (to do with caching?). It didn't happen after restarting Linux and starting again, it seems to need a longer shutdown for this to happen.

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.