mirror of
https://github.com/penpot/penpot.git
synced 2025-04-10 14:01:29 -05:00
Merge branch 'main' into develop
This commit is contained in:
commit
7fcf481243
6 changed files with 25 additions and 48 deletions
|
@ -135,7 +135,7 @@
|
|||
ws-send (mtx/wrap-counter ws-send mtx-messages ["send"])]
|
||||
|
||||
(letfn [(on-connect [conn]
|
||||
(mtx-aconn :inc)
|
||||
((::mtx/fn mtx-aconn) {:cmd :inc :by 1})
|
||||
;; A subscription channel should use a lossy buffer
|
||||
;; because we can't penalize normal clients when one
|
||||
;; slow client is connected to the room.
|
||||
|
@ -162,8 +162,8 @@
|
|||
(a/<! (handle-connect cfg))
|
||||
|
||||
;; when connection is closed
|
||||
(mtx-aconn :dec)
|
||||
(mtx-sessions :observe (/ (inst-ms (dt/diff created-at (dt/now))) 1000.0))
|
||||
((::mtx/fn mtx-aconn) {:cmd :dec :by 1})
|
||||
((::mtx/fn mtx-sessions) {:val (/ (inst-ms (dt/diff created-at (dt/now))) 1000.0)})
|
||||
|
||||
;; close subscription
|
||||
(a/close! sub-ch))))
|
||||
|
|
|
@ -5,7 +5,8 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
ENV LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8 \
|
||||
NODE_VERSION=v14.17.5
|
||||
NODE_VERSION=v14.17.5 \
|
||||
PENPOT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
|
||||
RUN set -ex; \
|
||||
mkdir -p /etc/resolvconf/resolv.conf.d; \
|
||||
|
|
|
@ -35,17 +35,13 @@ PENPOT_SMTP_DEFAULT_REPLY_TO=no-reply@example.com
|
|||
# PENPOT_SMTP_TLS=true
|
||||
# PENPOT_SMTP_SSL=false
|
||||
|
||||
# Enable or disable external user registration process.
|
||||
PENPOT_REGISTRATION_ENABLED=true
|
||||
# Feature flags. Right now they are only affect frontend, but in
|
||||
# future release they will affect to both backend and frontend.
|
||||
PENPOT_FLAGS="enable-registration enable-demo-users"
|
||||
|
||||
# Comma separated list of allowed domains to register. Empty to allow all.
|
||||
# PENPOT_REGISTRATION_DOMAIN_WHITELIST=""
|
||||
|
||||
# Penpot comes with the facility to create quick demo users that are
|
||||
# automatically deleted after some time. This settings enables or disables the
|
||||
# creation of demo users.
|
||||
PENPOT_ALLOW_DEMO_USERS=true
|
||||
|
||||
## Authentication providers
|
||||
|
||||
# Google
|
||||
|
|
|
@ -9,26 +9,6 @@ log() {
|
|||
## App Frontend config
|
||||
#########################################
|
||||
|
||||
update_demo_warning() {
|
||||
if [ -n "$PENPOT_DEMO_WARNING" ]; then
|
||||
log "Updating Demo Warning: $PENPOT_DEMO_WARNING"
|
||||
sed -i \
|
||||
-e "s|^//var penpotDemoWarning = .*;|var penpotDemoWarning = $PENPOT_DEMO_WARNING;|g" \
|
||||
"$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
update_allow_demo_users() {
|
||||
if [ -n "$PENPOT_ALLOW_DEMO_USERS" ]; then
|
||||
log "Updating Allow Demo Users: $PENPOT_ALLOW_DEMO_USERS"
|
||||
sed -i \
|
||||
-e "s|^//var penpotAllowDemoUsers = .*;|var penpotAllowDemoUsers = $PENPOT_ALLOW_DEMO_USERS;|g" \
|
||||
"$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
update_google_client_id() {
|
||||
if [ -n "$PENPOT_GOOGLE_CLIENT_ID" ]; then
|
||||
log "Updating Google Client Id: $PENPOT_GOOGLE_CLIENT_ID"
|
||||
|
@ -67,6 +47,7 @@ update_oidc_client_id() {
|
|||
fi
|
||||
}
|
||||
|
||||
# DEPRECATED
|
||||
update_login_with_ldap() {
|
||||
if [ -n "$PENPOT_LOGIN_WITH_LDAP" ]; then
|
||||
log "Updating Login with LDAP: $PENPOT_LOGIN_WITH_LDAP"
|
||||
|
@ -76,7 +57,7 @@ update_login_with_ldap() {
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
# DEPRECATED
|
||||
update_registration_enabled() {
|
||||
if [ -n "$PENPOT_REGISTRATION_ENABLED" ]; then
|
||||
log "Updating Registration Enabled: $PENPOT_REGISTRATION_ENABLED"
|
||||
|
@ -86,14 +67,6 @@ update_registration_enabled() {
|
|||
fi
|
||||
}
|
||||
|
||||
update_analytics_enabled() {
|
||||
if [ -n "$PENPOT_ANALYTICS_ENABLED" ]; then
|
||||
sed -i \
|
||||
-e "s|^//var penpotAnalyticsEnabled = .*;|var penpotAnalyticsEnabled = $PENPOT_ANALYTICS_ENABLED;|g" \
|
||||
"$1"
|
||||
fi
|
||||
}
|
||||
|
||||
update_flags() {
|
||||
if [ -n "$PENPOT_FLAGS" ]; then
|
||||
sed -i \
|
||||
|
@ -102,14 +75,11 @@ update_flags() {
|
|||
fi
|
||||
}
|
||||
|
||||
update_demo_warning /var/www/app/js/config.js
|
||||
update_allow_demo_users /var/www/app/js/config.js
|
||||
update_google_client_id /var/www/app/js/config.js
|
||||
update_gitlab_client_id /var/www/app/js/config.js
|
||||
update_github_client_id /var/www/app/js/config.js
|
||||
update_oidc_client_id /var/www/app/js/config.js
|
||||
update_login_with_ldap /var/www/app/js/config.js
|
||||
update_registration_enabled /var/www/app/js/config.js
|
||||
update_analytics_enabled /var/www/app/js/config.js
|
||||
update_flags /var/www/app/js/config.js
|
||||
exec "$@";
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
(ns app.config
|
||||
(:refer-clojure :exclude [get])
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
["process" :as process]
|
||||
[cljs.pprint]
|
||||
[cuerdas.core :as str]
|
||||
[app.common.data :as d]
|
||||
[app.common.spec :as us]
|
||||
[cljs.spec.alpha :as s]
|
||||
[cljs.core :as c]
|
||||
[cljs.pprint]
|
||||
[cljs.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[lambdaisland.uri :as u]))
|
||||
|
||||
(def defaults
|
||||
|
@ -22,6 +22,7 @@
|
|||
:browser-concurrency 5
|
||||
:browser-strategy :incognito})
|
||||
|
||||
(s/def ::browser-executable-path ::us/string)
|
||||
(s/def ::public-uri ::us/string)
|
||||
(s/def ::http-server-port ::us/integer)
|
||||
(s/def ::browser-concurrency ::us/integer)
|
||||
|
@ -31,7 +32,8 @@
|
|||
(s/keys :opt-un [::public-uri
|
||||
::http-server-port
|
||||
::browser-concurrency
|
||||
::browser-strategy]))
|
||||
::browser-strategy
|
||||
::browser-executable-path]))
|
||||
(defn- read-env
|
||||
[prefix]
|
||||
(let [env (unchecked-get process "env")
|
||||
|
|
|
@ -54,6 +54,14 @@
|
|||
:browser
|
||||
:webworker))
|
||||
|
||||
(def available-flags
|
||||
#{:registration
|
||||
:audit-log
|
||||
:demo-users
|
||||
:user-feedback
|
||||
:demo-warning
|
||||
:login-with-ldap})
|
||||
|
||||
(def default-flags
|
||||
#{:registration :demo-users})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue