- Install Docker
- cd
snippets-service
and rundocker-compose up
- run
docker ps
get the name of the container for theweb
servicedocker exec -it <container_name> /bin/bash
python manage.py migrate --noinput
python manage.py createsuperuser
- Some setting changes for CSP rules (otherwise it will complain about running on localhost, at least that is what happend to me)
- apply patch
- Login at
localhost:8000/admin
withsuperuser
created previously - add the snippet template https://github.com/mozmeao/snippets-service/blob/master/simple_template_server/snippets_as/snippet-one.html
Last active
April 9, 2018 20:09
-
-
Save piatra/b56a9722d48b4bb1e75726693e997a95 to your computer and use it in GitHub Desktop.
run mozmeao/snippets-service locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/snippets/settings.py b/snippets/settings.py | |
index 91e4e5a..f1e8dd6 100644 | |
--- a/snippets/settings.py | |
+++ b/snippets/settings.py | |
@@ -199,12 +199,14 @@ TEMPLATES = [ | |
CSP_DEFAULT_SRC = ( | |
"'self'", | |
+ "'unsafe-inline'", | |
) | |
CSP_IMG_SRC = ( | |
"'self'", | |
+ "'unsafe-inline'", | |
"data:", | |
) | |
-CSP_REPORT_ONLY = config('CSP_REPORT_ONLY', default=False, cast=bool) | |
+CSP_REPORT_ONLY = config('CSP_REPORT_ONLY', default=True, cast=bool) | |
CSP_REPORT_ENABLE = config('CSP_REPORT_ENABLE', default=True, cast=bool) | |
if CSP_REPORT_ENABLE: | |
CSP_REPORT_URI = config('CSP_REPORT_URI', default='/csp-violation-capture') | |
@@ -212,7 +214,7 @@ if CSP_REPORT_ENABLE: | |
SNIPPET_SIZE_LIMIT = 500 | |
SNIPPET_IMAGE_SIZE_LIMIT = 250 | |
-ENABLE_ADMIN = config('ENABLE_ADMIN', default=False, cast=bool) | |
+ENABLE_ADMIN = config('ENABLE_ADMIN', default=True, cast=bool) | |
CSRF_USE_SESSIONS = config('CSRF_USE_SESSIONS', default=True, cast=bool) | |
SNIPPET_BUNDLE_TIMEOUT = config('SNIPPET_BUNDLE_TIMEOUT', default=15 * 60, cast=int) # 15 minutes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment