Update dokumentation.

This commit is contained in:
Christoph 2023-12-12 16:28:41 +01:00
parent 7bf365d747
commit f21dfa6edc
2 changed files with 94 additions and 21 deletions

View File

@ -2,19 +2,48 @@
# Copy existing user data to new pad
# =================
cryptpad_user=cryptpad
backup_date="2022-09-22-1001"
# Stop cryptpad service
#
systemctl stop cryptpad.service
# 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
for i in blob blobstage block datastore ; do
echo""
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
done
# logoff from cryptpad user
#
exit
# Start cryptpad service
#
systemctl start cryptpad.service

View File

@ -51,6 +51,10 @@ adduser --gid $cryptpad_uid --uid $cryptpad_uid --home $cryptpad_home_dir $crypt
su - ${cryptpad_user}
cryptpad_base_dir=/var/www/cryptpad
cryptpad_home_dir="${cryptpad_base_dir}"
cryptpad_install_dir="${cryptpad_home_dir}/cryptpad"
cd ${cryptpad_home_dir}
@ -79,12 +83,20 @@ npm ci
# #
# npm audit fix
#
npm fund
npm audit fix
#npm fund
#npm audit fix
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
# ---
@ -131,6 +143,48 @@ fi
# -
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
# -
# - In order allow a variety of features to be changed and to allow site-specific
@ -145,22 +199,7 @@ 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
# - 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
# - 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
#
# To build some of CryptPad static pages & enable social media link previews,
# run the following command:
#
npm run build
#cp -a ${cryptpad_install_dir}/customize.dist ${cryptpad_install_dir}/cryptpad/customize
# Exit from cryptpad user
#
@ -359,6 +398,11 @@ server {
}
EOF
ln -s ../sites-available/${vhost_config_file} /etc/nginx/sites-available/${vhost_config_file}
nginx -t
systemctl restart nginx
# ---
# Basic Check of your configuration: