Compare commits

..

5 Commits

Author SHA1 Message Date
R. Miles McCain
4e13842334 Bump version 2020-05-19 17:58:21 -04:00
R. Miles McCain
62c3a87cda Add remote address to nginx conf 2020-05-19 17:57:02 -04:00
Santiago Alessandri
cac6d44166 Quote whitelabel to allow whitespace (#33)
The SHYNET_WHITELABEL variable was being used without quotes,
which breaks the commnand if it contains whitespaces
2020-05-17 00:23:38 -04:00
R. Miles McCain
1a5f68e353 Fix typo in README 2020-05-09 12:35:59 -04:00
R. Miles McCain
4569744726 Add email sending task 2020-05-09 12:35:50 -04:00
7 changed files with 31 additions and 5 deletions

View File

@@ -138,6 +138,7 @@ Nginx is a self hosted, highly configurable webserver. Nginx can be configured t
server {
listen 80;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}

View File

@@ -24,6 +24,7 @@ redis = "*"
django-redis-cache = "*"
pycountry = "*"
ipaddress = "*"
html2text = "*"
[pipenv]
allow_prereleases = true

10
Pipfile.lock generated
View File

@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "75fe7f0efbc05d6bc32c5ccaa08d3d619bf925682ca5eaffa728e74d0e8e5f66"
"sha256": "e66668cad32f92f11324d92caa0e3e83afcb3cafe471f3ba1f178fc090dd7b6b"
},
"pipfile-spec": 6,
"requires": {},
@@ -118,6 +118,14 @@
"index": "pypi",
"version": "==20.0.4"
},
"html2text": {
"hashes": [
"sha256:c7c629882da0cf377d66f073329ccf34a12ed2adf0169b9285ae4e63ef54c82b",
"sha256:e296318e16b059ddb97f7a8a1d6a5c1d7af4544049a01e261731d2d5cc277bbb"
],
"index": "pypi",
"version": "==2020.1.16"
},
"idna": {
"hashes": [
"sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb",

View File

@@ -79,7 +79,7 @@ Here's the information Shynet can give you about your visitors:
## Recommendations
Shynet isn't for everyone. It's great for personal projects and small to medium size websites, but hasn't been tested with ultra-high traffic sites. It's also requires a fair amount of technical know-how to deploy and maintain, so if you need a one-click solution, you're best served with other tools.
Shynet isn't for everyone. It's great for personal projects and small to medium size websites, but hasn't been tested with ultra-high traffic sites. It also requires a fair amount of technical know-how to deploy and maintain, so if you need a one-click solution, you're best served with other tools.
## Concepts

16
shynet/dashboard/tasks.py Normal file
View File

@@ -0,0 +1,16 @@
from celery import shared_task
from django.core import mail
from django.conf import settings
import html2text
@shared_task
def send_email(to: [str], subject: str, content: str, from_email: str = None):
text_content = html2text.html2text(content)
mail.send_mail(
subject,
text_content,
from_email or settings.DEFAULT_FROM_EMAIL,
to,
html_message=content,
)

View File

@@ -14,7 +14,7 @@ import os
from django.contrib.messages import constants as messages
# Increment on new releases
VERSION = "v0.4.0"
VERSION = "v0.4.1"
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

View File

@@ -35,7 +35,7 @@ fi
if [[ -n $SHYNET_WHITELABEL && ${sanity_results[3]} == True ]]; then
echo "Setting whitelabel..."
{
./manage.py whitelabel $SHYNET_WHITELABEL && echo "Whitelabel set! Whitelabel: $SHYNET_WHITELABEL"
./manage.py whitelabel "$SHYNET_WHITELABEL" && echo "Whitelabel set! Whitelabel: $SHYNET_WHITELABEL"
} || {
echo "Failed to set whitelabel, exiting" & exit 1
}