refactor: вся основа кода в отдельной папке
This commit is contained in:
20
R/utils/init_login_db.r
Normal file
20
R/utils/init_login_db.r
Normal 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"
|
||||
)
|
||||
Reference in New Issue
Block a user