Merge pull request #132 from jailmanager/minor-dev

V1.2.3
This commit is contained in:
Kjeld Schouten-Lebbing 2020-07-15 18:52:13 +02:00 committed by GitHub
commit 881ef5f95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 469 additions and 118 deletions

9
.github/CODEOWNERS vendored Normal file
View File

@ -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

27
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -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.

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

18
.github/SECURITY.md vendored Normal file
View File

@ -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)

View File

@ -4,6 +4,7 @@ on:
branches: branches:
- master - master
- dev - dev
- minor-dev
jobs: jobs:
build: build:

View File

@ -8,6 +8,7 @@ on:
branches: branches:
- master - master
- dev - dev
- minor-dev
jobs: jobs:
Shellcheck: Shellcheck:

View File

@ -1 +1 @@
disable=SC2034 disable=SC2034,SC2154

View File

@ -1,3 +1,3 @@
blueprint: blueprint:
bitwarden: bitwarden:
pkgs: sqlite3 nginx git sudo vim-tiny bash node npm python27-2.7.17_1 mariadb104-client pkgs: git sudo bash node npm mariadb104-client

View File

@ -7,7 +7,7 @@
JAIL_IP="jail_${1}_ip4_addr" JAIL_IP="jail_${1}_ip4_addr"
JAIL_IP="${!JAIL_IP%/*}" JAIL_IP="${!JAIL_IP%/*}"
HOST_NAME="jail_${1}_host_name" HOST_NAME="jail_${1}_host_name"
DB_DATABASE="jail_${1}_db_datavase" DB_DATABASE="jail_${1}_db_database"
DB_USER="jail_${1}_db_user" DB_USER="jail_${1}_db_user"
# shellcheck disable=SC2154 # shellcheck disable=SC2154
INSTALL_TYPE="jail_${1}_type" INSTALL_TYPE="jail_${1}_type"

View File

@ -1,7 +1,7 @@
#!/usr/local/bin/bash #!/usr/local/bin/bash
# This file contains the install script for jackett # 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" "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" 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" iocage exec "$1" "pw user add jackett -c jackett -u 818 -d /nonexistent -s /usr/bin/nologin"

View File

@ -12,9 +12,9 @@ createmount "$1" "${global_dataset_media}"
createmount "$1" "${global_dataset_media}"/music /mnt/music 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" "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.develop.0.2.0.371.linux.tar.gz -C /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.develop.0.2.0.371.linux.tar.gz" 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" "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" chown -R lidarr:lidarr /usr/local/share/Lidarr /config
iocage exec "$1" mkdir /usr/local/etc/rc.d iocage exec "$1" mkdir /usr/local/etc/rc.d

View File

@ -1,3 +1,3 @@
blueprint: blueprint:
mariadb: 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

View File

@ -0,0 +1,156 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @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 <https://docs.phpmyadmin.net/>.
*/

View File

@ -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

View File

@ -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] [client]
password=mypassword password=mypassword
port=3306
socket=/config/mysql.sock

View File

