mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-10 12:32:34 +02:00
fixed bug
This commit is contained in:
@@ -3,10 +3,8 @@ from lnbits.db import Database
|
|||||||
|
|
||||||
db = Database("ext_ngrok")
|
db = Database("ext_ngrok")
|
||||||
|
|
||||||
freetunnel_ext: Blueprint = Blueprint(
|
ngrok_ext: Blueprint = Blueprint(
|
||||||
"ngrok", __name__, static_folder="static", template_folder="templates"
|
"ngrok", __name__, static_folder="static", template_folder="templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
from .views_api import * # noqa
|
|
||||||
from .views import * # noqa
|
from .views import * # noqa
|
@@ -1,37 +1,47 @@
|
|||||||
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
|
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
|
||||||
%} {% block page %}
|
%} {% block page %}
|
||||||
<q-card>
|
|
||||||
<q-card-section>
|
<div class="row q-col-gutter-md">
|
||||||
<h5 class="text-subtitle1 q-mt-none q-mb-md">Access this lnbits instance at the following url</h5>
|
<div class="col-12 col-md-8 col-lg-7 q-gutter-y-md">
|
||||||
<q-separator class="q-my-lg"></q-separator>
|
<q-card>
|
||||||
<p><a href="{{ ngrok }}" target="_blank">{{ ngrok }}</a></p>
|
<q-card-section>
|
||||||
<p>Note that if you restart your device, your device will generate a new url. If anyone is using your old one for wallets, lnurls, etc., whatever they are doing will stop working.</p>
|
<h5 class="text-subtitle1 q-mt-none q-mb-md">
|
||||||
</q-card-section>
|
Access this lnbits instance at the following url
|
||||||
</q-card>
|
</h5>
|
||||||
|
<q-separator class="q-my-lg"></q-separator>
|
||||||
|
<p><a href="{{ ngrok }}" target="_blank">{{ ngrok }}</a></p>
|
||||||
|
<p>
|
||||||
|
Note that if you restart your device, your device will generate a new
|
||||||
|
url. If anyone is using your old one for wallets, lnurls, etc.,
|
||||||
|
whatever they are doing will stop working.
|
||||||
|
</p>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 col-md-5 q-gutter-y-md">
|
||||||
|
<q-card>
|
||||||
|
<q-card-section>
|
||||||
|
<h6 class="text-subtitle1 q-my-none">Ngrok extension</h6>
|
||||||
|
</q-card-section>
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<q-separator></q-separator>
|
||||||
|
<q-list>
|
||||||
|
{% include "tpos/_api_docs.html" %}
|
||||||
|
<q-separator></q-separator>
|
||||||
|
{% include "tpos/_tpos.html" %}
|
||||||
|
</q-list>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
||||||
<script>
|
<script>
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#vue',
|
el: '#vue',
|
||||||
mixins: [windowMixin],
|
mixins: [windowMixin],
|
||||||
data: function () {
|
data: function () {}
|
||||||
return {
|
|
||||||
tools: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created: function () {
|
|
||||||
var self = this
|
|
||||||
|
|
||||||
// axios is available for making requests
|
|
||||||
axios({
|
|
||||||
method: 'GET',
|
|
||||||
url: '/example/api/v1/tools',
|
|
||||||
headers: {
|
|
||||||
'X-example-header': 'not-used'
|
|
||||||
}
|
|
||||||
}).then(function (response) {
|
|
||||||
self.tools = response.data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -3,6 +3,7 @@ from quart import g, render_template
|
|||||||
from lnbits.decorators import check_user_exists, validate_uuids
|
from lnbits.decorators import check_user_exists, validate_uuids
|
||||||
|
|
||||||
from pyngrok import conf, ngrok
|
from pyngrok import conf, ngrok
|
||||||
|
from . import ngrok_ext
|
||||||
|
|
||||||
def log_event_callback(log):
|
def log_event_callback(log):
|
||||||
string = str(log)
|
string = str(log)
|
||||||
@@ -17,8 +18,6 @@ conf.get_default().log_event_callback = log_event_callback
|
|||||||
|
|
||||||
ngrok_tunnel = ngrok.connect(5000)
|
ngrok_tunnel = ngrok.connect(5000)
|
||||||
|
|
||||||
from . import ngrok_ext
|
|
||||||
|
|
||||||
@ngrok_ext.route("/")
|
@ngrok_ext.route("/")
|
||||||
@validate_uuids(["usr"], required=True)
|
@validate_uuids(["usr"], required=True)
|
||||||
@check_user_exists()
|
@check_user_exists()
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
# views_api.py is for you API endpoints that could be hit by another service
|
|
||||||
|
|
||||||
# add your dependencies here
|
|
||||||
|
|
||||||
import pyngrok
|
|
||||||
|
|
||||||
# import json
|
|
||||||
# import httpx
|
|
||||||
# (use httpx just like requests, except instead of response.ok there's only the
|
|
||||||
# response.is_error that is its inverse)
|
|
||||||
|
|
||||||
from quart import jsonify
|
|
||||||
from http import HTTPStatus
|
|
||||||
|
|
||||||
from . import ngrok_ext
|
|
Reference in New Issue
Block a user