diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000..c762adab
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,9 @@
+# Default code owner
+* @ornias1993
+
+# code owner for the docs.
+/docs/ @ornias1993
+
+# Code owners for individual blueprints
+/blueprints/influxdb/ @colemamd
+/blueprints/unifi/ @colemamd
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..71a89b41
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,27 @@
+---
+name: Bug report
+about: Create a report to help us improve JailMan
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..e74cb57f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: Feature
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md
new file mode 100644
index 00000000..d9c6fc45
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md
@@ -0,0 +1,40 @@
+---
+name: Bug Fix
+about: Submit a fix to help us improve JailMan
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**Description**
+
+Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+Fixes # (issue)
+
+**Type of change**
+
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Refactor of current code
+- [ ] This change requires additional documentation update
+
+**How Has This Been Tested?**
+
+Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
+
+- [ ] Test A
+- [ ] Test B
+
+**Notes:**
+_Please enter any other relevant information here_
+
+**Checklist:**
+
+- [ ] My code follows the style guidelines of this project
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+- [ ] I have added tests to this description that prove my fix is effective or that my feature works
+- [ ] Any new files are named using lowercase (to avoid issues on case sensitive file systems)
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE/general_improvement.md b/.github/PULL_REQUEST_TEMPLATE/general_improvement.md
new file mode 100644
index 00000000..e2af3b8e
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/general_improvement.md
@@ -0,0 +1,40 @@
+---
+name: General Improvement
+about: Submit a fix to help us improve JailMan
+title: ''
+labels: enhancement
+assignees: ''
+
+---
+
+**Description**
+
+Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+Fixes # (issue)
+
+**Type of change**
+
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Refactor of current code
+- [ ] This change requires additional documentation update
+
+**How Has This Been Tested?**
+
+Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
+
+- [ ] Test A
+- [ ] Test B
+
+**Notes:**
+_Please enter any other relevant information here_
+
+**Checklist:**
+
+- [ ] My code follows the style guidelines of this project
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+- [ ] I have added tests to this description that prove my fix is effective or that my feature works
+- [ ] Any new files are named using lowercase (to avoid issues on case sensitive file systems)
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE/new_blueprint.md b/.github/PULL_REQUEST_TEMPLATE/new_blueprint.md
new file mode 100644
index 00000000..1c264ab0
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/new_blueprint.md
@@ -0,0 +1,41 @@
+---
+name: New Blueprint
+about: Submit a new blueprint to help us expand JailMan
+title: ''
+labels: feature
+assignees: ''
+
+---
+
+**Description**
+
+Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+Fixes # (issue)
+
+**Type of change**
+
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Refactor of current code
+- [ ] This change requires additional documentation update
+
+**How Has This Been Tested?**
+
+Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
+
+- [ ] Test A
+- [ ] Test B
+
+**Notes:**
+_Please enter any other relevant information here_
+
+**Checklist:**
+
+- [ ] My code follows the style guidelines of this project
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+- [ ] I have added tests to this description that prove my fix is effective or that my feature works
+- [ ] Any new files are named using lowercase (to avoid issues on case sensitive file systems)
+- [ ] I've added myself as a codeowner for the new blueprint in /docs/CODEOWNERS
\ No newline at end of file
diff --git a/docs/Readme.md b/.github/Readme.md
similarity index 100%
rename from docs/Readme.md
rename to .github/Readme.md
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
new file mode 100644
index 00000000..3ba5b5e5
--- /dev/null
+++ b/.github/SECURITY.md
@@ -0,0 +1,18 @@
+# Security Policy
+
+## Supported Versions
+
+| Version | TrueNAS version | Supported with updates |
+| ------- | ------- |------------------ |
+| 1.3.0 | 12.0 | NOT RELEASED YET |
+| 1.2.x | 11.3U2-3 | :white_check_mark: |
+| 1.1.x | 11.3U1-2 | :x: |
+| 1.0.x | 11.3U1 | :x: |
+
+## Reporting a Vulnerability
+
+If you find any security issue, please email the project maintainer.
+
+Currently the Project Maintainer is:
+[Ornias1993](https://github.com/Ornias1993)
+
diff --git a/.github/workflows/filecheck.yml b/.github/workflows/filecheck.yml
index 59cba21b..e3efcef8 100644
--- a/.github/workflows/filecheck.yml
+++ b/.github/workflows/filecheck.yml
@@ -4,6 +4,7 @@ on:
branches:
- master
- dev
+ - minor-dev
jobs:
build:
diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml
index e5d12b6f..d4e3bd5b 100644
--- a/.github/workflows/shellcheck.yml
+++ b/.github/workflows/shellcheck.yml
@@ -8,6 +8,7 @@ on:
branches:
- master
- dev
+ - minor-dev
jobs:
Shellcheck:
diff --git a/.shellcheckrc b/.shellcheckrc
index d5a471e7..e70c8981 100644
--- a/.shellcheckrc
+++ b/.shellcheckrc
@@ -1 +1 @@
-disable=SC2034
+disable=SC2034,SC2154
diff --git a/docs/LICENSE.BSD2 b/LICENSE.BSD2
similarity index 100%
rename from docs/LICENSE.BSD2
rename to LICENSE.BSD2
diff --git a/docs/LICENSE.GPLV2 b/LICENSE.GPLV2
similarity index 100%
rename from docs/LICENSE.GPLV2
rename to LICENSE.GPLV2
diff --git a/blueprints/bitwarden/config.yml b/blueprints/bitwarden/config.yml
index c79bd93c..b0a293d7 100644
--- a/blueprints/bitwarden/config.yml
+++ b/blueprints/bitwarden/config.yml
@@ -1,3 +1,3 @@
blueprint:
bitwarden:
- pkgs: sqlite3 nginx git sudo vim-tiny bash node npm python27-2.7.17_1 mariadb104-client
\ No newline at end of file
+ pkgs: git sudo bash node npm mariadb104-client
\ No newline at end of file
diff --git a/blueprints/bitwarden/update.sh b/blueprints/bitwarden/update.sh
index a2775815..b46e4a6e 100755
--- a/blueprints/bitwarden/update.sh
+++ b/blueprints/bitwarden/update.sh
@@ -7,7 +7,7 @@
JAIL_IP="jail_${1}_ip4_addr"
JAIL_IP="${!JAIL_IP%/*}"
HOST_NAME="jail_${1}_host_name"
-DB_DATABASE="jail_${1}_db_datavase"
+DB_DATABASE="jail_${1}_db_database"
DB_USER="jail_${1}_db_user"
# shellcheck disable=SC2154
INSTALL_TYPE="jail_${1}_type"
diff --git a/blueprints/jackett/install.sh b/blueprints/jackett/install.sh
index d5e4ede7..51f22fc5 100755
--- a/blueprints/jackett/install.sh
+++ b/blueprints/jackett/install.sh
@@ -1,7 +1,7 @@
#!/usr/local/bin/bash
# This file contains the install script for jackett
-iocage exec "$1" "fetch https://github.com/Jackett/Jackett/releases/download/v0.11.502/Jackett.Binaries.Mono.tar.gz -o /usr/local/share"
+iocage exec "$1" "fetch https://github.com/Jackett/Jackett/releases/download/v0.16.546/Jackett.Binaries.Mono.tar.gz -o /usr/local/share"
iocage exec "$1" "tar -xzvf /usr/local/share/Jackett.Binaries.Mono.tar.gz -C /usr/local/share"
iocage exec "$1" rm /usr/local/share/Jackett.Binaries.Mono.tar.gz
iocage exec "$1" "pw user add jackett -c jackett -u 818 -d /nonexistent -s /usr/bin/nologin"
diff --git a/blueprints/lidarr/install.sh b/blueprints/lidarr/install.sh
index 119f9ebc..4fdaec1f 100755
--- a/blueprints/lidarr/install.sh
+++ b/blueprints/lidarr/install.sh
@@ -12,9 +12,9 @@ createmount "$1" "${global_dataset_media}"
createmount "$1" "${global_dataset_media}"/music /mnt/music
-iocage exec "$1" "fetch https://github.com/lidarr/Lidarr/releases/download/v0.2.0.371/Lidarr.develop.0.2.0.371.linux.tar.gz -o /usr/local/share"
-iocage exec "$1" "tar -xzvf /usr/local/share/Lidarr.develop.0.2.0.371.linux.tar.gz -C /usr/local/share"
-iocage exec "$1" "rm /usr/local/share/Lidarr.develop.0.2.0.371.linux.tar.gz"
+iocage exec "$1" "fetch https://github.com/lidarr/Lidarr/releases/download/v0.7.1.1381/Lidarr.master.0.7.1.1381.linux.tar.gz -o /usr/local/share"
+iocage exec "$1" "tar -xzvf /usr/local/share/Lidarr.master.0.7.1.1381.linux.tar.gz -C /usr/local/share"
+iocage exec "$1" "rm /usr/local/share/Lidarr.master.0.7.1.1381.linux.tar.gz"
iocage exec "$1" "pw user add lidarr -c lidarr -u 353 -d /nonexistent -s /usr/bin/nologin"
iocage exec "$1" chown -R lidarr:lidarr /usr/local/share/Lidarr /config
iocage exec "$1" mkdir /usr/local/etc/rc.d
diff --git a/blueprints/mariadb/config.yml b/blueprints/mariadb/config.yml
index 05feae35..403cb8a9 100644
--- a/blueprints/mariadb/config.yml
+++ b/blueprints/mariadb/config.yml
@@ -1,3 +1,3 @@
blueprint:
mariadb:
- pkgs: mariadb104-server git php74-session php74-xml php74-ctype php74-openssl php74-filter php74-gd php74-json php74-mysqli php74-mbstring php74-zlib php74-zip php74-bz2 phpMyAdmin5-php74 php74-pdo_mysql php74-mysqli phpMyAdmin5-php74-5.0.1
+ pkgs: mariadb104-server git php74-session php74-xml php74-ctype php74-openssl php74-filter php74-gd php74-json php74-mysqli php74-mbstring php74-zlib php74-zip php74-bz2 phpMyAdmin5-php74 php74-pdo_mysql php74-mysqli phpMyAdmin5-php74
diff --git a/blueprints/mariadb/includes/config.inc.php b/blueprints/mariadb/includes/config.inc.php
new file mode 100644
index 00000000..817f0f49
--- /dev/null
+++ b/blueprints/mariadb/includes/config.inc.php
@@ -0,0 +1,156 @@
+.
+ *
+ * @package PhpMyAdmin
+ */
+declare(strict_types=1);
+
+/**
+ * This is needed for cookie based authentication to encrypt password in
+ * cookie. Needs to be 32 chars long.
+ */
+$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
+
+/**
+ * Servers configuration
+ */
+$i = 0;
+
+/**
+ * First server
+ */
+$i++;
+/* Authentication type */
+/*$cfg['Servers'][$i]['auth_type'] = 'cookie';*/
+/* Server parameters */
+$cfg['Servers'][$i]['host'] = 'localhost';
+$cfg['Servers'][$i]['compress'] = false;
+$cfg['Servers'][$i]['AllowNoPassword'] = false;
+$cfg['Servers'][$i]['socket'] = '/config/mysql.sock';
+$cfg['Servers'][$i]['connect_type'] = 'socket';
+/**
+ * phpMyAdmin configuration storage settings.
+ */
+
+/* User used to manipulate with storage */
+// $cfg['Servers'][$i]['controlhost'] = '';
+// $cfg['Servers'][$i]['controlport'] = '';
+// $cfg['Servers'][$i]['controluser'] = 'pma';
+// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
+
+/* Storage database and tables */
+// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
+// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
+// $cfg['Servers'][$i]['relation'] = 'pma__relation';
+// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
+// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
+// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
+// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
+// $cfg['Servers'][$i]['history'] = 'pma__history';
+// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
+// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
+// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
+// $cfg['Servers'][$i]['recent'] = 'pma__recent';
+// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
+// $cfg['Servers'][$i]['users'] = 'pma__users';
+// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
+// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
+// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
+// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
+// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
+// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
+
+/**
+ * End of servers configuration
+ */
+
+/**
+ * Directories for saving/loading files from server
+ */
+$cfg['UploadDir'] = '';
+$cfg['SaveDir'] = '';
+
+/**
+ * Whether to display icons or text or both icons and text in table row
+ * action segment. Value can be either of 'icons', 'text' or 'both'.
+ * default = 'both'
+ */
+//$cfg['RowActionType'] = 'icons';
+
+/**
+ * Defines whether a user should be displayed a "show all (records)"
+ * button in browse mode or not.
+ * default = false
+ */
+//$cfg['ShowAll'] = true;
+
+/**
+ * Number of rows displayed when browsing a result set. If the result
+ * set contains more rows, "Previous" and "Next".
+ * Possible values: 25, 50, 100, 250, 500
+ * default = 25
+ */
+//$cfg['MaxRows'] = 50;
+
+/**
+ * Disallow editing of binary fields
+ * valid values are:
+ * false allow editing
+ * 'blob' allow editing except for BLOB fields
+ * 'noblob' disallow editing except for BLOB fields
+ * 'all' disallow editing
+ * default = 'blob'
+ */
+//$cfg['ProtectBinary'] = false;
+
+/**
+ * Default language to use, if not browser-defined or user-defined
+ * (you find all languages in the locale folder)
+ * uncomment the desired line:
+ * default = 'en'
+ */
+//$cfg['DefaultLang'] = 'en';
+//$cfg['DefaultLang'] = 'de';
+
+/**
+ * How many columns should be used for table display of a database?
+ * (a value larger than 1 results in some information being hidden)
+ * default = 1
+ */
+//$cfg['PropertiesNumColumns'] = 2;
+
+/**
+ * Set to true if you want DB-based query history.If false, this utilizes
+ * JS-routines to display query history (lost by window close)
+ *
+ * This requires configuration storage enabled, see above.
+ * default = false
+ */
+//$cfg['QueryHistoryDB'] = true;
+
+/**
+ * When using DB-based query history, how many entries should be kept?
+ * default = 25
+ */
+//$cfg['QueryHistoryMax'] = 100;
+
+/**
+ * Whether or not to query the user before sending the error report to
+ * the phpMyAdmin team when a JavaScript error occurs
+ *
+ * Available options
+ * ('ask' | 'always' | 'never')
+ * default = 'ask'
+ */
+//$cfg['SendErrorReports'] = 'always';
+
+/**
+ * You can find more configuration options in the documentation
+ * in the doc/ folder or at .
+ */
diff --git a/blueprints/mariadb/includes/my-system.cnf b/blueprints/mariadb/includes/my-system.cnf
deleted file mode 100644
index b7eca26d..00000000
--- a/blueprints/mariadb/includes/my-system.cnf
+++ /dev/null
@@ -1,16 +0,0 @@
-[mysqld]
-innodb_file_per_table=1
-transaction_isolation = READ-COMMITTED
-binlog_format = ROW
-
-symbolic-links=0
-innodb_doublewrite = 0
-innodb_checksum_algorithm = none
-innodb_file_per_table=1
-
-innodb_buffer_pool_size = 1G
-innodb_log_buffer_size = 8M
-innodb_open_files = 400
-innodb_io_capacity = 400
-innodb_flush_method = O_DIRECT
-innodb_io_capacity = 4000
diff --git a/blueprints/mariadb/includes/my.cnf b/blueprints/mariadb/includes/my.cnf
index 77b7660a..9545f512 100644
--- a/blueprints/mariadb/includes/my.cnf
+++ b/blueprints/mariadb/includes/my.cnf
@@ -1,3 +1,25 @@
-# MySQL client config file
+# MySQL config file
+[mysqld]
+datadir=/config/db
+socket=/config/mysql.sock
+log_error=/config/mysql.err
+innodb_file_per_table=1
+transaction_isolation = READ-COMMITTED
+binlog_format = ROW
+
+symbolic-links=0
+innodb_doublewrite = 0
+innodb_checksum_algorithm = none
+innodb_file_per_table=1
+
+innodb_buffer_pool_size = 1G
+innodb_log_buffer_size = 8M
+innodb_open_files = 400
+innodb_io_capacity = 400
+innodb_flush_method = O_DIRECT
+innodb_io_capacity = 4000
+
[client]
password=mypassword
+port=3306
+socket=/config/mysql.sock
diff --git a/blueprints/mariadb/install.sh b/blueprints/mariadb/install.sh
index e94678b0..397829a3 100755
--- a/blueprints/mariadb/install.sh
+++ b/blueprints/mariadb/install.sh
@@ -35,22 +35,33 @@ if [ "$(ls -A "/mnt/${global_dataset_config}/${1}/db")" ]; then
fi
# Mount database dataset and set zfs preferences
-createmount "${1}" "${global_dataset_config}"/"${1}"/db /var/db/mysql
+iocage exec "${1}" rm -Rf /usr/local/etc/mysql/my.cnf
+createmount "${1}" "${global_dataset_config}"/"${1}"/db /config/db
zfs set recordsize=16K "${global_dataset_config}"/"${1}"/db
zfs set primarycache=metadata "${global_dataset_config}"/"${1}"/db
-iocage exec "${1}" chown -R 88:88 /var/db/mysql
+iocage exec "${1}" "pw groupadd -n mysql -g 88"
+iocage exec "${1}" "pw useradd -n mysql -u 88 -d /nonexistent -s /usr/sbin/nologin -g mysql"
+
+iocage exec "${1}" chown -R mysql:mysql /config
+
+iocage exec "${1}" sysrc mysql_optfile=/config/my.cnf
+iocage exec "${1}" sysrc mysql_dbdir=/config/db
+iocage exec "${1}" sysrc mysql_pidfile=/config/mysql.pid
+iocage exec "${1}" sysrc mysql_enable="YES"
# Install includes fstab
iocage exec "${1}" mkdir -p /mnt/includes
iocage fstab -a "${1}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0
-iocage exec "${1}" mkdir -p /usr/local/www/phpmyadmin
-iocage exec "${1}" chown -R www:www /usr/local/www/phpmyadmin
+iocage exec "${1}" cp -f /mnt/includes/my.cnf /config/my.cnf
+iocage exec "${1}" cp -f /mnt/includes/config.inc.php /usr/local/www/phpMyAdmin/config.inc.php
+iocage exec "${1}" sed -i '' "s|mypassword|${!DB_ROOT_PASSWORD}|" /config/my.cnf
+iocage exec "${1}" ln -s /config/my.cnf /usr/local/etc/mysql/my.cnf
#####
#
-# Install mariadb, Caddy and PhpMyAdmin
+# Install Caddy and PhpMyAdmin
#
#####
@@ -61,8 +72,6 @@ then
exit 1
fi
-iocage exec "${1}" sysrc mysql_enable="YES"
-
# Copy and edit pre-written config files
echo "Copying Caddyfile for no SSL"
iocage exec "${1}" cp -f /mnt/includes/caddy.rc /usr/local/etc/rc.d/caddy
@@ -84,7 +93,6 @@ if [ "${REINSTALL}" == "true" ]; then
else
# Secure database, set root password, create Nextcloud DB, user, and password
- iocage exec "${1}" cp -f /mnt/includes/my-system.cnf /var/db/mysql/my.cnf
iocage exec "${1}" mysql -u root -e "DELETE FROM mysql.user WHERE User='';"
iocage exec "${1}" mysql -u root -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
iocage exec "${1}" mysql -u root -e "DROP DATABASE IF EXISTS test;"
@@ -92,8 +100,6 @@ else
iocage exec "${1}" mysqladmin --user=root password "${!DB_ROOT_PASSWORD}"
iocage exec "${1}" mysqladmin reload
fi
-iocage exec "${1}" cp -f /mnt/includes/my.cnf /root/.my.cnf
-iocage exec "${1}" sed -i '' "s|mypassword|${!DB_ROOT_PASSWORD}|" /root/.my.cnf
# Save passwords for later reference
iocage exec "${1}" echo "MariaDB root password is ${!DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt
diff --git a/blueprints/nextcloud/config.yml b/blueprints/nextcloud/config.yml
index 0f8e0193..a6f3f67b 100644
--- a/blueprints/nextcloud/config.yml
+++ b/blueprints/nextcloud/config.yml
@@ -1,4 +1,3 @@
blueprint:
nextcloud:
- pkgs: nano sudo redis php73-ctype gnupg php73-dom php73-gd php73-iconv php73-json php73-mbstring php73-posix php73-simplexml php73-xmlreader php73-xmlwriter php73-zip php73-zlib php73-hash php73-xml php73 php73-pecl-redis php73-session php73-wddx php73-xsl php73-filter php73-pecl-APCu php73-curl php73-fileinfo php73-bz2 php73-intl php73-openssl php73-ldap php73-ftp php73-imap php73-exif php73-gmp php73-pecl-memcache php73-pecl-imagick php73-pecl-smbclient perl5 p5-Locale-gettext help2man texinfo m4 autoconf
- ports: true
\ No newline at end of file
+ pkgs: nano sudo redis php74-ctype gnupg php74-dom php74-gd php74-iconv php74-json php74-mbstring php74-posix php74-simplexml php74-xmlreader php74-xmlwriter php74-zip php74-zlib php74-xml php74 php74-pecl-redis php74-session php74-xsl php74-filter php74-pecl-APCu php74-curl php74-fileinfo php74-bz2 php74-intl php74-openssl php74-ldap php74-ftp php74-imap php74-exif php74-gmp php74-pecl-memcache php74-pecl-imagick php74-pecl-smbclient perl5 p5-Locale-gettext help2man texinfo m4 autoconf php74-opcache php74-pcntl php74-bcmath php74-pecl-APCu
\ No newline at end of file
diff --git a/blueprints/nextcloud/includes/redis.conf b/blueprints/nextcloud/includes/redis.conf
index ae47f742..5df02308 100644
--- a/blueprints/nextcloud/includes/redis.conf
+++ b/blueprints/nextcloud/includes/redis.conf
@@ -98,8 +98,8 @@ tcp-backlog 511
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
-unixsocket /tmp/redis.sock
-unixsocketperm 777
+unixsocket /var/run/redis/redis.sock
+unixsocketperm 770
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
diff --git a/blueprints/nextcloud/install.sh b/blueprints/nextcloud/install.sh
index 79f56f3f..3d3612c2 100755
--- a/blueprints/nextcloud/install.sh
+++ b/blueprints/nextcloud/install.sh
@@ -50,7 +50,7 @@ if [ -z "${JAIL_IP}" ]; then
exit 1
fi
-if [ -z "${ADMIN_PASSWORD}" ]; then
+if [ -z "${!ADMIN_PASSWORD}" ]; then
echo 'Configuration error: The Nextcloud jail requires a admin_password'
echo 'Please reinstall using a fixed IP adress'
exit 1
@@ -130,7 +130,7 @@ iocage exec "${1}" chmod -R 770 /config/files
#####
if [ "${DB_TYPE}" = "mariadb" ]; then
- iocage exec "${1}" pkg install -qy mariadb103-client php73-pdo_mysql php73-mysqli
+ iocage exec "${1}" pkg install -qy mariadb104-client php74-pdo_mysql php74-mysqli
fi
fetch -o /tmp https://getcaddy.com
@@ -142,8 +142,6 @@ fi
iocage exec "${1}" sysrc redis_enable="YES"
iocage exec "${1}" sysrc php_fpm_enable="YES"
-iocage exec "${1}" sh -c "make -C /usr/ports/www/php73-opcache clean install BATCH=yes"
-iocage exec "${1}" sh -c "make -C /usr/ports/devel/php73-pcntl clean install BATCH=yes"
#####
@@ -152,7 +150,7 @@ iocage exec "${1}" sh -c "make -C /usr/ports/devel/php73-pcntl clean install BAT
#
#####
-FILE="latest-18.tar.bz2"
+FILE="latest-19.tar.bz2"
if ! iocage exec "${1}" fetch -o /tmp https://download.nextcloud.com/server/releases/"${FILE}" https://download.nextcloud.com/server/releases/"${FILE}".asc https://nextcloud.com/nextcloud.asc
then
echo "Failed to download Nextcloud"
@@ -167,6 +165,7 @@ then
fi
iocage exec "${1}" tar xjf /tmp/"${FILE}" -C /usr/local/www/
iocage exec "${1}" chown -R www:www /usr/local/www/nextcloud/
+iocage exec "${1}" pw usermod www -G redis
# Generate and install self-signed cert, if necessary
@@ -233,7 +232,7 @@ else
# Save passwords for later reference
iocage exec "${1}" echo "${DB_NAME} root password is ${DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt
iocage exec "${1}" echo "Nextcloud database password is ${!DB_PASSWORD}" >> /root/"${1}"_db_password.txt
- iocage exec "${1}" echo "Nextcloud Administrator password is ${ADMIN_PASSWORD}" >> /root/"${1}"_db_password.txt
+ iocage exec "${1}" echo "Nextcloud Administrator password is ${!ADMIN_PASSWORD}" >> /root/"${1}"_db_password.txt
# CLI installation and configuration of Nextcloud
if [ "${DB_TYPE}" = "mariadb" ]; then
@@ -248,7 +247,7 @@ else
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set loglevel --value="2"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set logrotate_size --value="104847600"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
- iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
+ iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/var/run/redis/redis.sock"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis port --value=0 --type=integer'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
iocage exec "${1}" su -m www -c "php /usr/local/www/nextcloud/occ config:system:set overwritehost --value=\"${!HOST_NAME}\""
@@ -289,7 +288,7 @@ if [ "${REINSTALL}" == "true" ]; then
echo "You did a reinstall, please use your old database and account credentials"
else
- echo "Default user is admin, password is ${ADMIN_PASSWORD}"
+ echo "Default user is admin, password is ${!ADMIN_PASSWORD}"
echo ""
echo "Database Information"
diff --git a/blueprints/organizr/config.yml b/blueprints/organizr/config.yml
index a06f8e48..a952ad5c 100644
--- a/blueprints/organizr/config.yml
+++ b/blueprints/organizr/config.yml
@@ -1,3 +1,3 @@
blueprint:
organizr:
- pkgs: nginx php72 php72-filter php72-curl php72-hash php72-json php72-openssl php72-pdo php72-pdo_sqlite php72-session php72-simplexml php72-sqlite3 php72-zip git
\ No newline at end of file
+ pkgs: nginx php74 php74-filter php74-curl php74-hash php74-json php74-openssl php74-pdo php74-pdo_sqlite php74-session php74-simplexml php74-sqlite3 php74-zip git
\ No newline at end of file
diff --git a/blueprints/tautulli/config.yml b/blueprints/tautulli/config.yml
index 3c6a9a2d..9acd5c2b 100644
--- a/blueprints/tautulli/config.yml
+++ b/blueprints/tautulli/config.yml
@@ -1,3 +1,3 @@
blueprint:
tautulli:
- pkgs: python2 py27-sqlite3 py27-openssl git
\ No newline at end of file
+ pkgs: python37 py37-setuptools py37-sqlite3 py37-openssl py37-pycryptodomex python3 git
\ No newline at end of file
diff --git a/blueprints/tautulli/install.sh b/blueprints/tautulli/install.sh
index c87ec954..d0c81373 100755
--- a/blueprints/tautulli/install.sh
+++ b/blueprints/tautulli/install.sh
@@ -1,6 +1,7 @@
#!/usr/local/bin/bash
# This file contains the install script for Tautulli
+iocage exec "$1" ln -s /usr/local/bin/python3 /usr/local/bin/python
iocage exec "$1" git clone https://github.com/Tautulli/Tautulli.git /usr/local/share/Tautulli
iocage exec "$1" "pw user add tautulli -c tautulli -u 109 -d /nonexistent -s /usr/bin/nologin"
iocage exec "$1" chown -R tautulli:tautulli /usr/local/share/Tautulli /config
diff --git a/blueprints/tautulli/update.sh b/blueprints/tautulli/update.sh
index 500aa181..a24393bf 100755
--- a/blueprints/tautulli/update.sh
+++ b/blueprints/tautulli/update.sh
@@ -2,6 +2,7 @@
# This file contains the update script for Tautulli
iocage exec "$1" service tautulli stop
+iocage exec "$1" ln -s /usr/local/bin/python3 /usr/local/bin/python
# Tautulli is updated through pkg, this is mostly just a placeholder
iocage exec "$1" chown -R tautulli:tautulli /usr/local/share/Tautulli /config
iocage exec "$1" cp /usr/local/share/Tautulli/init-scripts/init.freenas /usr/local/etc/rc.d/tautulli
diff --git a/blueprints/transmission/update.sh b/blueprints/transmission/update.sh
index 6c3d216e..8b0ec710 100755
--- a/blueprints/transmission/update.sh
+++ b/blueprints/transmission/update.sh
@@ -2,6 +2,7 @@
# This file contains the update script for transmission
iocage exec "$1" service transmission stop
+
# Transmision is updated during PKG update, this file is mostly just a placeholder
iocage exec "$1" chown -R transmission:transmission /config
iocage exec "$1" service transmission restart
\ No newline at end of file
diff --git a/blueprints/unifi/install.sh b/blueprints/unifi/install.sh
index 66e46d16..e51f13ae 100755
--- a/blueprints/unifi/install.sh
+++ b/blueprints/unifi/install.sh
@@ -63,10 +63,7 @@ iocage exec "${1}" sysrc unifi_enable=YES
iocage exec "${1}" service unifi start
# shellcheck disable=SC2154
-if [[ ! "${!POLLER}" ]]; then
- echo "Installation complete!"
- echo "Unifi Controller is accessible at https://${JAIL_IP}:8443."
-else
+if [ "${!POLLER}" == true ]; then
# Check if influxdb container exists, create unifi database if it does, error if it is not.
echo "Checking if the database jail and database exist..."
if [[ -d /mnt/"${global_dataset_iocage}"/jails/"${!DB_JAIL}" ]]; then
@@ -116,4 +113,7 @@ else
echo "Unifi Controller is accessible at https://${JAIL_IP}:8443."
echo "Please login to the Unifi Controller and add ${UP_USER} as a read-only user."
echo "In Grafana, add Unifi-Poller as a data source."
+else
+ echo "Installation complete!"
+ echo "Unifi Controller is accessible at https://${JAIL_IP}:8443."
fi
diff --git a/blueprints/unifi/update.sh b/blueprints/unifi/update.sh
index a585afab..424a7863 100755
--- a/blueprints/unifi/update.sh
+++ b/blueprints/unifi/update.sh
@@ -2,20 +2,28 @@
# This file contains the update script for unifi
# Unifi Controller is updated through pkg, Unifi-Poller is not. This script updates Unifi-Poller
-FILE_NAME=$(curl -s https://api.github.com/repos/unifi-poller/unifi-poller/releases/latest | jq -r ".assets[] | select(.name | contains(\"amd64.txz\")) | .name")
-DOWNLOAD=$(curl -s https://api.github.com/repos/unifi-poller/unifi-poller/releases/latest | jq -r ".assets[] | select(.name | contains(\"amd64.txz\")) | .browser_download_url")
+POLLER="jail_${1}_unifi_poller"
-# Check to see if there is an update.
# shellcheck disable=SC2154
-if [[ -f /mnt/"${global_dataset_config}"/"${1}"/"${FILE_NAME}" ]]; then
- echo "Unifi-Poller is up to date."
- exit 1
+if [ "${!POLLER}" == true ]; then
+ FILE_NAME=$(curl -s https://api.github.com/repos/unifi-poller/unifi-poller/releases/latest | jq -r ".assets[] | select(.name | contains(\"amd64.txz\")) | .name")
+ DOWNLOAD=$(curl -s https://api.github.com/repos/unifi-poller/unifi-poller/releases/latest | jq -r ".assets[] | select(.name | contains(\"amd64.txz\")) | .browser_download_url")
+
+ # Check to see if there is an update.
+ # shellcheck disable=SC2154
+ if [[ -f /mnt/"${global_dataset_config}"/"${1}"/"${FILE_NAME}" ]]; then
+ echo "Unifi-Poller is up to date."
+ exit 1
+ else
+ # Download and install the package
+ iocage exec "${1}" fetch -o /config "${DOWNLOAD}"
+ iocage exec "${1}" pkg install -qy /config/"${FILE_NAME}"
+
+ iocage exec "${1}" service unifi_poller restart
+ fi
else
- # Download and install the package
- iocage exec "${1}" fetch -o /config "${DOWNLOAD}"
- iocage exec "${1}" pkg install -qy /config/"${FILE_NAME}"
- iocage exec "${1}" service unifi restart
- iocage exec "${1}" service unifi_poller restart
+ echo "Skipping Unifi Poller for update, not installed"
fi
+iocage exec "${1}" service unifi restart
echo "Update complete!"
diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md
deleted file mode 100644
index 89fb703e..00000000
--- a/docs/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Issue Template
-
-## Description
-
-### Detailed Bug Report
-It helps if you include any relevant code / config (for describing how new features should work), images, gifs, or youtube videos!
-
-### Steps to Reproduce
-Please enter the steps to reproduce the bug or behaviour:
-
-1.
-2.
-3.
\ No newline at end of file
diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index ed2f76f0..00000000
--- a/docs/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Pull Request Template
-
-### Purpose
-_Describe the problem the PR fixes or the feature it introduces_
-_Don't forget to use "Fixes #issuenumber" to select issues and auto close them on merge_
-
-### Notes:
-_Please enter any other relevant information here_
-
-### Please make sure you have followed the self checks below before submitting a PR:
-
-- [ ] Code is sufficiently commented
-- [ ] Code is indented with tabs and not spaces
-- [ ] The PR does not bring up any new errors
-- [ ] The PR has been tested
-- [ ] Any new files are named using lowercase (to avoid issues on case sensitive file systems)
diff --git a/docs/test.md b/docs/test.md
deleted file mode 100644
index e440e5c8..00000000
--- a/docs/test.md
+++ /dev/null
@@ -1 +0,0 @@
-3
\ No newline at end of file
diff --git a/global.sh b/global.sh
index 37a1d607..f826d2ef 100755
--- a/global.sh
+++ b/global.sh
@@ -24,21 +24,29 @@ parse_yaml() {
# automatic update function
gitupdate() {
-git remote add upstream https://github.com/jailmanager/jailman.git > /dev/null 2>&1
-echo "checking for updates using Branch: $1"
-git fetch upstream > /dev/null 2>&1
-git update-index -q --refresh > /dev/null 2>&1
-CHANGED=$(git diff --name-only "$1")
-if [ -n "$CHANGED" ];
+if [ "$(git config --get remote.origin.url)" = "https://github.com/Ornias1993/jailman" ]
then
- echo "script requires update"
- git reset --hard > /dev/null 2>&1
- git checkout "${1}" > /dev/null 2>&1
- git pull > /dev/null 2>&1
- echo "script updated, please restart the script manually"
- exit 1
+ echo "The repository has been moved, please reinstall using the new repository: jailmanager/jailman"
+ exit 1
+fi
+if [ "$1" = "" ] || [ "$1" = "HEAD" ];
+then
+ echo "Detatched or invalid GIT HEAD detected, please reinstall"
else
- echo "script up-to-date"
+ echo "checking for updates using Branch: $1"
+ git fetch > /dev/null 2>&1
+ git update-index -q --refresh > /dev/null 2>&1
+ CHANGED=$(git diff --name-only "$1")
+ if [ -n "$CHANGED" ];
+ then
+ echo "script requires update"
+ git reset --hard > /dev/null 2>&1
+ git pull > /dev/null 2>&1
+ echo "script updated, please restart the script manually"
+ exit 1
+ else
+ echo "script up-to-date"
+ fi
fi
}
@@ -87,13 +95,13 @@ fi
rm /tmp/pkg.json
echo "creating jail config directory"
# shellcheck disable=SC2154
-createmount "${1}" "${global_dataset_config}"
-createmount "${1}" "${global_dataset_config}"/"${1}" /config
+createmount "${1}" "${global_dataset_config}" || exit 1
+createmount "${1}" "${global_dataset_config}"/"${1}" /config || exit 1
# Create and Mount portsnap
-createmount "${1}" "${global_dataset_config}"/portsnap
-createmount "${1}" "${global_dataset_config}"/portsnap/db /var/db/portsnap
-createmount "${1}" "${global_dataset_config}"/portsnap/ports /usr/ports
+createmount "${1}" "${global_dataset_config}"/portsnap || exit 1
+createmount "${1}" "${global_dataset_config}"/portsnap/db /var/db/portsnap || exit 1
+createmount "${1}" "${global_dataset_config}"/portsnap/ports /usr/ports || exit 1
if [ "${!blueprintports}" == "true" ]
then
echo "Mounting and fetching ports"
@@ -117,7 +125,7 @@ createmount() {
else
if [ ! -d "/mnt/$2" ]; then
echo "Dataset does not exist... Creating... $2"
- zfs create "${2}"
+ zfs create "${2}" || exit 1
else
echo "Dataset already exists, skipping creation of $2"
fi
@@ -125,9 +133,9 @@ createmount() {
if [ -n "$1" ] && [ -n "$3" ]; then
iocage exec "${1}" mkdir -p "${3}"
if [ -n "${4}" ]; then
- iocage fstab -a "${1}" /mnt/"${2}" "${3}" "${4}"
+ iocage fstab -a "${1}" /mnt/"${2}" "${3}" "${4}" || exit 1
else
- iocage fstab -a "${1}" /mnt/"${2}" "${3}" nullfs rw 0 0
+ iocage fstab -a "${1}" /mnt/"${2}" "${3}" nullfs rw 0 0 || exit 1
fi
else
echo "No Jail Name or Mount target specified, not mounting dataset"
diff --git a/jailman.sh b/jailman.sh
index f9b570ed..f89a7dca 100755
--- a/jailman.sh
+++ b/jailman.sh
@@ -20,8 +20,7 @@ if ! [ "$(id -u)" = 0 ]; then
fi
# Auto Update
-BRANCH="upstream/master"
-gitupdate ${BRANCH}
+gitupdate $(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)") || exit 1
# If no option is given, point to the help menu
if [ $# -eq 0 ]
@@ -197,7 +196,7 @@ else
then
echo "Updating $jail"
iocage update "${jail}"
- iocage exec "${jail}" "pkg update && pkg upgrade -y" && "${SCRIPT_DIR}"/jails/"${!blueprint}"/update.sh
+ iocage exec "${jail}" "pkg update && pkg upgrade -y" && "${SCRIPT_DIR}"/blueprints/"${!blueprint}"/update.sh "${jail}"
iocage restart "${jail}"
iocage start "${jail}"
else