Skip to content

Commit

Permalink
Merge pull request #194 from Flexiana/yogthos-config-update
Browse files Browse the repository at this point in the history
update yougthous config, bump version (0.4.0-rc1), rename config keys to `:xiana/...`
  • Loading branch information
Stas Makarov authored Feb 3, 2022
2 parents 950f256 + e38d66f commit a793cb4
Show file tree
Hide file tree
Showing 57 changed files with 434 additions and 615 deletions.
29 changes: 15 additions & 14 deletions .cljstyle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{:rules
{:whitespace {:remove-surrounding? true
:remove-trailing? true
:insert-missing? true}
:blank-lines {:padding-lines 1
:max-consecutive 1
:insert-padding true
:trim-consecutive? true}
:types {:enabled? false}
:functions {:enabled? false}
:eof-new-line {:enabled? true}
:namespaces {:enabled? true
:break-libs true
:indent-size 2}}}
{:files {:ignore #{"checkouts" "target"}
:extensions #{"clj" "edn"}}
:rules {:whitespace {:remove-surrounding? true
:remove-trailing? true
:insert-missing? true}
:blank-lines {:padding-lines 1
:max-consecutive 1
:insert-padding true
:trim-consecutive? true}
:types {:enabled? false}
:functions {:enabled? false}
:eof-new-line {:enabled? true}
:namespaces {:enabled? true
:break-libs true
:indent-size 2}}}
50 changes: 25 additions & 25 deletions config/dev/config.edn
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{:framework.db.storage/postgresql {:port 5432
:dbname "framework"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}
:framework.app/web-server {:port 3000
:join? false}
:framework.db.storage/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}
:framework.app/emails {:host ""
:user ""
:pass ""
:tls true
:port 587
:from ""}
:framework.app/auth {:hash-algorithm :bcrypt ;; Available values: :bcrypt, :scrypt, and :pbkdf2
:bcrypt-settings {:work-factor 11}
:scrypt-settings {:cpu-cost 32768 ;; Must be a power of 2
:memory-cost 8
:parallelization 1}
:pbkdf2-settings {:type :sha1 ;; Available values: :sha1 and :sha256
:iterations 100000}}}
{:xiana/postgresql {:port 5432
:dbname "framework"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}
:xiana/web-server {:port 3000
:join? false}
:xiana/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}
:xiana/emails {:host ""
:user ""
:pass ""
:tls true
:port 587
:from ""}
:xiana/auth {:hash-algorithm :bcrypt ; Available values: :bcrypt, :scrypt, and :pbkdf2
:bcrypt-settings {:work-factor 11}
:scrypt-settings {:cpu-cost 32768 ; Must be a power of 2
:memory-cost 8
:parallelization 1}
:pbkdf2-settings {:type :sha1 ; Available values: :sha1 and :sha256
:iterations 100000}}}
52 changes: 26 additions & 26 deletions config/test/config.edn
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{:framework.db.storage/postgresql {:image-name "postgres:14-alpine"
:port 5432
:dbname "framework"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}
:framework.app/web-server {:port 3333
:join? false}
:framework.db.storage/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}
:framework.app/emails {:host ""
:user ""
:pass ""
:tls true
:port 587
:from ""}
:framework.app/auth {:hash-algorithm :bcrypt ;; Available values: :bcrypt, :scrypt, and :pbkdf2
:bcrypt-settings {:work-factor 11}
:scrypt-settings {:cpu-cost 32768 ;; Must be a power of 2
:memory-cost 8
:parallelization 1}
:pbkdf2-settings {:type :sha1 ;; Available values: :sha1 and :sha256
:iterations 100000}}}
{:xiana/postgresql {:image-name "postgres:14-alpine"
:port 5432
:dbname "framework"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}
:xiana/web-server {:port 3333
:join? false}
:xiana/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}
:xiana/emails {:host ""
:user ""
:pass ""
:tls true
:port 587
:from ""}
:xiana/auth {:hash-algorithm :bcrypt ; Available values: :bcrypt, :scrypt, and :pbkdf2
:bcrypt-settings {:work-factor 11}
:scrypt-settings {:cpu-cost 32768 ; Must be a power of 2
:memory-cost 8
:parallelization 1}
:pbkdf2-settings {:type :sha1 ; Available values: :sha1 and :sha256
:iterations 100000}}}
3 changes: 3 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*/.shadow-cljs/
*/node_modules/
*/resources/public/js/
2 changes: 0 additions & 2 deletions examples/acl/Docker/db.Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions examples/acl/Docker/init.sql

