Forums  ›  General  ›  General discussions
 

SNAP and DOCKER

You can turn on ouput bufferring at the start of a script.  That sends the output to the buffer instead of the browser.  I don't know if any of the PHP IDEs have anything that can allow the script to run in real time and capture everything.  In order to test the oauth I have to connect to the database, get the user info, generate the header to send to the chat, then the chat server sends back the tokens. etc.  I have never used an IDE for PHP

This is way off  topic, but it leads me to a tool I once used which saved my life on more than one occasion.  It was designed for dBaseII which I used to teach at TAFE colleges in the 80's. (That shows my age!).

It was called  Set Talk On and it worked in conjunction with another command which I think was called Step. Keep in mind that this was in the days of CP/M and everything was an ASCII character. Even so, I still think some smart person could develop something for PHP/JAVA and the like to help debug scripts a lot easier than it's currently being done.

You could start anywhere as long as it was the start of a file. Step allowed you to step through one line of code at a time and Talk presented the result of that action (if any) on the right hand side. Talk would literally build a table element by element, and place everything inside that table in the correct place until the completed table or page appeared.

In the case of a form, it would build each field and if you were stepping through Append or Edit mode, you could physically enter data at that point.

If there was a coding error, such as an array not producing the correct data, you could instantly see the problem. It didn't display design errors unless they were horrific, thus it was essential to work with data you could remember, such as names or numbers.

dBaseII was simple by comparison to today's scripts and I can't even recall if it used Include files. Logically I can't see why this can't be replicated for today's programming environment. Chrome's Inspect module comes close, but I guess for security reasons it only does CSS as far as I can see. I think it would be fantastic if there was a program that worked something like Inspect, but covered the PHP/JAVA code as well.

Does anyone know of anything like it?

 

 

 

To see what is going on, i normally use the developer tools in Firefox. The network tab can show you what scripts are being run and whats sent to them. I also have used this firefox addon for seeing headers being sent. https://addons.mozilla.org/en-US/firefox/addon/http-header-live/

I am still looking for more tools to help solve problems. AJAX calls are a bitch and the hardest to debug.

 Thanks Deano, the header tool may be just what I need. 

To see what is going on, i normally use the developer tools in Firefox. The network tab can show you what scripts are being run and whats sent to them. I also have used this firefox addon for seeing headers being sent. https://addons.mozilla.org/en-US/firefox/addon/http-header-live/

I am still looking for more tools to help solve problems. AJAX calls are a bitch and the hardest to debug.

How can I see what is being sent to Rocket.Chat?

I took a look at the oauth2 module but I didn't see anything.  I spent some time reading up on implementing oauth2 but that didn't help.

I installed a Rocket.Chat snap on the server and I am back at the same old oauth error.  Perhaps it is the Dolphin oauth that is the cause of the problem.

Error in OAuth Server: Unexpected end of JSON input
I20200528-01:09:14.866(1) Exception while invoking method 'login' { SyntaxError: Unexpected end of JSON input     at JSON.parse (<anonymous>)     at CustomOAuth.getAccessToken (app/custom-oauth/server/custom_oauth_server.js:140:16)     at Object.OAuth.registerService.query [as handleOauthRequest] (app/custom-oauth/server/custom_oauth_server.js:189:26)     at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:10:33)     at middleware (packages/oauth/oauth_server.js:161:5)     at /snap/rocketchat-server/1427/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 message: 'Unexpected end of JSON input' } 
 
Rocket.Chat is no help here as I have tried in the past.

I usually don't like to put too many layers on the server; the KISS principle is a good one to follow.  However, containers appear to be the way of the future.  They allow developers to write applications specific to a platform but allow that application to run on different platforms through the use of containers.  With Docker, you basically run a mini system inside your server; similar to virtual machines but different in that resources are not fixed allocated to the Docker container.  Snaps are similar; they allow a developer to bundle all the runtimes and libraries needed for an application inside of the Snap.  Often when you install programmes, dependencies have to be installed that is needed by the programme.  Often that means hunting down repositories if the repositories on the machine don't have the needed dependencies.  Sometimes it can be a real PITA to find the needed dependencies.

Therefore, I have decided to read up on Snaps and Docker.  There is a Snap for Rocket.Chat that will install everything, mongod and Rocket.Chat and anything needed for Rocket.Chat to run.  I also found an interesting chat with video application that has a Docker that I may examine.  I watched a video on the chat system and it was impressive; managed by a single developer.

What does others think about Snap and Docker?  Has anyone used Snap or Docker to install applications?