User Tools

Site Tools


computing:pix3lfed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:pix3lfed [2026/03/01 18:01] oemb1905computing:pix3lfed [2026/03/02 02:17] (current) oemb1905
Line 16: Line 16:
 This tutorial provides users of Debian GNU/Linux with a roadmap for installing a Pixelfed instance. These isntructions are drawn from the [[https://pixelfed.github.io/docs-next/running-pixelfed/installation.html|Pixelfed documentation]]. Most steps were straightforward, however, there were a few issues not covered in their documentation, namely, special permissions for some OAUTH bits, initializing of storage, and a few other things. As with most other tutorials on this Wiki, make sure you first have a hardened VPS w/ LAMP ready to go - if not, head over to [[https://wiki.haacksnetworking.org/doku.php?id=computing:apachesurvival|Apache Survival]] first and set that up. Okay, here we go! This tutorial provides users of Debian GNU/Linux with a roadmap for installing a Pixelfed instance. These isntructions are drawn from the [[https://pixelfed.github.io/docs-next/running-pixelfed/installation.html|Pixelfed documentation]]. Most steps were straightforward, however, there were a few issues not covered in their documentation, namely, special permissions for some OAUTH bits, initializing of storage, and a few other things. As with most other tutorials on this Wiki, make sure you first have a hardened VPS w/ LAMP ready to go - if not, head over to [[https://wiki.haacksnetworking.org/doku.php?id=computing:apachesurvival|Apache Survival]] first and set that up. Okay, here we go!
  
-=== Step 1: PHP Requirements ===+=== Step 1: LAMP Requirements ===
  
-Your LAMP stack might not have all php dependencies, redis, and/or imagick. Let's make sure those are installed. Also you should be using ''mpm_event'' with ''php8.4-fpm'' - not the legacy handler.+Your LAMP stack might not have all php dependencies, redis, and/or imagick. Let's make sure those are installed. Also you should be using ''mpm_event'' with ''php8.4-fpm'' - not the legacy handler. We will also make sure to install git and ensure that you installed all LAMP-bits properly:
  
   sudo apt update   sudo apt update
-  sudo apt install php8.4-fpm php8.4-mysql php8.4-curl php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip php8.4-bcmath php8.4-intl php8.4-redis php8.4-imagick php8.4-imap php8.4-ldap apache2 mariadb-server* imagick* redis* -y+  sudo apt install php8.4-fpm php8.4-mysql php8.4-curl php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip php8.4-bcmath php8.4-intl php8.4-redis php8.4-imagick php8.4-imap php8.4-ldap php git apache2 mariadb-server* imagick* redis* -y
   sudo systemctl restart php8.4-fpm   sudo systemctl restart php8.4-fpm
  
Line 32: Line 32:
   sudo a2enmod setenvif   sudo a2enmod setenvif
   sudo a2enmod mpm_event   sudo a2enmod mpm_event
 +  sudo a2enmod rewrite
 +  sudo a2enmod proxy
 +  sudo a2enmod proxy_fcgi
 +  sudo a2enmod mime
 +  sudo a2enmod expires
 +  sudo a2enmod deflate
   sudo a2enconf php8.4-fpm   sudo a2enconf php8.4-fpm
   sudo apache2ctl configtest     sudo apache2ctl configtest  
Line 57: Line 63:
 === Step 2: Set up Your Database === === Step 2: Set up Your Database ===
  
-Create a new database named 'pixel' with a dedicated user for security. Log in to MySQL as root again.+Create a new database named 'pixel' (for example) with a dedicated user for security. Log in to MySQL with ''mysql -u root -p'' and enter something like:
  
-  mysql -u root -p +  CREATE DATABASE pixel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 
-</code>+  CREATE USER IF NOT EXISTS 'pixel'@'localhost' IDENTIFIED BY 'strongpass'; 
 +  GRANT ALL PRIVILEGES ON pixel.* TO 'pixel'@'localhost'; 
 +  FLUSH PRIVILEGES; 
 +  EXIT;
  
-Inside the MySQL shellrun:+Okay, now that the db is setupit is time to download and configure Pixelfed.
  
-<code sql> +=== Step 3: Download, Configure, & Initialize Pixelfed & It's Virtual Environment ===
-CREATE DATABASE pixel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +
-CREATE USER IF NOT EXISTS 'pixel'@'localhost' IDENTIFIED BY 'strongpass'; +
-GRANT ALL PRIVILEGES ON pixel.* TO 'pixel'@'localhost'; +
-FLUSH PRIVILEGES; +
-EXIT; +
-</code>+
  
-This sets up a UTF-8 compatible database optimized for Pixelfed's schema.+Pixelfed is in its infancy so use the dev branch until the stable version is released:
  
-=== Step 3Nuke the Old Pixelfed Directory (If Exists) ===+  cd /var/www 
 +  git clone -b dev https://github.com/pixelfed/pixelfed.git pixelfed
  
-<code bash> +Once it is downloaded, let's set up our permissions:
-sudo rm -rf /var/www/pixelfed +
-</code>+
  
-=== Step 4Clone Fresh Pixelfed from Git (Dev Branch) ===+  cd pixelfed 
 +  sudo chown www-data:www-data /var/www/pixelfed 
 +  sudo chown -R www-data:www-data ./  
 +  sudo find . -type d -exec chmod 755 {} \;  
 +  sudo find . -type f -exec chmod 644 {} \;  
 +  sudo chmod -R 775 /var/www/pixelfed/storage /var/www/pixelfed/bootstrap/cache 
 +  sudo chmod 600 /var/www/pixelfed/storage/oauth-private.key 
 +  sudo chmod 600 /var/www/pixelfed/storage/oauth-public.key
  
-Clone the latest development branch from the official repositoryThe 'dev' branch often includes fixes and features not yet in stable.+Once the permissions are setup, we can now initialize and setup Laravel, artisan, etc.and configure our virtual environment:
  
-<code bash> +  cd /var/www/pixelfed 
-cd /var/www +  sudo -u www-data composer install --no-dev --optimize-autoloader 
-git clone -dev https://github.com/pixelfed/pixelfed.git pixelfed +   
-</code>+Now that dependencies are installed, let's make a copy of the example environment config with ''cp .env.example .env'' and then open it up ''sudo nano /var/www/pixelfed/.env'' and drop in some settings something like mine, but adjusted to your use-case:
  
-=== Step 5Set Permissions for the New Installation ===+  APP_NAME="GNU/Linux Pics" 
 +  APP_ENV=production 
 +  APP_KEY=generated with artisan later 
 +  APP_DEBUG=false 
 +  APP_URL=https://gnulinux.pics 
 +  APP_DOMAIN=gnulinux.pics 
 +  ADMIN_DOMAIN=gnulinux.pics 
 +  SESSION_DOMAIN=gnulinux.pics 
 +  DB_CONNECTION=mysql 
 +  DB_HOST=127.0.0.1 
 +  DB_PORT=3306 
 +  DB_DATABASE=pixel 
 +  DB_USERNAME=pixel 
 +  DB_PASSWORD=strongpass 
 +  REDIS_HOST=127.0.0.1 
 +  REDIS_PASSWORD=null 
 +  REDIS_PORT=6379 
 +  REDIS_CLIENT=predis 
 +  REDIS_SCHEME=tcp 
 +  CACHE_DRIVER=redis 
 +  QUEUE_CONNECTION=redis 
 +  SESSION_DRIVER=redis 
 +  HORIZON_PREFIX=horizon- 
 +  MAIL_MAILER=smtp 
 +  MAIL_HOST=mail.haacksnetworking.org 
 +  MAIL_PORT=587 
 +  MAIL_USERNAME=webmaster 
 +  MAIL_PASSWORD=strongpass 
 +  MAIL_ENCRYPTION=tls 
 +  MAIL_FROM_ADDRESS=webmaster@haacksnetworking.org 
 +  MAIL_FROM_NAME="GNU/Linux Pics" 
 +  ACTIVITY_PUB=true 
 +  AP_REMOTE_FOLLOW=true 
 +  AP_INBOX=true 
 +  AP_OUTBOX=true 
 +  AP_SHAREDINBOX=true 
 +  RELAY=true 
 +  OPEN_REGISTRATION=true 
 +  ENFORCE_EMAIL_VERIFICATION=true 
 +  PF_MAX_USERS=1000 
 +  PF_OPTIMIZE_IMAGES=true 
 +  IMAGE_QUALITY=80 
 +  MAX_PHOTO_SIZE=15000 
 +  MAX_CAPTION_LENGTH=500 
 +  MAX_ALBUM_LENGTH=
 +  INSTANCE_DISCOVER_PUBLIC=true 
 +  PF_ENABLE_CLOUD=false
  
-<code bash> +Something like the above are the minimum settings one would want on spinup. Of course, you can add cloud storage and other stuff later if you so desire. You could also adjust it to use an off-site db and/or adjust your mailer to use sendgrid, etc. Personally, I prefer the db to be local as well as the mail server. I will eventually build a mail server on this instance and migrate the MAIL settings to using it instead, but for now, I've used an existing and working management mail server. It is now time to initialize the virtual environment using artisan:
-sudo chown -R www-data:www-data /var/www/pixelfed +
-sudo chmod -R 775 /var/www/pixelfed/storage /var/www/pixelfed/bootstrap/cache +
-</code>+
  
-This prevents permission errors during runtime, such as failed uploads or cache writes.+  cd /var/www/pixelfed 
 +  sudo -u www-data php artisan migrate --force 
 +  sudo -u www-data php artisan storage:link 
 +  ls -l /var/www/pixelfed/public/storage #optionally verify storage symlink 
 +  sudo -u www-data php artisan key:generate 
 +  sudo -u www-data php artisan passport:keys --force 
 +  sudo -u www-data php artisan passport:install --force 
 +  sudo -u www-data php artisan horizon:install 
 +  sudo -u www-data php artisan config:cache 
 +  sudo -u www-data php artisan route:cache 
 +  sudo -u www-data php artisan view:cache 
 +  sudo -u www-data php artisan optimize 
 +  sudo -u www-data php artisan instance:actor 
 +  sudo -u www-data php artisan import:cities
  
-=== Step 6: Install Dependencies with Composer === +=== Step 4: Additional Apache Tweaks ===
- +
-<code bash> +
-cd /var/www/pixelfed +
-sudo -u www-data composer install --no-dev --optimize-autoloader +
-</code> +
- +
-This pulls in Laravel and other required packages without development tools for a production setup. +
- +
-=== Step 7: Configure the .env File === +
- +
-<code bash> +
-sudo nano /var/www/pixelfed/.env +
-</code> +
- +
-Paste or update with the following content (replace placeholders if needed, e.g., passwords, domains, or mail settings): +
- +
-<code ini> +
-APP_NAME="GNU/Linux Pics" +
-APP_ENV=production +
-APP_KEY= # Generated later +
-APP_DEBUG=false +
-APP_URL=https://gnulinux.pics +
-APP_DOMAIN=gnulinux.pics +
-ADMIN_DOMAIN=gnulinux.pics +
-SESSION_DOMAIN=gnulinux.pics +
-DB_CONNECTION=mysql +
-DB_HOST=127.0.0.1 +
-DB_PORT=3306 +
-DB_DATABASE=pixel +
-DB_USERNAME=pixel +
-DB_PASSWORD=strongpass +
-REDIS_HOST=127.0.0.1 +
-REDIS_PASSWORD=null +
-REDIS_PORT=6379 +
-REDIS_CLIENT=predis +
-REDIS_SCHEME=tcp +
-CACHE_DRIVER=redis +
-QUEUE_CONNECTION=redis +
-SESSION_DRIVER=redis +
-HORIZON_PREFIX=horizon- +
-MAIL_MAILER=smtp +
-MAIL_HOST=mail.haacksnetworking.org +
-MAIL_PORT=587 +
-MAIL_USERNAME=webmaster +
-MAIL_PASSWORD=strongpass +
-MAIL_ENCRYPTION=tls +
-MAIL_FROM_ADDRESS=webmaster@haacksnetworking.org +
-MAIL_FROM_NAME="GNU/Linux Pics" +
-ACTIVITY_PUB=true +
-AP_REMOTE_FOLLOW=true +
-AP_INBOX=true +
-AP_OUTBOX=true +
-AP_SHAREDINBOX=true +
-RELAY=true +
-OPEN_REGISTRATION=true +
-ENFORCE_EMAIL_VERIFICATION=true +
-PF_MAX_USERS=1000 +
-PF_OPTIMIZE_IMAGES=true +
-IMAGE_QUALITY=80 +
-MAX_PHOTO_SIZE=15000 +
-MAX_CAPTION_LENGTH=500 +
-MAX_ALBUM_LENGTH=4 +
-INSTANCE_DISCOVER_PUBLIC=true +
-PF_ENABLE_CLOUD=false +
-FILESYSTEM_CLOUD=s3 +
-#AWS_ACCESS_KEY_ID= +
-#AWS_SECRET_ACCESS_KEY= +
-#AWS_DEFAULT_REGION= +
-#AWS_BUCKET= +
-#AWS_URL= +
-#AWS_ENDPOINT= +
-#AWS_USE_PATH_STYLE_ENDPOINT=false +
-</code> +
- +
-Save and exit. +
- +
-=== Step 8Run Database Migrations === +
- +
-<code bash> +
-sudo -u www-data php artisan migrate --force +
-</code> +
- +
-=== Step 9: Create the Public Storage Symlink (Critical for Images) === +
- +
-<code bash> +
-sudo -u www-data php artisan storage:link +
-</code> +
- +
-Verify the symlink: +
- +
-<code bash> +
-ls -l /var/www/pixelfed/public/storage +
-</code> +
- +
-Expected output: ''storage -> ../storage/app/public'' +
- +
-If images fail to display after uploads, recheck permissions: +
- +
-<code bash> +
-sudo chown -R www-data:www-data /var/www/pixelfed/storage +
-sudo chmod -R 775 /var/www/pixelfed/storage +
-#oauth bits require stronger perms +
-sudo chmod 600 /var/www/pixelfed/storage/oauth-private.key +
-sudo chmod 600 /var/www/pixelfed/storage/oauth-public.key +
-</code> +
- +
-=== Step 10: Generate Application Key === +
- +
-<code bash> +
-sudo -u www-data php artisan key:generate +
-</code> +
- +
-=== Step 11: Set Up Passport for OAuth === +
- +
-<code bash> +
-sudo -u www-data php artisan passport:keys --force +
-sudo -u www-data php artisan passport:install --force +
-</code> +
- +
-=== Step 12: Set Up Horizon for Queue Worker === +
- +
-<code bash> +
-sudo -u www-data php artisan horizon:install +
-</code> +
- +
-=== Step 13: Cache Configurations, Routes, and Views === +
- +
-<code bash> +
-sudo -u www-data php artisan config:cache +
-sudo -u www-data php artisan route:cache +
-sudo -u www-data php artisan view:cache +
-sudo -u www-data php artisan optimize +
-</code> +
- +
-=== Step 14: Configure Apache Virtual Hosts === +
- +
-For the non-SSL site (HTTP redirect): +
- +
-<code bash> +
-sudo nano /etc/apache2/sites-enabled/000-default.conf +
-</code> +
- +
-Paste: +
- +
-<code apache> +
-<VirtualHost *:80> +
-    ServerName gnulinux.pics +
-    RewriteEngine On +
-    RewriteCond %{SERVER_NAME} =gnulinux.pics +
-    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] +
-</VirtualHost> +
-</code> +
- +
-For the SSL site: +
- +
-<code bash> +
-sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf +
-</code>+
  
-Paste:+During testing, I was having some spinning and other issues that seemed to stem from re-writes and overrides glitching a bit. For this reason, I added an override inside each vhost as an extra precaution. You also want to ensure that the ''/var/www/pixelfed/public'' sub-directory is specified and that your php handler is explicitly declared. Open up your vhost(s), and ensure these additions are within your ''IfModule'' declarations:
  
-<code apache> 
-<VirtualHost *:443> 
-    ServerName gnulinux.pics 
-    SSLEngine on 
-    SSLCertificateFile /etc/letsencrypt/live/gnulinux.pics/fullchain.pem 
-    SSLCertificateKeyFile /etc/letsencrypt/live/gnulinux.pics/privkey.pem 
-    Include /etc/letsencrypt/options-ssl-apache.conf 
     DocumentRoot /var/www/pixelfed/public     DocumentRoot /var/www/pixelfed/public
     <Directory /var/www/pixelfed/public>     <Directory /var/www/pixelfed/public>
Line 276: Line 176:
         SetHandler "proxy:unix:/run/php/php8.4-fpm.sock|fcgi://localhost/"         SetHandler "proxy:unix:/run/php/php8.4-fpm.sock|fcgi://localhost/"
     </FilesMatch>     </FilesMatch>
-    LimitRequestBody 524288000 
-    ErrorLog ${APACHE_LOG_DIR}/gnulinux-pics_error.log 
-    CustomLog ${APACHE_LOG_DIR}/gnulinux-pics_access.log combined 
-</VirtualHost> 
-</code> 
  
-Ensure ''AllowOverride All'' in main config:+Pixelfed has a nested ''.htaccess'' file inside ''public'' so let's ensure that Overrides are enabled globally. Let's open up ''sudo nano /etc/apache2/apache2.conf'' and change ''None'' to ''All'' in the appropriate sections (this matches the Override rule in the vhost). In the webroot block, or ''<Directory /var/www/>'', it should look like:
  
 <code bash> <code bash>
-sudo nano /etc/apache2/apache2.conf 
-</code> 
- 
-In the ''<Directory /var/www/>'' block ensure: 
- 
-<code apache> 
 <Directory /var/www/> <Directory /var/www/>
     Options Indexes FollowSymLinks     Options Indexes FollowSymLinks
-    AllowOverride All+    AllowOverride All ### NOTE "All" instead of "None" ###
     Require all granted     Require all granted
 </Directory> </Directory>
 </code> </code>
  
-=== Step 15: Configure .htaccess for URL Rewrites ===+Additionally, the Pixelfed website mentions that some users of apache might have difficulty with the default ''.htaccess'' file in ''public'' so they recommended changing it. My instance indeed had trouble finding certain locations and directories unless I changed to their recommendation. Open up ''sudo nano /var/www/pixelfed/public/.htaccess'' and enter the recommendation as follows:
  
-<code bash+  <IfModule mod_rewrite.c
-sudo nano /var/www/pixelfed/public/.htaccess +  Options +FollowSymLinks -Indexes 
-</code>+  RewriteEngine On 
 +  RewriteCond %{HTTP:Authorization} . 
 +  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
 +  RewriteCond %{REQUEST_FILENAME} !-d 
 +  RewriteCond %{REQUEST_FILENAME} !-f 
 +  RewriteRule ^ index.php [L] 
 +  </IfModule>
  
-Paste:+Now that apache is fully configured, let's create out systemd unit file.
  
-<code apache> +=== Step 5Create and Enable Horizon Systemd Service ===
-Options +FollowSymLinks -Indexes +
-RewriteEngine On +
-RewriteCond %{HTTP:Authorization} . +
-RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +
-RewriteCond %{REQUEST_FILENAME} !-d +
-RewriteCond %{REQUEST_FILENAME} !-f +
-RewriteRule ^ index.php [L] +
-</code>+
  
-=== Step 16: Create and Enable Horizon Systemd Service ===+First, let's create the unit file over in ''sudo nano /etc/systemd/system/pixelfed.service'' and inside that unit file, put something similar to the following:
  
-<code bash> +  [Unit] 
-sudo nano /etc/systemd/system/pixelfed.service +  Description=Pixelfed Horizon Queue Worker (Laravel Horizon) 
-</code>+  After=network.target apache2.service php8.4-fpm.service redis-server.service mariadb.service 
 +  Wants=apache2.service php8.4-fpm.service redis-server.service mariadb.service 
 +  [Service] 
 +  Type=simple 
 +  User=www-data 
 +  Group=www-data 
 +  WorkingDirectory=/var/www/pixelfed 
 +  ExecStart=/usr/bin/php artisan horizon 
 +  Restart=on-failure 
 +  RestartSec=5s 
 +  StandardOutput=journal 
 +  StandardError=journal 
 +  NoNewPrivileges=yes 
 +  PrivateTmp=true 
 +  ProtectSystem=strict 
 +  ProtectHome=yes 
 +  ReadWritePaths=/var/www/pixelfed/storage 
 +  ReadWritePaths=/var/www/pixelfed/bootstrap/cache 
 +  [Install] 
 +  WantedBy=multi-user.target
  
-Paste:+After you create the unit file, let's reload the daemon, restart the service and check for any errors. Restart all services and check a web browser to see if the instance resolves after restarting the services.
  
-<code ini> +  sudo systemctl daemon-reload 
-[Unit] +  sudo systemctl enable pixelfed.service 
-Description=Pixelfed Horizon Queue Worker (Laravel Horizon) +  sudo systemctl restart pixelfed.service 
-After=network.target apache2.service php8.4-fpm.service redis-server.service mariadb.service +  sudo systemctl status pixelfed.service 
-Wants=apache2.service php8.4-fpm.service redis-server.service mariadb.service+  journalctl -u pixelfed.service -n 50 
 +  sudo apache2ctl configtest 
 +  sudo systemctl reload apache2 
 +  sudo systemctl restart apache2 php8.4-fpm pixelfed.service redis-server
  
-[Service] +At this point, most essential lifts are done. As long as your landing page resolves, which it should by this stage, you can now move on to creating an admin user and then managing the instance via the GUI web panel:
-Type=simple +
-User=www-data +
-Group=www-data +
-WorkingDirectory=/var/www/pixelfed +
-ExecStart=/usr/bin/php artisan horizon +
-Restart=on-failure +
-RestartSec=5s +
-StandardOutput=journal +
-StandardError=journal +
-NoNewPrivileges=yes +
-PrivateTmp=true +
-ProtectSystem=strict +
-ProtectHome=yes +
-ReadWritePaths=/var/www/pixelfed/storage +
-ReadWritePaths=/var/www/pixelfed/bootstrap/cache+
  
-[Install] +=== Step 6: User Creation & Instance Management ===
-WantedBy=multi-user.target +
-</code>+
  
-Then:+Let's create the admin user:
  
-<code bash> +  cd /var/www/pixelfed 
-sudo systemctl daemon-reload +  sudo -u www-data php artisan user:create
-sudo systemctl enable pixelfed.service +
-sudo systemctl restart pixelfed.service +
-sudo systemctl status pixelfed.service +
-journalctl -u pixelfed.service -n 50 +
-</code>+
  
-=== Step 17Restart All Services ===+Follow the prompts it provides with your desired values and make sure to state ''yes'' when it asks you to make this user and admin. Navigate to your instance in a web browser and log in. If it works, then you are good to go! If not, here are some common commands I ran to test and debug things while I was setting everything up:
  
-<code bash> +  redis-cli ping 
-sudo apache2ctl configtest +  redis-cli keys "horizon:*" 
-sudo systemctl reload apache2 +  journalctl -pixelfed.service -n 50 
-sudo systemctl restart apache2 php8.4-fpm pixelfed.service redis-server +  sudo -u www-data php artisan config:show queue | grep default  
-</code>+  tail -n 100 /var/www/pixelfed/storage/logs/laravel.log | grep -i "activitypub\|federat\|outbox\|inbox\|error\|fail\|exception" 
  
-=== Step 18Create Admin User ===+I am currently still working on getting the well-known to function correctly. I am unsure if the errors I am getting are due to the instance not yet being approved or if it is an error on my end. I will update here once confirmed:
  
-<code bash> +  curl -s https://gnulinux.pics/.well-known/nodeinfo 
-sudo -u www-data php artisan user:create +  curl -s https://gnulinux.pics/api/nodeinfo/2.0 
-</code>+  sudo -u www-data php artisan route:list | grep -i nodeinfo
  
-Follow prompts (example values):+For updating, something like the following is minimally required:
  
-  * Name: Admin +  cd /var/www/pixelfed 
-  * Username: admin +  git pull origin dev 
-  * Emailwebmaster@haacksnetworking.org +  sudo -u www-data composer install --no-dev --optimize-autoloader 
-  * Passwordstrongpass +  sudo -u www-data php artisan migrate --force 
-  * Make this user an admin? yes+  sudo -u www-data php artisan config:cache 
 +  sudo -u www-data php artisan route:cache 
 +  sudo systemctl restart pixelfed.service apache2 php8.4-fpm redis-server
  
-=== Step 19: Verification and Debugging Checks ===+After updating, the instance will hose the permissions on the OAUTH bits, so I decided to make a fun script to reset all caches and perms as follows. I created ''sudo nano /usr/local/bin/refresh.sh'' and put the following inside it:
  
-  * Check Redis+  #!/bin/bash 
-<code bash> +  cd /var/www/pixelfed 
-redis-cli ping +  echo "Starting full Pixel refresh – hold tight!" 
-redis-cli keys "horizon:*+  sleep 2s 
-sudo systemctl status redis-server +  echo "🔥 Clearing all old caches..." 
-sudo systemctl status pixelfed.service +  sudo -u www-data php artisan optimize:clear 
-journalctl -pixelfed.service -n 50 +  sudo -u www-data php artisan config:clear 
-</code>+  sudo -u www-data php artisan cache:clear 
 +  sudo -u www-data php artisan route:clear 
 +  sudo -u www-data php artisan view:clear 
 +  echo "🔥 Rebuilding fresh caches..." 
 +  sudo -u www-data php artisan config:cache 
 +  sudo -u www-data php artisan route:cache 
 +  sudo -u www-data php artisan view:cache 
 +  sudo -u www-data php artisan optimize 
 +  echo "🔥 Re-locking down the OAuth keys ...
 +  sudo chmod 600 /var/www/pixelfed/storage/oauth-private.key 
 +  sudo chmod 600 /var/www/pixelfed/storage/oauth-public.key 
 +  echo "🎉 Restarting services – bringing it all back online..." 
 +  sudo systemctl restart apache2 php8.4-fpm pixelfed.service redis-server
  
-  * Verify queue config: +This little script just helps me refresh everything if/when changes or adjustments need to be made. Once the instance gets approved and/or I have resolved the well-known federation and/or discovery stuff, I will post an update. Thanks all and happy hacking !!
-<code bash> +
-sudo -u www-data php artisan config:show queue | grep default +
-</code>+
  
-  * Check well-known / NodeInfo: +-------------------------------------------
-<code bash> +
-curl -s https://gnulinux.pics/.well-known/nodeinfo +
-curl -s https://gnulinux.pics/api/nodeinfo/2.0 +
-sudo -u www-data php artisan route:list | grep -i nodeinfo +
-</code>+
  
-  * Federation test: +=== Debugging, Miscellaneous, Updates === 
-<code bash> +From here forward, post miscellaneous debuggingTo fix images in DMs failing, as per github #5217, #5365, #5496, edited the db to accept wrongly submitted null values from the bad DM code:
-curl -https://pixelfed.social/.well-known/nodeinfo +
-curl -https://mastodon.social/.well-known/nodeinfo +
-</code>+
  
-  * Check logs: +  mysql -u root -
-<code bash> +  USE pixel; 
-tail -n 100 /var/www/pixelfed/storage/logs/laravel.log | grep -i "activitypub\|federat\|outbox\|inbox\|error\|fail\|exception" +  ALTER TABLE statuses MODIFY COLUMN caption TEXT NULL; 
-</code>+  EXIT;
  
-=== Update Instructions ===+This solves the issue and allows users to upload images inside their DMS. Here are the issues that helped me fix this:
  
-<code bash> +  * [[https://github.com/pixelfed/pixelfed/issues/5217|#5217]] 
-cd /var/www/pixelfed +  * [[https://github.com/pixelfed/pixelfed/issues/5365|#5365]] 
-git pull origin dev +  * [[https://github.com/pixelfed/pixelfed/issues/5496|#5496]]
-sudo -u www-data composer install --no-dev --optimize-autoloader +
-sudo -u www-data php artisan migrate --force +
-sudo -u www-data php artisan config:cache +
-sudo -u www-data php artisan route:cache +
-sudo systemctl restart pixelfed.service apache2 php8.4-fpm redis-server +
-</code>+
  
-Always check GitHub for release notes before updating+I'm having an issue where the sql of the instance wrongly uses 19 for the re-issuance of the new client registration. Since this conflicts with 19 being used by the default personal client, it fails. After repeatedly messing with auto-increment according to github iALTER TABLE oauth_clients DROP PRIMARY KEY;ssues and seeing it fail once the keys and passport were re-initialized, I decided to change the entry to a varchar assignment instead, removing the conflict: 
 + 
 +  ALTER TABLE oauth_clients MODIFY id INT NOT NULL; 
 +  ALTER TABLE oauth_clients DROP PRIMARY KEY; 
 +  ALTER TABLE oauth_clients MODIFY id VARCHAR(255) NOT NULL; 
 +  ALTER TABLE oauth_clients ADD PRIMARY KEY (id); 
 +  DESCRIBE oauth_clients; #verify it changed properly 
 +  EXIT; 
 +  cd /var/www/pixelfed 
 +  sudo -u www-data php artisan passport:install --force 
 +  sudo -u www-data php artisan passport:keys --force 
 +  sudo /usr/local/bin/refresh.sh 
 +   
 +Once I did this, the ''passport:keys'' step no longer failed or barfed about row 19.
  
- --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/03/01 17:56//+ --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/03/02 02:12//
computing/pix3lfed.1772388062.txt.gz · Last modified: by oemb1905