You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,6 +12,113 @@ API, storing it in JSON files, maintaining its local archive with
13
12
incremental updates, and turning those JSON files into the HTML
14
13
archive.
15
14
15
+
### Contents
16
+
*[Running zulip-archive as a GitHub action](#running-zulip-archive-as-a-github-action)
17
+
*[Running zulip-archive by yourselves](#running-zulip-archive-by-yourselves)
18
+
*[Why archive](#why-archive)
19
+
*[Contributing and future plans](#contributing-and-future-plans)
20
+
21
+
## Running zulip-archive as a GitHub action
22
+
23
+
Running `zulip-archive` as a GitHub action is easiest way to get up and running. The action would run periodically, sync the repo with latest messages and publish archive website using GitHub pages. Follow the steps below to setup `zulip-archive` Github action in a few minutes.
24
+
25
+
### Step 1 - Create a new repository for running action
26
+
27
+
We recommend using a new repository for running action. If you have not yet created one, goto https://github.com/new/ and create a new repository.
28
+
29
+
### Step 2 - Generate credentials
30
+
31
+
GitHub action needs the following credentials for running.
32
+
33
+
#### Zulip API Key
34
+
35
+
Zulip API key is used for fetching the messages of public streams from the Zulip organization. We recommend creating a bot and using it's API key instead of using your own API key. See https://zulipchat.com/help/add-a-bot-or-integration for more details.
36
+
37
+
#### GitHub Personal Access Token
38
+
39
+
The token is used by the GitHub action for pushing to the repo and running GitHub page builds. You can generate the token by going to https://github.com/settings/tokens. Make sure to enable `repo` and `workflow` while generating the token.
40
+
41
+
### Step 3 - Store credentials as secrets in the repository
42
+
43
+
Now that we have generated the credentials, we need to store them in the repository as secrets so that action can access them during run time. For that goto `https://github.com/<username>/<repo-name>/settings/secrets`. `<username>` is your GitHub username and `<repo-name>` is the name of the repo you just created.
44
+
45
+
Now create the following 4 secrets. Use the credentials generated in the above step as the value of each secret.
|zulip_organization_url | URL of your Zulip organization. |
50
+
|zulip_bot_email | The email of the Zulip bot you created |
51
+
|zulip_bot_key | API key of the Zulip bot you created |
52
+
|github_personal_access_token | The GitHub personal access token you created |
53
+
54
+
55
+
### Step 4 - Configure the streams you want to index
56
+
`zulip-archive` by default don't know which all public streams to be indexed. You can tell `zulip-archive` which all streams to be indexed by creating a file called `streams.yaml` in the newly created repository.
57
+
58
+
If you want to index all the public streams, set the following as the content of `streams.yaml` file.
59
+
60
+
```yaml
61
+
included:
62
+
- '*'
63
+
```
64
+
65
+
You can exclude some of the public streams by placing them under `excluded` key.
66
+
67
+
```yaml
68
+
included:
69
+
- '*'
70
+
71
+
excluded:
72
+
- general
73
+
- development help
74
+
```
75
+
76
+
Alternatively you can specify only the streams that you want to index.
77
+
78
+
```yaml
79
+
included:
80
+
- python
81
+
- data structures
82
+
- javascript
83
+
```
84
+
85
+
### Step 5 - Enable zulip-archive action
86
+
87
+
Final step is to enable the action. For that create a file called `.github/workflows/main.yaml` in your repository and pase the following as content.
88
+
89
+
```yaml
90
+
on:
91
+
schedule:
92
+
- cron: '*/20 * * * *'
93
+
94
+
jobs:
95
+
publish_archive_job:
96
+
runs-on: ubuntu-latest
97
+
name: A job to publish zulip-archive in GitHub pages
The above file tells GitHub to run the `zulip-archive` action every 20 minutes. You can adjust the `cron` key to modify the schedule as you feel appropriate. If you Zulip organization history is very large (not the case for most users) we recommend to increase the cron period from running every 30 minutes to maybe run every 1 hour (eg `'0 * * * *'`). This is is because the initial archive run that fetches the messages for the first time takes a lot of time and we don't want the second cron job to start before finishing the first run is over. After the initial run is over you can shorten the cron job period if necessary.
112
+
113
+
### Step 6 - Verify everything works
114
+
115
+
Final step is to verify that everything is working as it is supposed to be. You would have to wait for some time since the action is scheduled to run every 20 minutes (or the time you have configured it to be in above step.) You can track the status of the action by visiting `https://github.com/<github-username>/<repo-name>/actions`. Once the action completes running, you would be able to visit the archive by opening the link mentioned in the action run log at the end. The link would be usually be of the form `<github-username>.github.io/<repo-name>` or `<your-personal-domain>/<repo-name>` if you have configured your own personal domain to point to GitHub pages.
116
+
117
+
118
+
## Running zulip-archive by yourselves
119
+
120
+
For most users, running `zulip-archive` as GitHub actions should be good enough. If you want to run `zulip-archive` in your own server or do something else, see the [instructions](instructions.md) docs. The [hosting docs](hosting.md) also offer a few suggestions for good ways to host the output of this tool.
121
+
16
122
## Why archive?
17
123
18
124
The best place to participate actively in a Zulip community is an app
@@ -46,10 +152,6 @@ Zulip apps:
46
152
branding reasons or to integrate with other data. You can modify
47
153
the tools here as needed for that. You own your own data.
48
154
49
-
## Instructions
50
-
51
-
See the [instructions](instructions.md) to learn how to build
0 commit comments