📚 Update documentation.

This commit is contained in:
Andrey Antukh 2021-01-27 17:31:17 +01:00
parent fe67bf8fdb
commit 11ff1994f3
9 changed files with 218 additions and 88 deletions

View file

@ -82,7 +82,7 @@
:fullname (str "Profile " index)
:password "123123"
:demo? true
:email (str "profile" index ".test@penpot.app")})
:email (str "profile" index "@example.com")})
team-id (:default-team-id prof)
owner-id id]
(let [project-ids (collect (partial create-project conn team-id owner-id)

View file

@ -20,6 +20,7 @@
(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"
@ -29,13 +30,16 @@
:public-uri "http://localhost:3449"
:redis-uri "redis://localhost/0"
:srepl-host "127.0.0.1"
:srepl-port 6062
:storage-backend :fs
:storage-fs-directory "resources/public/assets"
:storage-s3-region :eu-central-1
:storage-s3-bucket "penpot-devenv-assets-pre"
:local-assets-uri "http://localhost:3449/internal/assets/"
:assets-path "/internal/assets/"
:rlimits-password 10
:rlimits-image 2
@ -82,7 +86,7 @@
(s/def ::storage-backend ::us/keyword)
(s/def ::storage-fs-directory ::us/string)
(s/def ::local-assets-uri ::us/string)
(s/def ::assets-path ::us/string)
(s/def ::storage-s3-region ::us/keyword)
(s/def ::storage-s3-bucket ::us/string)
@ -106,7 +110,9 @@
(s/def ::registration-domain-whitelist ::us/string)
(s/def ::debug ::us/boolean)
(s/def ::public-uri ::us/string)
(s/def ::backend-uri ::us/string)
(s/def ::srepl-host ::us/string)
(s/def ::srepl-port ::us/integer)
(s/def ::rlimits-password ::us/integer)
(s/def ::rlimits-image ::us/integer)
@ -190,6 +196,8 @@
::smtp-username
::storage-backend
::storage-fs-directory
::srepl-host
::srepl-port
::local-assets-uri
::storage-s3-bucket
::storage-s3-region

View file

@ -64,7 +64,7 @@
:body ""})
:fs
(let [purl (u/uri (:public-uri cfg))
(let [purl (u/uri (:assets-path cfg))
purl (u/join purl (sto/object->relative-path obj))]
{:status 204
:headers {"x-accel-redirect" (:path purl)
@ -100,12 +100,12 @@
;; --- Initialization
(s/def ::storage some?)
(s/def ::public-uri ::us/string)
(s/def ::assets-path ::us/string)
(s/def ::cache-max-age ::dt/duration)
(s/def ::signature-max-age ::dt/duration)
(defmethod ig/pre-init-spec ::handlers [_]
(s/keys :req-un [::storage ::mtx/metrics ::public-uri ::cache-max-age ::signature-max-age]))
(s/keys :req-un [::storage ::mtx/metrics ::assets-path ::cache-max-age ::signature-max-age]))
(defmethod ig/init-key ::handlers
[_ cfg]

View file

@ -90,9 +90,9 @@
:error-report-handler (ig/ref :app.error-reporter/handler)}
:app.http.assets/handlers
{:metrics (ig/ref :app.metrics/metrics)
:public-uri (:local-assets-uri cfg/config)
:storage (ig/ref :app.storage/storage)
{:metrics (ig/ref :app.metrics/metrics)
:assets-path (:assets-path cfg/config)
:storage (ig/ref :app.storage/storage)
:cache-max-age (dt/duration {:hours 24})
:signature-max-age (dt/duration {:hours 24 :minutes 5})}
@ -262,7 +262,8 @@
:uri (:telemetry-uri cfg/config)}
:app.srepl/server
{:port 6062}
{:port (:srepl-port cfg/config)
:host (:srepl-host cfg/config)}
:app.error-reporter/reporter
{:uri (:error-report-webhook cfg/config)

View file

@ -40,7 +40,7 @@
(defmethod ig/prep-key ::server
[_ cfg]
(merge {:port 6062 :host "127.0.0.1" :name "main"} cfg))
(merge {:name "main"} cfg))
(defmethod ig/init-key ::server
[_ {:keys [port host name] :as cfg}]