Blame
|
1 | # archivebox 使用 |
||||||
| 2 | ||||||||
| 3 | (未完待续) |
|||||||
| 4 | ||||||||
| 5 | ## 安装 archivebox |
|||||||
| 6 | ||||||||
| 7 | ```sh |
|||||||
| 8 | # create a folder to store your data (can be anywhere) |
|||||||
| 9 | mkdir -p ~/archivebox/data && cd ~/archivebox |
|||||||
| 10 | ||||||||
| 11 | # download the compose file into the directory |
|||||||
| 12 | # curl -fsSL 'https://docker-compose.archivebox.io' > docker-compose.yml |
|||||||
| 13 | curl --proxy http://127.0.0.1:7890 -fsSL 'https://docker-compose.archivebox.io' > docker-compose.yml |
|||||||
| 14 | ||||||||
| 15 | # (shortcut for getting https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/stable/docker-compose.yml) |
|||||||
| 16 | ||||||||
| 17 | # initialize your collection and create an admin user for the Web UI (or set ADMIN_USERNAME/ADMIN_PASSWORD env vars) |
|||||||
| 18 | docker compose run archivebox init |
|||||||
| 19 | docker compose run archivebox manage createsuperuser |
|||||||
| 20 | ``` |
|||||||
| 21 | ||||||||
| 22 | ## sonic 全文检索 |
|||||||
| 23 | ||||||||
| 24 | ```sh |
|||||||
| 25 | # download the sonic config file into your data folder (e.g. ~/archivebox) |
|||||||
| 26 | # curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/etc/sonic.cfg' > sonic.cfg |
|||||||
| 27 | curl --proxy http://127.0.0.1:7890 -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/etc/sonic.cfg' > sonic.cfg |
|||||||
| 28 | ||||||||
| 29 | # then uncomment the sonic-related sections in docker-compose.yml |
|||||||
| 30 | vi docker-compose.yml |
|||||||
| 31 | ||||||||
| 32 | # to backfill any existing archive data into the search index, run: |
|||||||
| 33 | docker compose run archivebox update --index-only |
|||||||
| 34 | ``` |
|||||||
| 35 | ||||||||
| 36 | ```sh |
|||||||
| 37 | docker compose up -d |
|||||||
| 38 | ``` |
|||||||
| 39 | ||||||||
| 40 | 此时 访问 ip:8000 可以浏览页面了 |
|||||||
| 41 | ||||||||
| 42 | ||||||||
| 43 | ||||||||
| 44 | ## 安装 chrome |
|||||||
| 45 | ||||||||
| 46 | 抓取需要登录的内容,通过 cookie 设置 |
|||||||
| 47 | ||||||||
| 48 | ```sh |
|||||||
| 49 | sudo apt update |
|||||||
| 50 | sudo apt install chromium-browser |
|||||||
| 51 | # or on some systems: |
|||||||
| 52 | sudo apt install chromium |
|||||||
| 53 | ``` |
|||||||
| 54 | ||||||||
| 55 | 修改docker-compose.yml |
|||||||
| 56 | ||||||||
| 57 | ```yml |
|||||||
| 58 | services: |
|||||||
| 59 | archivebox: |
|||||||
| 60 | ... |
|||||||
| 61 | volumes: |
|||||||
| 62 | ... |
|||||||
| 63 | - ./data/personas/Default:/data/personas/Default |
|||||||
| 64 | environment: |
|||||||
| 65 | - CHROME_USER_DATA_DIR=/data/personas/Default/chrome_profile |
|||||||
| 66 | - DISPLAY=novnc:0.0 |
|||||||
| 67 | novnc: |
|||||||
| 68 | image: theasp/novnc:latest |
|||||||
| 69 | environment: |
|||||||
| 70 | - DISPLAY_WIDTH=1920 |
|||||||
| 71 | - DISPLAY_HEIGHT=1080 |
|||||||
| 72 | - RUN_XTERM=no |
|||||||
| 73 | ports: |
|||||||
| 74 | - "8080:8080" |
|||||||
| 75 | ``` |
|||||||
| 76 | ||||||||
| 77 | 添加 CHROME_USER_DATA_DIR和 DISPLAY |
|||||||