Compare commits

...

128 commits

Author SHA1 Message Date
Micke Nordin 25d97470da
Merge branch 'main' into stable 2024-11-12 16:05:20 +01:00
Micke Nordin ce745ff6b0
Fix port and add more output 2024-11-12 16:01:43 +01:00
Micke Nordin 1aae63ba07
Clean up 2024-11-12 15:51:54 +01:00
Micke Nordin 5913537c34
Remove newlines and such 2024-11-12 15:44:15 +01:00
Micke Nordin 932d91364e
Script to remount userbuckets as project buckets 2024-11-12 15:33:35 +01:00
Magnus Andersson 812a56cf99
check_replication: Add user to docker exec to be able to check rootless builds. 2024-11-04 10:58:52 +01:00
Micke Nordin d5e88dd431
Dummy edit 2024-10-24 12:29:31 +02:00
Micke Nordin f27a9c353c
Merge branch 'testing' 2024-10-24 12:19:26 +02:00
Micke Nordin bff0aff823
remove admin pass from env 2024-10-24 12:19:05 +02:00
Micke Nordin a8060b7774
Decoupling the admin_password from proxysql 2024-10-24 12:18:05 +02:00
Micke Nordin dac082f4f5
Fix ntp 2024-10-24 12:18:04 +02:00
Micke Nordin 48f8f6d690
enable sysstat timer on debian 2024-10-24 12:18:03 +02:00
Micke Nordin deabba2e22
Oops 2024-10-24 12:18:03 +02:00
Micke Nordin 22bfeaf244
Set permissions on redis 2024-10-24 12:18:02 +02:00
Micke Nordin d6b4098932
Fix mode on log files 2024-10-24 12:18:01 +02:00
Micke Nordin 42363a9aaf
Rollback fix 2024-10-24 12:18:00 +02:00
Micke Nordin 4dd95bdb39
We want full compat 2024-10-24 12:17:59 +02:00
Micke Nordin 714e2d98f6
Add mysql command to host 2024-10-24 12:17:58 +02:00
Micke Nordin 64e3746628
Add fix to init script from mandersson 2024-10-24 12:17:57 +02:00
Micke Nordin a563e16309
Move nrpe class from opsrepo 2024-10-24 12:17:56 +02:00
Micke Nordin 124203cd92
Add audit log to other logs 2024-10-24 12:17:55 +02:00
Micke Nordin 6365549250
Move hee from cosmos-sites.pp 2024-10-24 12:17:54 +02:00
Micke Nordin 9a367b0955
Decoupling the admin_password from proxysql 2024-10-24 12:15:08 +02:00
Micke Nordin d3d0807d43
Fix ntp 2024-10-22 10:55:45 +02:00
Micke Nordin cb13190197
enable sysstat timer on debian 2024-10-22 10:55:44 +02:00
Micke Nordin 671b5f95df
Oops 2024-10-22 10:55:43 +02:00
Micke Nordin dc8ff6a712
Set permissions on redis 2024-10-22 10:55:43 +02:00
Micke Nordin 124c2f6c5d
Fix mode on log files 2024-10-22 10:55:42 +02:00
Micke Nordin 142fc78f6b
Rollback fix 2024-10-22 10:55:41 +02:00
Micke Nordin 4b4d0626cf
We want full compat 2024-10-22 10:55:40 +02:00
Micke Nordin e3a729e1a8
Add mysql command to host 2024-10-22 10:55:39 +02:00
Micke Nordin 8cae1a668a
Add fix to init script from mandersson 2024-10-22 10:55:38 +02:00
Micke Nordin 7177dfa12e
Add audit log to other logs 2024-10-22 10:55:37 +02:00
Micke Nordin 76640002c0
Move hee from cosmos-sites.pp 2024-10-22 10:55:36 +02:00
Micke Nordin b8a16bd700
Fix ntp 2024-10-22 10:54:57 +02:00
Micke Nordin a64b2533bb
enable sysstat timer on debian 2024-10-22 10:32:04 +02:00
Micke Nordin 6865d6833f
Oops 2024-10-22 10:32:03 +02:00
Micke Nordin 958ff7daa9
Set permissions on redis 2024-10-22 10:32:03 +02:00
Micke Nordin c649a7a6b4
Fix mode on log files 2024-10-22 10:32:02 +02:00
Micke Nordin ac9e29d39e
Rollback fix 2024-10-22 10:32:01 +02:00
Micke Nordin 56f8a5d149
We want full compat 2024-10-22 10:32:00 +02:00
Micke Nordin cb35c3bbf7
Add mysql command to host 2024-10-22 10:31:59 +02:00
Micke Nordin b280257882
Add fix to init script from mandersson 2024-10-22 10:31:58 +02:00
Micke Nordin d3cb9b9e14
Add audit log to other logs 2024-10-22 10:31:57 +02:00
Micke Nordin 39384f7e40
enable sysstat timer on debian 2024-10-22 10:30:59 +02:00
Micke Nordin e0f6d3bafa
Oops 2024-10-21 16:20:25 +02:00
Micke Nordin f531a60514
Fix mode on log files 2024-10-21 16:20:24 +02:00
Micke Nordin 8646f1eda7
Rollback fix 2024-10-21 16:20:23 +02:00
Micke Nordin f5f97e1c3a
We want full compat 2024-10-21 16:20:22 +02:00
Micke Nordin 81341be6e7
Add mysql command to host 2024-10-21 16:20:21 +02:00
Micke Nordin 51ddfa985c
Add fix to init script from mandersson 2024-10-21 16:20:20 +02:00
Micke Nordin 158f982aed
Add audit log to other logs 2024-10-21 16:20:19 +02:00
Micke Nordin a7fe6cecc7
Oops 2024-10-21 16:19:04 +02:00
Micke Nordin 45ac19bec8
Fix mode on log files 2024-10-21 16:16:29 +02:00
Micke Nordin a74899332e
Rollback fix 2024-10-21 16:16:28 +02:00
Micke Nordin d63c586998
We want full compat 2024-10-21 16:16:27 +02:00
Micke Nordin beb69036a1
Add mysql command to host 2024-10-21 16:16:26 +02:00
Micke Nordin 74af996a76
Add fix to init script from mandersson 2024-10-21 16:16:26 +02:00
Micke Nordin e76c22f6d5
Add audit log to other logs 2024-10-21 16:16:25 +02:00
Micke Nordin b065ac7ae6
Set permissions on redis 2024-10-21 16:15:54 +02:00
Micke Nordin 019a3d9792
puppet-lint --fix 2024-10-21 16:15:53 +02:00
Micke Nordin 6224fe3e96
Fix mode on log files 2024-10-21 16:15:52 +02:00
Micke Nordin cc2a9e9ebf
Rollback fix 2024-10-21 16:15:51 +02:00
Micke Nordin daa647beb9
We want full compat 2024-10-21 16:15:50 +02:00
Micke Nordin 1ecf6c8128
Add mysql command to host 2024-10-21 16:15:49 +02:00
Micke Nordin 4111ac7500
Add fix to init script from mandersson 2024-10-21 16:15:49 +02:00
Micke Nordin 8b0d90e4eb
Add audit log to other logs 2024-10-21 16:15:48 +02:00
Micke Nordin e3a66f95df
Set permissions on redis 2024-10-21 16:13:51 +02:00
Micke Nordin b096522c36 Merge branch 'testing' 2024-10-09 14:27:29 +02:00
Micke Nordin d7e7e260c2 puppet-lint --fix 2024-10-09 14:26:06 +02:00
Micke Nordin 52869ca089 Fix mode on log files 2024-10-09 14:26:06 +02:00
Micke Nordin 1a39e0dbec Rollback fix 2024-10-09 14:26:06 +02:00
Micke Nordin e0c06d4571 We want full compat 2024-10-09 14:26:06 +02:00
Micke Nordin f29e074ded Add mysql command to host 2024-10-09 14:26:06 +02:00
Micke Nordin c761c56052 Add fix to init script from mandersson 2024-10-09 14:26:06 +02:00
Micke Nordin 026c5c5d03 Add audit log to other logs 2024-10-09 14:26:06 +02:00
Micke Nordin 7460019ec5 puppet-lint --fix 2024-10-09 14:25:34 +02:00
Micke Nordin 5c0e05394d Fix mode on log files 2024-10-09 14:24:09 +02:00
Micke Nordin f2b8406826 Rollback fix 2024-10-09 14:24:09 +02:00
Micke Nordin 6d78fdde7c We want full compat 2024-10-09 14:24:09 +02:00
Micke Nordin 15beb333ec Add mysql command to host 2024-10-09 14:24:09 +02:00
Micke Nordin 8ca506f608 Add fix to init script from mandersson 2024-10-09 14:24:09 +02:00
Micke Nordin 00d4c96d28 Fix mode on log files 2024-10-09 14:23:08 +02:00
Micke Nordin d3e0f41ff1 Rollback fix 2024-10-07 12:22:03 +02:00
Micke Nordin 8b74bd9c75 We want full compat 2024-10-07 12:22:03 +02:00
Micke Nordin 5c16a783e9 Add mysql command to host 2024-10-07 12:22:03 +02:00
Micke Nordin 2b590b3f01 Rollback fix 2024-10-07 12:19:25 +02:00
Micke Nordin e4093f5e40 We want full compat 2024-10-04 10:05:20 +02:00
Micke Nordin b573820906 We want full compat 2024-10-04 10:04:43 +02:00
Micke Nordin 141f9334f2 Add mysql command to host 2024-10-04 10:01:17 +02:00
Micke Nordin 07ddb2220a format 2024-10-04 10:01:17 +02:00
Micke Nordin 722a8bdb68 Add mysql command to host 2024-10-04 10:00:50 +02:00
Micke Nordin d832f2a274 format 2024-10-03 16:14:33 +02:00
Micke Nordin ccdb53310d Add fix to init script from mandersson 2024-10-03 14:18:52 +02:00
Micke Nordin 07d54eba92 Add fix to init script from mandersson 2024-10-03 14:18:32 +02:00
Micke Nordin 260fd526fe Use all adresses 2024-10-02 17:39:01 +02:00
Micke Nordin ac917b9811 Use all adresses 2024-10-02 17:37:35 +02:00
Magnus Andersson e3697719d2
twofactor_enforced: Make template work with nil values 2024-10-01 11:26:10 +02:00
Magnus Andersson 766c337cb2
twofactor_enforced: Change manifest to work with fullnode 2024-10-01 11:25:25 +02:00
Magnus Andersson 24c2fcbdfc
twofactor_enforced: Make template work with nil values 2024-10-01 11:19:43 +02:00
Magnus Andersson b7e94c2259
twofactor_enforced: Change manifest to work with fullnode 2024-10-01 10:34:37 +02:00
Micke Nordin cf0a778781 Add uptime check taht warns if server has been up for too long 2024-09-24 22:31:26 +02:00
Micke Nordin 15a752a65d Add uptime check taht warns if server has been up for too long 2024-09-24 22:31:01 +02:00
Micke Nordin 911edbed58 Node3 sunet-prod reinstalled 2024-09-24 18:11:00 +02:00
Micke Nordin b4b099b237 Node3 sunet-prod reinstalled 2024-09-24 18:10:38 +02:00
Micke Nordin f8dce117a8 Correct hostgroup name 2024-09-24 17:47:32 +02:00
Micke Nordin 1a63b4884f Correct hostgroup name 2024-09-24 17:47:18 +02:00
Micke Nordin dbac473c26 Move nrpe class from opsrepo 2024-09-24 17:30:21 +02:00
Micke Nordin 7673aca60e Move nrpe class from opsrepo 2024-09-24 17:29:07 +02:00
Micke Nordin 1822ecd683 Add audit log to other logs 2024-09-24 15:36:43 +02:00
Micke Nordin 74768985cc Add audit log to other logs 2024-09-24 15:36:06 +02:00
Micke Nordin e20e41edf8 Move hee from cosmos-sites.pp 2024-09-23 17:05:08 +02:00
Micke Nordin 663021dc61 Move hee from cosmos-sites.pp 2024-09-23 17:03:40 +02:00
Micke Nordin 59e137e918 Merge branch 'main' into testing 2024-09-18 12:38:39 +02:00
Micke Nordin d7c724570f Install netcat on nodes and backup 2024-09-18 12:38:17 +02:00
Micke Nordin e4ccdde169 Create parent dir 2024-09-12 17:27:36 +02:00
Micke Nordin 589f62fc0a Create parent dir 2024-09-12 17:27:16 +02:00
Magnus Andersson 6827c0af7c
Dump customer datastructure for statistics logic to be transferred to script1. 2024-09-09 16:22:37 +02:00
Micke Nordin bff8d8ab22 Don't use incudes like this in newer puppet 2024-09-09 16:03:55 +02:00
Micke Nordin 2152b5b4a9 Don't use incudes like this in newer puppet 2024-09-09 16:03:30 +02:00
Magnus Andersson 75c3a77c6d
Gen users on department lists by a cronjob. 2024-09-03 14:33:46 +02:00
Magnus Andersson eac5b172f2
genusersondepartmentlists: Make status count 2024-09-03 13:43:43 +02:00
Magnus Andersson 05bde6adb6
genusersondepartmentlists: Add som logic for error handling 2024-09-03 12:43:13 +02:00
Magnus Andersson d8eaa122e3
Lookup statistics secret on multinode-db1 in env test. 2024-09-03 10:06:05 +02:00
Magnus Andersson 7402202b9a
multinode-db1: Add initial upload logic of deprtment filtered user lists. 2024-08-30 15:39:01 +02:00
Magnus Andersson 60cb53e631
multinode-db1: Add logic and template to create userlists by department. 2024-08-30 08:57:17 +02:00
Magnus Andersson c134f0771f
multinode-db1: Add script to list users by department domain in email. 2024-08-29 13:46:23 +02:00
Magnus Andersson 8acd0c40b8
multinode-db1 test: Add rclone and statistics remote 2024-08-29 11:02:30 +02:00
7 changed files with 105 additions and 9 deletions

