Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ridgarou authored Mar 29, 2022
1 parent 427bf62 commit 632ee4a
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,41 @@ service cron start
if [ ! -f /app/edited ]; then
sed -i 's/type="email" class="form-control" name="kindle_mail"/type="text" class="form-control" name="kindle_mail"/g' /app/calibre-web/cps/templates/user_edit.html

sed -i -e '519s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '520s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '521s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '522s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '523s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '524s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '525s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '526s/^/# /' /app/calibre-web/cps/helper.py
sed -i "527 i def valid_email(emails):" /app/calibre-web/cps/helper.py
sed -i "528 i \ emailList = emails.split(',')" /app/calibre-web/cps/helper.py
sed -i "529 i \ for email in emailList:" /app/calibre-web/cps/helper.py
sed -i "530 i \ # Regex according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation" /app/calibre-web/cps/helper.py
sed -i '531 i \ if not re\.search(r"\^\[\\w\.!#\$%\&\x27\*+\\\\\/=?\^_`{|}~-\]+@\[\\w\](?:\[\\w-\]{0,61}\[\\w\])?(?:\\\.\[\\w\](?:\[\\w-\]{0,61}\[\\w\])?)\*\$", email.strip()):' /app/calibre-web/cps/helper.py
sed -i "532 i \ log.error(u\"Invalid e-mail address format\")" /app/calibre-web/cps/helper.py
sed -i "533 i \ raise Exception(_(u\"Invalid e-mail address format\"))" /app/calibre-web/cps/helper.py
sed -i "534 i \ return emails" /app/calibre-web/cps/helper.py
sed -i -e '663s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '664s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '665s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '666s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '667s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '668s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '669s/^/# /' /app/calibre-web/cps/helper.py
sed -i -e '670/^/# /' /app/calibre-web/cps/helper.py
sed -i "671 i def valid_email(emails):" /app/calibre-web/cps/helper.py
sed -i "672 i \ emailList = emails.split(',')" /app/calibre-web/cps/helper.py
sed -i "673 i \ for email in emailList:" /app/calibre-web/cps/helper.py
sed -i "674 i \ # Regex according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation" /app/calibre-web/cps/helper.py
sed -i '675 i \ if not re\.search(r"\^\[\\w\.!#\$%\&\x27\*+\\\\\/=?\^_`{|}~-\]+@\[\\w\](?:\[\\w-\]{0,61}\[\\w\])?(?:\\\.\[\\w\](?:\[\\w-\]{0,61}\[\\w\])?)\*\$", email.strip()):' /app/calibre-web/cps/helper.py
sed -i "676 i \ log.error(u\"Invalid e-mail address format\")" /app/calibre-web/cps/helper.py
sed -i "677 i \ raise Exception(_(u\"Invalid e-mail address format\"))" /app/calibre-web/cps/helper.py
sed -i "678 i \ return emails" /app/calibre-web/cps/helper.py

sed -i -e '1445s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1446s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1447s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1448s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1449s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1450s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1451s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1452s/^/# /' /app/calibre-web/cps/web.py
sed -i "1453 i \ emailList = current_user.kindle_mail.split(',')" /app/calibre-web/cps/web.py
sed -i '1454 i \ aux_convert = convert' /app/calibre-web/cps/web.py
sed -i '1455 i \ for email in emailList:' /app/calibre-web/cps/web.py
sed -i '1456 i \ result = send_mail(book_id, book_format, convert, email, config.config_calibre_dir, current_user.name)' /app/calibre-web/cps/web.py
sed -i '1457 i \ aux_convert = False' /app/calibre-web/cps/web.py
sed -i '1458 i \ if result is None:' /app/calibre-web/cps/web.py
sed -i '1459 i \ flash(_(u"Book successfully queued for sending to %(kindlemail)s", kindlemail=email), category="success")' /app/calibre-web/cps/web.py
sed -i '1450 i \ ub.update_download(book_id, int(current_user.id))' /app/calibre-web/cps/web.py
sed -i '1461 i \ else:' /app/calibre-web/cps/web.py
sed -i '1462 i \ flash(_(u"Oops! There was an error sending this book: %(res)s , kindlemail=email", res=result, kindlemail=email), category="error")' /app/calibre-web/cps/web.py
sed -i -e '1424s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1425s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1426s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1427s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1428s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1429s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1430s/^/# /' /app/calibre-web/cps/web.py
sed -i -e '1431s/^/# /' /app/calibre-web/cps/web.py
sed -i "1432 i \ emailList = current_user.kindle_mail.split(',')" /app/calibre-web/cps/web.py
sed -i '1433 i \ aux_convert = convert' /app/calibre-web/cps/web.py
sed -i '1434 i \ for email in emailList:' /app/calibre-web/cps/web.py
sed -i '1435 i \ result = send_mail(book_id, book_format, convert, email, config.config_calibre_dir, current_user.name)' /app/calibre-web/cps/web.py
sed -i '1436 i \ aux_convert = False' /app/calibre-web/cps/web.py
sed -i '1437 i \ if result is None:' /app/calibre-web/cps/web.py
sed -i '1438 i \ flash(_(u"Book successfully queued for sending to %(kindlemail)s", kindlemail=email), category="success")' /app/calibre-web/cps/web.py
sed -i '1439 i \ ub.update_download(book_id, int(current_user.id))' /app/calibre-web/cps/web.py
sed -i '1440 i \ else:' /app/calibre-web/cps/web.py
sed -i '1441 i \ flash(_(u"Oops! There was an error sending this book: %(res)s , kindlemail=email", res=result, kindlemail=email), category="error")' /app/calibre-web/cps/web.py

touch /app/edited
fi
Expand Down

0 comments on commit 632ee4a

Please sign in to comment.