Compare commits

...

9 Commits

4 changed files with 256 additions and 19 deletions

34
README.OnlyOffice Normal file
View File

@ -0,0 +1,34 @@
# ---
# OnlyOffice is now a separate module
#
# OnlyOffice applications (Sheets, Document, Presentation) are not bundled with CryptPad
# anymore. You can install/update them by running the installation script we provide:
# ---
cryptpad_user=cryptpad
# - Stop cryptpad
# -
systemctl stop cryptpad
# Stop iptables firewall
#
ipt-firewall-server flush
ip6t-firewall-server flush
# Login as CryptPad user
#
su - ${cryptpad_user}
cd cryptpad
# Install OnlyOffice
#
# ./install-onlyoffice.sh
# # press q to close the license screen
# # and Y ⏎ to accept the OnlyOffice license
#
./install-onlyoffice.sh

View File

@ -2,19 +2,59 @@
# Copy existing user data to new pad # Copy existing user data to new pad
# ================= # =================
cryptpad_user=cryptpad
backup_date="2022-09-22-1001" # Stop cryptpad service
#
systemctl stop cryptpad.service systemctl stop cryptpad.service
for i in blob blobstage block datastore ; do
# login as cryptpad user
#
su - ${cryptpad_user}
backup_date="2023-12-12-1442"
# Backup current installation
#
cp -a cryptpad cryptpad.CURRENT
# Copy configuration file
#
cp cryptpad.BAK.${backup_date}/config/config.js cryptpad/config/config.js
# Instanzkonfiguration
#
# Note:
# some settings cannot be changed once user accounts have been created.
#
cp cryptpad.BAK.${backup_date}/customize/application_config.js cryptpad/customize/application_config.js
# Copy user data
#
#for i in blob blobstage block datastore ; do
for i in data datastore block blob ; do
echo"" echo""
echo -e " Syncing directory '${i}'.." echo -e " Syncing directory '${i}'.."
rsync -a --delete /var/www/cryptpad.BAK.${backup_date}/$i /var/www/cryptpad/cryptpad/ rsync -a --delete /var/www/cryptpad/cryptpad.BAK.${backup_date}/$i /var/www/cryptpad/cryptpad/
chown cryptpad:cryptpad /var/www/cryptpad/cryptpad/$i chown cryptpad:cryptpad /var/www/cryptpad/cryptpad/$i
done done
# logoff from cryptpad user
#
exit
# Start cryptpad service
#
systemctl start cryptpad.service systemctl start cryptpad.service

View File

