diff --git a/README.md b/README.md
index c2c1400..2430617 100755
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## HBNet is still under heavy development. Documentation is being added to the Wiki as I write it, so check perodically to see if there is any new information. V1.0 will be ready in the next few months. See [HBNet.xyz](https://hbnet.xyz) or [here](https://github.com/kf7eel/hbnet/discussions/33) for the development news.
+## HBNet is still under heavy development and currently undergoing a partiaql rewrite. Documentation is being added to the Wiki as I write it, so check perodically to see if there is any new information. V1.0 will be ready in the next few months. See [here](https://github.com/kf7eel/hbnet/discussions/33) for the development news.

diff --git a/bridge.py b/bridge.py
index 309492b..9a56899 100755
--- a/bridge.py
+++ b/bridge.py
@@ -1691,6 +1691,9 @@ if __name__ == '__main__':
except Exception as e:
logger.error('Control server unreachable or other error. Using local config.')
logger.error(e)
+ if LOCAL_CONFIG['WEB_SERVICE']['DISABLE_FALLBACK']:
+ logger.info('Falback disabled. Exiting...')
+ sys.exit()
spec = importlib.util.spec_from_file_location("module.name", cli_args.RULES_FILE)
rules_module = importlib.util.module_from_spec(spec)
try:
@@ -1763,5 +1766,6 @@ if __name__ == '__main__':
pass
else:
Path('/tmp/' + (CONFIG['LOGGER']['LOG_NAME'] + '_PEERS/')).mkdir()
-
+
+
reactor.run()
diff --git a/config.py b/config.py
index d046e5f..a546da4 100755
--- a/config.py
+++ b/config.py
@@ -161,6 +161,7 @@ def build_config(_config_file):
'THIS_SERVER_NAME': config.get(section, 'THIS_SERVER_NAME'),
'URL': config.get(section, 'URL'),
'REMOTE_CONFIG_ENABLED': config.getboolean(section, 'REMOTE_CONFIG_ENABLED'),
+ 'DISABLE_FALLBACK': config.getboolean(section, 'DISABLE_FALLBACK'),
'APPEND_INT': config.getint(section, 'APPEND_INT'),
'EXTRA_INT_1': config.getint(section, 'EXTRA_INT_1'),
'EXTRA_INT_2': config.getint(section, 'EXTRA_INT_2'),
diff --git a/hblink-SAMPLE.cfg b/hblink-SAMPLE.cfg
index 5bd30f1..1bcc307 100755
--- a/hblink-SAMPLE.cfg
+++ b/hblink-SAMPLE.cfg
@@ -110,6 +110,8 @@ STALE_DAYS: 7
# This is where to configure the details for use with a user managment script
[WEB_SERVICE]
THIS_SERVER_NAME: MMDVM_Server
+# When web service unreachable, die.
+DISABLE_FALLBACK: True
REMOTE_CONFIG_ENABLED: True
# URL of the user managment server
URL: http://localhost:8080/svr
@@ -197,7 +199,7 @@ REG_ACL: DENY:1
SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
-
+OTHER_OPTIONS:
# PEER INSTANCES - DUPLICATE SECTION FOR MULTIPLE PEERS
# There are a LOT of errors in the HB Protocol specifications on this one!
# MOST of these items are just strings and will be properly dealt with by the program
diff --git a/requirements.txt b/requirements.txt
index f2baea6..7ab84cd 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,4 +13,5 @@ cryptography
setproctitle
scapy
paho-mqtt
+service_identity
diff --git a/web/app.py b/web/app.py
index 732cfb1..6109fd0 100644
--- a/web/app.py
+++ b/web/app.py
@@ -53,8 +53,10 @@ import os, ast
from cryptography.fernet import Fernet
+from flaskext.markdown import Markdown
+
peer_locations = {}
-hbnet_version = 'HWS 0.0.1-pre_pre_alpha/MQTT'
+hbnet_version = 'V 09102022'
# Query radioid.net for list of IDs
def get_ids(callsign):
@@ -138,6 +140,7 @@ def hbnet_web_service():
# Create Flask app load app.config
mail = Mail()
app = Flask(__name__)
+ Markdown(app)
app.config.from_object(__name__+'.ConfigClass')
# Initialize Flask-BabelEx
@@ -544,7 +547,14 @@ def hbnet_web_service():
boo_2 = db.Column(db.Boolean(), nullable=True, server_default='1')
time = db.Column(db.DateTime())
-
+ class Pages(db.Model):
+ __tablename__ = 'pages'
+ id = db.Column(db.Integer, primary_key=True)
+ name = db.Column(db.String(1000))
+ enabled = db.Column(db.Boolean(), nullable=False, server_default='1')
+ notes = db.Column(db.String(1000))
+ data = db.Column(db.String(10000))
+ time = db.Column(db.DateTime())
@@ -642,24 +652,26 @@ def hbnet_web_service():
time = datetime.datetime.utcnow()
)
db.session.add(flash_entry_add)
- tos_entry_add = Misc(
- field_1 = 'terms_of_service',
- field_2 = '''
-
Terms of Use
-
-
By using ''' + title + ''', you agree not to do anything malicious. You agree to use the system with respect and courtesy to others. Please operate within the laws of your country.
-
-
-
''',
+
+ add_pg = Pages(
+ name='Home Page',
+ data="Welcome to your HBNet installation.",
+ notes = "Created on first start",
time = datetime.datetime.utcnow()
- )
- db.session.add(tos_entry_add)
- home_entry_add = Misc(
- field_1 = 'home_page',
- field_2 = '
Welcome to ' + title + '.
',
+ )
+ db.session.add(add_pg)
+
+ add_tos = Pages(
+ name='Terms of Service',
+ data='''### Terms of Use
+
+By using this service, you agree not to do anything malicious. You agree to use the system with respect and courtesy to others. Please operate within the laws of your country.
+''',
+ notes = "Created on first start",
time = datetime.datetime.utcnow()
- )
- db.session.add(home_entry_add)
+ )
+ db.session.add(add_tos)
+
ping_list_initial = Misc(
field_1 = 'ping_list',
field_2 = '{}',
@@ -681,6 +693,15 @@ def hbnet_web_service():
time = datetime.datetime.utcnow()
)
db.session.add(script_links_initial)
+
+ add_news = News(
+ subject = 'Welcome',
+ date = 'Today',
+ text = 'Welcome',
+ time = datetime.datetime.utcnow()
+ )
+ db.session.add(add_news)
+
db.session.commit()
# Query radioid.net for list of DMR IDs, then add to DB
@@ -787,37 +808,85 @@ def hbnet_web_service():
@app.route('/')
def home_page():
if mode == 'FULL' or mode == 'DMR_ONLY':
- home_text = Misc.query.filter_by(field_1='home_page').first()
+ home_text = Pages.query.filter_by(id=1).first()
#content = Markup('Index')
- try:
- l_news = News.query.order_by(News.time.desc()).first()
- content = '''
-
-