View file

@ -15,7 +15,6 @@ define sunetdrive::app_type (
# The config used
$config = $override_config
# Other settings
$admin_password = $config[ 'admin_password' ]
$dbhost = $config[ 'dbhost' ]
$dbname = $config[ 'dbname' ]
$dbuser = $config[ 'dbuser' ]
@ -31,7 +30,6 @@ define sunetdrive::app_type (
$config = hiera_hash($environment)
$skeletondirectory = $config['skeletondirectory']
# Other settings
$admin_password = safe_hiera('admin_password')
$dbhost = 'proxysql_proxysql_1'
$dbname = 'nextcloud'
$dbuser = 'nextcloud'
@ -143,6 +141,14 @@ define sunetdrive::app_type (
content => template('sunetdrive/application/upgrade23-25.erb.sh'),
mode => '0744',
}
file { '/usr/local/bin/remount_user_bucket_as_project.sh':
ensure => present,
force => true,
owner => 'root',
group => 'root',
content => template('sunetdrive/application/remount_user_bucket_as_project.sh'),
mode => '0744',
}
file { '/opt/rotate/conf.d/nextcloud.conf':
ensure => file,
force => true,

View file

@ -3,7 +3,6 @@
config_php='/var/www/html/config/config.php'
dbhost="<%= @dbhost %>"
mysql_user_password="<%= @mysql_user_password %>"
admin_password="<%= @admin_password %>"
location="<%= @location %>"
bucket="<%= @s3_bucket %>"
@ -14,6 +13,9 @@ if [[ "${user_input}" == "IKnowWhatIAmDoing" ]]; then
echo "WARNING: This will delete everything in the database and reinstall Nextcloud."
echo "You have 10 seconds to abort by hitting CTRL/C"
sleep 10s
echo "Setting temp admin password"
apt update && apt install -y apg
admin_password="$(apg -m 40 | head -1)"
echo "Ok, proceeding."
echo "Dropping database in 3 seconds"
sleep 3s
@ -48,6 +50,11 @@ EOF
instanceid=$(grep -E "^ 'instanceid'" ${config_php} | awk -F "'" '{print $4}')
secret=$(grep -E "^ 'secret'" ${config_php} | awk -F "'" '{print $4}')
passwordsalt=$(grep -E "^ 'passwordsalt'" ${config_php} | awk -F "'" '{print $4}')
echo "Now delete the admin user:"
echo " occ user:delete admin"
echo "and then create a new admin user:"
echo " /usr/local/bin/add_admin_user <username> <email address>"
echo ""
echo "Please use edit-secrets to add these variables to all Nextcloud servers:"
echo "instanceid: DEC::PKCS7[${instanceid}]!"
echo "secret: DEC::PKCS7[${secret}]!"

View file

@ -9,8 +9,6 @@ services:
<%- if @hostnet -%>
network_mode: host
<%- end -%>
environment:
- NC_PASS=<%= @admin_password%>
volumes:
- /opt/nextcloud/000-default.conf:/etc/apache2/sites-enabled/000-default.conf
- /opt/nextcloud/mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf

View file

@ -0,0 +1,79 @@
#!/bin/bash
mountid="${1}"
user="${2}"
container="${3}"
if [[ -z ${mountid} ]] || [[ -z ${user} ]]; then
echo "We need a valid mount id and user to proceed"
echo "Usage: ${0} <mountid> <user> [<container>]"
exit
fi
if [[ -z ${container} ]]; then
container="nextcloud_app_1"
fi
occ="/usr/local/bin/occ"
function get_config {
${occ} files_external:config ${mountid} ${1} | tr -d '\n\t\r'
}
echo "Gathering information, hang tight."
echo -n "."
bucket="$(get_config bucket)"
echo -n "."
hostname="$(get_config hostname)"
echo -n "."
key="$(get_config key)"
echo -n "."
region="$(get_config region)"
echo -n "."
secret="$(get_config secret)"
jsonfile="/tmp/${user}-user-bucket.json"
mount_point="${user/@/-}"
mount_point="${mount_point/./-}-user-bucket"
echo "This will remount the user bucket with mountid ${mountid} for ${user} as project bucket with mountpoint ${mount_point}."
read -r -p "Press enter to continue"
echo '
[
{
"mount_point": "\/'${mount_point}'",
"storage": "\\OCA\\Files_External\\Lib\\Storage\\AmazonS3",
"authentication_type": "amazons3::accesskey",
"configuration": {
"bucket": "'${bucket}'",
"hostname": "'${hostname}'",
"key": "'${key}'",
"legacy_auth": false,
"port": "443",
"region": "'${region}'",
"secret": "'${secret}'",
"storageClass": "",
"useMultipartCopy": false,
"use_path_style": true,
"use_ssl": true
},
"options": {
"encrypt": true,
"previews": true,
"enable_sharing": true,
"filesystem_check_changes": 0,
"encoding_compatibility": false,
"readonly": false
},
"applicable_users": [
],
"applicable_groups": ["admin"]
}
]
' > "${jsonfile}"
docker cp ${jsonfile} ${container}:/${jsonfile}
${occ} files_external:import /${jsonfile}
docker exec ${container} rm /${jsonfile}
rm ${jsonfile}
${occ} files_external:delete ${mountid}

View file

@ -1,6 +1,6 @@
#!/bin/bash
result="$(docker exec mariadb_backup_mariadb_backup_1 mysql -p<%= @mysql_root_password %> -BN -e 'show status like "slave_running"')"
result="$(docker exec -u root mariadb_backup_mariadb_backup_1 mysql -p<%= @mysql_root_password %> -BN -e 'show status like "slave_running"')"
if [[ "${result}" == "Slave_running ON" ]]; then
echo "OK: Replica running"
exit 0

View file

@ -3,10 +3,12 @@
config_php='/var/www/html/config/config.php'
dbhost="<%= @dbhost %>"
mysql_user_password="<%= @mysql_user_password %>"
admin_password="<%= @admin_password %>"
location="<%= @location %>"
bucket="<%= @s3_bucket %>"
customer="<%= @customer %>"
echo "Setting temp admin password"
apt update && apt install -y apg
admin_password="$(apg -m 40 | head -1)"
/usr/bin/mysql -e "drop database nextcloud" -u nextcloud -p"${mysql_user_password}" -h "${dbhost}" >/dev/null 2>&1
/usr/bin/mysql -e "create database nextcloud" -u nextcloud -p"${mysql_user_password}" -h "${dbhost}" >/dev/null 2>&1
@ -35,6 +37,11 @@ EOF
instanceid=$(grep -E "^ 'instanceid'" ${config_php} | awk -F "'" '{print $4}')
secret=$(grep -E "^ 'secret'" ${config_php} | awk -F "'" '{print $4}')
passwordsalt=$(grep -E "^ 'passwordsalt'" ${config_php} | awk -F "'" '{print $4}')
echo "Now delete the admin user:"
echo " occ <container> user:delete admin"
echo "and then create a new admin user:"
echo " /usr/local/bin/add_admin_user <username> <email address> <container>"
echo ""
echo "${customer}_instanceid: DEC::PKCS7[${instanceid}]!"
echo "${customer}_secret: DEC::PKCS7[${secret}]!"
echo "${customer}_passwordsalt: DEC::PKCS7[${passwordsalt}]!"

View file

@ -15,8 +15,7 @@ services:
- <%= @nextcloud_log_path %>:/var/www/html/data/nextcloud.log
- <%= @audit_log_path %>:/var/www/html/data/audit.log
- <%= @rclone_conf_path %>:/rclone.conf
environment:
- NC_PASS=<%= @admin_password%>
networks:
- default
- proxysql_proxysql