@ -3,7 +3,7 @@
# ================= # =================
# - See: # - See:
# - https://blog.cavebeat.org/2017/07/cryptpad-installation-on-debian-stretch/ # - https://docs.cryptpad.org/en/admin_guide/installation.html
# - # -
# - See also: # - See also:
# - git repository: https://github.com/xwiki-labs/cryptpad # - git repository: https://github.com/xwiki-labs/cryptpad
@ -13,6 +13,9 @@
cryptpad_url=cpad-01.oopen.de cryptpad_url=cpad-01.oopen.de
cryptpad_url=o13-pad.oopen.de cryptpad_url=o13-pad.oopen.de
cryptpad_url=o13-cryptpad.oopen.de cryptpad_url=o13-cryptpad.oopen.de
cryptpad_url=pad.ra-kanzlei-kiel.de
cryptpad_url=crpad.fluechtlingsrat-berlin.de
# bei vorgeschalteter authentifizierung funktioniert # bei vorgeschalteter authentifizierung funktioniert
# eine *extra* sandbox url nicht. in diesem falle die gleiche # eine *extra* sandbox url nicht. in diesem falle die gleiche
@ -23,6 +26,8 @@ cryptpad_sandbox_url="$cryptpad_url"
cryptpad_sandbox_url="cpadsb-01.oopen.de" cryptpad_sandbox_url="cpadsb-01.oopen.de"
cryptpad_sandbox_url="o13-padsb.oopen.de" cryptpad_sandbox_url="o13-padsb.oopen.de"
cryptpad_sandbox_url="o13-cryptpadsb.oopen.de" cryptpad_sandbox_url="o13-cryptpadsb.oopen.de"
cryptpad_sandbox_url="sandbox.pad.ra-kanzlei-kiel.de"
cryptpad_sandbox_url="cpadsb.fluechtlingsrat-berlin.de"
vhost_config_file="${cryptpad_url}.conf" vhost_config_file="${cryptpad_url}.conf"
@ -51,6 +56,24 @@ adduser --gid $cryptpad_uid --uid $cryptpad_uid --home $cryptpad_home_dir $crypt
su - ${cryptpad_user} su - ${cryptpad_user}
cryptpad_base_dir=/var/www/cryptpad
cryptpad_home_dir="${cryptpad_base_dir}"
cryptpad_install_dir="${cryptpad_home_dir}/cryptpad"
cryptpad_url=cpad-01.oopen.de
cryptpad_url=o13-pad.oopen.de
cryptpad_url=o13-cryptpad.oopen.de
cryptpad_url=pad.ra-kanzlei-kiel.de
cryptpad_url=crpad.fluechtlingsrat-berlin.de
cryptpad_sandbox_url="cpadsb-01.oopen.de"
cryptpad_sandbox_url="o13-padsb.oopen.de"
cryptpad_sandbox_url="o13-cryptpadsb.oopen.de"
cryptpad_sandbox_url="sandbox.pad.ra-kanzlei-kiel.de"
cryptpad_sandbox_url="cpadsb.fluechtlingsrat-berlin.de"
cd ${cryptpad_home_dir} cd ${cryptpad_home_dir}
@ -65,6 +88,19 @@ git clone https://github.com/cryptpad/cryptpad.git ${cryptpad_install_dir}
cd ${cryptpad_install_dir} cd ${cryptpad_install_dir}
# !!! NOTE
#
# Switch of IPv4 and IPv6 firewall
# ================================
#
# You will run into connection limit if the setting is too sensitive
#
# !!! NOTE
# - Complete Installation of cryptpad # - Complete Installation of cryptpad
# - # -
npm ci npm ci
@ -79,12 +115,21 @@ npm ci
# # # #
# npm audit fix # npm audit fix
# #
npm fund #npm fund
npm audit fix #npm audit fix
npm run install:components npm run install:components
# Build static pages & Open Graph metadata
#
# To build some of CryptPad static pages & enable social media link previews,
# run the following command:
#
npm run build
# --- # ---
# - Configure CryptPad # - Configure CryptPad
# --- # ---
@ -131,6 +176,48 @@ fi
# - # -
perl -i -n -p -e"s#(\s*)(/*\s*)(defaultStorageLimit:.*)#\1//\3\n\1defaultStorageLimit: 250 * 1024 * 1024,#" ${cryptpad_install_dir}/config/config.js perl -i -n -p -e"s#(\s*)(/*\s*)(defaultStorageLimit:.*)#\1//\3\n\1defaultStorageLimit: 250 * 1024 * 1024,#" ${cryptpad_install_dir}/config/config.js
# - Instance customization
# -
# - The functionality as well as the look-and-feel of an instance can be customized
# - by creating a customize folder and copying assets to be customized (images,
# - stylesheets, page templates, etc) from customize.dist into it. If a file exists
# -in customize, it will be served to users instead of its namesake in customize.dist.
# -
# - The purpose of the customize directory is to make it easier to upgrade CryptPad
# - while maintaining customizations in place. Occasionally, a major new version may
# - introduce breaking changes or require adjustments in the customizations.
# - Administrators with customized instances are therefore encouraged to read
# - instructions carefully before each upgrade.
# -
mkdir -p ${cryptpad_install_dir}/cryptpad/customize
# - Application config
# -
# - A wide range of settings are available in www/common/application_config_internal.js.
# - To modify them:
# -
# - 1. Make a copy of customize.dist/application_config.js in the customize folder.
# -
# - 2. Copy the default value(s) to modify from www/common/application_config_internal.js
# - into customize/application_config.js.
# -
cp ${cryptpad_install_dir}/customize.dist/application_config.js ${cryptpad_install_dir}/customize/
# - Restricting guest access
# -
# - To disable unregistered use of CryptPad, add the following to
# - customize/application_config.js:
# -
# - AppConfig.registeredOnlyTypes = AppConfig.availablePadTypes;
# ---
# - for further configurations see:
# - https://docs.cryptpad.org/en/admin_guide/customization.html#application-config
# ---
# - Customizing CryptPad # - Customizing CryptPad
# - # -
# - In order allow a variety of features to be changed and to allow site-specific # - In order allow a variety of features to be changed and to allow site-specific
@ -145,22 +232,20 @@ perl -i -n -p -e"s#(\s*)(/*\s*)(defaultStorageLimit:.*)#\1//\3\n\1defaultStorage
# - '/customize.dist/' to '/customize' and then edit it there, this way you will # - '/customize.dist/' to '/customize' and then edit it there, this way you will
# - still be able to pull from (and make pull requests to (!) the git repository. # - still be able to pull from (and make pull requests to (!) the git repository.
# - # -
cp -a /var/www/cryptpad/customize.dist /var/www/cryptpad/customize #cp -a ${cryptpad_install_dir}/customize.dist ${cryptpad_install_dir}/cryptpad/customize
# - Copy 'favicon.ico' to '/var/www/cryptpad/customize/main-favicon.png'
# -
#cp ~chris/favicon.ico /var/www/cryptpad/customize/main-favicon.png
#cp ~chris/favicon.ico /var/www/cryptpad/customize.dist/
#chown www-data:www-data /var/www/cryptpad/customize/main-favicon.png
#chown www-data:www-data /var/www/cryptpad/customize.dist/favicon.ico
# Build static pages & Open Graph metadata # Install OnlyOffice - OnlyOffice is now a separate module
# #
# To build some of CryptPad static pages & enable social media link previews, # OnlyOffice applications (Sheets, Document, Presentation) are not bundled with CryptPad
# run the following command: # anymore. You can install/update them by running the installation script we provide:
# #
npm run build # ./install-onlyoffice.sh
# # press q to close the license screen
# # and Y ⏎ to accept the OnlyOffice license
#
./install-onlyoffice.sh
# Exit from cryptpad user # Exit from cryptpad user
# #
@ -359,6 +444,11 @@ server {
} }
EOF EOF
ln -s ../sites-available/${vhost_config_file} /etc/nginx/sites-enabled/${vhost_config_file}
nginx -t
systemctl restart nginx
# --- # ---
# Basic Check of your configuration: # Basic Check of your configuration:

73
README.upgrade Normal file
View File

@ -0,0 +1,73 @@
# ====================
# - Upgrading CryptPad
# ====================
# see: https://docs.cryptpad.org/en/admin_guide/maintenance.html#upgrading-cryptpad
# - Note!
# -
# - Always read the release notes before upgrading, as there may be changes
# - that require special consideration.
cryptpad_user=cryptpad
# - Stop cryptpad
# -
systemctl stop cryptpad
# Stop iptables firewall
#
ipt-firewall-server flush
ip6t-firewall-server flush
# Login as CryptPad user
#
su - ${cryptpad_user}
# - Backup existing installation
# -
cp -a cryptpad cryptpad.BAK.$(date +%Y-%m-%d-%H%M)
# - Change into installation directory
# -
cd cryptpad
# - Update Git repository
# -
git pull
npm update
npm run install:components
# OnlyOffice is now a separate module
#
# OnlyOffice applications (Sheets, Document, Presentation) are not bundled with CryptPad
# anymore. You can install/update them by running the installation script we provide:
#
# ./install-onlyoffice.sh
# # press q to close the license screen
# # and Y ⏎ to accept the OnlyOffice license
#
./install-onlyoffice.sh
exit
# Restart firewll
#
ipt-firewall-server
ip6t-firewall-server
# - Start cryptpad
# -
systemctl start cryptpad