Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The historical version is not available. #9557

Open
1 task done
pipuwong opened this issue Jan 7, 2025 · 1 comment
Open
1 task done

The historical version is not available. #9557

pipuwong opened this issue Jan 7, 2025 · 1 comment

Comments

@pipuwong
Copy link

pipuwong commented Jan 7, 2025

What happened?

OS: Linux, Debian12
Desktop App Affine v0.19.5

I really like affine, I even recommend it to the people around me, hoping it gets better. Thank you for your efforts. I self-hosted affine on a server, and a problem occurred.

When I tried to restore the document, I found that the historical versions were not available.
How should I do to use the historical version?

CleanShot.2025-01-07.at.09.10.26.mp4

docker-compose.yml

name: affine
services:
  affine:
    image: ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}
    container_name: affine_server
    ports:
      - '${PORT:-3010}:3010'
    depends_on:
      redis:
        condition: service_healthy
      postgres:
        condition: service_healthy
      affine_migration:
        condition: service_completed_successfully
    volumes:
      # custom configurations
      - ${UPLOAD_LOCATION}:/root/.affine/storage
      - ${CONFIG_LOCATION}:/root/.affine/config
    env_file:
      - .env
    environment:
      - REDIS_SERVER_HOST=redis
      - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
    restart: unless-stopped

  affine_migration:
    image: ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}
    container_name: affine_migration_job
    volumes:
      # custom configurations
      - ${UPLOAD_LOCATION}:/root/.affine/storage
      - ${CONFIG_LOCATION}:/root/.affine/config
    command: ['sh', '-c', 'node ./scripts/self-host-predeploy.js']
    env_file:
      - .env
    environment:
      - REDIS_SERVER_HOST=redis
      - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  redis:
    image: redis
    container_name: redis
    healthcheck:
      test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  postgres:
    image: postgres:16
    container_name: postgres
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_DB: ${DB_DATABASE:-affine}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # you better set a password for you database
      # or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy
      POSTGRES_HOST_AUTH_METHOD: trust
    healthcheck:
      test:
        ['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

.env

# select a revision to deploy, available values: stable, beta, canary
AFFINE_REVISION=stable
 
# set the port for the server container it will expose the server on
PORT=3010
 
# set the host for the server for outgoing links
AFFINE_SERVER_HTTPS=true
AFFINE_SERVER_HOST=affine.example.com 



# or 
# AFFINE_SERVER_EXTERNAL_URL=https://affine.yourdomain.com
 
# position of the database data to persist
DB_DATA_LOCATION=./pgdata
# position of the upload data(images, files, etc.) to persist
UPLOAD_LOCATION=./storage
# position of the configuration files to persist
CONFIG_LOCATION=./config
 
# database credentials
DB_USERNAME=dfkoL3123xdgpu4lccs
DB_PASSWORD=KLDSJFKfdsxxoi
DB_DATABASE=Csagfskccxa234

Distribution version

macOS x64 (Intel)

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • Yes

Relevant log output

No response

Anything else?

No response

@forehalo
Copy link
Member

forehalo commented Jan 7, 2025

any log from your instance server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants