tekolote

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by tekolote

  1. @dave234ee From a bit of quick googling it sounds like your database was either corrupted or deleted while in use. Are you able to restore from backup?
  2. I just posted a guide for this here. Hopefully it can be helpful for setting this up
  3. I've seen some people ask for help setting up Pixelfed. I spent a few days trying to get it working. This is my first guide so please let me know if something needs to be changed or clarified. You will need a database (mysql or mariadb), redis, a reverse proxy (swag in this case), and the compose.manager plugin. ------------------------------------------------------- Database Setup ------------------------------------------------------- Pixelfed only supports mysql. I am using mariadb which seems to be working but it's not supported so your mileage may vary. If you feel more comfortable using mysql install it instead of mariadb and modify the .env changes we'll do later to match • Search CA for "mariadb" install the container from linuxserver's repository • in the setup create a mysql root password, mysql database, mysql user, and mysql password. You will need the database name, user, and mysql password for later. ------------------------------------------------------- redis Setup ------------------------------------------------------- • Search CA for "redis " install the container from jj9887's repository • set an a port number that is not being used by another service and click apply to install ------------------------------------------------------- pixelfed container setup ------------------------------------------------------- • Search CA for "Docker Compose Manager " install the container from dcflachs's repository • Return to the docker tab. At the bottom click the new "ADD NEW STACK'' button • Create a name for your new docker compose stack I used "pixelfed". Click the advanced dropdown arrow and set a directory for the compose stack, this is where the "appdata" will be downloaded. I used "/mnt/user/appdata/pixelfed" • Click the small gear icon next to the new stack and click "edit stack" then "compose file". • paste the following docker compose file into the text box that appears and click "save changes" --- # Require 3.8 to ensure people use a recent version of Docker + Compose version: "3.8" ############################################################### # Please see docker/README.md for usage information ############################################################### services: web: image: "murazaki/pixelfed:edge-apache" container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-web" restart: unless-stopped profiles: - ${DOCKER_WEB_PROFILE:-} environment: # Used by Pixelfed Docker init script DOCKER_SERVICE_NAME: "web" DOCKER_APP_ENTRYPOINT_DEBUG: ${DOCKER_APP_ENTRYPOINT_DEBUG:-0} ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} volumes: - "./.env:/var/www/.env" - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" ports: - "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80" healthcheck: test: 'curl --header "Host: ${APP_DOMAIN}" --fail http://localhost/api/service/health-check' interval: "${DOCKER_WEB_HEALTHCHECK_INTERVAL}" retries: 2 timeout: 5s worker: image: "murazaki/pixelfed:edge-apache" container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-worker" command: gosu www-data php artisan horizon restart: unless-stopped stop_signal: SIGTERM profiles: - ${DOCKER_WORKER_PROFILE:-} environment: # Used by Pixelfed Docker init script DOCKER_SERVICE_NAME: "worker" DOCKER_APP_ENTRYPOINT_DEBUG: ${DOCKER_APP_ENTRYPOINT_DEBUG:-0} ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} volumes: - "./.env:/var/www/.env" - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" healthcheck: test: gosu www-data php artisan horizon:status | grep running interval: "${DOCKER_WORKER_HEALTHCHECK_INTERVAL:?error}" timeout: 5s retries: 2 • Navigate to the directory you set for the pixelfed "appdata" and create a .env file. Paste the following into the file APP_NAME="pixelfed" # # !!! Domain Cannot be changed after instance is started !!! # APP_DOMAIN="pixelfed.domain" APP_URL="https://${APP_DOMAIN}" ADMIN_DOMAIN="${APP_DOMAIN}" APP_ENV="production" APP_DEBUG="false" ENABLE_CONFIG_CACHE="true" OPEN_REGISTRATION="false" ENFORCE_EMAIL_VERIFICATION="false" # # !!!The APP_TIMEZONE Cannot be changes after the instance is running!!! # APP_TIMEZONE="UST" APP_LOCALE="en" INSTANCE_CONTACT_EMAIL="admincontact@email" CACHE_DRIVER="redis" BROADCAST_DRIVER="redis" ################################################################################ # database ################################################################################ DB_VERSION="11.2" DB_CONNECTION="mysql" DB_HOST="MARIADBCONTAINERADDRESS" DB_USERNAME="DBUSER" DB_PASSWORD='DBPASSWORD' DB_DATABASE="DBNAME" DB_PORT="3306" DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY="false" ################################################################################ # redis ################################################################################ REDIS_CLIENT="phpredis" REDIS_SCHEME="tcp" REDIS_HOST="REDISCONTAINERADDRESS" REDIS_PORT="REDITPORT" ################################################################################ # ActivityPub ################################################################################ ACTIVITY_PUB="true" AP_REMOTE_FOLLOW="true" AP_SHAREDINBOX="true" AP_OUTBOX="true" ################################################################################ # Federation ################################################################################ ATOM_FEEDS="true" NODEINFO="true" WEBFINGER="true" ################################################################################ # logging ################################################################################ LOG_CHANNEL="stderr" ################################################################################ # session ################################################################################ SESSION_DRIVER="redis" ################################################################################ # docker shared ################################################################################ # # !!! Do not fill in the appkey line. It will be generated during instance setup !!! # APP_KEY= DOCKER_ALL_CONTAINER_NAME_PREFIX="${APP_NAME}" DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL="10s" DOCKER_ALL_HOST_ROOT_PATH="./docker-compose-state" DOCKER_ALL_HOST_DATA_ROOT_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/data" DOCKER_ALL_HOST_CONFIG_ROOT_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/config" DOCKER_APP_HOST_OVERRIDES_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/overrides" TZ="${APP_TIMEZONE}" ################################################################################ # docker app ################################################################################ DOCKER_APP_RELEASE="branch-jippi-fork" DOCKER_APP_PHP_VERSION="8.2" DOCKER_APP_RUNTIME="apache" DOCKER_APP_DEBIAN_RELEASE="bullseye" DOCKER_APP_BASE_TYPE="apache" DOCKER_APP_IMAGE="ghcr.io/jippi/pixelfed" DOCKER_APP_TAG="${DOCKER_APP_RELEASE:?error}-${DOCKER_APP_RUNTIME:?error}-${DOCKER_APP_PHP_VERSION:?error}" DOCKER_APP_HOST_STORAGE_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/pixelfed/storage" DOCKER_APP_HOST_CACHE_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/pixelfed/cache" ################################################################################ # docker web ################################################################################ DOCKER_WEB_PORT_EXTERNAL_HTTP="8080" DOCKER_WEB_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" • Modify the .env file to suit the needs of your instance. Note that the Domain and Timezone cannot be changed after the instance is started • In the docker tab of unraid click the new "compose up" button to this will download and start the docker containers from the murazaki/pixelfed:edge-apache repository. ------------------------------------------------------- pixelfed instance setup ------------------------------------------------------- The Following should set up the instance now that the containers are running. • In the docker tab of the unraid UI click on the new pixelfed-web container and click ">_ console" this will open a new window that contains a console shell of the docker container • Paste "php artisan key:generate" into the console window and press enter. This will generate an appkey and insert it into your .env file • in the Unraid docker tab click the "Compose Down" key to the right of your pixelfed stack then, when that is complete, "compose up". This will restart your containers • Enter the Console for pixelfed-web again and paste "php artisan config:cache" this will cache the settings in you .env to pixelfed. If you make changes to your .env file run "php artisan cache:clear" then "php artisan config:cache" to clear the old and cache the new settings • In the console paste "php artisan migrate" and press enter. You will be asked of you want to proceed. Arrow left and press enter to select "yes" This will set up your database • When this is complete compose down then up again to restart the containers • Enter the Console again and paste "php artisan user:create". Follow the prompts to create your first admin account. Email account is used for login so please use a valid email address format ------------------------------------------------------- reverse proxy setup (swag) ------------------------------------------------------- • Navigate to the proxy-conf directory of your swag appdata and edit the pixelfed.subdomain.conf.sample file to match the following config with the upsteam app and upstream port edited to match your setup server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name pixelfed.*; include /config/nginx/ssl.conf; client_max_body_size 0; location / { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; set $upstream_app PIXELFED-WEBADDRESS; set $upstream_port PIXELFED-WEBPORT; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } } ------------------------------------------------------- DNS and Beyons ------------------------------------------------------- At this point you should have a working pixelfed instance with a reverse proxy. What is left is to create a CNAME dns record. There are likely guides for how to do this for your DNS provider. If you are using cloudflare my understanding is that you will have to disable the cloudflare proxy for activity pub federation to work properly On the subject of federation if you would like to enable activity pub federation enter the pixelfed-web console again and run "php artisan instance:actor" After updates you may need to run "php artisan migrate" I haven't had to update yet so I haven't tested this. There are many settings that can be changed or added via the .env file. The one I posed is trimmed down to make it clearer and easier to follow. You can check out the full .env file at the Pixelfed Github repo in the .env.docker file ---------------------------------------------------------------------------------------------------------------------------------------------------- Hopefully by now you have a working instance that can be reached from outside of your network. I am sure there are better or more efficient ways to do but, this suits my needs for a small instance for a few friends and myself to use. Please understant that I am an amateur and am new to server/system administration so I cannot guarantee that this is secure enough for production use. Please review these methods along with the pixelfed official documentation before decideding if this is right for you and your user's security
  4. No worries. Getting support for things running on unraid when it's outside of the communities apps can be a real hassle since most developers understandably don't support it. I would have had a lot more trouble getting sliding-sync setup without your guide. so, Thanks for your contribution
  5. @JEZBRO I followed your guide for adding sliding-sync I noticed that you add a database to your matrix postgres server. Then, in the docker compose file it downloads and creates it's own postgresql15 server and database and uses that instead. You can check in pgadmin in the syncv3 database you created under schemas>tables. The tables dropdown will be empty if it's not being used because the sliding sync docker compose configuration is using it's own build in postgresql15 database instead of the one that was prepared for it on the matrix postgres server and places the database in the mounted volume at - /mnt/user/appdata/matrix/sliding-sync/database. I was able to get it to connect to the correct database by modifying the compose file. If you or anybody else following the guide would like to switch to the database you prepared Here's an example of my compose file. You'll have to add in your secret key and add the user, password, and server info to match yours version: '3.8' services: slidingsync-proxy: container_name: slidingsync-proxy image: 'ghcr.io/matrix-org/sliding-sync:latest' restart: unless-stopped environment: - 'SYNCV3_SERVER=https://chat.domain.com' - 'SYNCV3_SECRET=SECRETKEY' - 'SYNCV3_BINDADDR=:8009' - 'SYNCV3_DB=postgres://DATABASEUSER:DATABASEPASSWORD@DATABASEIP:DATABASEPORT/DATABASENAME'?sslmode=disable' ports: - '8009:8009'
  6. @Nelinski This is my config file for swag. I used "sliding" instead of "chat1" for my sliding-sync url. If I understand correctly, with this config you don't need to upload the JSON file becuase the well-known data is being returned by nginx. You'll have to change $upstream_app to point to your slidingsync-proxy, you might be able to you the container name instead of IP. Also, add your correct domains the the location entry. I also added this same location entry into my swag config for the matrix-synapse container. Before I did that the Elementx app said the server doesn't have sliding-sync configured. after adding it to both I got no errors and it seems to be working server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name sliding.*; include /config/nginx/ssl.conf; client_max_body_size 0; location / { include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; set $upstream_app UNRAIDIP; set $upstream_port 8009; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } location /.well-known/matrix/client { add_header Access-Control-Allow-Origin *; default_type application/json; return 200 '{"m.homeserver": {"base_url": "https://chat.yourdomain.com"}, "org.matrix.msc3575.proxy": {"url": "https://sliding.yourdomain.com"}}'; } } Another thing I noticed is that the postgresql database created in the fist part of the sliding-sync guide through pgadmin on host of the matrix database is not being used. It looks like the compose file is creating a new postgresql15 host and database and using that instead. I wasn't able to get it to connect to the postgres host I made for matrix but I am not knowledgeable about docker-compose and networking. Someday maybe I'll figure it out