From 393c9cd13cdfb446842672f1c5bed257be84c24f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 29 Jan 2021 11:00:54 +0100 Subject: [PATCH] :fire: Remove unused config variables. --- backend/scripts/repl | 4 +++- backend/scripts/start-dev | 2 ++ backend/src/app/config.clj | 13 +++---------- backend/src/app/http/middleware.clj | 7 +++---- docker/images/docker-compose.yaml | 6 ------ 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/backend/scripts/repl b/backend/scripts/repl index 76120806e..e3fa8b324 100755 --- a/backend/scripts/repl +++ b/backend/scripts/repl @@ -1,5 +1,7 @@ #!/usr/bin/env bash -set -ex +export PENPOT_ASSERTS_ENABLED=true + +set -ex # clojure -Ojmx-remote -A:dev -e "(set! *warn-on-reflection* true)" -m rebel-readline.main clojure -A:jmx-remote:dev -J-Xms512m -J-Xmx512m -M -m rebel-readline.main diff --git a/backend/scripts/start-dev b/backend/scripts/start-dev index 4a222bf3b..a25db5350 100755 --- a/backend/scripts/start-dev +++ b/backend/scripts/start-dev @@ -1,5 +1,7 @@ #!/bin/sh +export PENPOT_ASSERTS_ENABLED=true + set -ex if [ ! -e ~/.fixtures-loaded ]; then diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index e9aaeb7e7..5fdf166f1 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -19,12 +19,12 @@ (def defaults {:http-server-port 6060 - :http-server-cors "http://localhost:3449" :database-uri "postgresql://127.0.0.1/penpot" :database-username "penpot" :database-password "penpot" - :asserts-enabled true + + :asserts-enabled false :public-uri "http://localhost:3449" :redis-uri "redis://localhost/0" @@ -52,10 +52,9 @@ :registration-domain-whitelist "" :telemetry-enabled false + :telemetry-with-taiga true :telemetry-uri "https://telemetry.penpot.app/" - :debug true - ;; LDAP auth disabled by default. Set ldap-auth-host to enable ;:ldap-auth-host "ldap.mysupercompany.com" ;:ldap-auth-port 389 @@ -76,8 +75,6 @@ }) (s/def ::http-server-port ::us/integer) -(s/def ::http-server-debug ::us/boolean) -(s/def ::http-server-cors ::us/string) (s/def ::database-username (s/nilable ::us/string)) (s/def ::database-password (s/nilable ::us/string)) (s/def ::database-uri ::us/string) @@ -106,7 +103,6 @@ (s/def ::allow-demo-users ::us/boolean) (s/def ::registration-enabled ::us/boolean) (s/def ::registration-domain-whitelist ::us/string) -(s/def ::debug ::us/boolean) (s/def ::public-uri ::us/string) (s/def ::srepl-host ::us/string) @@ -153,7 +149,6 @@ ::database-password ::database-uri ::database-username - ::debug ::error-report-webhook ::github-client-id ::github-client-secret @@ -162,9 +157,7 @@ ::gitlab-client-secret ::google-client-id ::google-client-secret - ::http-server-debug ::http-server-port - ::http-server-cors ::ldap-auth-avatar-attribute ::ldap-auth-base-dn ::ldap-auth-email-attribute diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index a77716f4d..695ea94f7 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -5,12 +5,11 @@ ;; This Source Code Form is "Incompatible With Secondary Licenses", as ;; defined by the Mozilla Public License, v. 2.0. ;; -;; Copyright (c) 2020 UXBOX Labs SL +;; Copyright (c) 2020-2021 UXBOX Labs SL (ns app.http.middleware (:require [app.common.exceptions :as ex] - [app.config :as cfg] [app.metrics :as mtx] [app.util.transit :as t] [app.util.json :as json] @@ -47,7 +46,7 @@ :json (parse-json body) :transit (parse-transit body)) (catch Exception e - (let [type (if (:debug @cfg/config) :json-verbose :json) + (let [type :json-verbose data {:type :parse :hint "unable to parse request body" :message (ex-message e)}] @@ -80,7 +79,7 @@ (defn- impl-format-response-body [response] (let [body (:body response) - type (if (:debug cfg/config) :json-verbose :json)] + type :json-verbose] (cond (coll? body) (-> response diff --git a/docker/images/docker-compose.yaml b/docker/images/docker-compose.yaml index 64e494741..60bba2014 100644 --- a/docker/images/docker-compose.yaml +++ b/docker/images/docker-compose.yaml @@ -33,9 +33,6 @@ services: - penpot-redis environment: - # Used for creating tokens, important to be true random value - - PENPOT_SECRET_KEY=provide-here-a-secret-random-key - # Should be set to the public domain when penpot is going to be # served. - PENPOT_PUBLIC_URI=http://localhost:9001 @@ -78,9 +75,6 @@ services: # - PENPOT_SMTP_TLS=true # - PENPOT_SMTP_SSL=false - - PENPOT_ASSERTS_ENABLED=false - - PENPOT_DEBUG=false - networks: - penpot