Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make apps availble on deSEC #2422

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
694e063
make apps availble on deSEC
enoch85 Dec 28, 2022
3461bb4
Rename apps/collabora_docker_desec.sh to addons/deSEC/collabora_docke…
enoch85 Dec 28, 2022
1ef7641
add new function
enoch85 Dec 28, 2022
aa3111a
update menu
enoch85 Dec 28, 2022
0305773
talk
enoch85 Dec 28, 2022
af3c677
add onlyoffice
enoch85 Dec 28, 2022
febe625
Rename onlyoffice_docker._desec.sh to onlyoffice_docker_desec.sh
enoch85 Dec 28, 2022
298dbeb
Create onlyoffice_docker.sh
enoch85 Dec 28, 2022
6955314
Update collabora_docker_desec.sh
enoch85 Dec 28, 2022
9098598
Create talk_desec.sh
enoch85 Dec 28, 2022
fb5331f
Update onlyoffice_docker_desec.sh
enoch85 Dec 28, 2022
c7c73ca
typo
enoch85 Dec 28, 2022
d243cdf
typo
enoch85 Dec 28, 2022
282b6b6
Merge branch 'master' into desec-apps
enoch85 Dec 28, 2022
27c6035
fix comment
enoch85 Dec 28, 2022
0293172
change order
enoch85 Dec 29, 2022
617cb8e
collabora now generates as it should
enoch85 Dec 29, 2022
b72446d
onlyffice same as collabora
enoch85 Dec 29, 2022
1ce5053
stop at first occurance
enoch85 Dec 29, 2022
589f0e3
same changes as collabora and onlyoffice
enoch85 Dec 29, 2022
2669632
Merge branch 'master' into desec-apps
enoch85 Jan 5, 2023
cc92db9
Merge branch 'master' into desec-apps
enoch85 Jan 20, 2023
839d9e0
Merge branch 'master' into desec-apps
enoch85 Feb 6, 2023
22551e6
Merge branch 'master' into desec-apps
enoch85 Mar 17, 2023
1d61047
Merge branch 'master' into desec-apps
enoch85 Apr 2, 2023
3792d1d
Merge branch 'master' into desec-apps
enoch85 Apr 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
onlyffice same as collabora
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
enoch85 authored Dec 29, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b72446d533c535af79702f6eac5f3a5ce5bd46ab
131 changes: 67 additions & 64 deletions addons/deSEC/onlyoffice_docker_desec.sh
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ debug_mode
# Check if root
root_check

# Test RAM size (2GB min) + CPUs (min 2)
ram_check 2 OnlyOffice
cpu_check 2 OnlyOffice

# Check if onlyoffice is already installed
if ! does_this_docker_exist 'onlyoffice/documentserver'
then
@@ -52,81 +56,22 @@ export SUBDOMAIN=onlyoffice
if run_script DESEC desec_subdomain
then
SUBDOMAIN="$(grep onlyoffice -m 1 $SCRIPTS/deSEC/.subdomain | cut -d '=' -f2)"
# Curl the library another time to get the correct DHPARAMS
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
# Generate DHparams cipher
if [ ! -f "$DHPARAMS_SUB" ]
then
openssl dhparam -out "$DHPARAMS_SUB" 2048
fi
print_text_in_color "$IGreen" "Certs are generated!"
a2ensite "$SUBDOMAIN.conf"
restart_webserver
# Install OnlyOffice
# Install OnlyOffice App
install_and_enable_app onlyoffice
else
last_fail_tls "$SCRIPTS"/apps/onlyoffice.sh
exit 1
fi

# Check if apache2 evasive-mod is enabled and disable it because of compatibility issues
if [ "$(apache2ctl -M | grep evasive)" != "" ]
then
msg_box "We noticed that 'mod_evasive' is installed which is the DDOS protection for webservices. \
It has compatibility issues with OnlyOffice and you can now choose to disable it."
if ! yesno_box_yes "Do you want to disable DDOS protection?"
then
print_text_in_color "$ICyan" "Keeping mod_evasive active."
else
a2dismod evasive
# a2dismod mod-evasive # not needed, but existing in the Extra Security script.
apt-get purge libapache2-mod-evasive -y
systemctl restart apache2
fi
fi

# Nextcloud Main Domain
NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')

true
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh

# Get all needed variables from the library
nc_update

