diff --git a/roles/docker-bluesky/README.md b/roles/docker-bluesky/README.md new file mode 100644 index 00000000..00b231f1 --- /dev/null +++ b/roles/docker-bluesky/README.md @@ -0,0 +1,5 @@ +# DRAFT role docker-bluesky + +## more information +- https://therobbiedavis.com/selfhosting-bluesky-with-docker-and-swag/ +- https://cprimozic.net/notes/posts/notes-on-self-hosting-bluesky-pds-alongside-other-services/ \ No newline at end of file diff --git a/roles/docker-bluesky/tasks/main.yml b/roles/docker-bluesky/tasks/main.yml new file mode 100644 index 00000000..452e6d50 --- /dev/null +++ b/roles/docker-bluesky/tasks/main.yml @@ -0,0 +1,10 @@ +--- +- name: "include docker/compose/database.yml" + include_tasks: docker/compose/database.yml + +- name: "include tasks nginx-docker-proxy-domain.yml" + include_tasks: nginx-docker-proxy-domain.yml + +- name: add docker-compose.yml + template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml + notify: docker compose project setup diff --git a/roles/docker-bluesky/templates/docker-compose.yml.j2 b/roles/docker-bluesky/templates/docker-compose.yml.j2 new file mode 100644 index 00000000..2e9749c3 --- /dev/null +++ b/roles/docker-bluesky/templates/docker-compose.yml.j2 @@ -0,0 +1,52 @@ +services: + pds: + container_name: pds + image: ghcr.io/bluesky-social/pds:0.4 + restart: unless-stopped + ports: + - 3000:3000 + volumes: + - path/to/pds/storage:/pds + env_file: + - /path/to/pds.env + +{% include 'templates/docker/services/' + database_type + '.yml.j2' %} + + application: + logging: + driver: journald + restart: {{docker_restart_policy}} + image: gitea/gitea:latest + environment: + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - DB_HOST={{database_host}}:3306 + - DB_NAME={{database_name}} + - DB_USER={{database_username}} + - DB_PASSWD={{database_password}} + - SSH_PORT={{ssh_port}} + - SSH_LISTEN_PORT=22 + - DOMAIN={{domain}} + - SSH_DOMAIN={{domain}} + - RUN_MODE="{{run_mode}}" + - ROOT_URL="https://{{domain}}/" + ports: + - "127.0.0.1:{{http_port}}:3000" + - "{{ssh_port}}:22" + volumes: + - data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"] + interval: 1m + timeout: 10s + retries: 3 +{% include 'templates/docker/container/networks.yml.j2' %} +{% include 'templates/docker/container/depends-on-just-database.yml.j2' %} + +{% include 'templates/docker/compose/volumes.yml.j2' %} + data: + +{% include 'templates/docker/compose/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/docker-bluesky/templates/pds.env b/roles/docker-bluesky/templates/pds.env new file mode 100644 index 00000000..56c43363 --- /dev/null +++ b/roles/docker-bluesky/templates/pds.env @@ -0,0 +1,17 @@ +PDS_HOSTNAME= #bluesky.yourdomain.com +PDS_JWT_SECRET= #openssl rand --hex 16 +PDS_ADMIN_PASSWORD= #openssl rand --hex 16 +PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX= #openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32 +PDS_EMAIL_SMTP_URL= #smtp://username@gmail.com:password@smtp.gmail.com:587 +PDS_EMAIL_FROM_ADDRESS= #admin@domain.com +PDS_MODERATION_EMAIL_SMTP_URL= #smtp://username@gmail.com:password@smtp.gmail.com:587 +PDS_MODERATION_EMAIL_ADDRESS= #admin@domain.com +PDS_DATA_DIRECTORY=/pds +PDS_BLOBSTORE_DISK_LOCATION=/pds/blocks +PDS_DID_PLC_URL=https://plc.directory +PDS_BSKY_APP_VIEW_URL=https://api.bsky.app +PDS_BSKY_APP_VIEW_DID=did:web:api.bsky.app +PDS_REPORT_SERVICE_URL=https://mod.bsky.app +PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac +PDS_CRAWLERS=https://bsky.network +LOG_ENABLED=true \ No newline at end of file diff --git a/roles/docker-bluesky/vars/main.yml b/roles/docker-bluesky/vars/main.yml new file mode 100644 index 00000000..ea536dab --- /dev/null +++ b/roles/docker-bluesky/vars/main.yml @@ -0,0 +1,3 @@ +docker_compose_project_name: "bluesky" +database_password: "{{bluesky_database_password}}" +database_type: "mariadb" \ No newline at end of file