From 880a84f9b4856ccf01ca4c4859cd0a20af4fa50e Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Tue, 24 Mar 2020 11:36:13 -0700 Subject: [PATCH 01/69] Update .env.example (#30) --- .env.example | 87 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 36 deletions(-) diff --git a/.env.example b/.env.example index 491b6f7..f94308d 100644 --- a/.env.example +++ b/.env.example @@ -1,28 +1,42 @@ -ANNUAL_COST_EMPLOYEE=650000 -BUSINESS_HOURS_YEAR=2080 +# For configuration details, see: https://hawkins.gitbook.io/dispatch/configuration/app + +# General COMPOSE_PROJECT_NAME=dispatch +DISPATCH_HELP_EMAIL=help@example.com +DISPATCH_HELP_SLACK_CHANNEL=#general +DISPATCH_UI_URL=https://example.com + +# Database DATABASE_CREDENTIALS=creds DATABASE_HOSTNAME=postgres DATABASE_NAME=dispatch DATABASE_PORT=5432 -DISPATCH_HELP_EMAIL=help@example.com -DISPATCH_HELP_SLACK_CHANNEL=#general +POSTGRES_DB=dispatch +POSTGRES_PASSWORD=dispatch +POSTGRES_USER=dispatch + +# Authentication +DISPATCH_AUTHENTICATION_PROVIDER_PKCE_JWKS="" + +# Frontend +VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_PKCE_OPEN_ID_CONNECT_URL="" +VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_PKCE_CLIENT_ID="" + +# Cost +ANNUAL_COST_EMPLOYEE=50000 +BUSINESS_HOURS_YEAR=2080 + +# Incident configuration +INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID="INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID" INCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID=None +INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="" INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID" -INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID="INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID" +INCIDENT_FAQ_DOCUMENT_ID="" INCIDENT_FAQ_DOCUMENT_ID="INCIDENT_FAQ_DOCUMENT_ID" INCIDENT_NOTIFICATION_CONVERSATIONS="" +INCIDENT_NOTIFICATION_CONVERSATIONS="" +INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" -INCIDENT_PLUGIN_CONTACT_SLUG="slack-contact" -INCIDENT_PLUGIN_CONVERSATION_SLUG="slack-conversation" -INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG="dispatch-document-resolver" -INCIDENT_PLUGIN_DOCUMENT_SLUG="google-docs-document" -INCIDENT_PLUGIN_EMAIL_SLUG="google-gmail-conversation" -INCIDENT_PLUGIN_GROUP_SLUG="group-participant-group" -INCIDENT_PLUGIN_PARTICIPANT_SLUG="dispatch-participants" -INCIDENT_PLUGIN_STORAGE_SLUG="google-drive-storage" -INCIDENT_PLUGIN_TASK_SLUG="google-drive-task" -INCIDENT_PLUGIN_TICKET_SLUG="jira-ticket" INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT="google-docs-conversation-commands-reference-document" INCIDENT_RESOURCE_FAQ_DOCUMENT="google-docs-faq-document" INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT="google-docs-incident-review-document" @@ -31,25 +45,23 @@ INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT="google-docs-investigation-document" INCIDENT_RESOURCE_INVESTIGATION_SHEET="google-docs-investigation-sheet" INCIDENT_RESOURCE_NOTIFICATIONS_GROUP="google-group-participant-notifications-group" INCIDENT_RESOURCE_TACTICAL_GROUP="google-group-participant-tactical-group" -INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID=INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID -INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID -JWKS_URL=https://site.com -POSTGRES_DB=dispatch -POSTGRES_PASSWORD=dispatch -POSTGRES_USER=dispatch - -# Plugin-specific -# For configuration details, see: https://hawkins.gitbook.io/dispatch/configuration/app -# Incident configuration -INCIDENT_NOTIFICATION_CONVERSATIONS="" -INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID="" +INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID=INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID INCIDENT_STORAGE_DRIVE_ID_SLUG="" INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID="" -INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="" -INCIDENT_FAQ_DOCUMENT_ID="" +INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID # Plugin configuration +INCIDENT_PLUGIN_CONTACT_SLUG="slack-contact" +INCIDENT_PLUGIN_CONVERSATION_SLUG="slack-conversation" +INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG="dispatch-document-resolver" +INCIDENT_PLUGIN_DOCUMENT_SLUG="google-docs-document" +INCIDENT_PLUGIN_EMAIL_SLUG="google-gmail-conversation" +INCIDENT_PLUGIN_GROUP_SLUG="group-participant-group" +INCIDENT_PLUGIN_PARTICIPANT_SLUG="dispatch-participants" +INCIDENT_PLUGIN_STORAGE_SLUG="google-drive-storage" +INCIDENT_PLUGIN_TASK_SLUG="google-drive-task" +INCIDENT_PLUGIN_TICKET_SLUG="jira-ticket" # Slack SLACK_APP_USER_SLUG="" @@ -58,19 +70,22 @@ SLACK_SIGNING_SECRET="" SLACK_WORKSPACE_NAME="" # Google -GOOGLE_SERVICE_ACCOUNT_PROJECT_ID=id -GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY_ID=id -GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=key +GOOGLE_DEVELOPER_KEY=key +GOOGLE_DOMAIN=site.com GOOGLE_SERVICE_ACCOUNT_CLIENT_EMAIL=info@example.com GOOGLE_SERVICE_ACCOUNT_CLIENT_ID=id GOOGLE_SERVICE_ACCOUNT_DELEGATED_ACCOUNT=account -GOOGLE_DEVELOPER_KEY=key -GOOGLE_DOMAIN=site.com +GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=key +GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY_ID=id +GOOGLE_SERVICE_ACCOUNT_PROJECT_ID=id # Jira -JIRA_URL="" -JIRA_PASSWORD="" +JIRA_BROWSER_URL="" +JIRA_API_URL="" +JIRA_PROJECT_KEY="" +JIRA_ISSUE_TYPE_ID="" JIRA_USERNAME="" +JIRA_PASSWORD="" # PagerDuty PAGERDUTY_API_KEY="" From 23b00f66c46d8e265743260dfd63d50ec2b8e770 Mon Sep 17 00:00:00 2001 From: Sarah Curtis <54888897+sarahcthekey@users.noreply.github.com> Date: Tue, 14 Apr 2020 00:04:18 +0100 Subject: [PATCH 02/69] added port forward and web app expose on 0.0.0.0 (#36) Co-authored-by: root --- docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7e83b86..d5f097c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,9 @@ services: - postgres env_file: - .env - command: ["server", "start", "dispatch.main:app"] + command: ["server", "start", "dispatch.main:app", "--host=0.0.0.0"] + ports: + - "80:8000" scheduler: <<: *restart_policy build: From 6563eeb6ceca3b13adca547505c5ffa7375d1e5a Mon Sep 17 00:00:00 2001 From: "Ahmed Shibani (Shumbashi)" Date: Tue, 14 Apr 2020 01:05:23 +0200 Subject: [PATCH 03/69] Fix install.sh error when no .env file is present (#39) * Fix install.sh error when .env file is not present When there is no .env file present, two problems occur: 1- The line 'docker-compose down --rmi local --remove-orphans' fails because it's unable to find .env file 2- The function 'ensure_file_from_example' attemps to copy .example.env instead of .env.example * Fix SECRET_KEY is not added to .env The sed expression on line 72 fails to update the SECRET_KEY in .env file if there isn't SECRET_KEY value already present Co-authored-by: Ahmed Shibani --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index c903459..828f838 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,7 @@ function ensure_file_from_example { echo "$1 already exists, skipped creation." else echo "Creating $1..." - cp -n $(echo "$1" | sed 's/\.[^.]*$/.example&/') "$1" + cp -n $(echo "$1" | sed 's/\.[^.]*$/&.example/') "$1" fi } @@ -54,6 +54,10 @@ if [ "$RAM_AVAILABLE_IN_DOCKER" -lt "$MIN_RAM" ]; then exit -1 fi +echo "" +ensure_file_from_example $DISPATCH_CONFIG_ENV +ensure_file_from_example $DISPATCH_EXTRA_REQUIREMENTS + # Clean up old stuff and ensure nothing is working while we install/update docker-compose down --rmi local --remove-orphans @@ -61,15 +65,11 @@ echo "" echo "Creating volumes for persistent storage..." echo "Created $(docker volume create --name=dispatch-postgres)." -echo "" -ensure_file_from_example $DISPATCH_CONFIG_ENV -ensure_file_from_example $DISPATCH_EXTRA_REQUIREMENTS - echo "" echo "Generating secret key..." # This is to escape the secret key to be used in sed below SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') -sed -i -e 's/^SECRET_KEY=.*$/SECRET_KEY= '"'$SECRET_KEY'"'/' $DISPATCH_CONFIG_ENV +sed '/^SECRET_KEY=/{h;s/=.*/='"'$SECRET_KEY'"'/};${x;/^$/{s//SECRET_KEY='"'$SECRET_KEY'"'/;H};x}' $DISPATCH_CONFIG_ENV echo "Secret key written to $DISPATCH_CONFIG_ENV" echo "" From 60a0c3f812de355861c96c94dd0a7f640fe361a4 Mon Sep 17 00:00:00 2001 From: "Ahmed Shibani (Shumbashi)" Date: Tue, 14 Apr 2020 01:09:44 +0200 Subject: [PATCH 04/69] Fix SECRET_KEY is not added to .env (#40) * Fix SECRET_KEY is not added to .env The sed expression on line 72 fails to update the SECRET_KEY in .env file if there isn't SECRET_KEY value already present To fix the issue, SECRET_KEY should be added to .env.example. Also the sed expression should be updated to enforce adding SECRET_KEY if it's not present * Fix sed was missing -i Co-authored-by: Ahmed Shibani Co-authored-by: kevgliss --- .env.example | 1 + install.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f94308d..b401ef3 100644 --- a/.env.example +++ b/.env.example @@ -5,6 +5,7 @@ COMPOSE_PROJECT_NAME=dispatch DISPATCH_HELP_EMAIL=help@example.com DISPATCH_HELP_SLACK_CHANNEL=#general DISPATCH_UI_URL=https://example.com +SECRET_KEY=REPLACEWITHSOMETHIINGSECRET # Database DATABASE_CREDENTIALS=creds diff --git a/install.sh b/install.sh index 828f838..9e23713 100755 --- a/install.sh +++ b/install.sh @@ -69,7 +69,8 @@ echo "" echo "Generating secret key..." # This is to escape the secret key to be used in sed below SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') -sed '/^SECRET_KEY=/{h;s/=.*/='"'$SECRET_KEY'"'/};${x;/^$/{s//SECRET_KEY='"'$SECRET_KEY'"'/;H};x}' $DISPATCH_CONFIG_ENV +sed -i '/^SECRET_KEY=/{h;s/=.*/='"'$SECRET_KEY'"'/};${x;/^$/{s//SECRET_KEY='"'$SECRET_KEY'"'/;H};x}' $DISPATCH_CONFIG_ENV + echo "Secret key written to $DISPATCH_CONFIG_ENV" echo "" From e9e73c10c4a8702e88e8874de3c907ff676368bb Mon Sep 17 00:00:00 2001 From: "Ahmed Shibani (Shumbashi)" Date: Tue, 14 Apr 2020 01:10:37 +0200 Subject: [PATCH 05/69] Default .env file does not include required config (#41) The default .env file in the repository does not include all the configuration parameters required for a successful installation such as DISPATCH_UI_URL. Therefore .env file should be removed and rely on providing sane defaults in .env.example and reply on 'ensure_file_from_example' to take care of creating proper .env file Co-authored-by: Ahmed Shibani --- .env | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 1788051..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -COMPOSE_PROJECT_NAME=dispatch From 579f4c1af064bd924a29ff59294742e81091a21b Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 21 Apr 2020 14:51:58 -0700 Subject: [PATCH 06/69] Master is now stable enough that should be the default for docker (#45) --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d5f097c..2c747b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#develop:. + context: https://github.com/Netflix/dispatch.git#master:. image: dispatch-local-web depends_on: - postgres @@ -32,7 +32,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#develop:. + context: https://github.com/Netflix/dispatch.git#master:. args: DISPATCH_LIGHT_BUILD: "1" image: dispatch-local-scheduler From 1493eea62f216fd3872960f7e2b44d872f426226 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Apr 2020 15:10:13 -0700 Subject: [PATCH 07/69] Disabling authentication by default --- .env.example | 13 ++++--------- README.md | 4 ++++ install.sh | 2 -- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.env.example b/.env.example index b401ef3..c162f04 100644 --- a/.env.example +++ b/.env.example @@ -5,24 +5,19 @@ COMPOSE_PROJECT_NAME=dispatch DISPATCH_HELP_EMAIL=help@example.com DISPATCH_HELP_SLACK_CHANNEL=#general DISPATCH_UI_URL=https://example.com -SECRET_KEY=REPLACEWITHSOMETHIINGSECRET +DISPATCH_AUTHENTICATION_PROVIDER_SLUG= # Database -DATABASE_CREDENTIALS=creds +DATABASE_CREDENTIALS=dispatch:dispatch DATABASE_HOSTNAME=postgres DATABASE_NAME=dispatch DATABASE_PORT=5432 + +# Used by postgres docker POSTGRES_DB=dispatch POSTGRES_PASSWORD=dispatch POSTGRES_USER=dispatch -# Authentication -DISPATCH_AUTHENTICATION_PROVIDER_PKCE_JWKS="" - -# Frontend -VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_PKCE_OPEN_ID_CONNECT_URL="" -VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_PKCE_CLIENT_ID="" - # Cost ANNUAL_COST_EMPLOYEE=50000 BUSINESS_HOURS_YEAR=2080 diff --git a/README.md b/README.md index 54c9e60..4c87fc6 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ To get started with all the defaults, simply clone the repo and run `./install.s There may need to be modifications to the included example config files (`.env`) to accommodate your needs or your environment (such as adding Google credentials). If you want to perform these, do them before you run the install script and copy them without the `.example` extensions in the name before running the `install.sh` script. +## Data + +By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/develop/data/dispatch-sample-data.dump) to load example data. + ## Securing Dispatch with SSL/TLS If you'd like to protect your Dispatch install with SSL/TLS, there are diff --git a/install.sh b/install.sh index 9e23713..8682b1c 100755 --- a/install.sh +++ b/install.sh @@ -109,10 +109,8 @@ fi echo "" echo "Setting up database..." if [ $CI ]; then - docker-compose run web --help docker-compose run web database upgrade --no-input else - docker-compose run web --help docker-compose run web database upgrade fi From 9971ff06dd6ab692e6532fdefacef31ec382196f Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Apr 2020 15:17:20 -0700 Subject: [PATCH 08/69] Adding some example env pointers --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index c162f04..b29ad38 100644 --- a/.env.example +++ b/.env.example @@ -8,6 +8,7 @@ DISPATCH_UI_URL=https://example.com DISPATCH_AUTHENTICATION_PROVIDER_SLUG= # Database +# NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD DATABASE_CREDENTIALS=dispatch:dispatch DATABASE_HOSTNAME=postgres DATABASE_NAME=dispatch From ca07e8f75a5eb6af3016f04cbb3dff65d32e1c1f Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Tue, 28 Apr 2020 12:08:29 -0700 Subject: [PATCH 09/69] Copies env example file without using sed (#47) --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 8682b1c..3c49db8 100755 --- a/install.sh +++ b/install.sh @@ -29,13 +29,12 @@ RAM_AVAILABLE_IN_DOCKER=$(docker run --rm busybox free -m 2>/dev/null | awk '/Me # Compare dot-separated strings - function below is inspired by https://stackoverflow.com/a/37939589/808368 function ver () { echo "$@" | awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'; } -# Thanks to https://stackoverflow.com/a/25123013/90297 for the quick `sed` pattern function ensure_file_from_example { if [ -f "$1" ]; then echo "$1 already exists, skipped creation." else echo "Creating $1..." - cp -n $(echo "$1" | sed 's/\.[^.]*$/&.example/') "$1" + cp -n $(echo "$1".example) "$1" fi } From 68fbbb5ea3fb77ffb48775dac78ce124a6716248 Mon Sep 17 00:00:00 2001 From: Marc Vilanova Date: Thu, 30 Apr 2020 10:29:00 -0700 Subject: [PATCH 10/69] Fixes adding SECRET_KEY to .env file --- .env.example | 1 + install.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index b29ad38..248a071 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ DISPATCH_HELP_EMAIL=help@example.com DISPATCH_HELP_SLACK_CHANNEL=#general DISPATCH_UI_URL=https://example.com DISPATCH_AUTHENTICATION_PROVIDER_SLUG= +SECRET_KEY=REPLACEWITHSOMETHIINGSECRET # Database # NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD diff --git a/install.sh b/install.sh index 3c49db8..f0f5bfa 100755 --- a/install.sh +++ b/install.sh @@ -68,7 +68,7 @@ echo "" echo "Generating secret key..." # This is to escape the secret key to be used in sed below SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') -sed -i '/^SECRET_KEY=/{h;s/=.*/='"'$SECRET_KEY'"'/};${x;/^$/{s//SECRET_KEY='"'$SECRET_KEY'"'/;H};x}' $DISPATCH_CONFIG_ENV +sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"$SECRET_KEY\"/" $DISPATCH_CONFIG_ENV echo "Secret key written to $DISPATCH_CONFIG_ENV" From 57716b71d0aada2bef1ca529e496055b9268ffd5 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 30 Apr 2020 14:03:41 -0700 Subject: [PATCH 11/69] Removes empty example env file (#48) --- docker/.env.example | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docker/.env.example diff --git a/docker/.env.example b/docker/.env.example deleted file mode 100644 index e69de29..0000000 From d39ee3b35e0e60e4b7351bb01b6d4e6693d6dd92 Mon Sep 17 00:00:00 2001 From: Marc Vilanova Date: Thu, 7 May 2020 10:20:13 -0700 Subject: [PATCH 12/69] Adjusts sed command based on OS type --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f0f5bfa..bf10a1f 100755 --- a/install.sh +++ b/install.sh @@ -68,7 +68,12 @@ echo "" echo "Generating secret key..." # This is to escape the secret key to be used in sed below SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') -sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"$SECRET_KEY\"/" $DISPATCH_CONFIG_ENV +# We check the OS type and adjust the sed command accordingly +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV +else + sed -i "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV +fi echo "Secret key written to $DISPATCH_CONFIG_ENV" From b602994f33dbd0f5bb47d4cc8a31ec8988c4b1e8 Mon Sep 17 00:00:00 2001 From: DBX12 Date: Thu, 7 May 2020 17:27:42 +0000 Subject: [PATCH 13/69] Rename requirements.example.txt to requirements.txt.example (#51) The file must end in .example to be correctly recognized by the copy command in install.sh:37 --- requirements.example.txt | 1 - requirements.txt.example | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 requirements.example.txt create mode 100644 requirements.txt.example diff --git a/requirements.example.txt b/requirements.example.txt deleted file mode 100644 index 18c92b4..0000000 --- a/requirements.example.txt +++ /dev/null @@ -1 +0,0 @@ -# plugins here \ No newline at end of file diff --git a/requirements.txt.example b/requirements.txt.example new file mode 100644 index 0000000..a036261 --- /dev/null +++ b/requirements.txt.example @@ -0,0 +1 @@ +# plugins here From 84220800b75722afafc5332dd33e223074f013ef Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 20 May 2020 14:14:07 -0700 Subject: [PATCH 14/69] Making scheduler assets optional (#54) --- .gitignore | 4 +++- docker-compose.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e640210..8ce59eb 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,6 @@ docker-compose.override.yml *.tar data/ -.vscode/tags \ No newline at end of file +.vscode/tags + +.env \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 2c747b5..2789d6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,6 +40,8 @@ services: - postgres env_file: - .env + environment: + - STATIC_DIR= command: ["scheduler", "start"] volumes: dispatch-postgres: From 3a17be35b4bbf785f2d35cd68c5cec626eb57c12 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Thu, 28 May 2020 13:01:59 -0700 Subject: [PATCH 15/69] Adds report param --- .env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env.example b/.env.example index 248a071..a12cc0f 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,8 @@ INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="" INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID" INCIDENT_FAQ_DOCUMENT_ID="" INCIDENT_FAQ_DOCUMENT_ID="INCIDENT_FAQ_DOCUMENT_ID" +INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID="INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID" + INCIDENT_NOTIFICATION_CONVERSATIONS="" INCIDENT_NOTIFICATION_CONVERSATIONS="" INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" From c5c171ee037beb9df52d78eb301b98a708b2f521 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Mon, 1 Jun 2020 14:00:35 -0700 Subject: [PATCH 16/69] Removes quotes and adds missing envvars (#57) --- .env.example | 83 ++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/.env.example b/.env.example index a12cc0f..8403f3e 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ COMPOSE_PROJECT_NAME=dispatch DISPATCH_HELP_EMAIL=help@example.com DISPATCH_HELP_SLACK_CHANNEL=#general DISPATCH_UI_URL=https://example.com -DISPATCH_AUTHENTICATION_PROVIDER_SLUG= +DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic SECRET_KEY=REPLACEWITHSOMETHIINGSECRET # Database @@ -25,49 +25,42 @@ ANNUAL_COST_EMPLOYEE=50000 BUSINESS_HOURS_YEAR=2080 # Incident configuration -INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID="INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID" +INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID=INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID INCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID=None -INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="" -INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID="INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID" -INCIDENT_FAQ_DOCUMENT_ID="" -INCIDENT_FAQ_DOCUMENT_ID="INCIDENT_FAQ_DOCUMENT_ID" -INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID="INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID" - -INCIDENT_NOTIFICATION_CONVERSATIONS="" -INCIDENT_NOTIFICATION_CONVERSATIONS="" -INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" -INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS="" -INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT="google-docs-conversation-commands-reference-document" -INCIDENT_RESOURCE_FAQ_DOCUMENT="google-docs-faq-document" -INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT="google-docs-incident-review-document" -INCIDENT_RESOURCE_INCIDENT_TASK="google-docs-incident-task" -INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT="google-docs-investigation-document" -INCIDENT_RESOURCE_INVESTIGATION_SHEET="google-docs-investigation-sheet" -INCIDENT_RESOURCE_NOTIFICATIONS_GROUP="google-group-participant-notifications-group" -INCIDENT_RESOURCE_TACTICAL_GROUP="google-group-participant-tactical-group" -INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID="" +INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID=INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID +INCIDENT_FAQ_DOCUMENT_ID=INCIDENT_FAQ_DOCUMENT_ID +INCIDENT_NOTIFICATION_CONVERSATIONS=incidents +INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS=incidents@example.com +INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT=google-docs-conversation-commands-reference-document +INCIDENT_RESOURCE_FAQ_DOCUMENT=google-docs-faq-document +INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT=google-docs-incident-review-document +INCIDENT_RESOURCE_INCIDENT_TASK=google-docs-incident-task +INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT=google-docs-investigation-document +INCIDENT_RESOURCE_INVESTIGATION_SHEET=google-docs-investigation-sheet +INCIDENT_RESOURCE_NOTIFICATIONS_GROUP=google-group-participant-notifications-group +INCIDENT_RESOURCE_TACTICAL_GROUP=google-group-participant-tactical-group INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID=INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID -INCIDENT_STORAGE_DRIVE_ID_SLUG="" -INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID="" +INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID=INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID +INCIDENT_STORAGE_RESTRICTED=False # Plugin configuration -INCIDENT_PLUGIN_CONTACT_SLUG="slack-contact" -INCIDENT_PLUGIN_CONVERSATION_SLUG="slack-conversation" -INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG="dispatch-document-resolver" -INCIDENT_PLUGIN_DOCUMENT_SLUG="google-docs-document" -INCIDENT_PLUGIN_EMAIL_SLUG="google-gmail-conversation" -INCIDENT_PLUGIN_GROUP_SLUG="group-participant-group" -INCIDENT_PLUGIN_PARTICIPANT_SLUG="dispatch-participants" -INCIDENT_PLUGIN_STORAGE_SLUG="google-drive-storage" -INCIDENT_PLUGIN_TASK_SLUG="google-drive-task" -INCIDENT_PLUGIN_TICKET_SLUG="jira-ticket" +INCIDENT_PLUGIN_CONTACT_SLUG=slack-contact +INCIDENT_PLUGIN_CONVERSATION_SLUG=slack-conversation +INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG=dispatch-document-resolver +INCIDENT_PLUGIN_DOCUMENT_SLUG=google-docs-document +INCIDENT_PLUGIN_EMAIL_SLUG=google-gmail-conversation +INCIDENT_PLUGIN_GROUP_SLUG=group-participant-group +INCIDENT_PLUGIN_PARTICIPANT_SLUG=dispatch-participants +INCIDENT_PLUGIN_STORAGE_SLUG=google-drive-storage +INCIDENT_PLUGIN_TASK_SLUG=google-drive-task +INCIDENT_PLUGIN_TICKET_SLUG=jira-ticket # Slack -SLACK_APP_USER_SLUG="" -SLACK_API_BOT_TOKEN="" -SLACK_SIGNING_SECRET="" -SLACK_WORKSPACE_NAME="" +SLACK_APP_USER_SLUG= +SLACK_API_BOT_TOKEN= +SLACK_SIGNING_SECRET= +SLACK_WORKSPACE_NAME= # Google GOOGLE_DEVELOPER_KEY=key @@ -80,13 +73,13 @@ GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY_ID=id GOOGLE_SERVICE_ACCOUNT_PROJECT_ID=id # Jira -JIRA_BROWSER_URL="" -JIRA_API_URL="" -JIRA_PROJECT_KEY="" -JIRA_ISSUE_TYPE_ID="" -JIRA_USERNAME="" -JIRA_PASSWORD="" +JIRA_API_URL= +JIRA_BROWSER_URL= +JIRA_PROJECT_KEY= +JIRA_ISSUE_TYPE_ID= +JIRA_USERNAME= +JIRA_PASSWORD= # PagerDuty -PAGERDUTY_API_KEY="" -PAGERDUTY_API_FROM_EMAIL="" +PAGERDUTY_API_KEY= +PAGERDUTY_API_FROM_EMAIL= From aba69575fa8a722097ca08ce7af00fb62c28dd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Acosta=20Ramas?= Date: Fri, 12 Jun 2020 13:10:58 -0700 Subject: [PATCH 17/69] Fixing port mapping on docker-compose.yaml (#59) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2789d6e..47ffaa5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: - .env command: ["server", "start", "dispatch.main:app", "--host=0.0.0.0"] ports: - - "80:8000" + - "8000:8000" scheduler: <<: *restart_policy build: From 4ea3793d073b5c2e0bb136f76eec9e8e5e95bfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Acosta=20Ramas?= Date: Fri, 12 Jun 2020 15:41:17 -0700 Subject: [PATCH 18/69] Explaining that you need at least one user. (#61) * Explaining that you need at least one user. * Update README.md Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4c87fc6..38e1ecc 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,14 @@ To get started with all the defaults, simply clone the repo and run `./install.s There may need to be modifications to the included example config files (`.env`) to accommodate your needs or your environment (such as adding Google credentials). If you want to perform these, do them before you run the install script and copy them without the `.example` extensions in the name before running the `install.sh` script. + ## Data By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/develop/data/dispatch-sample-data.dump) to load example data. +### Starting with a clean database +If you decide to start with a clean database, you will need a user. To create a user, go to http://localhost:8000/register. + ## Securing Dispatch with SSL/TLS If you'd like to protect your Dispatch install with SSL/TLS, there are From 1165543de6336da60b4ebe910532df85ccbff889 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Fri, 24 Jul 2020 14:55:54 -0700 Subject: [PATCH 19/69] Bumps postgres version to latest stable (#65) --- docker-compose.yml | 2 +- install.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 47ffaa5..38fca12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: <<: *restart_policy env_file: - .env - image: "postgres:9.6" + image: postgres ports: - "5432:5432" volumes: diff --git a/install.sh b/install.sh index bf10a1f..612196c 100755 --- a/install.sh +++ b/install.sh @@ -92,17 +92,17 @@ docker-compose up -d postgres # Very naively check whether there's an existing dispatch-postgres volume and the PG version in it if [[ $(docker volume ls -q --filter name=dispatch-postgres) && $(docker run --rm -v dispatch-postgres:/db busybox cat /db/PG_VERSION 2>/dev/null) == "9.5" ]]; then docker volume rm dispatch-postgres-new || true - # If this is Postgres 9.5 data, start upgrading it to 9.6 in a new volume + # If this is Postgres 9.5 data, start upgrading it to 12 in a new volume docker run --rm \ -v dispatch-postgres:/var/lib/postgresql/9.5/data \ - -v dispatch-postgres-new:/var/lib/postgresql/9.6/data \ - tianon/postgres-upgrade:9.5-to-9.6 + -v dispatch-postgres-new:/var/lib/postgresql/12/data \ + tianon/postgres-upgrade:9.5-to-12 # Get rid of the old volume as we'll rename the new one to that docker volume rm dispatch-postgres docker volume create --name dispatch-postgres # There's no rename volume in Docker so copy the contents from old to new name - # Also append the `host all all all trust` line as `tianon/postgres-upgrade:9.5-to-9.6` + # Also append the `host all all all trust` line as `tianon/postgres-upgrade:9.5-to-12` # doesn't do that automatically. docker run --rm -v dispatch-postgres-new:/from -v dispatch-postgres:/to alpine ash -c \ "cd /from ; cp -av . /to ; echo 'host all all all trust' >> /to/pg_hba.conf" From d3242535614e6ac0d5d19adce264b883f1f59cd3 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Jul 2020 09:52:14 -0700 Subject: [PATCH 20/69] Installing plugins seperately. (#64) --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index 612196c..d73a28c 100755 --- a/install.sh +++ b/install.sh @@ -118,6 +118,11 @@ else docker-compose run web database upgrade fi +echo "" +echo "Installing plugins..." + docker-compose run web plugins install +fi + cleanup echo "" From cac76edac721aad794b3db573777a41e630f8b6c Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Jul 2020 10:05:10 -0700 Subject: [PATCH 21/69] Updating example env --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 8403f3e..a785d6e 100644 --- a/.env.example +++ b/.env.example @@ -39,7 +39,7 @@ INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT=google-docs-investigation-document INCIDENT_RESOURCE_INVESTIGATION_SHEET=google-docs-investigation-sheet INCIDENT_RESOURCE_NOTIFICATIONS_GROUP=google-group-participant-notifications-group INCIDENT_RESOURCE_TACTICAL_GROUP=google-group-participant-tactical-group -INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID=INCIDENT_STORAGE_ARCHIVAL_FOLDER_ID +INCIDENT_STORAGE_FOLDER_ID=INCIDENT_STORAGE_FOLDER_ID INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID=INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID INCIDENT_STORAGE_RESTRICTED=False From da87be550d90861e736de6ae5a56eecb173eaf16 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Jul 2020 10:34:02 -0700 Subject: [PATCH 22/69] Removing deprecated envvar --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index a785d6e..0d429ff 100644 --- a/.env.example +++ b/.env.example @@ -26,7 +26,7 @@ BUSINESS_HOURS_YEAR=2080 # Incident configuration INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID=INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID -INCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID=None +INCIDENT_ONCALL_SERVICE_ID=None INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID=INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID INCIDENT_FAQ_DOCUMENT_ID=INCIDENT_FAQ_DOCUMENT_ID INCIDENT_NOTIFICATION_CONVERSATIONS=incidents From f0736ff22c06224fbf2d508ee45c47de94e273b6 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 27 Jul 2020 13:10:38 -0700 Subject: [PATCH 23/69] Adding database upgrade instructions --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index 38e1ecc..aff8f2b 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,57 @@ and [Nginx](http://nginx.org/). You'll likely want to add this service to your ` ## Updating Dispatch The included `install.sh` script is meant to be idempotent and to bring you to the latest version. What this means is you can and should run `install.sh` to upgrade to the latest version available. + +### Upgrading from an older version of postgres +If you are using an earlier version of `postgres` you may need +to run manual steps to upgrade to the newest Postgres image. + +This assumes that you have not changed the default Postgres data path +(`/var/lib/postgresql/data`) in your `docker-compose.yml`. +If you have changed it, please replace all occurences of `/var/lib/postgresql/data` +with your path. + +1. Make a backup of your Dispatch Postgres data dir. +2. Stop all Dispatch containers, except the postgres one (e.g. use `docker stop` and not `docker-compose stop`). +3. Create a new Postgres container which uses a different data directory: +``` +docker run -d \ + --name postgresnew \ + -e POSTGRES_DB=dispatch \ + -e POSTGRES_USER=dispatch \ + -e POSTGRES_PASSWORD=dispatch \ + -v /var/lib/postgresql/new:/var/lib/postgresql/data:rw \ + postgres:latest +``` +4. Use `pg_dumpall` to dump all data from the existing Postgres container to +the new Postgres container (replace `DISPATCH_DATABASE_CONTAINER_NAME` (default is `postgres`) with the +name of the old Postgres container): +``` +docker exec \ + DISPATCH_DATABASE_CONTAINER_NAME pg_dumpall -U postgres | \ + docker exec -i postgresnew psql -U postgres +``` +5. Stop and remove both Postgres containers: +``` +docker stop DISPATCH_DATABASE_CONTAINER_NAME postgresnew +docker rm DISPATCH_DATABASE_CONTAINER_NAME postgresnew +``` +6. Edit your `docker-compose.yml` to use the `postgres:latest` +image for the `database` container. +7. Replace old Postgres data directory with upgraded data directory: +``` +mv /var/lib/postgresql/data /var/lib/postgresql/old +mv /var/lib/postgresql/new /var/lib/postgresql/data +``` +8. Delete the old existing containers: +``` +docker-compose rm +``` +9. Start Dispatch up again: +``` +docker-compose up +``` + +That should be it. Your Postgres data has now been updated to use the +`postgres` image. + From 36ece3dba7c2f126834821a0ad84fc10276569d9 Mon Sep 17 00:00:00 2001 From: Deepak Kosaraju Date: Thu, 30 Jul 2020 17:21:52 -0700 Subject: [PATCH 24/69] Update install.sh (#66) Removed unnecessary `fi`, ```bash Installing plugin... Slug: jira-ticket Version: 0.1.0 Installing plugin... Slug: pagerduty-oncall Version: 0.1.0 Installing plugin... Slug: slack-contact Version: 0.1.0 Installing plugin... Slug: slack-conversation Version: 0.1.0 ./install.sh: line 124: syntax error near unexpected token `fi' ``` --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index d73a28c..54d3e33 100755 --- a/install.sh +++ b/install.sh @@ -120,8 +120,7 @@ fi echo "" echo "Installing plugins..." - docker-compose run web plugins install -fi +docker-compose run web plugins install cleanup From 5ad5117a9fcc362096f3427488f121b4ec907057 Mon Sep 17 00:00:00 2001 From: Lee Spottiswood Date: Fri, 18 Sep 2020 17:33:16 +0100 Subject: [PATCH 25/69] Populate missing DISPATCH_JWT_SECRET env var via install script (#70) * populate DISPATCH_JWT_SECRET via install script * Update .env.example --- .env.example | 1 + install.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 0d429ff..7f8fb86 100644 --- a/.env.example +++ b/.env.example @@ -7,6 +7,7 @@ DISPATCH_HELP_SLACK_CHANNEL=#general DISPATCH_UI_URL=https://example.com DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic SECRET_KEY=REPLACEWITHSOMETHIINGSECRET +DISPATCH_JWT_SECRET=REPLACEWITHSOMETHIINGSECRET # Database # NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD diff --git a/install.sh b/install.sh index 54d3e33..224cfbf 100755 --- a/install.sh +++ b/install.sh @@ -65,17 +65,20 @@ echo "Creating volumes for persistent storage..." echo "Created $(docker volume create --name=dispatch-postgres)." echo "" -echo "Generating secret key..." +echo "Generating secret keys..." # This is to escape the secret key to be used in sed below SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') +DISPATCH_JWT_SECRET=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') # We check the OS type and adjust the sed command accordingly if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV + sed -i '' "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=\"${DISPATCH_JWT_SECRET}\"/" $DISPATCH_CONFIG_ENV else sed -i "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV + sed -i "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=\"${DISPATCH_JWT_SECRET}\"/" $DISPATCH_CONFIG_ENV fi -echo "Secret key written to $DISPATCH_CONFIG_ENV" +echo "Secret keys written to $DISPATCH_CONFIG_ENV" echo "" echo "Building and tagging Docker images..." From 3684fd93f268946f36537cda95f6a33c07828401 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Sep 2020 12:45:45 -0700 Subject: [PATCH 26/69] Adds the ability to automatically load example data. (#71) --- docker-compose.yml | 4 ++-- install.sh | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38fca12..bdc7a3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#master:. + context: https://github.com/Netflix/dispatch.git#v20200922.1 image: dispatch-local-web depends_on: - postgres @@ -32,7 +32,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#master:. + context: https://github.com/Netflix/dispatch.git#v20200922.1 args: DISPATCH_LIGHT_BUILD: "1" image: dispatch-local-scheduler diff --git a/install.sh b/install.sh index 224cfbf..17ecf35 100755 --- a/install.sh +++ b/install.sh @@ -118,7 +118,16 @@ echo "Setting up database..." if [ $CI ]; then docker-compose run web database upgrade --no-input else - docker-compose run web database upgrade + read -p "Do you want to load example data (y/n)?" CONT + if [ "$CONT" = "y" ]; then + wget https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump + export PGPASSWORD='dispatch' + createdb -h localhost -p 5432 -U dispatch dispatch + psql -h localhost -p 5432 -U dispatch -d dispatch -v ./dispatch-sample-data.dump + echo "Example data loaded. Navigate to /register and create a new user." + else + docker-compose run web database upgrade + fi fi echo "" From 07e5f665f8ed2c236a92ade23045862db8f5f52a Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 5 Oct 2020 09:28:56 -0700 Subject: [PATCH 27/69] Update to latest release (#72) --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bdc7a3b..d662537 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20200922.1 + context: https://github.com/Netflix/dispatch.git#v20201001 image: dispatch-local-web depends_on: - postgres @@ -32,7 +32,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20200922.1 + context: https://github.com/Netflix/dispatch.git#v20201001 args: DISPATCH_LIGHT_BUILD: "1" image: dispatch-local-scheduler From f3b78906d982cfeb51edf8cfa8c177df49dede56 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 5 Oct 2020 09:29:07 -0700 Subject: [PATCH 28/69] Fixes issues with illegal/problematic chars (#73) --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 17ecf35..ed5d5f6 100755 --- a/install.sh +++ b/install.sh @@ -67,8 +67,8 @@ echo "Created $(docker volume create --name=dispatch-postgres)." echo "" echo "Generating secret keys..." # This is to escape the secret key to be used in sed below -SECRET_KEY=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') -DISPATCH_JWT_SECRET=$(head /dev/urandom | env LC_CTYPE=C tr -dc "a-z0-9@#%^&*(-_=+)" | head -c 50 | sed -e 's/[\/&]/\\&/g') +SECRET_KEY=$(openssl rand --hex 30) +DISPATCH_JWT_SECRET=$(openssl rand --hex 30) # We check the OS type and adjust the sed command accordingly if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV From de904893dca2a067a2b941ce471cd467ae50b657 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 6 Oct 2020 09:54:30 -0700 Subject: [PATCH 29/69] Reducing the build times and cleaning up runtime containers (#74) --- .env.example | 19 ------------------- docker-compose.yml | 24 ++++++++++++------------ install.sh | 20 +++++++++++++------- 3 files changed, 25 insertions(+), 38 deletions(-) diff --git a/.env.example b/.env.example index 7f8fb86..8511133 100644 --- a/.env.example +++ b/.env.example @@ -2,10 +2,6 @@ # General COMPOSE_PROJECT_NAME=dispatch -DISPATCH_HELP_EMAIL=help@example.com -DISPATCH_HELP_SLACK_CHANNEL=#general -DISPATCH_UI_URL=https://example.com -DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic SECRET_KEY=REPLACEWITHSOMETHIINGSECRET DISPATCH_JWT_SECRET=REPLACEWITHSOMETHIINGSECRET @@ -41,21 +37,6 @@ INCIDENT_RESOURCE_INVESTIGATION_SHEET=google-docs-investigation-sheet INCIDENT_RESOURCE_NOTIFICATIONS_GROUP=google-group-participant-notifications-group INCIDENT_RESOURCE_TACTICAL_GROUP=google-group-participant-tactical-group INCIDENT_STORAGE_FOLDER_ID=INCIDENT_STORAGE_FOLDER_ID -INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID=INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID -INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID -INCIDENT_STORAGE_RESTRICTED=False - -# Plugin configuration -INCIDENT_PLUGIN_CONTACT_SLUG=slack-contact -INCIDENT_PLUGIN_CONVERSATION_SLUG=slack-conversation -INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG=dispatch-document-resolver -INCIDENT_PLUGIN_DOCUMENT_SLUG=google-docs-document -INCIDENT_PLUGIN_EMAIL_SLUG=google-gmail-conversation -INCIDENT_PLUGIN_GROUP_SLUG=group-participant-group -INCIDENT_PLUGIN_PARTICIPANT_SLUG=dispatch-participants -INCIDENT_PLUGIN_STORAGE_SLUG=google-drive-storage -INCIDENT_PLUGIN_TASK_SLUG=google-drive-task -INCIDENT_PLUGIN_TICKET_SLUG=jira-ticket # Slack SLACK_APP_USER_SLUG= diff --git a/docker-compose.yml b/docker-compose.yml index d662537..e20ff2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,16 +11,22 @@ services: - "5432:5432" volumes: - "dispatch-postgres:/var/lib/postgresql/data" - web: - <<: *restart_policy + core: + image: dispatch-local + env_file: + - .env build: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201001 - image: dispatch-local-web + #context: https://github.com/Netflix/dispatch.git#v20201001 + context: ../dispatch + web: + <<: *restart_policy + image: dispatch-local depends_on: - postgres + - core env_file: - .env command: ["server", "start", "dispatch.main:app", "--host=0.0.0.0"] @@ -28,16 +34,10 @@ services: - "8000:8000" scheduler: <<: *restart_policy - build: - # Pro-tip: point this to a relative directory containing the Dispatch - # project root to pick up changes from your dev environment - # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201001 - args: - DISPATCH_LIGHT_BUILD: "1" - image: dispatch-local-scheduler + image: dispatch-local depends_on: - postgres + - core env_file: - .env environment: diff --git a/install.sh b/install.sh index ed5d5f6..64d5f69 100755 --- a/install.sh +++ b/install.sh @@ -71,11 +71,11 @@ SECRET_KEY=$(openssl rand --hex 30) DISPATCH_JWT_SECRET=$(openssl rand --hex 30) # We check the OS type and adjust the sed command accordingly if [[ "$OSTYPE" == "darwin"* ]]; then - sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV - sed -i '' "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=\"${DISPATCH_JWT_SECRET}\"/" $DISPATCH_CONFIG_ENV + sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=${SECRET_KEY}/" $DISPATCH_CONFIG_ENV + sed -i '' "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=${DISPATCH_JWT_SECRET}/" $DISPATCH_CONFIG_ENV else - sed -i "s/^SECRET_KEY=.*/SECRET_KEY=\"${SECRET_KEY}\"/" $DISPATCH_CONFIG_ENV - sed -i "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=\"${DISPATCH_JWT_SECRET}\"/" $DISPATCH_CONFIG_ENV + sed -i "s/^SECRET_KEY=.*/SECRET_KEY=${SECRET_KEY}/" $DISPATCH_CONFIG_ENV + sed -i "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=${DISPATCH_JWT_SECRET}/" $DISPATCH_CONFIG_ENV fi echo "Secret keys written to $DISPATCH_CONFIG_ENV" @@ -118,7 +118,7 @@ echo "Setting up database..." if [ $CI ]; then docker-compose run web database upgrade --no-input else - read -p "Do you want to load example data (y/n)?" CONT + read -p "Do you want to load example data (y/N)?" CONT if [ "$CONT" = "y" ]; then wget https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump export PGPASSWORD='dispatch' @@ -126,13 +126,14 @@ else psql -h localhost -p 5432 -U dispatch -d dispatch -v ./dispatch-sample-data.dump echo "Example data loaded. Navigate to /register and create a new user." else - docker-compose run web database upgrade + echo "Running standard database migrations..." + docker-compose run --rm web database upgrade fi fi echo "" echo "Installing plugins..." -docker-compose run web plugins install +docker-compose run --rm web plugins install cleanup @@ -142,3 +143,8 @@ echo "You're all done! Run the following command to get Dispatch running:" echo "" echo " docker-compose up -d" echo "" +echo "Once running, access the Dispatch UI at:" +echo "" +echo " http://localhost:8000/register" +echo "----------------" +echo "" From 08bcb0d73d473160b1b4a2c86accf6ebc11fefaf Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 6 Oct 2020 10:42:18 -0700 Subject: [PATCH 30/69] Fixing context (#75) --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e20ff2b..df042ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,8 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - #context: https://github.com/Netflix/dispatch.git#v20201001 - context: ../dispatch + context: https://github.com/Netflix/dispatch.git#v20201001 web: <<: *restart_policy image: dispatch-local From 8093e2ce12ab1413363a8d2970cea9490ed05a03 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:38:27 -0700 Subject: [PATCH 31/69] Removes hyphen from openssl hex option to unbreak installs in macOS (#77) --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 64d5f69..716abd5 100755 --- a/install.sh +++ b/install.sh @@ -67,8 +67,8 @@ echo "Created $(docker volume create --name=dispatch-postgres)." echo "" echo "Generating secret keys..." # This is to escape the secret key to be used in sed below -SECRET_KEY=$(openssl rand --hex 30) -DISPATCH_JWT_SECRET=$(openssl rand --hex 30) +SECRET_KEY=$(openssl rand -hex 30) +DISPATCH_JWT_SECRET=$(openssl rand -hex 30) # We check the OS type and adjust the sed command accordingly if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=${SECRET_KEY}/" $DISPATCH_CONFIG_ENV From 5e12fa67b644b35cddcaf26fb11d1c4f9eb85ba7 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 8 Oct 2020 10:38:55 -0700 Subject: [PATCH 32/69] Let's only pull the postgres image (#78) --- install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 716abd5..d430b4b 100755 --- a/install.sh +++ b/install.sh @@ -81,14 +81,12 @@ fi echo "Secret keys written to $DISPATCH_CONFIG_ENV" echo "" -echo "Building and tagging Docker images..." +echo "Pulling, building, and tagging Docker images..." echo "" -# Build the dispatch image first -# Once successfully built these lines can be commented out -docker-compose pull --ignore-pull-failures +docker-compose pull postgres docker-compose build --force-rm echo "" -echo "Docker images built." +echo "Docker images pulled and built." docker-compose up -d postgres From 6f19ef41193a051ea66c6a7409460d172bd47711 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 19 Oct 2020 12:56:47 -0700 Subject: [PATCH 33/69] Bump to latest --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index df042ec..1221f98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201001 + context: https://github.com/Netflix/dispatch.git#v20201013 web: <<: *restart_policy image: dispatch-local From 0d117961d8409679d0f050fc3c200355fda06ba1 Mon Sep 17 00:00:00 2001 From: David Talbot Date: Fri, 23 Oct 2020 13:54:41 -0500 Subject: [PATCH 34/69] use curl instead of wget (#80) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index d430b4b..177e694 100755 --- a/install.sh +++ b/install.sh @@ -118,7 +118,7 @@ if [ $CI ]; then else read -p "Do you want to load example data (y/N)?" CONT if [ "$CONT" = "y" ]; then - wget https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump + curl -O https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump export PGPASSWORD='dispatch' createdb -h localhost -p 5432 -U dispatch dispatch psql -h localhost -p 5432 -U dispatch -d dispatch -v ./dispatch-sample-data.dump From baf75f02c77307a73c6151db3d7d0d9f63da321b Mon Sep 17 00:00:00 2001 From: David Talbot Date: Fri, 23 Oct 2020 13:57:59 -0500 Subject: [PATCH 35/69] update psql command (#79) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 177e694..acb6fba 100755 --- a/install.sh +++ b/install.sh @@ -121,7 +121,7 @@ else curl -O https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump export PGPASSWORD='dispatch' createdb -h localhost -p 5432 -U dispatch dispatch - psql -h localhost -p 5432 -U dispatch -d dispatch -v ./dispatch-sample-data.dump + psql -h localhost -p 5432 -U dispatch -d dispatch -f ./dispatch-sample-data.dump echo "Example data loaded. Navigate to /register and create a new user." else echo "Running standard database migrations..." From 68a456dab69942d120b23776f8f4416a02a5b921 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 27 Oct 2020 11:01:07 -0700 Subject: [PATCH 36/69] Release Bump --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1221f98..6263125 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201013 + context: https://github.com/Netflix/dispatch.git#v20201027 web: <<: *restart_policy image: dispatch-local From c659e5c3a735a8d8e500ec14469c047d7bb61e6c Mon Sep 17 00:00:00 2001 From: Marc Vilanova Date: Fri, 6 Nov 2020 11:21:37 -0800 Subject: [PATCH 37/69] Release v20201106 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6263125..bf4d863 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201027 + context: https://github.com/Netflix/dispatch.git#v20201106 web: <<: *restart_policy image: dispatch-local From 76ec4cae7b2a35defcf5bba1b7d6e3f7ed0a905c Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Mon, 16 Nov 2020 15:50:10 -0800 Subject: [PATCH 38/69] Drops dispatch database if it exists before creating it (#85) --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index acb6fba..a330f98 100755 --- a/install.sh +++ b/install.sh @@ -118,9 +118,14 @@ if [ $CI ]; then else read -p "Do you want to load example data (y/N)?" CONT if [ "$CONT" = "y" ]; then + echo "Downloading example data from Dispatch repository..." curl -O https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump export PGPASSWORD='dispatch' + echo "Dropping database dispatch if it already exists..." + dropdb -h localhost -p 5432 -U dispatch dispatch --if-exists + echo "Creating dispatch database..." createdb -h localhost -p 5432 -U dispatch dispatch + echo "Loading example data to the database..." psql -h localhost -p 5432 -U dispatch -d dispatch -f ./dispatch-sample-data.dump echo "Example data loaded. Navigate to /register and create a new user." else From 5711f8147b6c229535b7efce5b7fd78645654860 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 17 Nov 2020 10:45:42 -0800 Subject: [PATCH 39/69] Drop db warning (#86) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a330f98..51a5a43 100755 --- a/install.sh +++ b/install.sh @@ -116,7 +116,7 @@ echo "Setting up database..." if [ $CI ]; then docker-compose run web database upgrade --no-input else - read -p "Do you want to load example data (y/N)?" CONT + read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then echo "Downloading example data from Dispatch repository..." curl -O https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump From 1e356812692d2e873720a429d65249a46860d687 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 18 Nov 2020 15:07:28 -0500 Subject: [PATCH 40/69] Always migrate (#88) --- install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 51a5a43..e1d77a8 100755 --- a/install.sh +++ b/install.sh @@ -128,10 +128,8 @@ else echo "Loading example data to the database..." psql -h localhost -p 5432 -U dispatch -d dispatch -f ./dispatch-sample-data.dump echo "Example data loaded. Navigate to /register and create a new user." - else - echo "Running standard database migrations..." - docker-compose run --rm web database upgrade - fi + echo "Running standard database migrations..." + docker-compose run --rm web database upgrade fi echo "" From d5e76e7017fed14e380e156c0dc595e65415829e Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 18 Nov 2020 15:09:26 -0500 Subject: [PATCH 41/69] Bugfix/always migrate (#89) * Missing fi --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index e1d77a8..dd332ef 100755 --- a/install.sh +++ b/install.sh @@ -128,6 +128,7 @@ else echo "Loading example data to the database..." psql -h localhost -p 5432 -U dispatch -d dispatch -f ./dispatch-sample-data.dump echo "Example data loaded. Navigate to /register and create a new user." + fi echo "Running standard database migrations..." docker-compose run --rm web database upgrade fi From 01a89833cf1b3d6f0653aa98e9b57694ff7c60c7 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Thu, 19 Nov 2020 13:42:14 -0500 Subject: [PATCH 42/69] Reference latest tag so we don't have to manual bump this repo with new versions (#90) --- docker-compose.yml | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bf4d863..479093f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#v20201106 + context: https://github.com/Netflix/dispatch.git#latest web: <<: *restart_policy image: dispatch-local diff --git a/install.sh b/install.sh index dd332ef..066a4d2 100755 --- a/install.sh +++ b/install.sh @@ -119,7 +119,7 @@ else read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then echo "Downloading example data from Dispatch repository..." - curl -O https://raw.githubusercontent.com/Netflix/dispatch/master/data/dispatch-sample-data.dump + curl -O https://raw.githubusercontent.com/Netflix/dispatch/latest/data/dispatch-sample-data.dump export PGPASSWORD='dispatch' echo "Dropping database dispatch if it already exists..." dropdb -h localhost -p 5432 -U dispatch dispatch --if-exists From cf623a1ec8a7c2b645820a0b9ba599e8abf5996a Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 10 Dec 2020 09:28:43 -0800 Subject: [PATCH 43/69] Updates Readme (#94) --- README.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index aff8f2b..59d4763 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Official bootstrap for running your own `Dispatch` with [Docker](https://www.doc - Docker 17.05.0+ - Compose 1.19.0+ +- [PostgreSQL Client Applications](https://www.postgresql.org/docs/current/reference-client.html). They're included with PostgreSQL, which can be downloaded from [here](https://www.postgresql.org/download/). ## Minimum Hardware Requirements: @@ -17,12 +18,12 @@ To get started with all the defaults, simply clone the repo and run `./install.s There may need to be modifications to the included example config files (`.env`) to accommodate your needs or your environment (such as adding Google credentials). If you want to perform these, do them before you run the install script and copy them without the `.example` extensions in the name before running the `install.sh` script. - ## Data -By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/develop/data/dispatch-sample-data.dump) to load example data. +By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/master/data/dispatch-sample-data.dump) to load example data. ### Starting with a clean database + If you decide to start with a clean database, you will need a user. To create a user, go to http://localhost:8000/register. ## Securing Dispatch with SSL/TLS @@ -36,13 +37,12 @@ and [Nginx](http://nginx.org/). You'll likely want to add this service to your ` The included `install.sh` script is meant to be idempotent and to bring you to the latest version. What this means is you can and should run `install.sh` to upgrade to the latest version available. ### Upgrading from an older version of postgres -If you are using an earlier version of `postgres` you may need -to run manual steps to upgrade to the newest Postgres image. -This assumes that you have not changed the default Postgres data path -(`/var/lib/postgresql/data`) in your `docker-compose.yml`. -If you have changed it, please replace all occurences of `/var/lib/postgresql/data` -with your path. +If you are using an earlier version of `postgres` you may need to run manual steps to upgrade to the newest Postgres image. + +This assumes that you have not changed the default Postgres data path (`/var/lib/postgresql/data`) in your `docker-compose.yml`. + +If you have changed it, please replace all occurences of `/var/lib/postgresql/data` with your path. 1. Make a backup of your Dispatch Postgres data dir. 2. Stop all Dispatch containers, except the postgres one (e.g. use `docker stop` and not `docker-compose stop`). @@ -56,9 +56,7 @@ docker run -d \ -v /var/lib/postgresql/new:/var/lib/postgresql/data:rw \ postgres:latest ``` -4. Use `pg_dumpall` to dump all data from the existing Postgres container to -the new Postgres container (replace `DISPATCH_DATABASE_CONTAINER_NAME` (default is `postgres`) with the -name of the old Postgres container): +4. Use `pg_dumpall` to dump all data from the existing Postgres container to the new Postgres container (replace `DISPATCH_DATABASE_CONTAINER_NAME` (default is `postgres`) with the name of the old Postgres container): ``` docker exec \ DISPATCH_DATABASE_CONTAINER_NAME pg_dumpall -U postgres | \ @@ -69,8 +67,7 @@ docker exec \ docker stop DISPATCH_DATABASE_CONTAINER_NAME postgresnew docker rm DISPATCH_DATABASE_CONTAINER_NAME postgresnew ``` -6. Edit your `docker-compose.yml` to use the `postgres:latest` -image for the `database` container. +6. Edit your `docker-compose.yml` to use the `postgres:latest` image for the `database` container. 7. Replace old Postgres data directory with upgraded data directory: ``` mv /var/lib/postgresql/data /var/lib/postgresql/old @@ -85,6 +82,4 @@ docker-compose rm docker-compose up ``` -That should be it. Your Postgres data has now been updated to use the -`postgres` image. - +That should be it. Your Postgres data has now been updated to use the `postgres` image. From dcac0dec3575ee48daa1342d87ac466b5d0819e8 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Dec 2020 04:52:37 -0800 Subject: [PATCH 44/69] Fix register url (#96) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 066a4d2..5086ca1 100755 --- a/install.sh +++ b/install.sh @@ -147,6 +147,6 @@ echo " docker-compose up -d" echo "" echo "Once running, access the Dispatch UI at:" echo "" -echo " http://localhost:8000/register" +echo " http://localhost:8000/auth/register" echo "----------------" echo "" From dc26ab245d280937c253a742c7d5d10134adb4b7 Mon Sep 17 00:00:00 2001 From: Florian Krauthan Date: Thu, 14 Jan 2021 08:46:56 -0800 Subject: [PATCH 45/69] Remove dependency to local postgres client tools (#97) * Execute postgres command within container * Removed not needed env variable * Removed note about depending on postgres client tools * Moved some often used strings to constant variables * Update install.sh Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- README.md | 1 - install.sh | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 59d4763..32a99ac 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Official bootstrap for running your own `Dispatch` with [Docker](https://www.doc - Docker 17.05.0+ - Compose 1.19.0+ -- [PostgreSQL Client Applications](https://www.postgresql.org/docs/current/reference-client.html). They're included with PostgreSQL, which can be downloaded from [here](https://www.postgresql.org/download/). ## Minimum Hardware Requirements: diff --git a/install.sh b/install.sh index 5086ca1..b7d5a46 100755 --- a/install.sh +++ b/install.sh @@ -8,6 +8,10 @@ MIN_RAM=2400 # MB DISPATCH_CONFIG_ENV='./.env' DISPATCH_EXTRA_REQUIREMENTS='./requirements.txt' +DISPATCH_DB_PASSWORD='dispatch' +DISPATCH_DB_SAMPLE_DATA_FILE='dispatch-sample-data.dump' +DISPATCH_DB_SAMPLE_DATA_URL="https://raw.githubusercontent.com/Netflix/dispatch/latest/data/${DISPATCH_DB_SAMPLE_DATA_FILE}" + DID_CLEAN_UP=0 # the cleanup function will be the exit point cleanup () { @@ -119,14 +123,13 @@ else read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then echo "Downloading example data from Dispatch repository..." - curl -O https://raw.githubusercontent.com/Netflix/dispatch/latest/data/dispatch-sample-data.dump - export PGPASSWORD='dispatch' + curl -o "./$DISPATCH_DB_SAMPLE_DATA_FILE" "$DISPATCH_DB_SAMPLE_DATA_URL" echo "Dropping database dispatch if it already exists..." - dropdb -h localhost -p 5432 -U dispatch dispatch --if-exists + docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" --rm postgres dropdb -h postgres -p 5432 -U dispatch dispatch --if-exists echo "Creating dispatch database..." - createdb -h localhost -p 5432 -U dispatch dispatch + docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" --rm postgres createdb -h postgres -p 5432 -U dispatch dispatch echo "Loading example data to the database..." - psql -h localhost -p 5432 -U dispatch -d dispatch -f ./dispatch-sample-data.dump + docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE" --rm postgres psql -h postgres -p 5432 -U dispatch -d dispatch -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" echo "Example data loaded. Navigate to /register and create a new user." fi echo "Running standard database migrations..." From 28b90d0ea78bc8c92435aacc4f52136f142e996c Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:04:11 -0800 Subject: [PATCH 46/69] Update .env.example (#100) --- .env.example | 2 -- 1 file changed, 2 deletions(-) diff --git a/.env.example b/.env.example index 8511133..92790db 100644 --- a/.env.example +++ b/.env.example @@ -26,8 +26,6 @@ INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID=INCIDENT_CONVERSATION_COMMA INCIDENT_ONCALL_SERVICE_ID=None INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID=INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID INCIDENT_FAQ_DOCUMENT_ID=INCIDENT_FAQ_DOCUMENT_ID -INCIDENT_NOTIFICATION_CONVERSATIONS=incidents -INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS=incidents@example.com INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT=google-docs-conversation-commands-reference-document INCIDENT_RESOURCE_FAQ_DOCUMENT=google-docs-faq-document INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT=google-docs-incident-review-document From d53b3237c6cee749546bb1583c4a6332006f6ee8 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Fri, 12 Feb 2021 13:19:35 -0800 Subject: [PATCH 47/69] Aligning on postgres-12 (#101) --- docker-compose.yml | 2 +- install.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 479093f..94dddc1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: <<: *restart_policy env_file: - .env - image: postgres + image: postgres:12 ports: - "5432:5432" volumes: diff --git a/install.sh b/install.sh index b7d5a46..b1cda12 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +COMPOSE_DOCKER_CLI_BUILD=0 + MIN_DOCKER_VERSION='17.05.0' MIN_COMPOSE_VERSION='1.19.0' MIN_RAM=2400 # MB From 81add637545c240c333e2b4e8aa35bb00215c445 Mon Sep 17 00:00:00 2001 From: David Lamb <58757897+klarrio-dlamb@users.noreply.github.com> Date: Thu, 11 Mar 2021 09:01:42 +1100 Subject: [PATCH 48/69] small improvements for running the install (#105) * small improvements for running the install * use pw from env file * use var for source * Update .env.example Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- .gitignore | 3 ++- install.sh | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8ce59eb..76ad4bb 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,5 @@ docker-compose.override.yml data/ .vscode/tags -.env \ No newline at end of file +.env +dispatch-sample-data.dump diff --git a/install.sh b/install.sh index b1cda12..e2cdb50 100755 --- a/install.sh +++ b/install.sh @@ -10,7 +10,6 @@ MIN_RAM=2400 # MB DISPATCH_CONFIG_ENV='./.env' DISPATCH_EXTRA_REQUIREMENTS='./requirements.txt' -DISPATCH_DB_PASSWORD='dispatch' DISPATCH_DB_SAMPLE_DATA_FILE='dispatch-sample-data.dump' DISPATCH_DB_SAMPLE_DATA_URL="https://raw.githubusercontent.com/Netflix/dispatch/latest/data/${DISPATCH_DB_SAMPLE_DATA_FILE}" @@ -124,14 +123,15 @@ if [ $CI ]; then else read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then + source $DISPATCH_CONFIG_ENV echo "Downloading example data from Dispatch repository..." curl -o "./$DISPATCH_DB_SAMPLE_DATA_FILE" "$DISPATCH_DB_SAMPLE_DATA_URL" echo "Dropping database dispatch if it already exists..." - docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" --rm postgres dropdb -h postgres -p 5432 -U dispatch dispatch --if-exists + docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" --rm postgres dropdb -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER $DATABASE_NAME --if-exists echo "Creating dispatch database..." - docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" --rm postgres createdb -h postgres -p 5432 -U dispatch dispatch + docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" --rm postgres createdb -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER $DATABASE_NAME echo "Loading example data to the database..." - docker-compose run -e "PGPASSWORD=$DISPATCH_DB_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE" --rm postgres psql -h postgres -p 5432 -U dispatch -d dispatch -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" + docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" echo "Example data loaded. Navigate to /register and create a new user." fi echo "Running standard database migrations..." From 95b659944b7fbb543b156a8c387f0c288d6fac55 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Wed, 10 Mar 2021 14:24:14 -0800 Subject: [PATCH 49/69] Replaces progress meter with progress bar (#106) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e2cdb50..cbf41a0 100755 --- a/install.sh +++ b/install.sh @@ -125,7 +125,7 @@ else if [ "$CONT" = "y" ]; then source $DISPATCH_CONFIG_ENV echo "Downloading example data from Dispatch repository..." - curl -o "./$DISPATCH_DB_SAMPLE_DATA_FILE" "$DISPATCH_DB_SAMPLE_DATA_URL" + curl -# -o "./$DISPATCH_DB_SAMPLE_DATA_FILE" "$DISPATCH_DB_SAMPLE_DATA_URL" echo "Dropping database dispatch if it already exists..." docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" --rm postgres dropdb -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER $DATABASE_NAME --if-exists echo "Creating dispatch database..." From 72d229f23b80d2d65175cd2ec9205e8d2a891224 Mon Sep 17 00:00:00 2001 From: David Lamb <58757897+klarrio-dlamb@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:11:09 +1100 Subject: [PATCH 50/69] install.sh: don't overwrite existing secrets (#107) * Don't overwrite existing secrets * Update install.sh Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- install.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index cbf41a0..1785ea9 100755 --- a/install.sh +++ b/install.sh @@ -43,6 +43,26 @@ function ensure_file_from_example { fi } +# Handle OSX sed +if [[ "$OSTYPE" == "darwin"* ]]; then + sed_suffix_arg="-i ''" +else + sed_suffix_arg="-i" +fi + +function fill_uninitialised_secret { + secret_name=$1 + if [ -z ${!secret_name} ] || [ ${!secret_name} == "REPLACEWITHSOMETHIINGSECRET" ]; then + echo "Generating ${secret_name}..." + declare ${secret_name}=$(openssl rand -hex 30) + sed $sed_suffix_arg "s/^${secret_name}=.*/${secret_name}=${!secret_name}/" $DISPATCH_CONFIG_ENV + echo "${secret_name} written to $DISPATCH_CONFIG_ENV" + else + echo "Leaving existing ${secret_name}..." + fi +} + + if [ $(ver $DOCKER_VERSION) -lt $(ver $MIN_DOCKER_VERSION) ]; then echo "FAIL: Expected minimum Docker version to be $MIN_DOCKER_VERSION but found $DOCKER_VERSION" exit -1 @@ -61,6 +81,7 @@ fi echo "" ensure_file_from_example $DISPATCH_CONFIG_ENV ensure_file_from_example $DISPATCH_EXTRA_REQUIREMENTS +source $DISPATCH_CONFIG_ENV # Clean up old stuff and ensure nothing is working while we install/update docker-compose down --rmi local --remove-orphans @@ -70,20 +91,8 @@ echo "Creating volumes for persistent storage..." echo "Created $(docker volume create --name=dispatch-postgres)." echo "" -echo "Generating secret keys..." -# This is to escape the secret key to be used in sed below -SECRET_KEY=$(openssl rand -hex 30) -DISPATCH_JWT_SECRET=$(openssl rand -hex 30) -# We check the OS type and adjust the sed command accordingly -if [[ "$OSTYPE" == "darwin"* ]]; then - sed -i '' "s/^SECRET_KEY=.*/SECRET_KEY=${SECRET_KEY}/" $DISPATCH_CONFIG_ENV - sed -i '' "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=${DISPATCH_JWT_SECRET}/" $DISPATCH_CONFIG_ENV -else - sed -i "s/^SECRET_KEY=.*/SECRET_KEY=${SECRET_KEY}/" $DISPATCH_CONFIG_ENV - sed -i "s/^DISPATCH_JWT_SECRET=.*/DISPATCH_JWT_SECRET=${DISPATCH_JWT_SECRET}/" $DISPATCH_CONFIG_ENV -fi - -echo "Secret keys written to $DISPATCH_CONFIG_ENV" +fill_uninitialised_secret "SECRET_KEY" +fill_uninitialised_secret "DISPATCH_JWT_SECRET" echo "" echo "Pulling, building, and tagging Docker images..." @@ -123,7 +132,6 @@ if [ $CI ]; then else read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then - source $DISPATCH_CONFIG_ENV echo "Downloading example data from Dispatch repository..." curl -# -o "./$DISPATCH_DB_SAMPLE_DATA_FILE" "$DISPATCH_DB_SAMPLE_DATA_URL" echo "Dropping database dispatch if it already exists..." From d68731213a99b550b41cc30709bb290b91e8e85c Mon Sep 17 00:00:00 2001 From: Ross Vandegrift Date: Wed, 28 Apr 2021 22:18:08 -0700 Subject: [PATCH 51/69] Fix noninteractive upgrades (#111) --- install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 1785ea9..f09bed5 100755 --- a/install.sh +++ b/install.sh @@ -127,9 +127,7 @@ fi echo "" echo "Setting up database..." -if [ $CI ]; then - docker-compose run web database upgrade --no-input -else +if [ ! $CI ]; then read -p "Do you want to load example data (WARNING: this will remove all existing database data) (y/N)?" CONT if [ "$CONT" = "y" ]; then echo "Downloading example data from Dispatch repository..." @@ -142,9 +140,9 @@ else docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" echo "Example data loaded. Navigate to /register and create a new user." fi - echo "Running standard database migrations..." - docker-compose run --rm web database upgrade fi +echo "Running standard database migrations..." +docker-compose run --rm web database upgrade echo "" echo "Installing plugins..." From 88842cba903068a3a8c0d9b88102036eb8b1f4f1 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 28 Jul 2021 10:53:56 -0700 Subject: [PATCH 52/69] Fixing default url (#113) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f09bed5..8d8b086 100755 --- a/install.sh +++ b/install.sh @@ -158,6 +158,6 @@ echo " docker-compose up -d" echo "" echo "Once running, access the Dispatch UI at:" echo "" -echo " http://localhost:8000/auth/register" +echo " http://localhost:8000/default/auth/register" echo "----------------" echo "" From 9437d7d9112cbdf1013f0f61c56cb41dc157ebf6 Mon Sep 17 00:00:00 2001 From: Yurii Matsiuk <24990891+ymatsiuk@users.noreply.github.com> Date: Thu, 5 Aug 2021 22:46:09 +0200 Subject: [PATCH 53/69] Allow build time variables VUE_APP_* (#116) Co-authored-by: Yurii Matsiuk --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8d8b086..f0d9486 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,7 @@ set -e COMPOSE_DOCKER_CLI_BUILD=0 +COMPOSE_BUILD_ARGS="$(grep -E '^(VUE_APP)' ${DISPATCH_CONFIG_ENV} | while read var ; do printf %b "--build-arg ${var} "; done)" MIN_DOCKER_VERSION='17.05.0' MIN_COMPOSE_VERSION='1.19.0' @@ -98,7 +99,7 @@ echo "" echo "Pulling, building, and tagging Docker images..." echo "" docker-compose pull postgres -docker-compose build --force-rm +docker-compose build ${COMPOSE_BUILD_ARGS} --force-rm echo "" echo "Docker images pulled and built." From 883afd8be6e0df0e05af3875c5a462a18b2ee822 Mon Sep 17 00:00:00 2001 From: Yurii Matsiuk <24990891+ymatsiuk@users.noreply.github.com> Date: Fri, 6 Aug 2021 15:04:28 +0200 Subject: [PATCH 54/69] Fix variables order in install.sh (#117) --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f0d9486..b9fbd95 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,6 @@ set -e COMPOSE_DOCKER_CLI_BUILD=0 -COMPOSE_BUILD_ARGS="$(grep -E '^(VUE_APP)' ${DISPATCH_CONFIG_ENV} | while read var ; do printf %b "--build-arg ${var} "; done)" MIN_DOCKER_VERSION='17.05.0' MIN_COMPOSE_VERSION='1.19.0' @@ -11,6 +10,8 @@ MIN_RAM=2400 # MB DISPATCH_CONFIG_ENV='./.env' DISPATCH_EXTRA_REQUIREMENTS='./requirements.txt' +COMPOSE_BUILD_ARGS="$(grep -E '^(VUE_APP)' ${DISPATCH_CONFIG_ENV} | while read var ; do printf %b "--build-arg ${var} "; done)" + DISPATCH_DB_SAMPLE_DATA_FILE='dispatch-sample-data.dump' DISPATCH_DB_SAMPLE_DATA_URL="https://raw.githubusercontent.com/Netflix/dispatch/latest/data/${DISPATCH_DB_SAMPLE_DATA_FILE}" From 197296e0efc46e3e2dc55429658c7fddb714896b Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 7 Oct 2021 11:47:34 -0700 Subject: [PATCH 55/69] Updates env example (#124) --- .env.example | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/.env.example b/.env.example index 92790db..ca42c10 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,3 @@ -# For configuration details, see: https://hawkins.gitbook.io/dispatch/configuration/app - # General COMPOSE_PROJECT_NAME=dispatch SECRET_KEY=REPLACEWITHSOMETHIINGSECRET @@ -17,49 +15,4 @@ POSTGRES_DB=dispatch POSTGRES_PASSWORD=dispatch POSTGRES_USER=dispatch -# Cost -ANNUAL_COST_EMPLOYEE=50000 -BUSINESS_HOURS_YEAR=2080 - -# Incident configuration -INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID=INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID -INCIDENT_ONCALL_SERVICE_ID=None -INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID=INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID -INCIDENT_FAQ_DOCUMENT_ID=INCIDENT_FAQ_DOCUMENT_ID -INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT=google-docs-conversation-commands-reference-document -INCIDENT_RESOURCE_FAQ_DOCUMENT=google-docs-faq-document -INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT=google-docs-incident-review-document -INCIDENT_RESOURCE_INCIDENT_TASK=google-docs-incident-task -INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT=google-docs-investigation-document -INCIDENT_RESOURCE_INVESTIGATION_SHEET=google-docs-investigation-sheet -INCIDENT_RESOURCE_NOTIFICATIONS_GROUP=google-group-participant-notifications-group -INCIDENT_RESOURCE_TACTICAL_GROUP=google-group-participant-tactical-group -INCIDENT_STORAGE_FOLDER_ID=INCIDENT_STORAGE_FOLDER_ID - -# Slack -SLACK_APP_USER_SLUG= -SLACK_API_BOT_TOKEN= -SLACK_SIGNING_SECRET= -SLACK_WORKSPACE_NAME= - -# Google -GOOGLE_DEVELOPER_KEY=key -GOOGLE_DOMAIN=site.com -GOOGLE_SERVICE_ACCOUNT_CLIENT_EMAIL=info@example.com -GOOGLE_SERVICE_ACCOUNT_CLIENT_ID=id -GOOGLE_SERVICE_ACCOUNT_DELEGATED_ACCOUNT=account -GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=key -GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY_ID=id -GOOGLE_SERVICE_ACCOUNT_PROJECT_ID=id - -# Jira -JIRA_API_URL= -JIRA_BROWSER_URL= -JIRA_PROJECT_KEY= -JIRA_ISSUE_TYPE_ID= -JIRA_USERNAME= -JIRA_PASSWORD= - -# PagerDuty -PAGERDUTY_API_KEY= -PAGERDUTY_API_FROM_EMAIL= +# For additional server configuration options see: https://hawkins.gitbook.io/dispatch/administration-guide/server From 7b72912b90ea30a38586d96ace4a435b36067cd3 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:24:56 -0700 Subject: [PATCH 56/69] Adds Github templates and workflow actions (#125) --- .github/CODEOWNERS | 2 ++ .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ .github/workflows/enforce-labels.yml | 14 +++++++++ .github/workflows/stale.yml | 20 ++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/enforce-labels.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8e54217 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +mvilanova +kevgliss diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml new file mode 100644 index 0000000..ad042b2 --- /dev/null +++ b/.github/workflows/enforce-labels.yml @@ -0,0 +1,14 @@ +name: Enforce PR labels + +on: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + runs-on: ubuntu-latest + steps: + - uses: yogevbd/enforce-label-action@2.1.0 + with: + REQUIRED_LABELS_ANY: "bug,enhancement,documentation,feature,dependencies,skip-changelog" + REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','documentation','feature','dependencies','enhancement','skip-changelog']" + BANNED_LABELS: "banned" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..5244106 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,20 @@ +name: 'Close stale issues and pull requests' +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue is stale, because it has been open for 30 days with no activity. Remove the stale label or comment, or this will be closed in 5 days.' + close-issue-message: 'This issue was closed, because it has been stalled for 5 days with no activity.' + stale-pr-message: 'This PR is stale, because it has been open for 45 days with no activity. Remove the stale label or comment, or this will be closed in 10 days.' + close-pr-message: 'This PR was closed, because it has been stalled for 10 days with no activity.' + days-before-issue-stale: 30 + days-before-issue-close: 5 + days-before-pr-stale: 45 + days-before-pr-close: 10 From a94da4acc1225c0e014eba61c8bc4bb0163398e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen?= Date: Fri, 8 Oct 2021 19:09:50 +0200 Subject: [PATCH 57/69] Fix: Permission denied on SELinux (#126) psql: error: /dispatch-sample-data.dump: Permission denied --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b9fbd95..c75e843 100755 --- a/install.sh +++ b/install.sh @@ -139,7 +139,7 @@ if [ ! $CI ]; then echo "Creating dispatch database..." docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" --rm postgres createdb -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER $DATABASE_NAME echo "Loading example data to the database..." - docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" + docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE:Z" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" echo "Example data loaded. Navigate to /register and create a new user." fi fi From f3197fd2d613320f05cefb0cae18f5cce4bccf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen?= Date: Fri, 8 Oct 2021 19:11:31 +0200 Subject: [PATCH 58/69] Fix: KeyError: Config 'DISPATCH_ENCRYPTION_KEY' is missing (#127) Fix this error during install.sh Creating dispatch_web_run ... done Traceback (most recent call last): File "/usr/local/bin/dispatch", line 5, in from dispatch.cli import entrypoint File "/usr/local/lib/python3.9/site-packages/dispatch/cli.py", line 6, in from dispatch import __version__, config File "/usr/local/lib/python3.9/site-packages/dispatch/config.py", line 99, in DISPATCH_ENCRYPTION_KEY = config("DISPATCH_ENCRYPTION_KEY", cast=Secret) File "/usr/local/lib/python3.9/site-packages/starlette/config.py", line 64, in __call__ return self.get(key, cast, default) File "/usr/local/lib/python3.9/site-packages/starlette/config.py", line 77, in get raise KeyError(f"Config '{key}' is missing, and has no default.") KeyError: "Config 'DISPATCH_ENCRYPTION_KEY' is missing, and has no default." ERROR: 1 Cleaning up... --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index ca42c10..1e9b67d 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,7 @@ COMPOSE_PROJECT_NAME=dispatch SECRET_KEY=REPLACEWITHSOMETHIINGSECRET DISPATCH_JWT_SECRET=REPLACEWITHSOMETHIINGSECRET +DISPATCH_ENCRYPTION_KEY=REPLACEWITHSOMETHIINGSECRET # Database # NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD From 912db07faee07912af8eb87acd39fe1ba14d3b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen?= Date: Fri, 8 Oct 2021 20:22:02 +0200 Subject: [PATCH 59/69] Improvement: Make clear what to do after registration (#128) * Improvement: Make clear what to do after registration I believe adding this command and instructions directly to the install.sh takes away a bit of the friction when just starting and testing Dispatch. * Update install.sh admin -> owner Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index c75e843..4726c1a 100755 --- a/install.sh +++ b/install.sh @@ -161,5 +161,12 @@ echo "" echo "Once running, access the Dispatch UI at:" echo "" echo " http://localhost:8000/default/auth/register" +echo "" +echo "After registering, run the command below to get owner rights for the user you just registered:" +echo "" +echo " docker exec -it dispatch_web_1 bash -c 'dispatch user update --role Owner --organization name-of-the-organization email-address-of-registered-user'" +echo "" +echo "In case you load the sample data, your organization name is: default" +echo "" echo "----------------" echo "" From 24835f9088fdb75d0e83bbbacb849bcd0d1138c3 Mon Sep 17 00:00:00 2001 From: Pete Ehlke Date: Mon, 31 Jan 2022 12:46:08 -0700 Subject: [PATCH 60/69] fix(Ad-Hoc): init the database if we don't load sample data (#133) --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 4726c1a..fe9c93b 100755 --- a/install.sh +++ b/install.sh @@ -141,6 +141,9 @@ if [ ! $CI ]; then echo "Loading example data to the database..." docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE:Z" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" echo "Example data loaded. Navigate to /register and create a new user." + else + echo "Initializing the database" + docker-compose run --rm web database init fi fi echo "Running standard database migrations..." From e2194b98b9dca3f2d119aec6ac85c87d0a7627c2 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:10:57 -0800 Subject: [PATCH 61/69] Adds license file (#137) --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2838d81 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Netflix, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From d60598e5a616095ac7cf9858271476cfc5179de0 Mon Sep 17 00:00:00 2001 From: Keet Malin Sugathadasa Date: Mon, 25 Apr 2022 23:34:25 +0530 Subject: [PATCH 62/69] Version Extract Regex fixed for both docker-compose 1+ and 2+ (#138) * Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index fe9c93b..8358d50 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,7 @@ trap cleanup ERR INT TERM echo "Checking minimum requirements..." DOCKER_VERSION=$(docker version --format '{{.Server.Version}}') -COMPOSE_VERSION=$(docker-compose --version | sed 's/docker-compose version \(.\{1,\}\),.*/\1/') +COMPOSE_VERSION=$(docker-compose --version | grep -o "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}") RAM_AVAILABLE_IN_DOCKER=$(docker run --rm busybox free -m 2>/dev/null | awk '/Mem/ {print $2}'); # Compare dot-separated strings - function below is inspired by https://stackoverflow.com/a/37939589/808368 From b0c12e1aa0ec0cde5de9ba27c6666139e194e206 Mon Sep 17 00:00:00 2001 From: Keet Malin Sugathadasa Date: Thu, 28 Apr 2022 21:05:14 +0530 Subject: [PATCH 63/69] Update Instructions given in Readme and Install.sh file (#141) * Update install.sh * Update install.sh * Create install.sh * Update install.sh * Update README.md * Update install.sh --- README.md | 4 +++- install.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 32a99ac..8de0a11 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,11 @@ There may need to be modifications to the included example config files (`.env`) By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/master/data/dispatch-sample-data.dump) to load example data. +Note: when running the `install.sh` file, you will be asked whether to load this database dump, or to initialize a new database. + ### Starting with a clean database -If you decide to start with a clean database, you will need a user. To create a user, go to http://localhost:8000/register. +If you decide to start with a clean database, you will need a user. To create a user, go to http://localhost:8000/default/auth/register. ## Securing Dispatch with SSL/TLS diff --git a/install.sh b/install.sh index 8358d50..8574b3b 100755 --- a/install.sh +++ b/install.sh @@ -140,7 +140,7 @@ if [ ! $CI ]; then docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" --rm postgres createdb -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER $DATABASE_NAME echo "Loading example data to the database..." docker-compose run -e "PGPASSWORD=$POSTGRES_PASSWORD" -v "$(pwd)/$DISPATCH_DB_SAMPLE_DATA_FILE:/$DISPATCH_DB_SAMPLE_DATA_FILE:Z" --rm postgres psql -h $DATABASE_HOSTNAME -p $DATABASE_PORT -U $POSTGRES_USER -d $DATABASE_NAME -f "/$DISPATCH_DB_SAMPLE_DATA_FILE" - echo "Example data loaded. Navigate to /register and create a new user." + echo "Example data loaded. Navigate to /default/auth/register and create a new user." else echo "Initializing the database" docker-compose run --rm web database init @@ -167,7 +167,7 @@ echo " http://localhost:8000/default/auth/register" echo "" echo "After registering, run the command below to get owner rights for the user you just registered:" echo "" -echo " docker exec -it dispatch_web_1 bash -c 'dispatch user update --role Owner --organization name-of-the-organization email-address-of-registered-user'" +echo " docker exec -it dispatch-web-1 bash -c 'dispatch user update --role Owner --organization name-of-the-organization email-address-of-registered-user'" echo "" echo "In case you load the sample data, your organization name is: default" echo "" From 9dd762b6a0546b7a25669d92b35dd733598c6e30 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Thu, 16 Feb 2023 16:06:03 -0800 Subject: [PATCH 64/69] Bumps docker postgresql version (#145) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 94dddc1..8c4b4e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: <<: *restart_policy env_file: - .env - image: postgres:12 + image: postgres:14.6 ports: - "5432:5432" volumes: From 926f6d5f6435506c856f98090fbb2e3408e826df Mon Sep 17 00:00:00 2001 From: Cino Jose Date: Fri, 17 Feb 2023 08:06:47 +0800 Subject: [PATCH 65/69] Fix VITE env variables during build time (#144) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8574b3b..a9db10f 100755 --- a/install.sh +++ b/install.sh @@ -10,7 +10,7 @@ MIN_RAM=2400 # MB DISPATCH_CONFIG_ENV='./.env' DISPATCH_EXTRA_REQUIREMENTS='./requirements.txt' -COMPOSE_BUILD_ARGS="$(grep -E '^(VUE_APP)' ${DISPATCH_CONFIG_ENV} | while read var ; do printf %b "--build-arg ${var} "; done)" +COMPOSE_BUILD_ARGS="$(grep -E '^(VITE)' ${DISPATCH_CONFIG_ENV} | while read var ; do printf %b "--build-arg ${var} "; done)" DISPATCH_DB_SAMPLE_DATA_FILE='dispatch-sample-data.dump' DISPATCH_DB_SAMPLE_DATA_URL="https://raw.githubusercontent.com/Netflix/dispatch/latest/data/${DISPATCH_DB_SAMPLE_DATA_FILE}" From ba06f75c7287d65d3207ef594aada35970765bba Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 1 Aug 2023 10:03:10 -0700 Subject: [PATCH 66/69] Fixes docker context path. (#150) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8c4b4e7..79e71a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#latest + context: https://github.com/Netflix/dispatch.git#latest:docker web: <<: *restart_policy image: dispatch-local From 67161e7796713b0a0c764ea102c6dee9500674ca Mon Sep 17 00:00:00 2001 From: Avery Lee Date: Thu, 1 Feb 2024 14:01:09 -0800 Subject: [PATCH 67/69] Fix docker context path. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 79e71a3..8c4b4e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Pro-tip: point this to a relative directory containing the Dispatch # project root to pick up changes from your dev environment # (e.g., ../dispatch-root) - context: https://github.com/Netflix/dispatch.git#latest:docker + context: https://github.com/Netflix/dispatch.git#latest web: <<: *restart_policy image: dispatch-local From 8a85e56d53428dd25e339a0287234a45f57db720 Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:44:18 -0800 Subject: [PATCH 68/69] fix: update Dispatch main branch (#154) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8de0a11..80f86d7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ There may need to be modifications to the included example config files (`.env`) ## Data -By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/master/data/dispatch-sample-data.dump) to load example data. +By default Dispatch does not come with any data. If you're looking for some example data, please use the postgres dump file located [here](https://github.com/Netflix/dispatch/blob/main/data/dispatch-sample-data.dump) to load example data. Note: when running the `install.sh` file, you will be asked whether to load this database dump, or to initialize a new database. From 81dfb36db5bf95d41e61fb047864ff71d542c8c8 Mon Sep 17 00:00:00 2001 From: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:54:26 -0700 Subject: [PATCH 69/69] Update README.md (#155) --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 80f86d7..e4f0764 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ +# 🚨 Notice: Dispatch is Being Archived 🚨 + +This repository will be **archived and marked as read-only on September 1, 2025**. After this date, no further changes, issues, or pull requests will be accepted. + +## 🙏 Thank You + +Since the first commit on **February 10, 2020**, Dispatch has grown into a sophisticated incident and signal management platform, thanks to the dedication and passion of its community. We are deeply grateful to the **[80 contributors](https://github.com/Netflix/dispatch/graphs/contributors)** who have shared their time, expertise, and creativity over the years. Your support has made Dispatch what it is today. + +## â„šī¸ What Does This Mean? + +- The codebase will remain publicly available in a **read-only** state. +- No new issues, pull requests, or discussions will be accepted. +- Existing issues and pull requests will be closed. +- We encourage users to fork the repository if they wish to continue development independently. + +Thank you again to everyone who has contributed, used, or supported Dispatch over the years! + +— The Dispatch Team at Netflix + +--- + # Dispatch Official bootstrap for running your own `Dispatch` with [Docker](https://www.docker.com/).