From 94fe18b4aeed7f913572ac9eec20ec71271b1d44 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 9 Dec 2019 16:29:26 +0100 Subject: [PATCH] :construction: Improve build scripts. --- backend/bin/kaocha | 2 + backend/bin/start | 14 + backend/deps.edn | 108 +-- backend/tests.edn | 5 + docker/devenv/docker-compose.yaml | 2 + docker/devenv/files/postgresql.conf | 809 ++++++++++-------- docker/devenv/files/start.sh | 3 +- docker/docker-compose.yml | 43 +- frontend/deps.edn | 53 +- .../src/uxbox/main/ui/dashboard/icons.cljs | 2 +- frontend/tools.clj | 12 +- manage.sh | 45 +- 12 files changed, 649 insertions(+), 449 deletions(-) create mode 100755 backend/bin/kaocha create mode 100755 backend/bin/start create mode 100644 backend/tests.edn diff --git a/backend/bin/kaocha b/backend/bin/kaocha new file mode 100755 index 000000000..4a31cbf77 --- /dev/null +++ b/backend/bin/kaocha @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +clojure -A:dev:test -m kaocha.runner "$@" diff --git a/backend/bin/start b/backend/bin/start new file mode 100755 index 000000000..178a4bac3 --- /dev/null +++ b/backend/bin/start @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ ! -e ~/local/.fixtures-loaded ]; then + echo "Loading fixtures..." + clojure -Adev -m uxbox.fixtures + touch ~/local/.fixtures-loaded +fi + +clojure -J-XX:-OmitStackTraceInFastThrow -m uxbox.main + + + diff --git a/backend/deps.edn b/backend/deps.edn index 83ce549d3..afc2773f5 100644 --- a/backend/deps.edn +++ b/backend/deps.edn @@ -1,64 +1,74 @@ -{:deps {org.clojure/clojure {:mvn/version "1.10.1"} - funcool/promesa {:mvn/version "5.0.0-SNAPSHOT"} - funcool/cuerdas {:mvn/version "2.2.1"} +{:deps + {org.clojure/clojure {:mvn/version "1.10.1"} + funcool/promesa {:mvn/version "5.0.0-SNAPSHOT"} + funcool/cuerdas {:mvn/version "2.2.1"} - ;; Logging - org.clojure/tools.logging {:mvn/version "0.5.0"} - org.apache.logging.log4j/log4j-api {:mvn/version "2.12.1"} - org.apache.logging.log4j/log4j-core {:mvn/version "2.12.1"} - org.apache.logging.log4j/log4j-jul {:mvn/version "2.12.1"} - funcool/datoteka {:mvn/version "1.1.0"} - expound/expound {:mvn/version "0.7.2"} - instaparse/instaparse {:mvn/version "1.4.10"} - com.cognitect/transit-clj {:mvn/version "0.8.319"} + ;; Logging + org.clojure/tools.logging {:mvn/version "0.5.0"} + org.apache.logging.log4j/log4j-api {:mvn/version "2.12.1"} + org.apache.logging.log4j/log4j-core {:mvn/version "2.12.1"} + org.apache.logging.log4j/log4j-jul {:mvn/version "2.12.1"} + funcool/datoteka {:mvn/version "1.1.0"} + expound/expound {:mvn/version "0.7.2"} + instaparse/instaparse {:mvn/version "1.4.10"} + com.cognitect/transit-clj {:mvn/version "0.8.319"} - ;; vertx deps - ;; vertx-clojure/vertx {:mvn/version "0.0.0-SNAPSHOT"} - metosin/reitit-core {:mvn/version "0.3.10"} - metosin/sieppari {:mvn/version "0.0.0-alpha8"} - io.vertx/vertx-core {:mvn/version "3.8.4"} - io.vertx/vertx-web {:mvn/version "3.8.4"} - io.vertx/vertx-web-client {:mvn/version "3.8.4"} - io.vertx/vertx-pg-client {:mvn/version "3.8.4"} - ;; end verx deps + ;; vertx deps + ;; vertx-clojure/vertx {:mvn/version "0.0.0-SNAPSHOT"} + metosin/reitit-core {:mvn/version "0.3.10"} + metosin/sieppari {:mvn/version "0.0.0-alpha8"} + io.vertx/vertx-core {:mvn/version "3.8.4"} + io.vertx/vertx-web {:mvn/version "3.8.4"} + io.vertx/vertx-web-client {:mvn/version "3.8.4"} + io.vertx/vertx-pg-client {:mvn/version "3.8.4"} + ;; end verx deps - lambdaisland/uri {:mvn/version "1.1.0"} + lambdaisland/uri {:mvn/version "1.1.0"} - danlentz/clj-uuid {:mvn/version "0.1.9"} - org.jsoup/jsoup {:mvn/version "1.12.1"} - hiccup/hiccup {:mvn/version "1.0.5"} - org.im4java/im4java {:mvn/version "1.4.0"} + danlentz/clj-uuid {:mvn/version "0.1.9"} + org.jsoup/jsoup {:mvn/version "1.12.1"} + hiccup/hiccup {:mvn/version "1.0.5"} + org.im4java/im4java {:mvn/version "1.4.0"} - buddy/buddy-sign {:mvn/version "3.1.0"} - buddy/buddy-hashers {:mvn/version "1.4.0"} + buddy/buddy-sign {:mvn/version "3.1.0"} + buddy/buddy-hashers {:mvn/version "1.4.0"} - org.xerial.snappy/snappy-java {:mvn/version "1.1.7.3"} - com.github.spullara.mustache.java/compiler {:mvn/version "0.9.6"} - commons-io/commons-io {:mvn/version "2.6"} - com.draines/postal {:mvn/version "2.0.3" - :exclusions [commons-codec/commons-codec]} + org.xerial.snappy/snappy-java {:mvn/version "1.1.7.3"} + com.github.spullara.mustache.java/compiler {:mvn/version "0.9.6"} + commons-io/commons-io {:mvn/version "2.6"} + com.draines/postal {:mvn/version "2.0.3" + :exclusions [commons-codec/commons-codec]} - ;; exception printing - io.aviso/pretty {:mvn/version "0.1.37"} + ;; exception printing + io.aviso/pretty {:mvn/version "0.1.37"} - mount/mount {:mvn/version "0.1.16"} - environ/environ {:mvn/version "1.1.0"} - } + mount/mount {:mvn/version "0.1.16"} + environ/environ {:mvn/version "1.1.0"}} :paths ["src" "vendor" "resources"] :aliases {:dev - {:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"} - org.clojure/tools.namespace {:mvn/version "0.3.1"} - fipp/fipp {:mvn/version "0.6.21"} - criterium/criterium {:mvn/version "0.4.5"} - mockery/mockery {:mvn/version "0.1.4"} - } + {:extra-deps + {com.bhauman/rebel-readline {:mvn/version "0.1.4"} + org.clojure/tools.namespace {:mvn/version "0.3.1"} + fipp/fipp {:mvn/version "0.6.21"} + criterium/criterium {:mvn/version "0.4.5"} + mockery/mockery {:mvn/version "0.1.4"}} :extra-paths ["test"]} - :repl {:main-opts ["-m" "rebel-readline.main"]} - :nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"}} - :main-opts ["-m" "nrepl.cmdline"]} - :ancient {:main-opts ["-m" "deps-ancient.deps-ancient"] - :extra-deps {deps-ancient {:mvn/version "RELEASE"}}} + + :repl + {:main-opts ["-m" "rebel-readline.main"]} + + :test + {:extra-deps {lambdaisland/kaocha {:mvn/version "0.0-554"}}} + + :nrepl + {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"}} + :main-opts ["-m" "nrepl.cmdline"]} + + :ancient + {:main-opts ["-m" "deps-ancient.deps-ancient"] + :extra-deps {deps-ancient {:mvn/version "RELEASE"}}} + }} diff --git a/backend/tests.edn b/backend/tests.edn new file mode 100644 index 000000000..bb837d2b7 --- /dev/null +++ b/backend/tests.edn @@ -0,0 +1,5 @@ +#kaocha/v1 +{:tests + [{:id :unit + :test-paths ["test" "src"] + :ns-patterns ["test-.*"]}]} diff --git a/docker/devenv/docker-compose.yaml b/docker/devenv/docker-compose.yaml index c958916ff..61d18dcc1 100644 --- a/docker/devenv/docker-compose.yaml +++ b/docker/devenv/docker-compose.yaml @@ -49,6 +49,7 @@ services: postgres: image: postgres:12 + # command: postgres -c config_file=/etc/postgresql.conf hostname: 'uxbox-devenv-postgres' container_name: 'uxbox-devenv-postgres' restart: always @@ -61,4 +62,5 @@ services: - POSTGRES_USER=uxbox - POSTGRES_PASSWORD=uxbox volumes: + # - ./files/postgresql.conf:/etc/postgresql.conf - postgres_data:/var/lib/postgresql/data diff --git a/docker/devenv/files/postgresql.conf b/docker/devenv/files/postgresql.conf index b012ae5ab..282b4f067 100644 --- a/docker/devenv/files/postgresql.conf +++ b/docker/devenv/files/postgresql.conf @@ -1,3 +1,4 @@ + # ----------------------------- # PostgreSQL configuration file # ----------------------------- @@ -16,9 +17,9 @@ # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. # # Any parameter can also be given as a command-line option to the server, e.g., # "postgres -c log_connections=on". Some parameters can be changed at run time @@ -38,16 +39,16 @@ # The default values of these variables are driven from the -D command-line # option or PGDATA environment variable, represented here as ConfigDir. -data_directory = '/var/lib/postgresql/9.5/main' # use data in another directory - # (change requires restart) -hba_file = '/etc/postgresql/9.5/main/pg_hba.conf' # host-based authentication file - # (change requires restart) -ident_file = '/etc/postgresql/9.5/main/pg_ident.conf' # ident configuration file - # (change requires restart) +#data_directory = 'ConfigDir' # use data in another directory + # (change requires restart) +#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file + # (change requires restart) +#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file + # (change requires restart) # If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '/var/run/postgresql/9.5-main.pid' # write an extra PID file - # (change requires restart) +#external_pid_file = '' # write an extra PID file + # (change requires restart) #------------------------------------------------------------------------------ @@ -56,54 +57,60 @@ external_pid_file = '/var/run/postgresql/9.5-main.pid' # write an extra PID fi # - Connection Settings - -#listen_addresses = 'localhost' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -port = 5432 # (change requires restart) -max_connections = 100 # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -#superuser_reserved_connections = 3 # (change requires restart) -unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories - # (change requires restart) -#unix_socket_group = '' # (change requires restart) -#unix_socket_permissions = 0777 # begin with 0 to use octal notation - # (change requires restart) -#bonjour = off # advertise server via Bonjour - # (change requires restart) -#bonjour_name = '' # defaults to the computer name - # (change requires restart) +listen_addresses = '*' + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +#port = 5432 # (change requires restart) +max_connections = 100 # (change requires restart) +#superuser_reserved_connections = 3 # (change requires restart) +#unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories + # (change requires restart) +#unix_socket_group = '' # (change requires restart) +#unix_socket_permissions = 0777 # begin with 0 to use octal notation + # (change requires restart) +#bonjour = off # advertise server via Bonjour + # (change requires restart) +#bonjour_name = '' # defaults to the computer name + # (change requires restart) -# - Security and Authentication - +# - TCP settings - +# see "man 7 tcp" for details -#authentication_timeout = 1min # 1s-600s -ssl = true # (change requires restart) -#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers - # (change requires restart) -#ssl_prefer_server_ciphers = on # (change requires restart) -#ssl_ecdh_curve = 'prime256v1' # (change requires restart) -ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) -ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) -#ssl_ca_file = '' # (change requires restart) -#ssl_crl_file = '' # (change requires restart) -#password_encryption = on +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default +#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +# - Authentication - + +#authentication_timeout = 1min # 1s-600s +#password_encryption = md5 # md5 or scram-sha-256 #db_user_namespace = off -#row_security = on # GSSAPI using Kerberos #krb_server_keyfile = '' #krb_caseins_users = off -# - TCP Keepalives - -# see "man 7 tcp" for details +# - SSL - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default +#ssl = off +#ssl_ca_file = '' +#ssl_cert_file = 'server.crt' +#ssl_crl_file = '' +#ssl_key_file = 'server.key' +#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers +#ssl_prefer_server_ciphers = on +#ssl_ecdh_curve = 'prime256v1' +#ssl_min_protocol_version = 'TLSv1' +#ssl_max_protocol_version = '' +#ssl_dh_params_file = '' +#ssl_passphrase_command = '' +#ssl_passphrase_command_supports_reload = off #------------------------------------------------------------------------------ @@ -112,157 +119,226 @@ ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires rest # - Memory - -shared_buffers = 256MB # min 128kB - # (change requires restart) -#huge_pages = try # on, off, or try - # (change requires restart) -#temp_buffers = 8MB # min 800kB -#max_prepared_transactions = 0 # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -#work_mem = 4MB # min 64kB -#maintenance_work_mem = 64MB # min 1MB -#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem -#max_stack_depth = 2MB # min 100kB -dynamic_shared_memory_type = posix # the default is the first option - # supported by the operating system: - # posix - # sysv - # windows - # mmap - # use none to disable dynamic shared memory +shared_buffers = 256MB # min 128kB + # (change requires restart) +#huge_pages = try # on, off, or try + # (change requires restart) +temp_buffers = 8MB # min 800kB +#max_prepared_transactions = 0 # zero disables the feature + # (change requires restart) +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. +work_mem = 8MB # min 64kB +#maintenance_work_mem = 64MB # min 1MB +#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem +#max_stack_depth = 2MB # min 100kB +#shared_memory_type = mmap # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) +dynamic_shared_memory_type = posix # the default is the first option + # supported by the operating system: + # posix + # sysv + # windows + # mmap + # (change requires restart) # - Disk - -#temp_file_limit = -1 # limits per-session temp file space - # in kB, or -1 for no limit +#temp_file_limit = -1 # limits per-process temp file space + # in kB, or -1 for no limit -# - Kernel Resource Usage - +# - Kernel Resources - -#max_files_per_process = 1000 # min 25 - # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) +#max_files_per_process = 1000 # min 25 + # (change requires restart) # - Cost-Based Vacuum Delay - -#vacuum_cost_delay = 0 # 0-100 milliseconds -#vacuum_cost_page_hit = 1 # 0-10000 credits -#vacuum_cost_page_miss = 10 # 0-10000 credits -#vacuum_cost_page_dirty = 20 # 0-10000 credits -#vacuum_cost_limit = 200 # 1-10000 credits +#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) +#vacuum_cost_page_hit = 1 # 0-10000 credits +#vacuum_cost_page_miss = 10 # 0-10000 credits +#vacuum_cost_page_dirty = 20 # 0-10000 credits +#vacuum_cost_limit = 200 # 1-10000 credits # - Background Writer - -#bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round +#bgwriter_delay = 200ms # 10-10000ms between rounds +#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round +#bgwriter_flush_after = 512kB # measured in pages, 0 disables # - Asynchronous Behavior - -#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching -#max_worker_processes = 8 +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching +#max_worker_processes = 8 # (change requires restart) +#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers +#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers +#parallel_leader_participation = on +#max_parallel_workers = 8 # maximum number of max_worker_processes that + # can be used in parallel operations +#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) +#backend_flush_after = 0 # measured in pages, 0 disables #------------------------------------------------------------------------------ -# WRITE AHEAD LOG +# WRITE-AHEAD LOG #------------------------------------------------------------------------------ # - Settings - -#wal_level = minimal # minimal, archive, hot_standby, or logical - # (change requires restart) -#fsync = on # turns forced synchronization on or off -synchronous_commit = off # synchronization level; - # off, local, remote_write, or on -#wal_sync_method = fsync # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -#full_page_writes = on # recover from partial page writes -#wal_compression = off # enable compression of full-page writes -#wal_log_hints = off # also do full page writes of non-critical updates - # (change requires restart) -#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -wal_writer_delay = 300ms # 1-10000 milliseconds +#wal_level = replica # minimal, replica, or logical + # (change requires restart) +#fsync = on # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) +synchronous_commit = off # synchronization level; + # off, local, remote_write, remote_apply, or on +#wal_sync_method = fsync # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux) + # fsync + # fsync_writethrough + # open_sync +#full_page_writes = on # recover from partial page writes +#wal_compression = off # enable compression of full-page writes +#wal_log_hints = off # also do full page writes of non-critical updates + # (change requires restart) +#wal_init_zero = on # zero-fill new WAL files +#wal_recycle = on # recycle WAL files +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +#wal_writer_delay = 200ms # 1-10000 milliseconds +#wal_writer_flush_after = 1MB # measured in pages, 0 disables -#commit_delay = 0 # range 0-100000, in microseconds -#commit_siblings = 5 # range 1-1000 +#commit_delay = 0 # range 0-100000, in microseconds +#commit_siblings = 5 # range 1-1000 # - Checkpoints - -#checkpoint_timeout = 5min # range 30s-1h -#max_wal_size = 1GB -#min_wal_size = 80MB -#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_warning = 30s # 0 disables +#checkpoint_timeout = 5min # range 30s-1d +max_wal_size = 1GB +min_wal_size = 80MB +#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 +#checkpoint_flush_after = 256kB # measured in pages, 0 disables +#checkpoint_warning = 30s # 0 disables # - Archiving - -#archive_mode = off # enables archiving; off, on, or always - # (change requires restart) -#archive_command = '' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -#archive_timeout = 0 # force a logfile segment switch after this - # number of seconds; 0 disables +#archive_mode = off # enables archiving; off, on, or always + # (change requires restart) +#archive_command = '' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +#archive_timeout = 0 # force a logfile segment switch after this + # number of seconds; 0 disables + +# - Archive Recovery - + +# These are only used in recovery mode. + +#restore_command = '' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' + # (change requires restart) +#archive_cleanup_command = '' # command to execute at every restartpoint +#recovery_end_command = '' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +#recovery_target = '' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +#recovery_target_name = '' # the named restore point to which recovery will proceed + # (change requires restart) +#recovery_target_time = '' # the time stamp up to which recovery will proceed + # (change requires restart) +#recovery_target_xid = '' # the transaction ID up to which recovery will proceed + # (change requires restart) +#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed + # (change requires restart) +#recovery_target_inclusive = on # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID + # (change requires restart) +#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' + # (change requires restart) #------------------------------------------------------------------------------ # REPLICATION #------------------------------------------------------------------------------ -# - Sending Server(s) - +# - Sending Servers - # Set these on the master and on any standby that will send replication data. -#max_wal_senders = 0 # max number of walsender processes - # (change requires restart) -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables -#wal_sender_timeout = 60s # in milliseconds; 0 disables +#max_wal_senders = 10 # max number of walsender processes + # (change requires restart) +#wal_keep_segments = 0 # in logfile segments; 0 disables +#wal_sender_timeout = 60s # in milliseconds; 0 disables -#max_replication_slots = 0 # max number of replication slots - # (change requires restart) -#track_commit_timestamp = off # collect timestamp of transaction commit - # (change requires restart) +#max_replication_slots = 10 # max number of replication slots + # (change requires restart) +#track_commit_timestamp = off # collect timestamp of transaction commit + # (change requires restart) # - Master Server - # These settings are ignored on a standby server. -#synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed +#synchronous_standby_names = '' # standby servers that provide sync rep + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name + # from standby(s); '*' = all +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed # - Standby Servers - # These settings are ignored on a master server. -#hot_standby = off # "on" allows queries during recovery - # (change requires restart) -#max_standby_archive_delay = 30s # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -#max_standby_streaming_delay = 30s # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -#wal_receiver_status_interval = 10s # send replies at least this often - # 0 disables -#hot_standby_feedback = off # send info from standby to prevent - # query conflicts -#wal_receiver_timeout = 60s # time that receiver waits for - # communication from master - # in milliseconds; 0 disables -#wal_retrieve_retry_interval = 5s # time to wait before retrying to - # retrieve WAL after a failed attempt +#primary_conninfo = '' # connection string to sending server + # (change requires restart) +#primary_slot_name = '' # replication slot on sending server + # (change requires restart) +#promote_trigger_file = '' # file name whose presence ends recovery +#hot_standby = on # "off" disallows queries during recovery + # (change requires restart) +#max_standby_archive_delay = 30s # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +#max_standby_streaming_delay = 30s # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +#wal_receiver_status_interval = 10s # send replies at least this often + # 0 disables +#hot_standby_feedback = off # send info from standby to prevent + # query conflicts +#wal_receiver_timeout = 60s # time that receiver waits for + # communication from master + # in milliseconds; 0 disables +#wal_retrieve_retry_interval = 5s # time to wait before retrying to + # retrieve WAL after a failed attempt +#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +#max_logical_replication_workers = 4 # taken from max_worker_processes + # (change requires restart) +#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers #------------------------------------------------------------------------------ @@ -279,130 +355,148 @@ wal_writer_delay = 300ms # 1-10000 milliseconds #enable_material = on #enable_mergejoin = on #enable_nestloop = on +#enable_parallel_append = on #enable_seqscan = on #enable_sort = on #enable_tidscan = on +#enable_partitionwise_join = off +#enable_partitionwise_aggregate = off +#enable_parallel_hash = on +#enable_partition_pruning = on # - Planner Cost Constants - -#seq_page_cost = 1.0 # measured on an arbitrary scale -#random_page_cost = 4.0 # same scale as above -#cpu_tuple_cost = 0.01 # same scale as above -#cpu_index_tuple_cost = 0.005 # same scale as above -#cpu_operator_cost = 0.0025 # same scale as above +#seq_page_cost = 1.0 # measured on an arbitrary scale +#random_page_cost = 4.0 # same scale as above +#cpu_tuple_cost = 0.01 # same scale as above +#cpu_index_tuple_cost = 0.005 # same scale as above +#cpu_operator_cost = 0.0025 # same scale as above +#parallel_tuple_cost = 0.1 # same scale as above +#parallel_setup_cost = 1000.0 # same scale as above + +#jit_above_cost = 100000 # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +#jit_inline_above_cost = 500000 # inline small functions if query is + # more expensive than this; -1 disables +#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +#min_parallel_table_scan_size = 8MB +#min_parallel_index_scan_size = 512kB #effective_cache_size = 4GB # - Genetic Query Optimizer - #geqo = on #geqo_threshold = 12 -#geqo_effort = 5 # range 1-10 -#geqo_pool_size = 0 # selects default based on effort -#geqo_generations = 0 # selects default based on effort -#geqo_selection_bias = 2.0 # range 1.5-2.0 -#geqo_seed = 0.0 # range 0.0-1.0 +#geqo_effort = 5 # range 1-10 +#geqo_pool_size = 0 # selects default based on effort +#geqo_generations = 0 # selects default based on effort +#geqo_selection_bias = 2.0 # range 1.5-2.0 +#geqo_seed = 0.0 # range 0.0-1.0 # - Other Planner Options - -#default_statistics_target = 100 # range 1-10000 -#constraint_exclusion = partition # on, off, or partition -#cursor_tuple_fraction = 0.1 # range 0.0-1.0 +#default_statistics_target = 100 # range 1-10000 +#constraint_exclusion = partition # on, off, or partition +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 #from_collapse_limit = 8 -#join_collapse_limit = 8 # 1 disables collapsing of explicit - # JOIN clauses +#join_collapse_limit = 8 # 1 disables collapsing of explicit + # JOIN clauses +#force_parallel_mode = off +#jit = on # allow JIT compilation +#plan_cache_mode = auto # auto, force_generic_plan or + # force_custom_plan #------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING +# REPORTING AND LOGGING #------------------------------------------------------------------------------ # - Where to Log - -log_destination = 'stderr' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. +log_destination = 'stderr' # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. # This is used when logging to stderr: -logging_collector = on # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) +#logging_collector = off # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) # These are only used if logging_collector is on: -log_directory = 'pg_log' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = 'postgresql-%Y-%m-%d.log' # log file name pattern, - # can include strftime() escapes -#log_file_mode = 0600 # creation mode for log files, - # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will - # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. +#log_directory = 'log' # directory where log files are written, + # can be absolute or relative to PGDATA +#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, + # can include strftime() escapes +#log_file_mode = 0600 # creation mode for log files, + # begin with 0 to use octal notation +#log_truncate_on_rotation = off # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. +#log_rotation_age = 1d # Automatic rotation of logfiles will + # happen after that time. 0 disables. +#log_rotation_size = 10MB # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. # These are relevant when logging to syslog: #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' +#syslog_sequence_numbers = on +#syslog_split_messages = on # This is only relevant when logging to eventlog (win32): +# (change requires restart) #event_source = 'PostgreSQL' # - When to Log - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error +#log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic -#log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic +#log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) -#log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds +log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds +#log_transaction_sample_rate = 0.0 # Fraction of transactions whose statements + # are logged regardless of their duration. 1.0 logs all + # statements from all transactions, 0.0 never logs. # - What to Log - @@ -414,59 +508,61 @@ log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements #log_connections = off #log_disconnections = off #log_duration = off -#log_error_verbosity = default # terse, default, or verbose messages +#log_error_verbosity = default # terse, default, or verbose messages #log_hostname = off -log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -#log_lock_waits = off # log lock waits >= deadlock_timeout -#log_statement = 'none' # none, ddl, mod, all +#log_line_prefix = '%m [%p] ' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %n = timestamp with milliseconds (as a Unix epoch) + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' +#log_lock_waits = off # log lock waits >= deadlock_timeout +#log_statement = 'none' # none, ddl, mod, all #log_replication_commands = off -#log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -log_timezone = 'UTC' +#log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files +log_timezone = 'Etc/UTC' +#------------------------------------------------------------------------------ +# PROCESS TITLE +#------------------------------------------------------------------------------ -# - Process Title - - -#cluster_name = '' # added to process titles if nonempty - # (change requires restart) +#cluster_name = '' # added to process titles if nonempty + # (change requires restart) #update_process_title = on #------------------------------------------------------------------------------ -# RUNTIME STATISTICS +# STATISTICS #------------------------------------------------------------------------------ -# - Query/Index Statistics Collector - +# - Query and Index Statistics Collector - #track_activities = on #track_counts = on #track_io_timing = off -#track_functions = none # none, pl, all -#track_activity_query_size = 1024 # (change requires restart) -stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp' +#track_functions = none # none, pl, all +#track_activity_query_size = 1024 # (change requires restart) +#stats_temp_directory = 'pg_stat_tmp' -# - Statistics Monitoring - +# - Monitoring - #log_parser_stats = off #log_planner_stats = off @@ -475,35 +571,35 @@ stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp' #------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS +# AUTOVACUUM #------------------------------------------------------------------------------ -#autovacuum = on # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -#autovacuum_max_workers = 3 # max number of autovacuum subprocesses - # (change requires restart) -#autovacuum_naptime = 1min # time between autovacuum runs -#autovacuum_vacuum_threshold = 50 # min number of row updates before - # vacuum -#autovacuum_analyze_threshold = 50 # min number of row updates before - # analyze -#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum -#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze -#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum - # (change requires restart) -#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age - # before forced vacuum - # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit +#autovacuum = on # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses + # (change requires restart) +#autovacuum_naptime = 1min # time between autovacuum runs +#autovacuum_vacuum_threshold = 50 # min number of row updates before + # vacuum +#autovacuum_analyze_threshold = 50 # min number of row updates before + # analyze +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum + # (change requires restart) +#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age + # before forced vacuum + # (change requires restart) +#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit #------------------------------------------------------------------------------ @@ -512,22 +608,38 @@ stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp' # - Statement Behavior - -#search_path = '"$user", public' # schema names -#default_tablespace = '' # a tablespace name, '' uses the default -#temp_tablespaces = '' # a list of tablespace names, '' uses - # only default tablespace +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +#search_path = '"$user", public' # schema names +#row_security = on +#default_tablespace = '' # a tablespace name, '' uses the default +#temp_tablespaces = '' # a list of tablespace names, '' uses + # only default tablespace +#default_table_access_method = 'heap' #check_function_bodies = on #default_transaction_isolation = 'read committed' #default_transaction_read_only = off #default_transaction_deferrable = off #session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#lock_timeout = 0 # in milliseconds, 0 is disabled +#statement_timeout = 0 # in milliseconds, 0 is disabled +#lock_timeout = 0 # in milliseconds, 0 is disabled +#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled #vacuum_freeze_min_age = 50000000 #vacuum_freeze_table_age = 150000000 #vacuum_multixact_freeze_min_age = 5000000 #vacuum_multixact_freeze_table_age = 150000000 -#bytea_output = 'hex' # hex, escape +#vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples + # before index cleanup, 0 always performs + # index cleanup +#bytea_output = 'hex' # hex, escape #xmlbinary = 'base64' #xmloption = 'content' #gin_fuzzy_search_limit = 0 @@ -537,33 +649,39 @@ stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp' datestyle = 'iso, mdy' #intervalstyle = 'postgres' -timezone = 'UTC' +timezone = 'Etc/UTC' #timezone_abbreviations = 'Default' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 -#client_encoding = sql_ascii # actually, defaults to database - # encoding + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +#extra_float_digits = 1 # min -15, max 3; any value >0 actually + # selects precise output mode +#client_encoding = sql_ascii # actually, defaults to database + # encoding # These settings are initialized by initdb, but they can be changed. -lc_messages = 'C' # locale for system error message - # strings -lc_monetary = 'C' # locale for monetary formatting -lc_numeric = 'C' # locale for number formatting -lc_time = 'C' # locale for time formatting +lc_messages = 'en_US.utf8' # locale for system error message + # strings +lc_monetary = 'en_US.utf8' # locale for monetary formatting +lc_numeric = 'en_US.utf8' # locale for number formatting +lc_time = 'en_US.utf8' # locale for time formatting # default configuration for text search default_text_search_config = 'pg_catalog.english' +# - Shared Library Preloading - + +#shared_preload_libraries = '' # (change requires restart) +#local_preload_libraries = '' +#session_preload_libraries = '' +#jit_provider = 'llvmjit' # JIT library to use + # - Other Defaults - #dynamic_library_path = '$libdir' -#local_preload_libraries = '' -#session_preload_libraries = '' #------------------------------------------------------------------------------ @@ -571,29 +689,28 @@ default_text_search_config = 'pg_catalog.english' #------------------------------------------------------------------------------ #deadlock_timeout = 1s -#max_locks_per_transaction = 64 # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -#max_pred_locks_per_transaction = 64 # min 10 - # (change requires restart) +#max_locks_per_transaction = 64 # min 10 + # (change requires restart) +#max_pred_locks_per_transaction = 64 # min 10 + # (change requires restart) +#max_pred_locks_per_relation = -2 # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +#max_pred_locks_per_page = 2 # min 0 #------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY +# VERSION AND PLATFORM COMPATIBILITY #------------------------------------------------------------------------------ # - Previous PostgreSQL Versions - #array_nulls = on -#backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off +#backslash_quote = safe_encoding # on, off, or safe_encoding #escape_string_warning = on #lo_compat_privileges = off #operator_precedence_warning = off #quote_all_identifiers = off -#sql_inheritance = on #standard_conforming_strings = on #synchronize_seqscans = on @@ -606,8 +723,11 @@ default_text_search_config = 'pg_catalog.english' # ERROR HANDLING #------------------------------------------------------------------------------ -#exit_on_error = off # terminate session on any error? -#restart_after_crash = on # reinitialize after backend crash? +#exit_on_error = off # terminate session on any error? +#restart_after_crash = on # reinitialize after backend crash? +#data_sync_retry = off # retry or panic on failure to fsync + # data? + # (change requires restart) #------------------------------------------------------------------------------ @@ -615,12 +735,13 @@ default_text_search_config = 'pg_catalog.english' #------------------------------------------------------------------------------ # These options allow settings to be loaded from files other than the -# default postgresql.conf. +# default postgresql.conf. Note that these are directives, not variable +# assignments, so they can usefully be given more than once. -#include_dir = 'conf.d' # include files ending in '.conf' from - # directory 'conf.d' -#include_if_exists = 'exists.conf' # include file only if it exists -#include = 'special.conf' # include file +#include_dir = '...' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +#include_if_exists = '...' # include file only if it exists +#include = '...' # include file #------------------------------------------------------------------------------ @@ -628,3 +749,5 @@ default_text_search_config = 'pg_catalog.english' #------------------------------------------------------------------------------ # Add settings for extensions here + + diff --git a/docker/devenv/files/start.sh b/docker/devenv/files/start.sh index 4a8976d52..118065e1a 100755 --- a/docker/devenv/files/start.sh +++ b/docker/devenv/files/start.sh @@ -10,8 +10,7 @@ tmux send-keys -t uxbox 'clojure -Adev tools.clj figwheel' enter tmux new-window -t uxbox:2 -n 'backend' tmux select-window -t uxbox:2 tmux send-keys -t uxbox 'cd uxbox/backend' enter C-l -# tmux send-keys -t uxbox 'clojure -Adev -m uxbox.fixtures' enter C-l -tmux send-keys -t uxbox 'clojure -Adev:repl' enter +tmux send-keys -t uxbox './bin/start' enter tmux rename-window -t uxbox:0 'gulp' tmux select-window -t uxbox:0 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 34d87123d..75c172a7f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -14,7 +14,7 @@ networks: services: postgres: - image: postgres:11 + image: postgres:12 restart: always stop_signal: SIGINT ports: @@ -26,46 +26,51 @@ services: - POSTGRES_PASSWORD=uxbox_postgres_password volumes: - postgres_data:/var/lib/postgresql/data - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro backend: image: uxbox-backend:latest restart: always depends_on: - postgres + - smtp ports: - 6060 volumes: - backend_data:/srv/uxbox/data - backend_m2:/root/.m2 - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro + environment: # HTTP setup - - UXBOX_HTTP_SERVER_DEBUG=false - UXBOX_HTTP_SERVER_CORS=* + + # Media & Assets - UXBOX_MEDIA_URI="/media/" - UXBOX_ASSETS_URI="/static/" - UXBOX_MEDIA_DIRECTORY="data/media" - UXBOX_ASSETS_DIRECTORY="data/static" - # Database setup - - UXBOX_DATABASE_URI="jdbc:postgresql://postgres/uxbox" + + # Database setup (using the `postgres` container) + - UXBOX_DATABASE_URI="postgresql://postgres/uxbox" - UXBOX_DATABASE_USERNAME="uxbox" - UXBOX_DATABASE_PASSWORD="uxbox_postgres_password" + # Mail setup - UXBOX_EMAIL_REPLY_TO="no-reply@uxbox.io" - UXBOX_EMAIL_FROM="no-reply@uxbox.io" - # STMP setup - - UXBOX_SMTP_HOST="localhost" + + # STMP setup (using the `smtp` container) + - UXBOX_SMTP_HOST="smtp" - UXBOX_SMTP_PORT=25 - UXBOX_SMTP_USER="uxbox" - - UXBOX_SMTP_PASSWORD="youshouldoverwritethiswithsomethingelse" + # - UXBOX_SMTP_PASSWORD="" - UXBOX_SMTP_SSL=false - UXBOX_SMTP_TLS=false - UXBOX_SMTP_ENABLED=false - # Security setup - - UXBOX_SECRET="foobar" + + ## Security setup + # Overwrite with a randomy generated string. Mainly used as + # shared key for sign cookies, tokens, etc. + - UXBOX_SECRET="the very secret string" frontend: image: uxbox-frontend:latest @@ -76,8 +81,6 @@ services: - 8080:8080 volumes: - backend_data:/srv/uxbox/ - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro frontend-dev: image: uxbox-frontend-dbg:latest @@ -88,6 +91,12 @@ services: - 8081:8080 volumes: - backend_data:/srv/uxbox/ - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro + + smtp: + image: mwader/postfix-relay + restart: always + environment: + - POSTFIX_myhostname=smtp.uxbox.io + - OPENDKIM_DOMAINS=smtp.uxbox.io + diff --git a/frontend/deps.edn b/frontend/deps.edn index ca09fff0c..65a259917 100644 --- a/frontend/deps.edn +++ b/frontend/deps.edn @@ -1,30 +1,39 @@ -{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"} - org.clojure/clojure {:mvn/version "1.10.1"} - com.cognitect/transit-cljs {:mvn/version "0.8.256"} +{:deps + {org.clojure/clojurescript {:mvn/version "1.10.597"} + org.clojure/clojure {:mvn/version "1.10.1"} + com.cognitect/transit-cljs {:mvn/version "0.8.256"} - cljsjs/react-dom-server {:mvn/version "16.9.0-0"} + cljsjs/react {:mvn/version "16.11.0-0"} + cljsjs/react-dom {:mvn/version "16.11.0-0"} + cljsjs/react-dom-server {:mvn/version "16.11.0-0"} - environ/environ {:mvn/version "1.1.0"} - metosin/reitit-core {:mvn/version "0.3.10"} - expound/expound {:mvn/version "0.7.2"} + environ/environ {:mvn/version "1.1.0"} + metosin/reitit-core {:mvn/version "0.3.10"} + expound/expound {:mvn/version "0.7.2"} - funcool/beicon {:mvn/version "5.1.0"} - funcool/cuerdas {:mvn/version "2.2.0"} - funcool/lentes {:mvn/version "1.3.3"} - funcool/potok {:mvn/version "2.7.0"} - funcool/promesa {:mvn/version "4.0.2"} - funcool/rumext {:mvn/version "2.0.0-SNAPSHOT"} - } + funcool/beicon {:mvn/version "5.1.0"} + funcool/cuerdas {:mvn/version "2.2.0"} + funcool/lentes {:mvn/version "1.3.3"} + funcool/potok {:mvn/version "2.7.0"} + funcool/promesa {:mvn/version "4.0.2"} + funcool/rumext {:mvn/version "2.0.0-SNAPSHOT"} + } :paths ["src" "vendor" "resources"] :aliases - {:dev {:extra-deps {com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"} - com.bhauman/rebel-readline {:mvn/version "0.1.4"} - com.bhauman/figwheel-main {:mvn/version "0.2.3"} - org.clojure/tools.namespace {:mvn/version "0.3.1"}} - :extra-paths ["test"]} + {:dev + {:extra-deps + {com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"} + com.bhauman/rebel-readline {:mvn/version "0.1.4"} + com.bhauman/figwheel-main {:mvn/version "0.2.3"} + org.clojure/tools.namespace {:mvn/version "0.3.1"}} + :extra-paths ["test"]} + + :repl + {:main-opts ["-m" "rebel-readline.main"]} + + :ancient + {:main-opts ["-m" "deps-ancient.deps-ancient"] + :extra-deps {deps-ancient {:mvn/version "RELEASE"}}} - :repl {:main-opts ["-m" "rebel-readline.main"]} - :ancient {:main-opts ["-m" "deps-ancient.deps-ancient"] - :extra-deps {deps-ancient {:mvn/version "RELEASE"}}} }} diff --git a/frontend/src/uxbox/main/ui/dashboard/icons.cljs b/frontend/src/uxbox/main/ui/dashboard/icons.cljs index 25f76195c..2e8ed2a9d 100644 --- a/frontend/src/uxbox/main/ui/dashboard/icons.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/icons.cljs @@ -149,7 +149,7 @@ [:ul.library-elements (when own? [:li - [:a.btn-primary {:on-click #(st/emit! (di/create-collection))} + [:a.btn-primary {:on-click #(st/emit! di/create-collection)} (tr "ds.icons-collection.new")]]) (when own? [:& nav-item {:selected? (nil? id)}]) diff --git a/frontend/tools.clj b/frontend/tools.clj index a204050e6..8577970a0 100644 --- a/frontend/tools.clj +++ b/frontend/tools.clj @@ -49,14 +49,11 @@ (def main-build-options {:output-dir "resources/public/js" :asset-path "/js" - :modules {:common {:entries #{} - :output-to "resources/public/js/common.js"} - :main {:entries #{"uxbox.main"} - :output-to "resources/public/js/main.js" - :depends-on #{:common}} + :modules {:main {:entries #{"uxbox.main"} + :output-to "resources/public/js/main.js"} :view {:entries #{"uxbox.view"} :output-to "resources/public/js/view.js" - :depends-on #{:common}}}}) + }}}) (def worker-build-options {:main 'uxbox.worker @@ -70,7 +67,6 @@ main-build-options dist-build-options) (assoc :output-dir "dist/js") - (assoc-in [:modules :common :output-to] "dist/js/common.js") (assoc-in [:modules :main :output-to] "dist/js/main.js") (assoc-in [:modules :view :output-to] "dist/js/view.js"))) @@ -99,7 +95,7 @@ (defmethod task "dist:main" [args] (let [cfg main-dist-build-options] - ;; (pprint cfg) + (pprint cfg) (api/build (api/inputs "src") cfg))) (defmethod task "dist:worker" diff --git a/manage.sh b/manage.sh index 896c62ca6..7251762be 100755 --- a/manage.sh +++ b/manage.sh @@ -92,19 +92,29 @@ function build-frontend-local { } function build-frontend-image { + echo "#############################################" + echo "## START build 'uxbox-frontend' image. ##" + echo "#############################################" build-frontend-local "dist" || exit 1; - rm -rf docker/frontend/dist || exit 1; - cp -vr frontend/dist docker/frontend/ || exit 1; + # rm -rf docker/frontend/dist || exit 1; + # cp -vr frontend/dist docker/frontend/ || exit 1; - docker build --rm=true \ - -t uxbox-frontend:$REV \ - -t uxbox-frontend:latest \ - docker/frontend/; + # docker build --rm=true \ + # -t uxbox-frontend:$REV \ + # -t uxbox-frontend:latest \ + # docker/frontend/; - rm -rf docker/frontend/dist || exit 1; + # rm -rf docker/frontend/dist || exit 1; + echo "#############################################" + echo "## END build 'uxbox-frontend' image. ##" + echo "#############################################" } function build-frontend-dbg-image { + echo "#############################################" + echo "## START build 'uxbox-frontend-dbg' image. ##" + echo "#############################################" + build-frontend-local "dbg-dist" || exit 1; rm -rf docker/frontend/dist || exit 1; cp -vr frontend/dist docker/frontend/ || exit 1; @@ -115,6 +125,11 @@ function build-frontend-dbg-image { docker/frontend/; rm -rf docker/frontend/dist || exit 1; + + echo "#############################################" + echo "## END build 'uxbox-frontend-dbg' image. ##" + echo "#############################################" + } function build-backend-local { @@ -132,6 +147,10 @@ function build-backend-local { } function build-backend-image { + echo "#############################################" + echo "## START build 'uxbox-backend' image. ##" + echo "#############################################" + build-backend-local || exit 1; rm -rf docker/backend/dist || exit 1; cp -vr backend/dist docker/backend/ || exit 1; @@ -142,6 +161,11 @@ function build-backend-image { docker/backend/; rm -rf docker/backend/dist || exit 1; + + echo "#############################################" + echo "## END build 'uxbox-backend' image. ##" + echo "#############################################" + } function build-images { @@ -176,6 +200,10 @@ function log { docker-compose -p uxbox -f docker/docker-compose.yml logs -f --tail=50 } +function log-devenv { + docker-compose -p uxbox-devenv -f docker/devenv/docker-compose.yaml logs -f --tail=50 +} + function stop { echo "Stoping containers..." docker-compose -p uxbox -f ./docker/docker-compose.yml stop @@ -225,6 +253,9 @@ case $1 in stop-devenv) stop-devenv ${@:2} ;; + log-devenv) + log-devenv ${@:2} + ;; ## testin related commands