json rpc – Connect C-lightning to a remote bitcoind through tor

Yes but not by default.

C-lightning uses a pluggable Bitcoin backend. The default one, bcli, will use the bitcoin-cli executable to make requests to a bitcoind.
It exposes bitcoin-cli‘s rpcconnect startup option to lightningd which does not not support onion hosts. And you probably don’t want it to as it is not meant to be exposed.

If you want to run C-lightning without having the full block chain locally you’d probably opt for a light backend solution, such as:

  • A pruned bitcoind (beware of misconfiguration)
  • An explorer-backed backend.
    For example, the Sauron plugin which you could connect to an external
    Esplora instance you would run on a machine with more space. It supports onion services.

If you really want to remotely access bitcoind‘s RPC, you should probably opt for an SSH tunnel.

Accessing wordpress data via json gives Html data for certain keys

am fairly new to this community. I am creating an android app for a client whose site is in wordpress. I am not sure , but i found that a particular api for accessing the articles of a wordpress website as json is https://site_url/wp-json/wp/v2/posts. This gives a ton of key value pairs, So i was tying to access this site via this url. But for a particular content key, this is giving the following output:

 "content": {
    "rendered": "<p>&nbsp;</p>rnrn<p>The next class for &#8220;MICROVITA&#8221; will be on &#8220;Aug 07th, 2020 at 8:00 PM IST / 10:30 AM EST on &#8220;MicroVita Science(माइक्रोवाइटा विषय समापन )&#8221; by Ac.Vimalananda Avt. </p>rnrnrnrnn<div class="dpn-zvc-shortcode-op-wrapper">nt        <table class="vczapi-shortcode-meeting-table">n            <tr class="vczapi-shortcode-meeting-table--row1">n                <td>Meeting ID</td>n                <td>000000000</td>n            </tr>n            <tr class="vczapi-shortcode-meeting-table--row2">..."
}

I am not sure how to retrieve the important information from such html content. maybe that’s a question better suited for other stack communities, but what i want to know is that if it is the expected behavior from a wordpress site? or is there some other api which might give me a better response?

Combine json object in typescript or in javascript

Combine the members based on the names in typescript or in javascript .
How can i combine these data’s.
Thanks in advance!!

data=[
      {
        "name": "test11",
        "member": "test01"
      },
      {
        "name": "test11",
        "member": "test2"
      },
      {
        "name": "test11",
        "member": "demo-obj"
      },
      {
        "name": "test12",
        "member": "first"
      },
      {
        "name": "test12",
        "member": "demo-obj"
      },
      {
        "name": "test12",
        "member": "test1"
      },
      {
        "name": "test12",
        "member": "test2"
      }
    ]

I Want the output as,

[{
"name":"test11",
"member":"test01,test2,demo-obj"
},
{
"name":"test12",
"member":"first,test1,demo-obj,test2"
},

]

pls help me out this?

json – Shared Text Content – XSS Safe

I have a bulletin on my site that all valid users have access to (read and write). User input posted to this bulletin is stored in JSON. Because of these qualities there is definitely some concern for XSS. Im hoping to figure out the best way to protect my app and its users when using this feature.

Some thoughts:

Validation – because this is a bulletin/message board I would prefer to allow users access to any character they can type. One user might need to say Boss says "Specials for ages < 12 & > 65 are as follows...". Because of my requirements, validation does not seem possible.

Sansitization – this has the same issues as validation, we would lose functionality.

Encoding – Im fairly new to this and do not know how one might encode user input to make it safe within the DOM (or JSON). If this is the preferred route I am interested in links to documentation or examples.

More Context:

I am adding to the content by doing something similar to the following; where obj is the full entry and message is the user supplied input.

var body = $('<p>').text(obj.message);

Because I am only adding user input in the text context does that mean I can avoid concern?

Lastly, I am newer to using JSON to store user supplied info. I have not been able to find much on JSON security but if you have any topics related to the above, I would appreciate links to documentation.

node.js – Doubts about Json web token and users’ sessions control

Well, i just took a basic Backend development course with Nodejs and it could be said that i’m newby in the web development world. In one of the modules of the course i learned how to secure my backend’s routes with Json web tokens and now i’m starting to develop a basic chat using reactjs for the frontend side and Nodejs to develop my backend. But now that i’m thinking about the security of the page, there are many questions that comes to my mind that weren´t explained in the course. I’ve planned to validate an user to access to the page routes with a login sending a JWT. So considering that fact the following are my questions:

  1. How to get the token from the frontend?

The course i took was completly focused on the backend, so i worked with postman sending the requests and storing the data from the reponses in the enviroment variables. So i don’t know how to get the token from the frontend (i don’t know if i can get it from any side of the cache storage or i need to save it in a database or something).

  1. How to revoke the token?

Well, i know that i can specify an expiration time for the token, but in this case i don’t want that expires unless the user logs out from the page. I’ve read from some sites that it’s not posible to delete it that easy but they recommend to remove the token from the client side and for the server side, saving the token in a forbidden list which contains tokens that are not reached their expiration time but they are not longer available.

  1. The last one is, how to refresh the jwt?

Well, i don’t know if the question was formulated correctly but here is it and i think is related with the second one. Imagine that i don’t want the token lasts forever, instead i want the token expires in one week in case the user doesn’t enter in the entire week, but once the user enters, the time expiration refreshes. In short words, i want the user can stay logged unless he doesn’t enter to the page in one week. What would be the most pratical to do?

Without anymore to say, thanks for reading and i would appreciate any tip or code example that you have to resolve my questions. Thank you.

json – Como fazer filtro no Javascript somente com números e letras (Eliminando os caracteres especiais)

<textarea id='txt' style="height: 200">
9 190 087 006
9190087006
13067/5
130675
VR-B190
VR B190
</textarea>
<br>
<button onclick='limpar()'>Clear</button>
<button onclick='render()'>Pesquisa</button>
<!-- <input type="" name="" id='pesq'> -->

<div id="lista"></div>

<script>
    
    x = (

{"Codigo":"T001","Marca":"AAAAAA","Cod":{" Marca":"9 190 087 006"}},
{"Codigo":"T001","Marca":"AAAAAA","Cod":{" Marca":"9-190-085-001"}},
{"Codigo":"T001","Marca":"AAAAAA","Cod":{" Marca":"9.190.087.011"}},
{"Codigo":"T001","Marca":"AAAAAA","Cod":{" Marca":"13067/5"}},
{"Codigo":"T001","Marca":"AAAAAA","Cod":{" Marca":"2500216"}},
{"Codigo":"T002","Marca":"AAAAAA","Cod":{" Marca":"130216"}},
{"Codigo":"T002","Marca":"AAAAAA","Cod":{" Marca":"IK420HD"}},
{"Codigo":"T002","Marca":"AAAAAA","Cod":{" Marca":"VR-B190"}},
{"Codigo":"T002","Marca":"AAAAAA","Cod":{" Marca":"VRB190"}},
{"Codigo":"T003","Marca":"AAAAAA","Cod":{" Marca":"IB305"}},
{"Codigo":"T003","Marca":"AAAAAA","Cod":{" Marca":"9 190 083 002"}},
{"Codigo":"T003","Marca":"AAAAAA","Cod":{" Marca":"1197 BE3 002"}}

)

    function pesquisa(valor){
        // valor = this.value
        
        resultados = ()
        for(i of x){

            reg = new RegExp(valor,"g")

            if(valor == i.Cod(' Marca').match(reg)){
                resultados.push(i)
            }
        }
        return resultados
        // console.log(resultados)
        // lista.innerHTML = resultados
    }

    function add(str){
        j = ()
        json1 = pesquisa(str)
        div = document.createElement("div")
        div.innerHTML = JSON.stringify(json1)
        lista.appendChild(div)
    }

    function render(){
        t = txt.value.split("n")
        for(o of t){
            add(o)
        }
    }
    render()

    function limpar(){
        lista.innerHTML = ""
    }

</script>

php – Fetch post block/field data as JSON with WordPress API

Usually find what I need from here without asking but seem to have run into something new, apologies if this has been answered elsewhere. I am building a site in wordpress which isn’t my usual CMS but seems straight forward enough. I’m trying to get the post data using the API accessing the data at /wp-json/wp/v2/pages/24 which is great until we get to the actual content itself. The block/page content comes only as fully rendered with html. I tried using different context but this seems to either do nothing or throw a permissions error.

What I’m looking for is something along the lines of the below but cant seem to find that anywhere. Is this just not what’s available or am I missing the point of this API all together? Any help would be great!