# Get the latest packages
apt-get update -q4 & spinner_loading

# Check if Nextcloud is installed
print_text_in_color "$ICyan" "Checking if Nextcloud is installed..."
if ! curl -s https://"$NCDOMAIN"/status.php | grep -q 'installed":true'
then
msg_box "It seems like Nextcloud is not installed or that you don't use https on:
$NCDOMAIN.
Please install Nextcloud and make sure your domain is reachable, or activate TLS
on your domain to be able to run this script.
If you use the Nextcloud VM you can use the Let's Encrypt script to get TLS and activate your Nextcloud domain.
When TLS is activated, run these commands from your CLI:
sudo curl -sLO $APP/onlyoffice_docker.sh
sudo bash onlyoffice_docker.sh"
last_fail_tls "$SCRIPTS"/apps/onlyoffice_docker.sh
exit 1
fi

# Test RAM size (2GB min) + CPUs (min 2)
ram_check 2 OnlyOffice
cpu_check 2 OnlyOffice

# Check if Nextcloud is installed with TLS
check_nextcloud_https "OnlyOffice (Docker)"

# Install Docker
install_docker

ONLYOFFICE_SECRET="$(gen_passwd "$SHUF" "a-zA-Z0-9")"

# Install Onlyoffice docker
docker pull onlyoffice/documentserver:latest
docker run -i -t -d -p 127.0.0.3:9090:80 -e JWT_ENABLED=true -e JWT_HEADER=AuthorizationJwt -e JWT_SECRET="$ONLYOFFICE_SECRET" --restart always --name onlyoffice onlyoffice/documentserver

# Install apache2
install_if_not apache2

@@ -206,6 +151,8 @@ HTTPS_CREATE
if [ -f "$HTTPS_CONF" ];
then
print_text_in_color "$IGreen" "$HTTPS_CONF was successfully created."
a2ensite "$SUBDOMAIN.conf"
restart_webserver
sleep 1
else
print_text_in_color "$IRed" "Unable to create vhost, exiting..."
@@ -214,6 +161,62 @@ HTTPS_CREATE
fi
fi

# Check if apache2 evasive-mod is enabled and disable it because of compatibility issues
if [ "$(apache2ctl -M | grep evasive)" != "" ]
then
msg_box "We noticed that 'mod_evasive' is installed which is the DDOS protection for webservices. \
It has compatibility issues with OnlyOffice and you can now choose to disable it."
if ! yesno_box_yes "Do you want to disable DDOS protection?"
then
print_text_in_color "$ICyan" "Keeping mod_evasive active."
else
a2dismod evasive
# a2dismod mod-evasive # not needed, but existing in the Extra Security script.
apt-get purge libapache2-mod-evasive -y
systemctl restart apache2
fi
fi

# Nextcloud Main Domain
NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')

true
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)

# Get all needed variables from the library
nc_update

# Get the latest packages
apt-get update -q4 & spinner_loading

# Check if Nextcloud is installed
print_text_in_color "$ICyan" "Checking if Nextcloud is installed..."
if ! curl -s https://"$NCDOMAIN"/status.php | grep -q 'installed":true'
then
msg_box "It seems like Nextcloud is not installed or that you don't use https on:
$NCDOMAIN.
Please install Nextcloud and make sure your domain is reachable, or activate TLS
on your domain to be able to run this script.
If you use the Nextcloud VM you can use the Let's Encrypt script to get TLS and activate your Nextcloud domain.
When TLS is activated, run these commands from your CLI:
sudo curl -sLO $APP/onlyoffice_docker.sh
sudo bash onlyoffice_docker.sh"
exit 1
fi

# Check if Nextcloud is installed with TLS
check_nextcloud_https "OnlyOffice (Docker)"

# Install Docker
install_docker

ONLYOFFICE_SECRET="$(gen_passwd "$SHUF" "a-zA-Z0-9")"

# Install Onlyoffice docker
docker pull onlyoffice/documentserver:latest
docker run -i -t -d -p 127.0.0.3:9090:80 -e JWT_ENABLED=true -e JWT_HEADER=AuthorizationJwt -e JWT_SECRET="$ONLYOFFICE_SECRET" --restart always --name onlyoffice onlyoffice/documentserver

# Set config for OnlyOffice
if [ -d "$NC_APPS_PATH"/onlyoffice ]
then