====== Information ====== * Piwigo ((https://www.piwigo.org/)) * Bootstrap Darkroom Theme ((https://piwigo.org/ext/index.php?eid=831)) ((https://doc.piwigo.org/piwigo-themes/bootstrap-darkroom-theme-piwigo)) * [[information;realm_of_espionage|Realm of Espionage]] * https://media.realmofespionage.xyz ===== Prerequisites ===== * [[windows;10_ltsc_server|Windows 10 (21H2)]] * [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]] * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]] * [[programs;windows;git|Git]] * [[servers;windows;mariadb|MariaDB]] ====== Dependencies ====== * https://piwigo.org/guides/install/requirements * https://github.com/Piwigo/piwigo-videojs/wiki/How-to-add-videos * https://github.com/Piwigo/piwigo-videojs/wiki/Synchronize#requirement ====== Download Source ====== * https://github.com/Piwigo/Piwigo/commits/master/ "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/Piwigo/Piwigo.git" "%SystemDrive%\www\media" ===== Bootstrap Darkroom ===== * https://github.com/Piwigo/piwigo-bootstrap-darkroom/commits/master/ "%ProgramFiles%\Git\bin\git.exe" clone --branch "master" --depth "1" --recurse-submodules "https://github.com/Piwigo/piwigo-bootstrap-darkroom.git" "%SystemDrive%\www\media\themes\bootstrap_darkroom" ====== Database ====== "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" CREATE DATABASE piwigo; CREATE USER 'piwigo'@'localhost' IDENTIFIED BY 'x'; GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost'; FLUSH PRIVILEGES;EXIT; ====== nginx + PHP-CGI Configuration ====== ===== PHP ===== "notepad.exe" "%SystemDrive%\www\php\media.ini" [PHP] extension_dir = ".\ext" extension = "exif" extension = "gd" extension = "mbstring" extension = "mysqli" log_errors = "Off" error_reporting = "~E_ALL" display_errors = "Off" display_startup_errors = "Off" html_errors = "Off" max_execution_time = "200" memory_limit = "512M" post_max_size = "100M" upload_max_filesize = "100M" max_file_uploads = "100" [Date] date.timezone = "America/New_York" ; End "php.exe" -c "%SystemDrive%\www\php\media.ini" -m ===== PHP-CGI ===== "notepad.exe" "%SystemDrive%\www\nginx\default.d\media.conf" location "~" "\.(php)(/.*)?$" { fastcgi_split_path_info "^(.+\.(?:php))(/.*)$"; fastcgi_intercept_errors "on"; fastcgi_index "index.php"; include "C:/www/nginx/conf/fastcgi_params"; fastcgi_param "SCRIPT_FILENAME" "$document_root$fastcgi_script_name"; fastcgi_param "PATH_INFO" "$fastcgi_path_info"; fastcgi_param "HTTPS" "on"; fastcgi_pass "127.0.0.1:9003"; } # End ===== Server Block ===== "notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\media.conf" server { listen "443" "ssl"; http2 "on"; server_name "media.realmofespionage.xyz"; root "C:/www/media"; index "index.php"; include "C:/www/nginx/default.d/media.conf"; include "C:/www/nginx/default.d/headers.conf"; client_max_body_size "100M"; # access_log "logs/media-access.log"; # error_log "logs/media-error.log"; location "/" { index "index.php"; try_files "$uri $uri/" "@rewrite"; } location "@rewrite" { rewrite "^/picture((/|$).*)$" "/picture.php$1" "last"; rewrite "^/index((/|$).*)$" "/index.php$1" "last"; rewrite "^/i((/|$).*)$" "/i.php$1" "last"; } } # End "%SystemDrive%\www\scripts\nginx\Reload.bat" ====== Scripts ====== MKDIR "%SystemDrive%\www\scripts\media" "explorer.exe" "%SystemDrive%\www\scripts\media" ===== PHP-CGI ===== "notepad.exe" "%SystemDrive%\www\scripts\media\PHP-CGI.bat" @echo off CD "%Temp%" SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_CHILDREN=1" START "Media PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9003" -c "%SystemDrive%\www\php\media.ini" -q SET "PHP_FCGI_MAX_REQUESTS=" SET "PHP_FCGI_CHILDREN=" :: End "%SystemDrive%\www\scripts\media\PHP-CGI.bat" ===== Update ===== "notepad.exe" "%SystemDrive%\www\scripts\media\Update.bat" @echo off TITLE Media Updater CD "%Temp%" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" pull origin "master" --rebase "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" pull origin "master" --rebase :: End "%SystemDrive%\www\scripts\media\Update.bat" ===== Back-up ===== "notepad.exe" "%SystemDrive%\www\scripts\media\Back-up.bat" @echo off TITLE Media Back-up CD "%Temp%" "tar.exe" -czf "D:\Servers\Scheduled Backups\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-piwigo.sql" "piwigo" ::"tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" ::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-piwigo.sql" "piwigo" :: End "%SystemDrive%\www\scripts\media\Back-up.bat" ===== Maintenance ===== "notepad.exe" "%SystemDrive%\www\scripts\media\Maintenance.bat" @echo off TITLE Media Maintenance CD "%Temp%" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" gc --aggressive --prune="all" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" fsck --full --strict "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" gc --aggressive --prune="all" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" fsck --full --strict :: End "%SystemDrive%\www\scripts\media\Maintenance.bat" ===== Git Fix ===== * :!: Set **both** ''user.email'' "notepad.exe" "%SystemDrive%\www\scripts\media\Git Fix.bat" @echo off TITLE Media Git Fix CD "%Temp%" ::################## ::# Piwigo ::################## RMDIR /S /Q "%SystemDrive%\www\media\.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" init --initial-branch="master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" add "." ::###################################### "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" config "user.email" "espionage724@x" ::###################################### "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" commit --message="x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" remote add "origin" "https://github.com/Piwigo/Piwigo.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" pull --depth "1" --recurse-submodules "origin" "master" --rebase "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" gc --aggressive --prune="all" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media" fsck --full --strict ::################## ::# Bootstrap Darkroom ::################## RMDIR /S /Q "%SystemDrive%\www\media\themes\bootstrap_darkroom\.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" init --initial-branch="master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" add "." ::###################################### "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" config "user.email" "espionage724@x" ::###################################### "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" commit --message="x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" remote add "origin" "https://github.com/Piwigo/piwigo-bootstrap-darkroom.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" pull --depth "1" --recurse-submodules "origin" "master" --rebase "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" reset --hard "origin/master" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" gc --aggressive --prune="all" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\media\themes\bootstrap_darkroom" fsck --full --strict :: End "%SystemDrive%\www\scripts\media\Git Fix.bat" ====== Task Scheduler ====== ===== PHP-CGI ===== * Auto-start SCHTASKS /Create /SC "ONLOGON" /TN "Media PHP-CGI" /TR "%SystemDrive%\www\scripts\media\PHP-CGI.bat" /F ===== Update ===== * Daily ''01:00:00 AM'' SCHTASKS /Create /SC "DAILY" /TN "Media Update" /TR "%SystemDrive%\www\scripts\media\Update.bat" /ST "01:00" /F ===== Back-up ===== * Monthly (2nd) ''01:10:00 AM'' SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Back-up" /TR "%SystemDrive%\www\scripts\media\Back-up.bat" /ST "01:10" /F ===== Maintenance ===== * Monthly (2nd) ''01:30:00 AM'' SCHTASKS /Create /SC "MONTHLY" /D "2" /M "*" /TN "Media Maintenance" /TR "%SystemDrive%\www\scripts\media\Maintenance.bat" /ST "01:30" /F ====== Initial Setup ====== * https://media.realmofespionage.xyz ====== Settings ====== * :!: Disable ''Allow user registration'' **immediately** under Configuration -> Options -> General -> Permissions * Activate Boostrap Darkroom theme * Default photos order: ''Numeric identifier, 9 -> 1'' ===== Page Banner ===== ****

Tech, hardware, food, nature, and gaming pictures and videos!

===== config.inc.php ===== * [[https://piwigo.org/forum/viewtopic.php?pid=159584#p159584|nginx Rewrite source]] * [[https://doc.piwigo.org/import-and-manage-photos/file-formats-compatible-piwigo#block-5cef6409208a4b3ead19b930f85942b2|Video Uploading source]] * [[https://github.com/Piwigo/Piwigo/blob/master/include/config_default.inc.php|More Settings]] "notepad.exe" "%SystemDrive%\www\media\local\config\config.inc.php" 'Realm of Espionage', 'https://wiki.realmofespionage.xyz/start' => 'RoE | Wiki', 'https://blog.realmofespionage.xyz' => 'RoE | Blog', 'https://social.realmofespionage.xyz/profile/espionage724' => 'RoE | Social', 'https://forums.realmofespionage.xyz' => 'RoE | Forums', 'https://wiki.realmofespionage.xyz/user;espionage724' => 'Webmaster Info', 'https://wiki.realmofespionage.xyz/servers;windows;nginx;piwigo' => 'Instance Configuration Notes', ); // Video Uploading $conf['upload_form_all_types'] = true; $conf['file_ext'] = array_merge( $conf['picture_ext'], array('mp4','webmv','m4v','webm','mov') ); // End ?> ===== database.inc.php ===== * :!: Change ''db_password'' "notepad.exe" "%SystemDrive%\www\media\local\config\config.inc.php" ====== Backup ====== ===== Folder ===== **** "tar.exe" -czf "%UserProfile%\Downloads\piwigo-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "media" ===== Database ===== **** CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "piwigo.sql" "piwigo" ====== Restore ====== ===== Database ===== * [[#database|Initial set-up]] "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE piwigo" "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "piwigo" < "%UserProfile%\Downloads\piwigo.sql" ====== Resources ====== ===== Albums Formatting ===== ==== 4 Links ==== * https://media.realmofespionage.xyz/index/category/2 Windows | Linux | FreeBSD | Lost City Forums ==== Single Link ==== * https://media.realmofespionage.xyz/picture/268/category/17 Notes ===== TODOs ===== * Show title on pictures (long titles get cut-off in navbar) * AI ([[https://piwigo.org/forum/viewtopic.php?pid=192438#p192438|post]], [[https://github.com/Piwigo/Piwigo/commits/master/include/config_default.inc.php|config.inc.php]])