| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:linux:nginx:friendica [2025/12/22 02:24] – Sean Rhone | servers:linux:nginx:friendica [2026/01/01 04:41] (current) – [Etc] Sean Rhone |
|---|
| ===== Prerequisites ===== | ===== Prerequisites ===== |
| |
| * [[linux:distros:server:ubuntu_server|Ubuntu Server]] | * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]] |
| * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] | * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] |
| * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]] | * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]] |
| * https://wiki.friendi.ca/docs/install#requirements | * https://wiki.friendi.ca/docs/install#requirements |
| |
| sudo apt install composer php-curl php-gd php-gmp php-mbstring php-intl php-mysql php-zip | sudo zypper install php-composer2 php8-curl php-gd php8-gmp php8-pdo php8-mbstring php8-intl php8-mysql php8-zip php8-openssl php8-fileinfo php8-posix |
| |
| ====== Download Source ====== | ====== Download Source ====== |
| * https://github.com/friendica/friendica/commits/develop/ | * https://github.com/friendica/friendica/commits/develop/ |
| |
| sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/var/www/social' && sudo chown -R 'www-data':'www-data' '/var/www/social' && sudo chmod -R '0755' '/var/www/social' | sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica.git' '/srv/www/social' && sudo chown -R 'wwwrun':'www' '/srv/www/social' && sudo chmod -R '0755' '/srv/www/social' |
| |
| ===== Addons ===== | ===== Addons ===== |
| * :!: Required for ''composer install'' even without any addons enabled | * :!: Required for ''composer install'' even without any addons enabled |
| |
| sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica-addons.git' '/var/www/social/addon' && sudo chown -R 'www-data':'www-data' '/var/www/social/addon' && sudo chmod -R '0755' '/var/www/social/addon' | sudo git clone --branch 'develop' --depth '1' --recurse-submodules 'https://github.com/friendica/friendica-addons.git' '/srv/www/social/addon' && sudo chown -R 'wwwrun':'www' '/srv/www/social/addon' && sudo chmod -R '0755' '/srv/www/social/addon' |
| |
| ====== Environment ====== | ====== Environment ====== |
| ===== Composer ===== | ===== Composer ===== |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/tmp' && '/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev | cd '/tmp' && '/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev |
| |
| exit | exit |
| |
| ===== php-json-ld Fix ===== | |
| |
| * 2025/12/22: ''git.friendi.ca'' requires authentication and fails during ''composer install'' | |
| * [[https://github.com/friendica/friendica/issues/15340|#15340]] | |
| |
| nano '/var/www/social/composer.lock' | |
| |
| <code> | |
| "url": "https://github.com/digitalbazaar/php-json-ld.git", | |
| "reference": "fe18c3f2ce47f30ace904ef58e7416f933be25e1"</code> | |
| |
| friendica/json-ld | |
| |
| <code> | |
| "name": "friendica/json-ld", | |
| "version": "1.1.4", | |
| "source": { | |
| "type": "git", | |
| "url": "https://github.com/digitalbazaar/php-json-ld.git", | |
| "reference": "fe18c3f2ce47f30ace904ef58e7416f933be25e1" | |
| },</code> | |
| |
| ==== sed Test ==== | |
| |
| sudo su 'www-data' -s '/bin/bash' | |
| |
| sed -i 's|https://git.friendi.ca/friendica/php-json-ld|https://github.com/digitalbazaar/php-json-ld.git|g' '/var/www/social/composer.lock' | |
| |
| sed -i 's/1f33c8766b5cfbecfbc2122238873debeed35fb6/fe18c3f2ce47f30ace904ef58e7416f933be25e1/g' '/var/www/social/composer.lock' | |
| |
| ====== Database ====== | ====== Database ====== |
| ===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== |
| |
| sudo -e '/etc/php/8.4/fpm/pool.d/social.conf' && sudo systemctl restart 'php8.4-fpm' | sudo -e '/etc/php8/fpm/php-fpm.d/social.conf' && sudo systemctl restart 'php-fpm' |
| |
| <code> | <code> |
| |
| ; User/Group | ; User/Group |
| user = "www-data" | user = "wwwrun" |
| group = "www-data" | group = "www" |
| |
| ; Socket | ; Socket |
| listen = "/run/php/social.sock" | listen = "/run/php-fpm/social.sock" |
| listen.owner = "www-data" | listen.owner = "wwwrun" |
| listen.group = "www-data" | listen.group = "www" |
| listen.mode = "0662" | listen.mode = "0662" |
| |
| ; General | ; General |
| php_value[date.timezone] = "America/New_York" | php_value[date.timezone] = "America/New_York" |
| | |
| | ; openSUSE php.ini Defaults |
| | php_value[session.save_path] = "/var/lib/php8/sessions" |
| |
| ; Friendica | ; Friendica |
| ===== FastCGI ===== | ===== FastCGI ===== |
| |
| sudo -e '/etc/nginx/snippets/social.conf' | sudo -e '/etc/nginx/default.d/social.conf' |
| |
| <code> | <code> |
| fastcgi_param 'HTTPS' 'on'; | fastcgi_param 'HTTPS' 'on'; |
| |
| fastcgi_pass 'unix:/run/php/social.sock'; | fastcgi_pass 'unix:/run/php-fpm/social.sock'; |
| |
| } | } |
| ===== Server Block ===== | ===== Server Block ===== |
| |
| * :!: ''sites-enabled'' should be done after [[#initialize]] | sudo -e '/etc/nginx/vhosts.d/social.conf' && sudo systemctl reload 'nginx' |
| | |
| sudo -e '/etc/nginx/sites-available/social.conf' | |
| |
| <code> | <code> |
| http2 'on'; | http2 'on'; |
| server_name 'social.realmofespionage.xyz'; | server_name 'social.realmofespionage.xyz'; |
| root '/var/www/social'; | root '/srv/www/social'; |
| index 'index.php'; | index 'index.php'; |
| |
| include '/etc/nginx/snippets/social.conf'; | include '/etc/nginx/default.d/social.conf'; |
| include '/etc/nginx/snippets/headers.conf'; | include '/etc/nginx/default.d/headers.conf'; |
| |
| client_max_body_size '10M'; | client_max_body_size '10M'; |
| |
| # End</code> | # End</code> |
| |
| sudo ln -s -f '/etc/nginx/sites-available/social.conf' '/etc/nginx/sites-enabled/social.conf' && sudo systemctl reload 'nginx' | |
| |
| ====== Initial Setup ====== | ====== Initial Setup ====== |
| * :?: Might be able to use ''--file'' on manually-created [[#localconfigphp|local.config.php]] instead | * :?: Might be able to use ''--file'' on manually-created [[#localconfigphp|local.config.php]] instead |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/var/www/social' && '/var/www/social/bin/console' autoinstall --dbhost 'localhost' --dbport '3365' --dbdata 'friendica' --dbuser 'friendica' --url 'https://social.realmofespionage.xyz' --basepath '/var/www/social' --dbpass 'x' --admin 'x' | cd '/srv/www/social' && '/srv/www/social/bin/console' autoinstall --dbhost 'localhost' --dbport '3365' --dbdata 'friendica' --dbuser 'friendica' --url 'https://social.realmofespionage.xyz' --basepath '/srv/www/social' --dbpass 'x' --admin 'x' |
| |
| ===== Account Create ===== | ===== Account Create ===== |
| * :!: ''x'' is the **nickname** chosen at website registration | * :!: ''x'' is the **nickname** chosen at website registration |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/var/www/social' && '/var/www/social/bin/console' user password 'x' | cd '/srv/www/social' && '/srv/www/social/bin/console' user password 'x' |
| |
| ===== Disable Registration ===== | ===== Disable Registration ===== |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'register_policy' '0' | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'config' 'register_policy' '0' |
| |
| ===== Etc ===== | ===== Etc ===== |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| | |
| | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' worker |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' worker | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure update --force |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' dbstructure update --force | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure drop --execute |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' dbstructure drop --execute | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' postupdate |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' postupdate | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' cache clear |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' cache clear | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' clearavatarcache |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' clearavatarcache | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'system' 'basepath' '/srv/www/social' |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica' | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config 'config' 'info' 'https://wiki.realmofespionage.xyz/servers:linux:nginx:friendica' |
| |
| exit | exit |
| * :!: Change database ''password'' and config ''admin_email'' | * :!: Change database ''password'' and config ''admin_email'' |
| |
| sudo -u 'www-data' -e '/var/www/social/config/local.config.php' | sudo -e '/srv/www/social/config/local.config.php' && sudo chown -v 'wwwrun':'www' '/srv/www/social/config/local.config.php' |
| |
| <code> | <code> |
| 'system' => [ | 'system' => [ |
| 'url' => 'https://social.realmofespionage.xyz', | 'url' => 'https://social.realmofespionage.xyz', |
| 'basepath' => '/var/www/social', | 'basepath' => '/srv/www/social', |
| 'default_timezone' => 'America/New_York', | 'default_timezone' => 'America/New_York', |
| 'language' => 'en', | 'language' => 'en', |
| * :!: Set email for **both** ''user.email'' | * :!: Set email for **both** ''user.email'' |
| |
| sudo mkdir -p '/etc/nginx/scripts/social' && sudo -e '/etc/nginx/scripts/social/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/social/git-fix.sh' && sudo chown 'www-data':'www-data' '/etc/nginx/scripts/social/git-fix.sh' | sudo mkdir -p '/etc/nginx/scripts/social' && sudo -e '/etc/nginx/scripts/social/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/social/git-fix.sh' && sudo chown 'wwwrun':'www' '/etc/nginx/scripts/social/git-fix.sh' |
| |
| <code> | <code> |
| #!/bin/bash | #!/bin/bash |
| |
| '/usr/bin/rm' -Rf '/var/www/social/.git' | cd '/tmp' |
| '/usr/bin/git' -C '/var/www/social' init --initial-branch='develop' | |
| '/usr/bin/git' -C '/var/www/social' add '.' | '/usr/bin/rm' -Rf '/srv/www/social/.git' |
| | '/usr/bin/git' -C '/srv/www/social' init --initial-branch='develop' |
| | '/usr/bin/git' -C '/srv/www/social' add '.' |
| |
| ######################################## | ######################################## |
| '/usr/bin/git' -C '/var/www/social' config 'user.email' 'espionage724@x' | '/usr/bin/git' -C '/srv/www/social' config 'user.email' 'espionage724@x' |
| ######################################## | ######################################## |
| |
| '/usr/bin/git' -C '/var/www/social' commit --message='x' | '/usr/bin/git' -C '/srv/www/social' commit --message='x' |
| |
| '/usr/bin/git' -C '/var/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' | '/usr/bin/git' -C '/srv/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' |
| '/usr/bin/git' -C '/var/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase | '/usr/bin/git' -C '/srv/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase |
| |
| '/usr/bin/git' -C '/var/www/social' reset --hard 'origin/develop' | '/usr/bin/git' -C '/srv/www/social' reset --hard 'origin/develop' |
| '/usr/bin/git' -C '/var/www/social' gc --aggressive --prune='all' | '/usr/bin/git' -C '/srv/www/social' gc --aggressive --prune='all' |
| '/usr/bin/git' -C '/var/www/social' fsck --full --strict | '/usr/bin/git' -C '/srv/www/social' fsck --full --strict |
| |
| '/usr/bin/rm' -Rf '/var/www/social/addon/.git' | '/usr/bin/rm' -Rf '/srv/www/social/addon/.git' |
| '/usr/bin/git' -C '/var/www/social/addon' init --initial-branch='develop' | '/usr/bin/git' -C '/srv/www/social/addon' init --initial-branch='develop' |
| '/usr/bin/git' -C '/var/www/social/addon' add '.' | '/usr/bin/git' -C '/srv/www/social/addon' add '.' |
| |
| ######################################## | ######################################## |
| '/usr/bin/git' -C '/var/www/social/addon' config 'user.email' 'espionage724@x' | '/usr/bin/git' -C '/srv/www/social/addon' config 'user.email' 'espionage724@x' |
| ######################################## | ######################################## |
| |
| '/usr/bin/git' -C '/var/www/social/addon' commit --message='x' | '/usr/bin/git' -C '/srv/www/social/addon' commit --message='x' |
| |
| '/usr/bin/git' -C '/var/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' | '/usr/bin/git' -C '/srv/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' |
| '/usr/bin/git' -C '/var/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase | '/usr/bin/git' -C '/srv/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase |
| |
| '/usr/bin/git' -C '/var/www/social/addon' reset --hard 'origin/develop' | '/usr/bin/git' -C '/srv/www/social/addon' reset --hard 'origin/develop' |
| '/usr/bin/git' -C '/var/www/social/addon' gc --aggressive --prune='all' | '/usr/bin/git' -C '/srv/www/social/addon' gc --aggressive --prune='all' |
| '/usr/bin/git' -C '/var/www/social/addon' fsck --full --strict | '/usr/bin/git' -C '/srv/www/social/addon' fsck --full --strict |
| |
| # End</code> | # End</code> |
| |
| sudo -u 'www-data' '/etc/nginx/scripts/social/git-fix.sh' | ==== Execute ==== |
| | |
| | sudo su 'wwwrun' -s '/bin/bash' |
| | |
| | '/etc/nginx/scripts/social/git-fix.sh' |
| | |
| | exit |
| |
| ====== Services ====== | ====== Services ====== |
| |
| ===== Worker ===== | ===== Worker ===== |
| | |
| | * https://wiki.friendi.ca/docs/install#required_background_tasks |
| |
| ==== Service ==== | ==== Service ==== |
| <code> | <code> |
| [Service] | [Service] |
| User=www-data | User=wwwrun |
| Group=www-data | Group=www |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/var/www/social | WorkingDirectory=/srv/www/social |
| |
| ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' worker | ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' worker |
| |
| # End</code> | # End</code> |
| |
| ==== Timer ==== | ==== Timer ==== |
| |
| * https://wiki.friendi.ca/docs/install#required_background_tasks | |
| |
| * Every 10 minutes | * Every 10 minutes |
| <code> | <code> |
| [Service] | [Service] |
| User=www-data | User=wwwrun |
| Group=www-data | Group=www |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/var/www/social | WorkingDirectory=/srv/www/social |
| Environment="COMPOSER_CACHE_DIR=/dev/null" | Environment="COMPOSER_CACHE_DIR=/dev/null" |
| |
| ExecStart='/usr/bin/git' -C '/var/www/social' reset --hard 'origin/develop' | ExecStart='/usr/bin/git' -C '/srv/www/social' reset --hard 'origin/develop' |
| ExecStart='/usr/bin/git' -C '/var/www/social' pull origin 'develop' --rebase | ExecStart='/usr/bin/git' -C '/srv/www/social' pull origin 'develop' --rebase |
| |
| ExecStart='/usr/bin/git' -C '/var/www/social/addon' reset --hard 'origin/develop' | ExecStart='/usr/bin/git' -C '/srv/www/social/addon' reset --hard 'origin/develop' |
| ExecStart='/usr/bin/git' -C '/var/www/social/addon' pull origin 'develop' --rebase | ExecStart='/usr/bin/git' -C '/srv/www/social/addon' pull origin 'develop' --rebase |
| |
| # Temp php-json-ld Fix (#15340) | ExecStart='/usr/bin/composer' --working-dir='/srv/www/social' --no-cache install --no-dev |
| ExecStart='/usr/bin/sed' -i 's|https://git.friendi.ca/friendica/php-json-ld|https://github.com/digitalbazaar/php-json-ld.git|g' '/var/www/social/composer.lock' | |
| ExecStart='/usr/bin/sed' -i 's/1f33c8766b5cfbecfbc2122238873debeed35fb6/fe18c3f2ce47f30ace904ef58e7416f933be25e1/g' '/var/www/social/composer.lock' | |
| |
| ExecStart='/usr/bin/composer' --working-dir='/var/www/social' --no-cache install --no-dev | ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure update --force |
| | ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' dbstructure drop --execute |
| |
| ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' dbstructure update --force | ExecStartPost='/usr/bin/php' '/srv/www/social/bin/console.php' postupdate |
| ExecStart='/usr/bin/php' '/var/www/social/bin/console.php' dbstructure drop --execute | |
| | |
| ExecStartPost='/usr/bin/php' '/var/www/social/bin/console.php' postupdate | |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/var/www/social | WorkingDirectory=/srv/www/social |
| |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/friendica-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/var/www" "social"' | ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/friendica-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www" "social"' |
| |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| === Database Auth === | === Database Auth === |
| |
| sudo mkdir -p '/var/lib/mysql/auth' && sudo -e '/var/lib/mysql/auth/friendica' && sudo chown 'mysql':'mysql' '/var/lib/mysql/auth/friendica' && sudo chmod '0600' '/var/lib/mysql/auth/friendica' | sudo mkdir -p '/srv/lib/mysql/auth' && sudo -e '/srv/lib/mysql/auth/friendica' && sudo chown 'mysql':'mysql' '/srv/lib/mysql/auth/friendica' && sudo chmod '0600' '/srv/lib/mysql/auth/friendica' |
| |
| <code> | <code> |
| === Service === | === Service === |
| |
| mkdir -p ~/'backups' && sudo mkdir -p '/var/lib/mysql/tmp' && sudo -e '/etc/systemd/system/social-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/social-db.service' | mkdir -p ~/'backups' && sudo mkdir -p '/srv/lib/mysql/tmp' && sudo -e '/etc/systemd/system/social-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/social-db.service' |
| |
| <code> | <code> |
| Type=oneshot | Type=oneshot |
| |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/var/lib/mysql/auth/friendica" --single-transaction --quick "friendica" -r "/home/CHANGEME/backups/friendica-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' | WorkingDirectory=/srv/lib/mysql |
| | |
| | ExecStart='/usr/bin/bash' -c '"/usr/bin/mariadb-dump" --defaults-extra-file="/srv/lib/mysql/auth/friendica" --single-transaction --quick "friendica" -r "/home/CHANGEME/backups/friendica-database-auto-"$$(date +%%Y-%%m-%%d)".sql"' |
| |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| === Timer === | === Timer === |
| |
| * ''01'' day of every month at ''04:10:00'' | * Monthly (5th) ''04:10:00 AM'' |
| |
| sudo -e '/etc/systemd/system/social-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-db.timer' --now && sudo systemctl start 'social-db' && sudo systemctl status 'social-db' -l | sudo -e '/etc/systemd/system/social-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-db.timer' --now && sudo systemctl start 'social-db' && sudo systemctl status 'social-db' -l |
| |
| [Timer] | [Timer] |
| OnCalendar=*-*-01 04:10:00 | OnCalendar=*-*-05 04:10:00 |
| Persistent=true | Persistent=true |
| |
| <code> | <code> |
| [Service] | [Service] |
| User=www-data | User=wwwrun |
| Group=www-data | Group=www |
| Type=oneshot | Type=oneshot |
| |
| ExecStart='/usr/bin/git' -C '/var/www/social' reset --hard | WorkingDirectory=/srv/www/social |
| ExecStart='/usr/bin/git' -C '/var/www/social' gc --aggressive --prune='all' | |
| ExecStart='/usr/bin/git' -C '/var/www/social' fsck --full --strict | ExecStart='/usr/bin/git' -C '/srv/www/social' gc --aggressive --prune='all' |
| | ExecStart='/usr/bin/git' -C '/srv/www/social' fsck --full --strict |
| | |
| | ExecStart='/usr/bin/git' -C '/srv/www/social/addon' gc --aggressive --prune='all' |
| | ExecStart='/usr/bin/git' -C '/srv/www/social/addon' fsck --full --strict |
| |
| ExecStart='/usr/bin/git' -C '/var/www/social/addon' reset --hard | ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' cache clear |
| ExecStart='/usr/bin/git' -C '/var/www/social/addon' gc --aggressive --prune='all' | ExecStart='/usr/bin/php' '/srv/www/social/bin/console.php' clearavatarcache |
| ExecStart='/usr/bin/git' -C '/var/www/social/addon' fsck --full --strict | |
| |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| ==== Timer ==== | ==== Timer ==== |
| |
| * ''01'' day of every month at ''04:30:00'' | * Monthly (5th) ''04:30:00 AM'' |
| |
| sudo -e '/etc/systemd/system/social-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-m.timer' --now | sudo -e '/etc/systemd/system/social-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'social-m.timer' --now |
| |
| [Timer] | [Timer] |
| OnCalendar=*-*-01 04:30:00 | OnCalendar=*-*-05 04:30:00 |
| Persistent=true | Persistent=true |
| |
| **** | **** |
| |
| sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/var/www' 'social' | sudo tar -czf ~/'friendica-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/srv/www' 'social' |
| |
| ===== Database ===== | ===== Database ===== |
| **** | **** |
| |
| ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/var/www/social' | ls ~/'friendica-files-'*'.tar.gz' && sudo rm -Rf '/srv/www/social' |
| |
| ===== Restore Files ===== | ===== Restore Files ===== |
| **** | **** |
| |
| sudo tar -xzf ~/'friendica-files-'*'.tar.gz' -C '/var/www' 'social' && sudo chown -R 'www-data':'www-data' '/var/www/social' && sudo chmod -R '0755' '/var/www/social' | sudo tar -xzf ~/'friendica-files-'*'.tar.gz' -C '/srv/www' 'social' && sudo chown -R 'wwwrun':'www' '/srv/www/social' && sudo chmod -R '0755' '/srv/www/social' |
| |
| ===== Git Fix ===== | ===== Git Fix ===== |
| * :!: Requires [[#etc|Etc]] commands afterwards ((https://social.realmofespionage.xyz doesn't redirect to single-profile URL and shows an error)) | * :!: Requires [[#etc|Etc]] commands afterwards ((https://social.realmofespionage.xyz doesn't redirect to single-profile URL and shows an error)) |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| rm -Rf '/var/www/social/.git' | rm -Rf '/srv/www/social/.git' |
| |
| git -C '/var/www/social' init --initial-branch='develop' | git -C '/srv/www/social' init --initial-branch='develop' |
| |
| git -C '/var/www/social' add '.' | git -C '/srv/www/social' add '.' |
| |
| git -C '/var/www/social' config 'user.email' 'espionage724@x' | git -C '/srv/www/social' config 'user.email' 'espionage724@x' |
| |
| git -C '/var/www/social' commit --message='x' | git -C '/srv/www/social' commit --message='x' |
| |
| git -C '/var/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' | git -C '/srv/www/social' remote add 'origin' 'https://github.com/friendica/friendica.git' |
| |
| git -C '/var/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase | git -C '/srv/www/social' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase |
| |
| git -C '/var/www/social' reset --hard 'origin/develop' | git -C '/srv/www/social' reset --hard 'origin/develop' |
| |
| git -C '/var/www/social' gc --aggressive --prune='all' | git -C '/srv/www/social' gc --aggressive --prune='all' |
| |
| git -C '/var/www/social' fsck --full --strict | git -C '/srv/www/social' fsck --full --strict |
| |
| ==== Addons ==== | ==== Addons ==== |
| * :!: Set email for ''user.email'' | * :!: Set email for ''user.email'' |
| |
| rm -Rf '/var/www/social/addon/.git' | rm -Rf '/srv/www/social/addon/.git' |
| |
| git -C '/var/www/social/addon' init --initial-branch='develop' | git -C '/srv/www/social/addon' init --initial-branch='develop' |
| |
| git -C '/var/www/social/addon' add '.' | git -C '/srv/www/social/addon' add '.' |
| |
| git -C '/var/www/social/addon' config 'user.email' 'espionage724@x' | git -C '/srv/www/social/addon' config 'user.email' 'espionage724@x' |
| |
| git -C '/var/www/social/addon' commit --message='x' | git -C '/srv/www/social/addon' commit --message='x' |
| |
| git -C '/var/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' | git -C '/srv/www/social/addon' remote add 'origin' 'https://github.com/friendica/friendica-addons.git' |
| |
| git -C '/var/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase | git -C '/srv/www/social/addon' pull --depth '1' --recurse-submodules 'origin' 'develop' --rebase |
| |
| git -C '/var/www/social/addon' reset --hard 'origin/develop' | git -C '/srv/www/social/addon' reset --hard 'origin/develop' |
| |
| git -C '/var/www/social/addon' gc --aggressive --prune='all' | git -C '/srv/www/social/addon' gc --aggressive --prune='all' |
| |
| git -C '/var/www/social/addon' fsck --full --strict | git -C '/srv/www/social/addon' fsck --full --strict |
| |
| exit | exit |
| ===== Database Connection ===== | ===== Database Connection ===== |
| |
| sudo -u 'www-data' -e '/var/www/social/config/local.config.php' | sudo -e '/srv/www/social/config/local.config.php' && sudo chown -v 'wwwrun':'www' '/srv/www/social/config/local.config.php' |
| |
| <code> | <code> |
| <code> | <code> |
| 'system' => [ | 'system' => [ |
| 'basepath' => '/var/www/social',</code> | 'basepath' => '/srv/www/social',</code> |
| |
| ===== Restore Database ===== | ===== Restore Database ===== |
| ===== Commands ===== | ===== Commands ===== |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' -h | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' -h |
| |
| ===== Show Config ===== | ===== Show Config ===== |
| |
| sudo su 'www-data' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/var/www/social' && '/usr/bin/php' '/var/www/social/bin/console.php' config | cd '/srv/www/social' && '/usr/bin/php' '/srv/www/social/bin/console.php' config |
| |