refactor: вся основа кода в отдельной папке

This commit is contained in:
2026-06-15 16:24:42 +03:00
parent 2ececc8029
commit e6e15392c3
11 changed files with 26 additions and 26 deletions

20
R/utils/init_login_db.r Normal file
View File

@@ -0,0 +1,20 @@
# script to setup authentification database (using shinymanager)
# SETUP AUTH =============================
# Init DB using credentials data
credentials <- data.frame(
user = c("admin", "user", "user2"),
password = c("admin", "user", "user2"),
# password will automatically be hashed
admin = c(TRUE, FALSE, FALSE),
scheme_access = c(NA, "all", "example_of_scheme"), # NA - none | all - all | string with seperate
stringsAsFactors = FALSE
)
# Init the database
shinymanager::create_db(
credentials_data = credentials,
sqlite_path = "auth.sqlite", # will be created
passphrase = Sys.getenv("AUTH_DB_KEY")
# passphrase = "passphrase_wihtout_keyring"
)