@ -35,22 +35,33 @@ if [ "$(ls -A "/mnt/${global_dataset_config}/${1}/db")" ]; then
fi fi
# Mount database dataset and set zfs preferences # 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 recordsize=16K "${global_dataset_config}"/"${1}"/db
zfs set primarycache=metadata "${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 # Install includes fstab
iocage exec "${1}" mkdir -p /mnt/includes iocage exec "${1}" mkdir -p /mnt/includes
iocage fstab -a "${1}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0 iocage fstab -a "${1}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0
iocage exec "${1}" mkdir -p /usr/local/www/phpmyadmin iocage exec "${1}" cp -f /mnt/includes/my.cnf /config/my.cnf
iocage exec "${1}" chown -R www:www /usr/local/www/phpmyadmin 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 exit 1
fi fi
iocage exec "${1}" sysrc mysql_enable="YES"
# Copy and edit pre-written config files # Copy and edit pre-written config files
echo "Copying Caddyfile for no SSL" echo "Copying Caddyfile for no SSL"
iocage exec "${1}" cp -f /mnt/includes/caddy.rc /usr/local/etc/rc.d/caddy iocage exec "${1}" cp -f /mnt/includes/caddy.rc /usr/local/etc/rc.d/caddy
@ -84,7 +93,6 @@ if [ "${REINSTALL}" == "true" ]; then
else else
# Secure database, set root password, create Nextcloud DB, user, and password # 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='';"
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 "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;" 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 --user=root password "${!DB_ROOT_PASSWORD}"
iocage exec "${1}" mysqladmin reload iocage exec "${1}" mysqladmin reload
fi 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 # Save passwords for later reference
iocage exec "${1}" echo "MariaDB root password is ${!DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt iocage exec "${1}" echo "MariaDB root password is ${!DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt

View File

@ -1,4 +1,3 @@
blueprint: blueprint:
nextcloud: 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 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
ports: true

View File

@ -98,8 +98,8 @@ tcp-backlog 511
# incoming connections. There is no default, so Redis will not listen # incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified. # on a unix socket when not specified.
# #
unixsocket /tmp/redis.sock unixsocket /var/run/redis/redis.sock
unixsocketperm 777 unixsocketperm 770
# Close the connection after a client is idle for N seconds (0 to disable) # Close the connection after a client is idle for N seconds (0 to disable)
timeout 0 timeout 0

View File

@ -50,7 +50,7 @@ if [ -z "${JAIL_IP}" ]; then
exit 1 exit 1
fi fi
if [ -z "${ADMIN_PASSWORD}" ]; then if [ -z "${!ADMIN_PASSWORD}" ]; then
echo 'Configuration error: The Nextcloud jail requires a admin_password' echo 'Configuration error: The Nextcloud jail requires a admin_password'
echo 'Please reinstall using a fixed IP adress' echo 'Please reinstall using a fixed IP adress'
exit 1 exit 1
@ -130,7 +130,7 @@ iocage exec "${1}" chmod -R 770 /config/files
##### #####
if [ "${DB_TYPE}" = "mariadb" ]; then 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 fi
fetch -o /tmp https://getcaddy.com fetch -o /tmp https://getcaddy.com
@ -142,8 +142,6 @@ fi
iocage exec "${1}" sysrc redis_enable="YES" iocage exec "${1}" sysrc redis_enable="YES"
iocage exec "${1}" sysrc php_fpm_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 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 then
echo "Failed to download Nextcloud" echo "Failed to download Nextcloud"
@ -167,6 +165,7 @@ then
fi fi
iocage exec "${1}" tar xjf /tmp/"${FILE}" -C /usr/local/www/ 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}" chown -R www:www /usr/local/www/nextcloud/
iocage exec "${1}" pw usermod www -G redis
# Generate and install self-signed cert, if necessary # Generate and install self-signed cert, if necessary
@ -233,7 +232,7 @@ else
# Save passwords for later reference # 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 "${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 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 # CLI installation and configuration of Nextcloud
if [ "${DB_TYPE}" = "mariadb" ]; then 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 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 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 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 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 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}\"" 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" echo "You did a reinstall, please use your old database and account credentials"
else else
echo "Default user is admin, password is ${ADMIN_PASSWORD}" echo "Default user is admin, password is ${!ADMIN_PASSWORD}"
echo "" echo ""
echo "Database Information" echo "Database Information"

View File

@ -1,3 +1,3 @@
blueprint: blueprint:
organizr: 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 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

View File

@ -1,3 +1,3 @@
blueprint: blueprint:
tautulli: tautulli:
pkgs: python2 py27-sqlite3 py27-openssl git pkgs: python37 py37-setuptools py37-sqlite3 py37-openssl py37-pycryptodomex python3 git

View File

@ -1,6 +1,7 @@
#!/usr/local/bin/bash #!/usr/local/bin/bash
# This file contains the install script for Tautulli # 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" 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" "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 iocage exec "$1" chown -R tautulli:tautulli /usr/local/share/Tautulli /config

View File

@ -2,6 +2,7 @@
# This file contains the update script for Tautulli # This file contains the update script for Tautulli
iocage exec "$1" service tautulli stop 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 # 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" 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 iocage exec "$1" cp /usr/local/share/Tautulli/init-scripts/init.freenas /usr/local/etc/rc.d/tautulli

View File

@ -2,6 +2,7 @@
# This file contains the update script for transmission # This file contains the update script for transmission
iocage exec "$1" service transmission stop iocage exec "$1" service transmission stop
# Transmision is updated during PKG update, this file is mostly just a placeholder # Transmision is updated during PKG update, this file is mostly just a placeholder
iocage exec "$1" chown -R transmission:transmission /config iocage exec "$1" chown -R transmission:transmission /config
iocage exec "$1" service transmission restart iocage exec "$1" service transmission restart

View File

@ -63,10 +63,7 @@ iocage exec "${1}" sysrc unifi_enable=YES
iocage exec "${1}" service unifi start iocage exec "${1}" service unifi start
# shellcheck disable=SC2154 # shellcheck disable=SC2154
if [[ ! "${!POLLER}" ]]; then if [ "${!POLLER}" == true ]; then
echo "Installation complete!"
echo "Unifi Controller is accessible at https://${JAIL_IP}:8443."
else
# Check if influxdb container exists, create unifi database if it does, error if it is not. # 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..." echo "Checking if the database jail and database exist..."
if [[ -d /mnt/"${global_dataset_iocage}"/jails/"${!DB_JAIL}" ]]; then 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 "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 "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." 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 fi

View File

