From 3e4da4362746a5089a53ba5aa42695fc19c3c7b4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 17 Jan 2025 20:47:42 +0100 Subject: [PATCH] Implemented pdsadmin --- roles/docker-bluesky/README.md | 3 +- roles/docker-bluesky/tasks/main.yml | 33 +++++++++++++++++-- .../templates/docker-compose.yml.j2 | 6 ++-- roles/docker-bluesky/vars/main.yml | 8 ++++- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/roles/docker-bluesky/README.md b/roles/docker-bluesky/README.md index 19181e67..e01e8d43 100644 --- a/roles/docker-bluesky/README.md +++ b/roles/docker-bluesky/README.md @@ -36,4 +36,5 @@ curl -X POST https://your-pds-domain/xrpc/com.atproto.server.createAccount \ - https://github.com/bluesky-social/pds - https://chatgpt.com/c/678a2eb6-145c-800f-bf51-ff706981a928 - https://www.youtube.com/watch?v=7_AG50u7D6c -- https://github.com/bluesky-social/pds/issues/52 \ No newline at end of file +- https://github.com/bluesky-social/pds/issues/52 +- https://github.com/lhaig/pdsadmin \ No newline at end of file diff --git a/roles/docker-bluesky/tasks/main.yml b/roles/docker-bluesky/tasks/main.yml index 0b30a525..a5c52f17 100644 --- a/roles/docker-bluesky/tasks/main.yml +++ b/roles/docker-bluesky/tasks/main.yml @@ -12,14 +12,41 @@ include_tasks: nginx-docker-proxy-domain.yml vars: domain: "{{ domain_web }}" - http_port: "{{ http_port_web }}" + http_port: "{{ http_port_web }}" + +# The following lines should be removed when the following issue is closed: +# https://github.com/bluesky-social/pds/issues/52 + +- name: Download pdsadmin tarball + get_url: + url: "https://github.com/lhaig/pdsadmin/releases/download/v1.0.0-dev/pdsadmin_Linux_x86_64.tar.gz" + dest: "{{pdsadmin_temporary_tar_path}}" + mode: '0644' + +- name: Create {{pdsadmin_folder_path}} + file: + path: "{{pdsadmin_folder_path}}" + state: directory + mode: '0755' + +- name: Extract pdsadmin tarball + unarchive: + src: "{{pdsadmin_temporary_tar_path}}" + dest: "{{pdsadmin_folder_path}}" + remote_src: yes + mode: '0755' + +- name: Ensure pdsadmin is executable + file: + path: "{{pdsadmin_file_path}}" + mode: '0755' + state: file - name: clone social app repository git: repo: "https://github.com/bluesky-social/social-app.git" dest: "{{social_app_path}}" - version: "main" # Optional: spezifischer Branch oder Tag - update: yes # Aktualisiert das Repo, falls es schon existiert + version: "main" notify: docker compose project build and setup - name: add docker-compose.yml diff --git a/roles/docker-bluesky/templates/docker-compose.yml.j2 b/roles/docker-bluesky/templates/docker-compose.yml.j2 index e5fec101..192b5fb9 100644 --- a/roles/docker-bluesky/templates/docker-compose.yml.j2 +++ b/roles/docker-bluesky/templates/docker-compose.yml.j2 @@ -1,9 +1,10 @@ services: pds: - image: ghcr.io/bluesky-social/pds:0.4 + image: ghcr.io/bluesky-social/pds:latest restart: {{docker_restart_policy}} volumes: - pds_data:/pds + - {{pdsadmin_file_path}}:/usr/local/bin/pdsadmin:ro environment: # Geben Sie hier Ihre Domain und Konfigurationsdetails an PDS_HOSTNAME: "{{domain_api}}" @@ -41,7 +42,8 @@ services: command: ["bskyweb","serve"] build: context: "{{ social_app_path }}" - dockerfile: Dockerfile # Standard-Dockerfile im Repository + dockerfile: Dockerfile + # It doesn't compile yet with this parameters. @todo Fix it args: REACT_APP_PDS_URL: "http://{{domain_api}}" # URL des PDS REACT_APP_API_URL: "http://{{domain_api}}" # API-URL des PDS diff --git a/roles/docker-bluesky/vars/main.yml b/roles/docker-bluesky/vars/main.yml index 1462f29c..733c9a82 100644 --- a/roles/docker-bluesky/vars/main.yml +++ b/roles/docker-bluesky/vars/main.yml @@ -1,2 +1,8 @@ docker_compose_project_name: "bluesky" -social_app_path: "{{ docker_compose_instance_directory }}/social-app" \ No newline at end of file +social_app_path: "{{ docker_compose_instance_directory }}/social-app" + +# This should be removed when the following issue is closed: +# https://github.com/bluesky-social/pds/issues/52 +pdsadmin_folder_path: "{{ docker_compose_instance_directory }}/pdsadmin" +pdsadmin_file_path: "{{pdsadmin_folder_path}}/pdsadmin" +pdsadmin_temporary_tar_path: "/tmp/pdsadmin.tar.gz" \ No newline at end of file