"content": {
"blocks": {
  "cover": {
    "classes": "wp-block-cover has-background-dim",
    "background-image": "https://localhost.local:8890/wp-content/uploads/2020/07/92977310_Preview.jpeg",
    "content": "Our Range Title"
  },
  "image": {
    "classes": "wp-block-image",
    "image": "https://localhost.local:8890/wp-content/uploads/2020/07/976545678.jpeg",
    "alt": "This is the alt for the image"
  },
  "layout": {
    "classes":  "background-green",
    "columns": 2,
    "content": [
      {
        "image": {
          "classes": "wp-block-image",
          "image": "https://localhost.local:8890/wp-content/uploads/2020/07/976545678.jpeg",
          "alt": "This is the alt for the image"
        },
        "paragraph": {
          "classes": "",
          "content": "This is the <strong>paragraph for</strong> the left column."
        }
      },
      {
        "image": {
          "classes": "wp-block-image",
          "image": "https://localhost.local:8890/wp-content/uploads/2020/07/976545678.jpeg",
          "alt": "This is the alt for the image"
        },
        "paragraph": {
          "classes": "",
          "content": "This is the <strong>paragraph for</strong> the right column."
        }
      }
    ]
  }
},
"protected": false

}

json – Kubernetes custom column output formatting issue

I am working on a project and I need an IP filtered out from POD using Json query. Could you please help me.

kubectl get pods rcsm-sc-rms-sc-01 -o jsonpath='{.metadata.annotations.k8s.v1.cni.cncf.io/network-status}’

##OUTPUT##

“[{n “name”: “calico”,n “ips”: [n “240b:c0e0:202:5e2b:b424:2:0:342″n ],n “default”: true,n “dns”: {}n},{n “name”: “robin-ovs”,n “interface”: “eth1”,n “ips”: [n “240b:c0e0:102:550e:a727:2:1:501″n ],n “dns”: {}n},{n “name”: “sriov-network”,n “interface”: “eth2”,n “ips”: [n “240b:c0e0:102:550b:a728:2:1:501″n ],n “mac”: “5e:ad:97:7a:d2:4c”,n “dns”: {}n},{n “name”: “sriov-network”,n “interface”: “eth3”,n “ips”: [n “240b:c0e0:102:550c:a728:2:1:501″n ],n “mac”: “d6:eb:b1:e2:22:16”,n “dns”: {}n},{n “name”: “sriov-network”,n “interface”: “eth4”,n “ips”: [n “240b:c0e0:102:5510:a728:2:1:501″n ],n “mac”: “e6:dc:f6:6e:9c:b9”,n “dns”: {}n}]”

I want to get one IP from this output and put it in custom coloumn with name OAM IP using kubernetes custom-column utility.

DESIRED####

Example :

OAMIP

240b:c0e0:102:550b:a728:2:1:501

Problem is output of my query is a string and I dont know json query to filter out this complex string.

html5 – Como leo un archivo JSON Con javascript, he buscado como hacerlo en http request de w3schools pero no me funciona

estoy tratando de leer datos de un archivo .json que codifique usando javscript, sin embargo no logro que me muestre nada… probe imprimirlo en texto plano y ahi si funciona.
estoy usando WAMP Como servidor de pruebas
aca el codigo del javascript

var xhttp=new XMLHttpRequest();
        xhttp.onreadystatechange=function(){
            if(this.readyState==4 && this.status==200){
                var respuesta=JSON.parse(xhttp.responseText);
                var personas=respuesta.personas;
                var salida='';
                for(var i=0;i<personas.lenght;i++){
                    salida= "<li>" + personas(i).nombre + "</li>";
                    
                }
                document.getElementById("personas").innerHTML=salida;
            }
        }
        xhttp.open("GET","personas.json",true);
        xhttp.send();

aca el codigo del json

{
    "personas":(
        {"nombre":"Jose De Marzo","edad":19,"estudiante":true,"edo_civil":"soltero"},
        {"nombre":"Nelson Carrasco","edad":19,"estudiante":false,"edo_civil":"casado"},
        {"nombre":"Marlyn Montero","edad":39,"estudiante":false,"edo_civil":"soltera"}
    )
}

no muestra nada en pantalla, sin embargo sin pasarlo a json si lee el texto plano