-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall-nextcloud-sandbox.rb
More file actions
executable file
·32 lines (28 loc) · 1.04 KB
/
install-nextcloud-sandbox.rb
File metadata and controls
executable file
·32 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env ruby
require 'stringio'
STDERR.puts "Installing user_external app in Sandbox Nextcloud..."
system("./config.rb run nextcloud php occ app:install user_external")
STDERR.puts "Activating HTTP Basic Authentication Fallback for Sandbox Nextcloud..."
config = StringIO.open do |io|
File.open('data/nextcloud/config/config.php') do |f|
f.each_line do |line|
if line.include?('OC_User_BasicAuth')
STDERR.puts "OC_User_BasicAuth already present in config, exiting..."
exit(1)
end
if line.strip == ');'
io.puts " 'user_backends' => array("
io.puts " array("
io.puts " 'class' => 'OC_User_BasicAuth',"
io.puts " 'arguments' => array('http://nginx/nc_auth'),"
io.puts " ),"
io.puts " ),"
end
io.puts line
end
end
io.string
end
File.open('data/nextcloud/config/config.php', 'w') do |f|
f.write(config)
end