This I already have, but itβs not (yet?) published. Itβs built using the source code of GenieAuthentication and GenieAuthorisation, but has been heavily modified. I still need to complete the password reset functionality via email and implement multi-factor authentication and more security things.
xxx@xxx:~/.julia/dev/AuthPlugin$ tree # Small adjustments
βββ files
β βββ app
β β βββ layouts
β β β βββ authapp.jl.html
β β β βββ authapp_stipple.jl.html
β β βββ resources
β β βββ accounts
β β β βββ AccountsController.jl
β β β βββ views
β β β βββ account_index.jl.html
β β βββ admins
β β β βββ AdminsController.jl
β β β βββ views
β β β βββ index.jl.html
β β βββ legals
β β β βββ LegalsController.jl
β β β βββ views
β β β βββ imprint.jl.html
β β β βββ privacy.jl.html
β β βββ mains
β β β βββ MainsController.jl
β β β βββ views
β β β βββ index.jl.html
β β βββ panels
β β βββ PanelsController.jl
β β βββ views
β β βββ panels.jl
β βββ config
β β βββ initializers
β β βββ authplugin_init.jl
β βββ locales
β β βββ de
β β βββ en
β β βββ accounts.toml
β β βββ admins.toml
β β βββ layout.toml
β β βββ legals.toml
β β βββ mains.toml
β βββ plugins
β β βββ authplugin.jl
β βββ public
β βββ css
β βββ authpluginstyle.css
βββ index.md
βββ LICENSE
βββ Manifest.toml
βββ Project.toml
βββ README.md
βββ src
β βββ Authentication.jl
β βββ Authorisation.jl
β βββ AuthPlugin.jl
β βββ install.jl
β βββ internal
β β βββ AuthautoRoutes.jl
β β βββ db
β β β βββ migrations
β β β β βββ 2019052410085235_create_table_users.jl
β β β β βββ 2021061519495560_create_table_roles.jl
β β β β βββ 2021061519503270_create_table_permissions.jl
β β β β βββ 2021061519532446_create_table_roles_users.jl
β β β β βββ 2021061519540214_create_table_permissions_roles.jl
β β β β βββ 2024010112000000_create_table_bananas.jl
β β β βββ seeds
β β β βββ AuthSeeds.jl
β β βββ helpers
β β β βββ AuthenticationViewHelper.jl
β β βββ locales
β β β βββ de
β β β β βββ authentication.toml
β β β β βββ mailers.toml
β β β β βββ users.toml
β β β βββ en
β β β β βββ authentication.toml
β β β β βββ mailers.toml
β β β β βββ users.toml
β β β βββ es
β β β β βββ authentication.toml
β β β β βββ mailers.toml
β β β β βββ users.toml
β β β βββ fr
β β β βββ authentication.toml
β β β βββ mailers.toml
β β β βββ users.toml
β β βββ resources
β β βββ authentication
β β β βββ AuthenticationController.jl
β β β βββ views
β β β βββ forgot.jl.html
β β β βββ login.jl.html
β β β βββ register.jl.html
β β β βββ reset.jl.html
β β β βββ success.jl.html
β β βββ users
β β βββ UsersController.jl
β β βββ Users.jl
β β βββ UsersValidator.jl
β β βββ views
β β βββ admin_access_index.jl.html
β β βββ admin_permissions_edit.jl.html
β β βββ admin_permissions_index.jl.html
β β βββ admin_permissions_new.jl.html
β β βββ admin_roles_edit.jl.html
β β βββ admin_roles_index.jl.html
β β βββ admin_roles_new.jl.html
β β βββ admin_users_edit.jl.html
β β βββ admin_users_index.jl.html
β β βββ admin_users_new.jl.html
β β βββ edit.jl.html
β β βββ index.jl.html
β βββ Mailers.jl
β βββ SearchLightExt.jl
βββ test
βββ runtests.jl
This app basically keeps most of the user management in the plugin, so updating is easier. The one how installs it can modify the accounts and admins resources and has some other nice template files to edit.
Installing is simple:
julia> using Genie, AuthPlugin, SearchLight
julia> # Create a new MVC APP with Genie Generator
julia> AuthPlugin.install(@__DIR__; force=true)
julia> SearchLight.Migrations.init()
julia> AuthPlugin.SearchLightExt.all_up_for!!(AuthPlugin) # run all plugin migrations
julia> AuthPlugin.seed_admin_account!() # create an βadminβ user
julia> AuthPlugin.seed_permissions_and_roles!() # populate users/roles/perms
The layout can be modified by adjusting a constant dict using plugins/authplugin.jl in his app.
AuthPlugin.LAYOUT[:user] = "authapp.jl.html" # "authapp_stipple.jl.html"
AuthPlugin.LAYOUT[:admin] = "authapp.jl.html" # "authapp_stipple.jl.html"
and so forthβ¦
I also have a nice bash script for deployment which does basically this (the real script is a little different):
But I do believe that having a ready container where you only need to define a new Stipple app and can adjust other pages via a pagebuilder like in Wordpress is easier for most. And this is where your new package might be handy.
Then one just needs to have a docker file like this (untested) in a folder and the respective Caddyfile:
services:
web:
image: genieframework:latest
container_name: genieframework
restart: always
environment:
GENIE_ENV: prod
volumes:
- genie_db:/app/db/prod.sqlite3
#- geniedata ?
secrets:
- genie_secret
- openai_api_key
caddy:
image: caddy:latest
container_name: caddy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
secrets:
genie_secret:
file: /home/thisuser/.secrets/GENIE_SECRET.txt
openai_api_key:
file: /home/thisuser/.secrets/OPENAI_API_KEY.txt
volumes:
db:
#geniedata: ?
caddy_data:
caddy_config:
thiswebsite.de {
reverse_proxy web:8000
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
}
tls max.mustermann@musterdomain.de
}
and one has just to do:
cd ~/genieapp
docker compose up -d
But this is kind of a whole new product based on the Framework and needs much time to be implemented.
Here are some screenshots. I know that the design could be betterβ¦ but itβs work in progress.