This file was deleted.

5 changes: 3 additions & 2 deletions examples/acl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ API implementation for ACL example

### Prepare

- start postgres with docker-compose, or with `postgres-start.sh` shell-script
- apply tables and default users with `lein migratus migrate`
start postgres with docker-compose:

docker compose up -d

### Run application

Expand Down
132 changes: 57 additions & 75 deletions examples/acl/config/dev/config.edn
Original file line number Diff line number Diff line change
@@ -1,77 +1,59 @@
{:framework.db.storage/postgresql {:port 5433
:dbname "acl"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}
{:xiana/postgresql {:port 5433
:dbname "acl"
:host "localhost"
:dbtype "postgresql"
:user "postgres"
:password "postgres"}

:framework.db.storage/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}
:xiana/migration {:store :database
:migration-dir "resources/migrations"
:init-in-transaction? false
:migration-table-name "migrations"}

:framework.app/ring {:defaults {:params {:urlencoded true
:multipart true
:nested true
:keywordize true}
:cookies true
:session {:flash true
:cookie-attrs
{:http-only true, :same-site :strict}}
:security {:anti-forgery true
:xss-protection
{:enable? true, :mode :block}
:frame-options :sameorigin
:content-type-options :nosniff}
:static {:resources "public"}
:responses {:not-modified-responses true
:absolute-redirects true
:content-types true}}}

:framework.app/web-server {:port 3000
:join? false}
:framework.app/role-set {:resources [:posts :comments :users]
:actions {:posts [:read :create :update :delete :comment :react]
:comments [:read :create :update :delete :reply :react]
:users [:read :create :update :delete :ban]}
:roles {:guest {:posts {:read :all}
:comments {:read :all}}
:member {:posts {:read :all
:comment :friends
:react :friends
:create :own
:update :own
:delete :own}
:comments {:read :all
:create :own
:update :own
:delete :own
:reply :friends
:react :friends}
:users {:read :all
:create :own
:update :own
:delete :own}}
:staff {:posts {:read :all
:delete :all}
:comments {:read :all
:delete :all}
:users {:read :all
:delete :ban}}
:superuser {:posts {:read :all
:comment :all
:react :all
:create :all
:update :all
:delete :all}
:comments {:read :all
:create :all
:update :all
:delete :all
:reply :all
:react :all}
:users {:read :all
:create :all
:update :all
:delete :all
:ban :all}}}}}
:xiana/web-server {:port 3000
:join? false}
:xiana/role-set {:resources [:posts :comments :users]
:actions {:posts [:read :create :update :delete :comment :react]
:comments [:read :create :update :delete :reply :react]
:users [:read :create :update :delete :ban]}
:roles {:guest {:posts {:read :all}
:comments {:read :all}}
:member {:posts {:read :all
:comment :friends
:react :friends
:create :own
:update :own
:delete :own}
:comments {:read :all
:create :own
:update :own
:delete :own
:reply :friends
:react :friends}
:users {:read :all
:create :own
:update :own
:delete :own}}
:staff {:posts {:read :all
:delete :all}
:comments {:read :all
:delete :all}
:users {:read :all
:delete :ban}}
:superuser {:posts {:read :all
:comment :all
:react :all
:create :all
:update :all
:delete :all}
:comments {:read :all
:create :all
:update :all
:delete :all
:reply :all
:react :all}
:users {:read :all
:create :all
:update :all
:delete :all
:ban :all}}}}}
Loading

0 comments on commit a793cb4

Please sign in to comment.