Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2022-06-05 20:56:20 +01:00
commit b8e2a08ad8
8 changed files with 6069 additions and 11 deletions

View File

@ -3,6 +3,8 @@ VERSION=1.1.0
all:
debug:
sbom:
scanoss-py scan . > sbom.json
source:
rm -f *.*~ *~
rm -f ontology/*~
@ -17,6 +19,7 @@ source:
rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc
cd .. && mv ${APP} ${APP}-${VERSION} && tar -zcvf ${APP}_${VERSION}.orig.tar.gz ${APP}-${VERSION}/ && mv ${APP}-${VERSION} ${APP}
clean:
rm -f \#*
rm -f *.*~ *~ *.dot
rm -f orgs/*~
rm -f ontology/*~
@ -25,6 +28,7 @@ clean:
rm -f theme/indymediaclassic/welcome/*~
rm -f theme/indymediamodern/welcome/*~
rm -f website/EN/*~
rm -f cwlists/*~
rm -f gemini/EN/*~
rm -f scripts/*~
rm -f deploy/*~

View File

@ -311,3 +311,13 @@ To run the network tests. These simulate instances exchanging messages.
``` bash
python3 epicyon.py --testsnetwork
```
## Software Bill of Materials
To update the software bill of materials:
``` bash
sudo pip3 install scanoss
make clean
make sbom
```

View File

@ -451,8 +451,8 @@
"warning": "26A0",
"wastebasket": "1F5D1",
"watch": "231A",
"waveman": "1F64B-1F3FE-200D-2642-FE0F",
"wavewoman": "1F64B-1F3FE-200D-2640-FE0F",
"waveman": "1F64B",
"wavewoman": "1F64B",
"wavydash": "3030",
"wheelchairsymbol": "267F",
"wheelchair": "1F9BD",
@ -2824,5 +2824,6 @@
"vegananarchism": "vegananarchism",
"wiphala_bolivia": "wiphala_bolivia",
"yayblob": "yayblob",
"notankies": "notankies"
"notankies": "notankies",
"highfive": "1F64B"
}

13
maps.py
View File

@ -46,17 +46,24 @@ def _geocoords_from_osm_link(url: str, osm_domain: str) -> (int, float, float):
def _geocoords_from_gmaps_link(url: str) -> (int, float, float):
"""Returns geocoordinates from a Gmaps link
"""
if '/maps/@' not in url:
if '/maps/' not in url:
return None, None, None
coords_str = url.split('/maps', 1)[1]
if '/@' not in coords_str:
return None, None, None
coords_str = url.split('/maps/@')[1]
coords_str = coords_str.split('/@', 1)[1]
if 'z' not in coords_str:
return None, None, None
coords_str = coords_str.split('z', 1)[0]
if ',' not in coords_str:
return None, None, None
coords = coords_str.split(',')
if len(coords) != 3:
return None, None, None
zoom = coords[2].replace('z', '')
zoom = coords[2]
if not zoom.isdigit():
return None, None, None
latitude = coords[0]

6028
sbom.json 100644

File diff suppressed because it is too large Load Diff

View File

@ -725,9 +725,9 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
str(maps_zoom) + ',normal'
location_label_with_link = \
'<a href="' + maps_url + '" ' + \
'rel="nofollow noopener noreferrer" target="_blank">' + \
'rel="nofollow noopener noreferrer" target="_blank">🗺️ ' + \
translate['Location'] + '</a>'
date_and_location += '<p>\n' + \
date_and_location += '<br><p>\n' + \
edit_text_field(location_label_with_link, 'location', '',
'https://www.openstreetmap.org/#map=') + '</p>\n'
date_and_location += end_edit_section()

View File

@ -395,7 +395,15 @@ def html_moderation_info(css_cache: {}, translate: {},
blocking_filename = base_dir + '/accounts/blocking.txt'
if os.path.isfile(blocking_filename):
with open(blocking_filename, 'r') as fp_block:
blocked_str = fp_block.read()
blocked_lines = fp_block.readlines()
blocked_str = ''
if blocked_lines:
blocked_lines.sort()
for line in blocked_lines:
if not line:
continue
line = line.replace('\n', '').replace('\r', '').strip()
blocked_str += line + '\n'
info_form += '<div class="container">\n'
info_form += \
' <br><b>' + \
@ -405,7 +413,7 @@ def html_moderation_info(css_cache: {}, translate: {},
translate[msg_str1]
info_form += \
' <textarea id="message" ' + \
'name="blocked" style="height:700px" spellcheck="false">' + \
'name="blocked" style="height:2000px" spellcheck="false">' + \
blocked_str + '</textarea>\n'
info_form += '</div>\n'
info_shown = True

View File

@ -221,7 +221,7 @@ def html_theme_designer(css_cache: {}, base_dir: str,
translate['Reset'] + '</button>\n' + \
' <button type="submit" class="button" ' + \
'name="submitThemeDesigner" accesskey="' + submit_key + '">' + \
translate['Publish'] + '</button>\n </center>\n'
translate['Save'] + '</button>\n </center>\n'
contrast_warning = ''
if theme_json.get('main-bg-color'):