@ -2,20 +2,28 @@
# This file contains the update script for unifi # This file contains the update script for unifi
# Unifi Controller is updated through pkg, Unifi-Poller is not. This script updates Unifi-Poller # 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") POLLER="jail_${1}_unifi_poller"
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 # shellcheck disable=SC2154
if [[ -f /mnt/"${global_dataset_config}"/"${1}"/"${FILE_NAME}" ]]; then 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." echo "Unifi-Poller is up to date."
exit 1 exit 1
else else
# Download and install the package # Download and install the package
iocage exec "${1}" fetch -o /config "${DOWNLOAD}" iocage exec "${1}" fetch -o /config "${DOWNLOAD}"
iocage exec "${1}" pkg install -qy /config/"${FILE_NAME}" iocage exec "${1}" pkg install -qy /config/"${FILE_NAME}"
iocage exec "${1}" service unifi restart
iocage exec "${1}" service unifi_poller restart iocage exec "${1}" service unifi_poller restart
fi
else
echo "Skipping Unifi Poller for update, not installed"
fi fi
iocage exec "${1}" service unifi restart
echo "Update complete!" echo "Update complete!"

View File

@ -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.

View File

@ -1,16 +0,0 @@
# Pull Request Template
### Purpose
_Describe the problem the PR fixes or the feature it introduces_<br>
_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)

View File

@ -1 +0,0 @@
3

View File

@ -24,21 +24,29 @@ parse_yaml() {
# automatic update function # automatic update function
gitupdate() { gitupdate() {
git remote add upstream https://github.com/jailmanager/jailman.git > /dev/null 2>&1 if [ "$(git config --get remote.origin.url)" = "https://github.com/Ornias1993/jailman" ]
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" ];
then then
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 "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" echo "script requires update"
git reset --hard > /dev/null 2>&1 git reset --hard > /dev/null 2>&1
git checkout "${1}" > /dev/null 2>&1
git pull > /dev/null 2>&1 git pull > /dev/null 2>&1
echo "script updated, please restart the script manually" echo "script updated, please restart the script manually"
exit 1 exit 1
else else
echo "script up-to-date" echo "script up-to-date"
fi
fi fi
} }
@ -87,13 +95,13 @@ fi
rm /tmp/pkg.json rm /tmp/pkg.json
echo "creating jail config directory" echo "creating jail config directory"
# shellcheck disable=SC2154 # shellcheck disable=SC2154
createmount "${1}" "${global_dataset_config}" createmount "${1}" "${global_dataset_config}" || exit 1
createmount "${1}" "${global_dataset_config}"/"${1}" /config createmount "${1}" "${global_dataset_config}"/"${1}" /config || exit 1
# Create and Mount portsnap # Create and Mount portsnap
createmount "${1}" "${global_dataset_config}"/portsnap createmount "${1}" "${global_dataset_config}"/portsnap || exit 1
createmount "${1}" "${global_dataset_config}"/portsnap/db /var/db/portsnap createmount "${1}" "${global_dataset_config}"/portsnap/db /var/db/portsnap || exit 1
createmount "${1}" "${global_dataset_config}"/portsnap/ports /usr/ports createmount "${1}" "${global_dataset_config}"/portsnap/ports /usr/ports || exit 1
if [ "${!blueprintports}" == "true" ] if [ "${!blueprintports}" == "true" ]
then then
echo "Mounting and fetching ports" echo "Mounting and fetching ports"
@ -117,7 +125,7 @@ createmount() {
else else
if [ ! -d "/mnt/$2" ]; then if [ ! -d "/mnt/$2" ]; then
echo "Dataset does not exist... Creating... $2" echo "Dataset does not exist... Creating... $2"
zfs create "${2}" zfs create "${2}" || exit 1
else else
echo "Dataset already exists, skipping creation of $2" echo "Dataset already exists, skipping creation of $2"
fi fi
@ -125,9 +133,9 @@ createmount() {
if [ -n "$1" ] && [ -n "$3" ]; then if [ -n "$1" ] && [ -n "$3" ]; then
iocage exec "${1}" mkdir -p "${3}" iocage exec "${1}" mkdir -p "${3}"
if [ -n "${4}" ]; then if [ -n "${4}" ]; then
iocage fstab -a "${1}" /mnt/"${2}" "${3}" "${4}" iocage fstab -a "${1}" /mnt/"${2}" "${3}" "${4}" || exit 1
else 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 fi
else else
echo "No Jail Name or Mount target specified, not mounting dataset" echo "No Jail Name or Mount target specified, not mounting dataset"

View File

@ -20,8 +20,7 @@ if ! [ "$(id -u)" = 0 ]; then
fi fi
# Auto Update # Auto Update
BRANCH="upstream/master" gitupdate $(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)") || exit 1
gitupdate ${BRANCH}
# If no option is given, point to the help menu # If no option is given, point to the help menu
if [ $# -eq 0 ] if [ $# -eq 0 ]
@ -197,7 +196,7 @@ else
then then
echo "Updating $jail" echo "Updating $jail"
iocage update "${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 restart "${jail}"
iocage start "${jail}" iocage start "${jail}"
else else