Compare commits
110 commits
richir-add
...
main
Author | SHA1 | Date | |
---|---|---|---|
1a41a66355 | |||
da7be10d58 | |||
44e398a418 | |||
d903f4f90d | |||
ad13e65250 | |||
b63229092c | |||
4b3c189481 | |||
8d57b773a0 | |||
3c815b9a38 | |||
55cc71871f | |||
46f1330b5c | |||
d774349950 | |||
249fe90c54 | |||
87b6ea8ddb | |||
dc39cb5d85 | |||
beff4242ac | |||
cc31a2f038 | |||
6a63031f84 | |||
1c3eecdd85 | |||
16c4f3650c | |||
57b90cced4 | |||
4e67d6f1b8 | |||
9bb2afa68b | |||
26ea8e8e8d | |||
5c42f9d7d2 | |||
f87fac3c3b | |||
582d88d2f1 | |||
4f84f71070 | |||
4caed83e80 | |||
38174166a0 | |||
3b42817c57 | |||
5950751c73 | |||
d010d27f20 | |||
d5c3486425 | |||
1aea2f5674 | |||
0b3a2d43cb | |||
4b952bac40 | |||
e150fa3625 | |||
3579682de8 | |||
8f090bfcac | |||
0e189ad0ef | |||
e27cf34987 | |||
17d8d8b2de | |||
3fbfe26c66 | |||
4a6d35b984 | |||
ef1eb5b4ad | |||
dc5b61c9e6 | |||
33389e842a | |||
bb7ab09db8 | |||
bc481d44d5 | |||
5619cb8270 | |||
fbe409efff | |||
9096bf7c33 | |||
1c38cfbf3c | |||
d332a810b9 | |||
74da008b5e | |||
a6eaddbd8f | |||
0da62f097d | |||
ed3d4b1b9c | |||
bb44e6da8f | |||
ec4e2bdb38 | |||
a1b7a03908 | |||
9f0eccdb3d | |||
f6cd170e6f | |||
e0f427fcc8 | |||
705479f29c | |||
e0e1d5148f | |||
8b216f6730 | |||
434cd6d1e4 | |||
b3c42225e1 | |||
cbb291be47 | |||
76e110ab90 | |||
96632b111b | |||
74343d15ef | |||
0046349756 | |||
|
98158e1be5 | ||
78bc2b3f7e | |||
26ee034887 | |||
d891874202 | |||
c11e95f5fe | |||
9596f9d210 | |||
e57349f011 | |||
02578640a9 | |||
c9bdb766eb | |||
9425d56716 | |||
b2d3b80f37 | |||
d67cc24318 | |||
efd05971b1 | |||
8dd5534b0f | |||
d24fa23262 | |||
84fc07cffe | |||
5b68f26771 | |||
dc59842fe8 | |||
a91bb85313 | |||
5f0c24865f | |||
8ee75b0601 | |||
62670483c1 | |||
ace56103fc | |||
4afec74a34 | |||
d4d998cf81 | |||
9794b03d44 | |||
45a44789a4 | |||
4201f18ce6 | |||
8057a2fa22 | |||
6cfa2b3da7 | |||
ee6887bfeb | |||
5a04dcdd0f | |||
8927f194d9 | |||
04e4592f4c | |||
45989b8d3d |
14 changed files with 116 additions and 44 deletions
6
files/scriptreciver/sysctl-d-gofasta.conf
Normal file
6
files/scriptreciver/sysctl-d-gofasta.conf
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
net.core.rmem_max=67108864
|
||||||
|
net.core.wmem_max=67108864
|
||||||
|
net.ipv4.tcp_rmem=4096 87380 33554432
|
||||||
|
net.ipv4.tcp_wmem=4096 87380 33554432
|
||||||
|
net.core.default_qdisc=fq
|
||||||
|
net.ipv4.tcp_congestion_control=bbr
|
|
@ -101,6 +101,23 @@ define sunetdrive::app_type (
|
||||||
content => template('sunetdrive/application/get_containers'),
|
content => template('sunetdrive/application/get_containers'),
|
||||||
mode => '0744',
|
mode => '0744',
|
||||||
}
|
}
|
||||||
|
if ($nodenumber == 3) {
|
||||||
|
file { '/usr/lib/nagios/plugins/check_nextcloud_mounts.py':
|
||||||
|
ensure => present,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
content => template('sunetdrive/application/check_nextcloud_mounts.py'),
|
||||||
|
mode => '0744',
|
||||||
|
}
|
||||||
|
sunet::sudoer {'nagios_run_nextcloud_mounts_command':
|
||||||
|
user_name => 'nagios',
|
||||||
|
collection => 'nrpe_nextcloud_mounts_check',
|
||||||
|
command_line => '/usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
||||||
|
}
|
||||||
|
sunet::nagios::nrpe_command {'check_nextcloud_mounts':
|
||||||
|
command_line => '/usr/bin/sudo /usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($nodenumber == 3) {
|
if ($nodenumber == 3) {
|
||||||
file { '/usr/local/bin/scan_external_mounts':
|
file { '/usr/local/bin/scan_external_mounts':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
@ -388,22 +405,4 @@ define sunetdrive::app_type (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if $facts['networking']['hostname'] == 'node1' or $is_multinode {
|
|
||||||
file { '/usr/lib/nagios/plugins/check_nextcloud_mounts.py':
|
|
||||||
ensure => present,
|
|
||||||
force => true,
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
content => template('sunetdrive/application/check_nextcloud_mounts.py'),
|
|
||||||
mode => '0744',
|
|
||||||
}
|
|
||||||
sunet::sudoer {'nagios_run_nextcloud_mounts_command':
|
|
||||||
user_name => 'nagios',
|
|
||||||
collection => 'nrpe_nextcloud_mounts_check',
|
|
||||||
command_line => '/usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
|
||||||
}
|
|
||||||
sunet::nagios::nrpe_command {'check_nextcloud_mounts':
|
|
||||||
command_line => '/usr/bin/sudo /usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ define sunetdrive::db_type(
|
||||||
$backup_password = safe_hiera('backup_password')
|
$backup_password = safe_hiera('backup_password')
|
||||||
$proxysql_password = safe_hiera('proxysql_password')
|
$proxysql_password = safe_hiera('proxysql_password')
|
||||||
$mysql_user_password = safe_hiera('mysql_user_password')
|
$mysql_user_password = safe_hiera('mysql_user_password')
|
||||||
|
$roundcube_password = safe_hiera('roundcube_password')
|
||||||
$mariadb_dir = '/etc/mariadb'
|
$mariadb_dir = '/etc/mariadb'
|
||||||
$mycnf_path = 'sunetdrive/mariadb/my.cnf.erb'
|
$mycnf_path = 'sunetdrive/mariadb/my.cnf.erb'
|
||||||
$server_id = 1000 + Integer($facts['networking']['hostname'][-1])
|
$server_id = 1000 + Integer($facts['networking']['hostname'][-1])
|
||||||
|
@ -33,8 +34,10 @@ define sunetdrive::db_type(
|
||||||
$ports = [3306, 4444, 4567, 4568]
|
$ports = [3306, 4444, 4567, 4568]
|
||||||
if $location =~ /^multinode/ {
|
if $location =~ /^multinode/ {
|
||||||
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6 + $config['kube'] + $config['kube_v6']
|
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6 + $config['kube'] + $config['kube_v6']
|
||||||
} elsif $location == 'sunet-test' or $location == 'sunet-prod' {
|
} elsif $location == 'sunet-prod' {
|
||||||
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6 + $config['imap'] + $config['imap_v6'] + $config['smtp'] + $config['smtp_v6']
|
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6 + $config['imap'] + $config['imap_v6'] + $config['smtp'] + $config['smtp_v6'] + $config['webmail'] + $config['webmail_v6']
|
||||||
|
} elsif $location == 'sunet-test' {
|
||||||
|
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6 + $config['imap'] + $config['imap_v6'] + $config['smtp'] + $config['smtp_v6'] + $config['webmail'] + $config['webmail_v6'] + $config['calendar'] + $config['calendar_v6']
|
||||||
} else {
|
} else {
|
||||||
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6
|
$from = $db_ip + $nextcloud_ip + $backup_ip + $backup_ipv6 + $db_ipv6
|
||||||
}
|
}
|
||||||
|
@ -46,7 +49,7 @@ define sunetdrive::db_type(
|
||||||
sunet::system_user {'mysql': username => 'mysql', group => 'mysql' }
|
sunet::system_user {'mysql': username => 'mysql', group => 'mysql' }
|
||||||
|
|
||||||
|
|
||||||
$sql_files = ['02-backup_user.sql', '03-proxysql.sql', '04-nextcloud.sql']
|
$sql_files = ['02-backup_user.sql', '03-proxysql.sql', '04-nextcloud.sql', '05-roundcube.sql']
|
||||||
$sql_files.each |$sql_file|{
|
$sql_files.each |$sql_file|{
|
||||||
file { "${mariadb_dir}/init/${sql_file}":
|
file { "${mariadb_dir}/init/${sql_file}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
|
|
@ -46,6 +46,21 @@ class sunetdrive::multinode (
|
||||||
content => template('sunetdrive/application/get_containers'),
|
content => template('sunetdrive/application/get_containers'),
|
||||||
mode => '0744',
|
mode => '0744',
|
||||||
}
|
}
|
||||||
|
file { '/usr/lib/nagios/plugins/check_nextcloud_mounts.py':
|
||||||
|
ensure => present,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
content => template('sunetdrive/application/check_nextcloud_mounts.py'),
|
||||||
|
mode => '0744',
|
||||||
|
}
|
||||||
|
sunet::sudoer {'nagios_run_nextcloud_mounts_command':
|
||||||
|
user_name => 'nagios',
|
||||||
|
collection => 'nrpe_nextcloud_mounts_check',
|
||||||
|
command_line => '/usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
||||||
|
}
|
||||||
|
sunet::nagios::nrpe_command {'check_nextcloud_mounts':
|
||||||
|
command_line => '/usr/bin/sudo /usr/lib/nagios/plugins/check_nextcloud_mounts.py'
|
||||||
|
}
|
||||||
file { '/usr/local/bin/scan_external_mounts':
|
file { '/usr/local/bin/scan_external_mounts':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
force => true,
|
force => true,
|
||||||
|
|
|
@ -41,7 +41,10 @@ class sunetdrive::multinode_db(){
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0600',
|
mode => '0600',
|
||||||
}
|
}
|
||||||
file { '/root/tasks/listusersbydep.sh':
|
file { '/root/tasks/':
|
||||||
|
ensure => directory,
|
||||||
|
}
|
||||||
|
-> file { '/root/tasks/listusersbydep.sh':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template('sunetdrive/mariadb/listusersdep.sh.erb'),
|
content => template('sunetdrive/mariadb/listusersdep.sh.erb'),
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
@ -55,7 +58,10 @@ class sunetdrive::multinode_db(){
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0700',
|
mode => '0700',
|
||||||
}
|
}
|
||||||
file {'/opt/mariadb/statistics/custdata.json':
|
file {'/opt/mariadb/statistics/':
|
||||||
|
ensure => directory,
|
||||||
|
}
|
||||||
|
-> file {'/opt/mariadb/statistics/custdata.json':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template('sunetdrive/mariadb/custconfig.json.erb'),
|
content => template('sunetdrive/mariadb/custconfig.json.erb'),
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
|
|
@ -5,7 +5,19 @@ class sunetdrive::scriptreceiver()
|
||||||
sunet::system_user {'script': username => 'script', group => 'script', managehome => true, shell => '/bin/bash' }
|
sunet::system_user {'script': username => 'script', group => 'script', managehome => true, shell => '/bin/bash' }
|
||||||
|
|
||||||
# These tasks correspond to a ${task}.erb.sh template
|
# These tasks correspond to a ${task}.erb.sh template
|
||||||
$tasks = ['list_users', 'list_files_for_user', 'create_bucket', 'backup_db', 'purge_backups', 'maintenancemode', 'restart_sunet_service', 'start_sentinel', 'stop_sentinel', 'removeswap', 'backup_multinode_db']
|
$tasks = [
|
||||||
|
'list_users',
|
||||||
|
'list_files_for_user',
|
||||||
|
'create_bucket',
|
||||||
|
'backup_db',
|
||||||
|
'purge_backups',
|
||||||
|
'maintenancemode',
|
||||||
|
'restart_sunet_service',
|
||||||
|
'start_sentinel',
|
||||||
|
'stop_sentinel',
|
||||||
|
'removeswap',
|
||||||
|
'backup_multinode_db'
|
||||||
|
]
|
||||||
|
|
||||||
$environment = sunetdrive::get_environment()
|
$environment = sunetdrive::get_environment()
|
||||||
$config = hiera_hash($environment)
|
$config = hiera_hash($environment)
|
||||||
|
@ -35,7 +47,9 @@ class sunetdrive::scriptreceiver()
|
||||||
type => 'ssh-ed25519',
|
type => 'ssh-ed25519',
|
||||||
key => $script_pub_key,
|
key => $script_pub_key,
|
||||||
}
|
}
|
||||||
|
file { '/etc/sysctl.d/gofasta.conf':
|
||||||
|
ensure => 'absent',
|
||||||
|
}
|
||||||
file { '/opt/rotate':
|
file { '/opt/rotate':
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => '0750',
|
mode => '0750',
|
||||||
|
|
|
@ -11,6 +11,9 @@ class sunetdrive::sitemonitornaemon() {
|
||||||
$environment = sunetdrive::get_environment()
|
$environment = sunetdrive::get_environment()
|
||||||
$influx_passwd = safe_hiera('influx_passwd')
|
$influx_passwd = safe_hiera('influx_passwd')
|
||||||
$slack_url = safe_hiera('slack_url')
|
$slack_url = safe_hiera('slack_url')
|
||||||
|
$extra_host_groups = {
|
||||||
|
node3_hosts => join($facts['configured_hosts_in_cosmos']['all'].filter |$host| { $host =~ /^node3\./ }, ',')
|
||||||
|
}
|
||||||
|
|
||||||
file { '/usr/local/bin/slack_nagios.sh':
|
file { '/usr/local/bin/slack_nagios.sh':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
@ -45,6 +48,11 @@ class sunetdrive::sitemonitornaemon() {
|
||||||
content => template('sunetdrive/monitor/sunetdrive_thruk_templates.conf.erb'),
|
content => template('sunetdrive/monitor/sunetdrive_thruk_templates.conf.erb'),
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
}
|
}
|
||||||
|
file { '/etc/naemon/conf.d/sunetdrive_extra_hostgroups.cfg':
|
||||||
|
ensure => present,
|
||||||
|
content => template('sunetdrive/monitor/sunetdrive_extra_hostgroups.cfg.erb'),
|
||||||
|
mode => '0644',
|
||||||
|
}
|
||||||
nagioscfg::service {'check_scriptherder':
|
nagioscfg::service {'check_scriptherder':
|
||||||
hostgroup_name => ['sunetdrive::nrpe'],
|
hostgroup_name => ['sunetdrive::nrpe'],
|
||||||
check_command => 'check_nrpe_1arg_to300!check_scriptherder',
|
check_command => 'check_nrpe_1arg_to300!check_scriptherder',
|
||||||
|
@ -100,10 +108,11 @@ class sunetdrive::sitemonitornaemon() {
|
||||||
contact_groups => ['alerts']
|
contact_groups => ['alerts']
|
||||||
}
|
}
|
||||||
nagioscfg::service {'check_nextcloud_mounts':
|
nagioscfg::service {'check_nextcloud_mounts':
|
||||||
hostgroup_name => ['sunetdrive::application','sunetdrive::multinode'],
|
hostgroup_name => ['node3_hosts','sunetdrive::multinode'],
|
||||||
check_command => 'check_nrpe_1arg!check_nextcloud_mounts',
|
check_command => 'check_nrpe_1arg!check_nextcloud_mounts',
|
||||||
description => 'Nextcloud bucket mounted multiple times',
|
description => 'S3 buckets with multiple Nextcloud mounts',
|
||||||
contact_groups => ['alerts']
|
contact_groups => ['alerts']
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,29 +6,37 @@ import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
buckets = []
|
|
||||||
bucket_count = {}
|
|
||||||
containers = {}
|
|
||||||
exit = 0
|
exit = 0
|
||||||
|
base_message = "OK: no duplicate mounts"
|
||||||
|
long_message = ""
|
||||||
|
|
||||||
get_containers = subprocess.Popen('/usr/local/bin/get_containers', stdout=subprocess.PIPE).stdout.read()
|
get_containers = subprocess.Popen('/usr/local/bin/get_containers', stdout=subprocess.PIPE).stdout.read()
|
||||||
containers = get_containers.decode().splitlines()
|
containers = get_containers.decode().splitlines()
|
||||||
|
|
||||||
for container in containers:
|
for i, container in enumerate(containers, start=1):
|
||||||
|
buckets = []
|
||||||
list_command = f"/usr/local/bin/nocc {container} files_external:list --all --show-password --output json"
|
list_command = f"/usr/local/bin/nocc {container} files_external:list --all --show-password --output json"
|
||||||
command = shlex.split(list_command)
|
command = shlex.split(list_command)
|
||||||
mount_data_byte = subprocess.Popen(command, stdout=subprocess.PIPE).stdout.read()
|
mount_data_byte = subprocess.Popen(command, stdout=subprocess.PIPE).stdout.read()
|
||||||
mount_data = json.loads(mount_data_byte.decode())
|
try:
|
||||||
|
mount_data = json.loads(mount_data_byte.decode())
|
||||||
|
except json.decoder.JSONDecodeError as err:
|
||||||
|
if i == 1 or i != len(containers):
|
||||||
|
base_message = "WARNING: invalid json"
|
||||||
|
long_message += f"\ncontainer: {container} - json decode error: {err}"
|
||||||
|
# lets do exit 0 for now
|
||||||
|
# exit = 1
|
||||||
|
continue
|
||||||
for items in mount_data:
|
for items in mount_data:
|
||||||
buckets.append(items["configuration"]["bucket"])
|
buckets.append(items["configuration"]["bucket"])
|
||||||
bucket_count = dict(Counter(buckets))
|
bucket_count = dict(Counter(buckets))
|
||||||
for i, (k, v) in enumerate(bucket_count.items()):
|
for k, v in bucket_count.items():
|
||||||
if v > 1:
|
if v > 1:
|
||||||
if i == 0:
|
base_message = "WARNING: buckets with multiple mounts"
|
||||||
print("WARNING: buckets with multiple mounts")
|
long_message += f"\ncontainer: {container} - bucket: {k} - {v}"
|
||||||
print(f"bucket {k} is mounted {v} times | {k}_num_mounts={v}")
|
|
||||||
else:
|
|
||||||
print(f"bucket {k} is mounted {v} times | {k}_num_mounts={v}")
|
|
||||||
# lets do exit 0 for now
|
# lets do exit 0 for now
|
||||||
# exit = 1
|
# exit = 1
|
||||||
|
print(base_message)
|
||||||
|
if long_message != "":
|
||||||
|
print(long_message.lstrip())
|
||||||
sys.exit(exit)
|
sys.exit(exit)
|
||||||
|
|
|
@ -16,6 +16,7 @@ $CONFIG = array (
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'appstoreenabled' => false,
|
'appstoreenabled' => false,
|
||||||
|
'auth.bruteforce.protection.enabled' => false,
|
||||||
'config_is_read_only' => true,
|
'config_is_read_only' => true,
|
||||||
'csrf.disabled' => true,
|
'csrf.disabled' => true,
|
||||||
'datadirectory' => '/var/www/html/data',
|
'datadirectory' => '/var/www/html/data',
|
||||||
|
@ -76,7 +77,7 @@ $CONFIG = array (
|
||||||
'region' => 'us-east-1',
|
'region' => 'us-east-1',
|
||||||
'hostname' => '<%= @s3_host %>',
|
'hostname' => '<%= @s3_host %>',
|
||||||
'port' => '',
|
'port' => '',
|
||||||
'useMultipartCopy' => false,
|
'useMultipartCopy' => true,
|
||||||
'objectPrefix' => 'urn:oid:',
|
'objectPrefix' => 'urn:oid:',
|
||||||
'autocreate' => false,
|
'autocreate' => false,
|
||||||
'use_ssl' => true,
|
'use_ssl' => true,
|
||||||
|
|
|
@ -52,7 +52,7 @@ echo '
|
||||||
"region": "'${region}'",
|
"region": "'${region}'",
|
||||||
"secret": "'${secret}'",
|
"secret": "'${secret}'",
|
||||||
"storageClass": "",
|
"storageClass": "",
|
||||||
"useMultipartCopy": false,
|
"useMultipartCopy": true,
|
||||||
"use_path_style": true,
|
"use_path_style": true,
|
||||||
"use_ssl": true
|
"use_ssl": true
|
||||||
},
|
},
|
||||||
|
|
3
templates/mariadb/05-roundcube.sql.erb
Normal file
3
templates/mariadb/05-roundcube.sql.erb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
CREATE SCHEMA roundcubemail;
|
||||||
|
CREATE USER 'roundcube'@'%' IDENTIFIED BY '<%= @roundcube_password %>';
|
||||||
|
GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'%' IDENTIFIED BY '<%= @roundcube_password %>';
|
8
templates/monitor/sunetdrive_extra_hostgroups.cfg.erb
Normal file
8
templates/monitor/sunetdrive_extra_hostgroups.cfg.erb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<% @extra_host_groups.each do |group, members| -%>
|
||||||
|
# <%= group %>
|
||||||
|
define hostgroup {
|
||||||
|
hostgroup_name <%= group %>
|
||||||
|
alias <%= group %>
|
||||||
|
members <%= members %>
|
||||||
|
}
|
||||||
|
<% end -%>
|
|
@ -38,7 +38,7 @@ preexisting="$(docker exec -u www-data -i "${container}" php --define apc.enable
|
||||||
if [[ -z ${preexisting} ]]; then
|
if [[ -z ${preexisting} ]]; then
|
||||||
docker exec -u www-data -i "${container}" php --define apc.enable_cli=1 /var/www/html/occ files_external:create "${user_bucket_name}" \
|
docker exec -u www-data -i "${container}" php --define apc.enable_cli=1 /var/www/html/occ files_external:create "${user_bucket_name}" \
|
||||||
amazons3 -c bucket="${bucket}" -c key="${key}" -c secret="${secret}" -c hostname="${endpoint}" -c use_ssl=true -c use_path_style=true -c region=us-east-1 \
|
amazons3 -c bucket="${bucket}" -c key="${key}" -c secret="${secret}" -c hostname="${endpoint}" -c use_ssl=true -c use_path_style=true -c region=us-east-1 \
|
||||||
-c useMultipartCopy=false amazons3::accesskey --user ${user}
|
-c useMultipartCopy=true amazons3::accesskey --user ${user}
|
||||||
for shareid in $(docker exec -u www-data -i ${container} php --define apc.enable_cli=1 /var/www/html/occ files_external:export ${user} | jq -r '.[].mount_id'); do
|
for shareid in $(docker exec -u www-data -i ${container} php --define apc.enable_cli=1 /var/www/html/occ files_external:export ${user} | jq -r '.[].mount_id'); do
|
||||||
docker exec -u www-data -i ${container} php --define apc.enable_cli=1 /var/www/html/occ files_external:option ${shareid} enable_sharing true
|
docker exec -u www-data -i ${container} php --define apc.enable_cli=1 /var/www/html/occ files_external:option ${shareid} enable_sharing true
|
||||||
done
|
done
|
||||||
|
|
|
@ -7,7 +7,7 @@ bucket=${4}
|
||||||
user=${5}
|
user=${5}
|
||||||
/usr/local/bin/occ files_external:create "${bucket}" \
|
/usr/local/bin/occ files_external:create "${bucket}" \
|
||||||
amazons3 -c bucket="${bucket}" -c key="${key}" -c secret="${secret}" -c hostname="${endpoint}" -c use_ssl=true -c use_path_style=true -c region=us-east-1 \
|
amazons3 -c bucket="${bucket}" -c key="${key}" -c secret="${secret}" -c hostname="${endpoint}" -c use_ssl=true -c use_path_style=true -c region=us-east-1 \
|
||||||
-c useMultipartCopy=false amazons3::accesskey --user "${user}"
|
-c useMultipartCopy=true amazons3::accesskey --user "${user}"
|
||||||
for shareid in $(/usr/local/bin/occ files_external:export "${user}" | jq -r '.[].mount_id'); do
|
for shareid in $(/usr/local/bin/nocc files_external:export "${user}" | jq -r '.[].mount_id'); do
|
||||||
/usr/local/bin/occ files_external:option "${shareid}" enable_sharing true
|
/usr/local/bin/nocc files_external:option "${shareid}" enable_sharing true
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue