Merge remote-tracking branch 'origin/main' into heroku-app
This commit is contained in:
commit
858c923239
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,6 +12,6 @@ app/static/custom_config
|
||||||
app/static/bangs
|
app/static/bangs
|
||||||
|
|
||||||
# pip stuff
|
# pip stuff
|
||||||
build/
|
/build/
|
||||||
dist/
|
dist/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
|
|
|
@ -69,6 +69,9 @@ COPY app/ app/
|
||||||
COPY run .
|
COPY run .
|
||||||
COPY whoogle.env .
|
COPY whoogle.env .
|
||||||
|
|
||||||
|
# Allow writing symlinks to build dir
|
||||||
|
RUN chown 102:102 app/static/build
|
||||||
|
|
||||||
EXPOSE $EXPOSE_PORT
|
EXPOSE $EXPOSE_PORT
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s \
|
HEALTHCHECK --interval=30s --timeout=5s \
|
||||||
|
|
|
@ -101,7 +101,12 @@ for cb_dir in cache_busting_dirs:
|
||||||
full_cb_path = os.path.join(full_cb_dir, cb_file)
|
full_cb_path = os.path.join(full_cb_dir, cb_file)
|
||||||
cb_file_link = gen_file_hash(full_cb_dir, cb_file)
|
cb_file_link = gen_file_hash(full_cb_dir, cb_file)
|
||||||
build_path = os.path.join(app.config['BUILD_FOLDER'], cb_file_link)
|
build_path = os.path.join(app.config['BUILD_FOLDER'], cb_file_link)
|
||||||
os.symlink(full_cb_path, build_path)
|
|
||||||
|
try:
|
||||||
|
os.symlink(full_cb_path, build_path)
|
||||||
|
except FileExistsError:
|
||||||
|
# Symlink hasn't changed, ignore
|
||||||
|
pass
|
||||||
|
|
||||||
# Create mapping for relative path urls
|
# Create mapping for relative path urls
|
||||||
map_path = build_path.replace(app.config['APP_ROOT'], '')
|
map_path = build_path.replace(app.config['APP_ROOT'], '')
|
||||||
|
|
|
@ -173,8 +173,12 @@ class Filter:
|
||||||
break
|
break
|
||||||
|
|
||||||
# Create the new details element to wrap around the result's
|
# Create the new details element to wrap around the result's
|
||||||
# immediate parent
|
# first parent
|
||||||
parent = result_children[0].parent
|
parent = None
|
||||||
|
idx = 0
|
||||||
|
while not parent and idx < len(result_children):
|
||||||
|
parent = result_children[idx].parent
|
||||||
|
idx += 1
|
||||||
details = BeautifulSoup(features='html.parser').new_tag('details')
|
details = BeautifulSoup(features='html.parser').new_tag('details')
|
||||||
summary = BeautifulSoup(features='html.parser').new_tag('summary')
|
summary = BeautifulSoup(features='html.parser').new_tag('summary')
|
||||||
summary.string = label
|
summary.string = label
|
||||||
|
|
2
app/static/build/.gitignore
vendored
Normal file
2
app/static/build/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
|
@ -16,7 +16,6 @@ services:
|
||||||
- no-new-privileges
|
- no-new-privileges
|
||||||
cap_drop:
|
cap_drop:
|
||||||
- ALL
|
- ALL
|
||||||
read_only: true
|
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /config/:size=10M,uid=102,gid=102,mode=1700
|
- /config/:size=10M,uid=102,gid=102,mode=1700
|
||||||
- /var/lib/tor/:size=10M,uid=102,gid=102,mode=1700
|
- /var/lib/tor/:size=10M,uid=102,gid=102,mode=1700
|
||||||
|
|
2
run
2
run
|
@ -12,8 +12,6 @@ SUBDIR="${1:-app}"
|
||||||
export APP_ROOT="$SCRIPT_DIR/$SUBDIR"
|
export APP_ROOT="$SCRIPT_DIR/$SUBDIR"
|
||||||
export STATIC_FOLDER="$APP_ROOT/static"
|
export STATIC_FOLDER="$APP_ROOT/static"
|
||||||
|
|
||||||
rm -rf $STATIC_FOLDER/build
|
|
||||||
|
|
||||||
# Check for regular vs test run
|
# Check for regular vs test run
|
||||||
if [[ "$SUBDIR" == "test" ]]; then
|
if [[ "$SUBDIR" == "test" ]]; then
|
||||||
# Set up static files for testing
|
# Set up static files for testing
|
||||||
|
|
Loading…
Reference in New Issue
Block a user