feat: add convenience batch file
This commit is contained in:
parent
20d037b1e8
commit
910dadf061
@ -25,29 +25,38 @@ process
|
||||
|
||||
Copy-Item $MyInvocation.MyCommand.Path $Path -Force | Out-Null
|
||||
|
||||
Write-Warning "Initializing Database"
|
||||
$null = filebrowser config init -d $db_path -c $config_path | Out-Null
|
||||
|
||||
filebrowser users add guest "" `
|
||||
--perm.download=true `
|
||||
--perm.admin=false `
|
||||
--perm.delete=false `
|
||||
--perm.execute=false `
|
||||
--perm.modify=false `
|
||||
--perm.rename=false `
|
||||
--perm.share=false `
|
||||
--perm.create=false `
|
||||
--locale=de `
|
||||
--viewMode 'list' `
|
||||
--scope "." `
|
||||
--lockPassword `
|
||||
-d $db_path `
|
||||
-c $config_path | Out-Null
|
||||
Write-Warning "Folgender Ordner ist nun öffentlich zugänglich: $Path"
|
||||
Write-Warning "Creating 'guest' User"
|
||||
$filebrowserArgs = @(
|
||||
'users',
|
||||
'add',
|
||||
'guest', '""',
|
||||
'--perm.download=true',
|
||||
'--perm.admin=false',
|
||||
'--perm.delete=false',
|
||||
'--perm.execute=false',
|
||||
'--perm.modify=false',
|
||||
'--perm.rename=false',
|
||||
'--perm.share=false',
|
||||
'--perm.create=false',
|
||||
'--locale=de',
|
||||
'--viewMode', 'list',
|
||||
'--scope', ".",
|
||||
'--lockPassword',
|
||||
'-d', $db_path,
|
||||
'-c', $config_path)
|
||||
|
||||
& filebrowser @filebrowserArgs | Out-Null
|
||||
|
||||
Write-Warning "Folgender Ordner ist nun oeffentlich zugaenglich: $Path"
|
||||
filebrowser -r $Path -d $db_path -c $config_path -a "0.0.0.0"
|
||||
}
|
||||
|
||||
begin
|
||||
{
|
||||
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
|
||||
$config_json = '{
|
||||
"settings": {
|
||||
"signup": false,
|
||||
@ -150,7 +159,7 @@ begin
|
||||
|
||||
Set-Alias 'filebrowser' $filebrowser_exe
|
||||
$config_path = Join-Path $app_dir 'config.json'
|
||||
$config_json > $config_path
|
||||
$config_json | Set-Content -Path $config_path
|
||||
|
||||
$db_path = Join-Path $app_dir "filebrowser.db"
|
||||
if(Test-Path $db_path -PathType Leaf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user