5
5
Source code for the default [ Cargo] ( http://doc.crates.io ) registry. Viewable
6
6
online at [ crates.io] ( https://crates.io ) .
7
7
8
- This project is built on ember-cli and cargo, visit
9
- [ iamstef.net/ember-cli] ( http://ember-cli.com/ ) or
10
- [ doc.crates.io] ( http://doc.crates.io/ ) respectively for more information.
8
+ ## Status of crates.io
11
9
12
- ## Working on the Frontend
10
+ Any known issues currently affecting the registry running at https://crates.io
11
+ will be posted to [ @cratesiostatus ] ( https://twitter.com/cratesiostatus ) .
13
12
14
- Install [ Yarn] ( https://yarnpkg.com ) , see
15
- [ yarnpkg.com/en/docs/install] ( https://yarnpkg.com/en/docs/install ) for
16
- instructions for your OS.
13
+ If you are experiencing an issue not addressed there, please contact us in one
14
+ of the following ways:
17
15
18
- ``` bash
19
- git clone https://github.com/rust-lang/crates.io.git
20
- cd crates.io/
21
- yarn
22
- yarn run bower install
23
- ```
16
+ - [ File a new issue] ( https://github.com/rust-lang/crates.io/issues/new )
17
+
18
+ - Chat on irc.mozilla.org in the [ #rust-infra] ( https://kiwiirc.com/client/irc.mozilla.org:+6667/#rust-infra ) channel
24
19
25
- The website's frontend is built with [ Ember.js] ( http://emberjs.com/ ) . This
26
- makes it possible to work on the frontend without running a local backend.
27
- To start the frontend run:
20
+ A volunteer will get back to you as soon as possible.
28
21
29
- ``` bash
30
- yarn run start:staging
31
- ```
22
+ ## Contributing
32
23
33
- This will run a local frontend using the staging backend (hosted on Heroku at
34
- [ staging-crates-io.herokuapp.com] ( https://staging-crates-io.herokuapp.com ) ).
24
+ Welcome! We love contributions! Crates.io is an [ Ember] ( https://emberjs.com/ )
25
+ frontend with a Rust backend, and there are many tasks appropriate for a
26
+ variety of skill levels.
35
27
36
- If you want to set up a particular situation, you can edit the fixture data used
37
- for tests in ` mirage/fixtures ` . Note that the fixture data does not contain
38
- JSON needed to support every page, so some pages might not load correctly. To
39
- run the frontend and use that data, don't specify any backend:
28
+ Please see [ docs/CONTRIBUTING.md] ( https://github.com/rust-lang/crates.io/blob/master/docs/CONTRIBUTING.md ) for ideas about what to work on and how to set up a development
29
+ environment.
40
30
41
- ``` bash
42
- yarn run start
43
- ```
31
+ ### Categories
44
32
45
- If you'd like to run the frontend with a specific backend endpoint, you can
46
- specify arguments to ` yarn start ` . For example you can set the proxy to
47
- ` https://crates.io/ ` to use the production version.
48
-
49
- ** Note: it is also possible to make changes to the production data**
50
-
51
- To do this, run:
52
-
53
- ``` bash
54
- yarn start -- --proxy https://crates.io
55
- # or
56
- yarn run start:live
57
- ```
58
-
59
- ** Note** : This requires npm 2.
60
-
61
- ### Running Tests
62
-
63
- Install [ phantomjs] ( http://phantomjs.org/ ) , typically: `npm install
64
- phantomjs-prebuilt`.
65
-
66
- Then run the tests with:
67
-
68
- ```
69
- yarn run ember test
70
- yarn run ember test --server
71
- ```
72
-
73
- ## Working on the Backend
74
-
75
- Working on the backend requires a usable postgres server and to configure
76
- crates.io to use it. There are slight differences in configuration for
77
- hosting the backend and running tests, both of which are described in more
78
- details in the appropriate subsections.
79
-
80
- After cloning the repo, do the following:
81
-
82
- 1 . Install [ Postgres] ( https://www.postgresql.org/ ) >= 9.5. On Linux this is
83
- generally available in the distribution repositories as ` postgresql ` or
84
- ` postgresql-server ` . This will need to be up and running for running tests
85
- for hosting the site locally.
86
-
87
- 2 . Copy the ` .env.sample ` file to ` .env ` . Some settings will need to be
88
- modified. These instructions are in the subsequent sections.
89
-
90
- 3 . Install ` diesel_cli ` using `cargo install diesel_cli --no-default-features
91
- --features postgres`.
92
-
93
- ### Running Tests
94
-
95
- After following the above instructions:
96
-
97
- 1 . Configure the location of the test database. Create a database specifically
98
- for testing since running the tests will clear the database. For example,
99
- to use a database named ` cargo_registry_test ` , create it in postgres by
100
- running ` psql ` to connect to postgres, then run `CREATE DATABASE
101
- cargo_registry_test;`. The test harness will ensure that migrations are run.
102
-
103
- In your ` .env ` file, specify your test database URL. Here's an example,
104
- assuming your test database is named ` cargo_registry_test ` :
105
-
106
- ```
107
- export TEST_DATABASE_URL=postgres://postgres@localhost/cargo_registry_test
108
- ```
109
-
110
- 2 . Run the backend API server tests:
111
-
112
- ```
113
- cargo test
114
- ```
115
-
116
- ### Hosting crates.io locally
117
-
118
- After following the instructions described in "Working on the Backend":
119
-
120
- 1 . Make sure your local postgres instance is running and create a database for
121
- use with the local crates.io instance. ` cargo_registry ` is a good name to
122
- use. You can do this by running ` psql ` to connect to ` postgres ` and run:
123
-
124
- ```
125
- CREATE DATABASE cargo_registry;
126
- ```
127
-
128
- 2 . Modify the ` .env ` configuration file's ` DATABASE_URL ` setting to point
129
- to the local postgres instance with the database you want to use. If you've
130
- followed these instructions it should likely look like:
131
-
132
- ```
133
- export DATABASE_URL=postgres://postgres@localhost/cargo_registry
134
- ```
135
-
136
- 3 . Set up the git index:
137
-
138
- ```
139
- ./script/init-local-index.sh
140
- ```
141
-
142
- But * do not* modify your ` ~/.cargo/config ` yet (but record the instructions
143
- shown at the end of this step as you'll need them later).
144
-
145
- 4 . Build the server:
146
-
147
- ```
148
- cargo build
149
- ```
150
-
151
- On OS X 10.11, you will need to install the openssl headers first, and tell
152
- cargo where to find them. See https://github.com/sfackler/rust-openssl#osx .
153
-
154
- 5 . Modify your ` ~/.cargo/config ` after successfully building crates.io
155
- following the instructions shown at the end of Step 3.
156
-
157
- 5 . Run the migrations:
158
-
159
- ```
160
- diesel migration run
161
- ```
162
-
163
- 6 . Start the backend server:
164
-
165
- ```
166
- ./target/debug/server
167
- ```
168
-
169
- 7 . ** Optionally** start a local frontend:
170
-
171
- ```
172
- yarn run start:local
173
- ```
174
-
175
- ## Categories
33
+ Adding or editing the categories and corresponding descriptions displayed on
34
+ [ crates.io/categories] ( https://crates.io/categories ) does not require a full
35
+ development environment set up.
176
36
177
37
The list of categories available on crates.io is stored in
178
- ` src/categories.toml ` . To propose adding, removing, or changing a category,
179
- send a pull request making the appropriate change to that file as noted in the
180
- comment at the top of the file. Please add a description that will help others
181
- to know what crates are in that category.
38
+ [ ` src/categories.toml ` ] ( https://github.com/rust-lang/crates.io/blob/master/src/categories.toml ) .
39
+ To propose adding, removing, or changing a category, send a pull request making
40
+ the appropriate change to that file as noted in the comment at the top of the
41
+ file. Please add a description that will help others to know what crates are in
42
+ that category.
182
43
183
44
For new categories, it's helpful to note in your PR description examples of
184
45
crates that would fit in that category, and describe what distinguishes the new
@@ -187,74 +48,6 @@ category from existing categories.
187
48
After your PR is accepted, the next time that crates.io is deployed the
188
49
categories will be synced from this file.
189
50
190
- ## Deploying & Using a Mirror
191
-
192
- ** DISCLAIMER: The process of setting up a mirror is a work-in-progress and is
193
- likely to change. It is not currently recommended for mission-critical
194
- production use. It also requires Cargo from Rust distribution 1.12.0 or
195
- later.**
196
-
197
- ### Current functionality: a read-only, download-API-only mirror
198
-
199
- This mirror will function as a read-only duplicate of crates.io's API. You will
200
- be able to download crates using your index and your mirror, but the crate files
201
- will still come from crates.io's S3 storage.
202
-
203
- Your mirror will not:
204
-
205
- - Allow users to sign up/sign in
206
- - Allow crate publish
207
- - Keep track of any statistics
208
- - Display available crates in its UI
209
-
210
- ### API server setup
211
-
212
- To deploy the API on Heroku, use this button:
213
-
214
- [ ![ Deploy] ( https://www.herokucdn.com/deploy/button.svg )] [ deploy ]
215
-
216
- [ deploy ] : https://heroku.com/deploy
217
-
218
- The only config variable you need to set is ` GIT_REPO_URL ` , which should be the
219
- git URL of your crates index repository; see the next section for setup
220
- instructions for that.
221
-
222
- ### Index Mirror Setup
223
-
224
- You also need a mirror of the crates.io git index, and your index needs to point
225
- to your API server.
226
-
227
- 1 . ` git clone https://github.com/rust-lang/crates.io-index.git `
228
- 2 . Edit the config.json file to point to your API server so it looks like:
229
-
230
- ``` json
231
- {
232
- "dl" : " https://[your heroku app name].herokuapp.com/api/v1/crates" ,
233
- "api" : " https://[your heroku app name].herokuapp.com/"
234
- }
235
- ```
236
-
237
- 3 . Commit and push to wherever you will be hosting your index (ex: github,
238
- gitlab, an internal git server)
239
-
240
- 4 . In order to keep your mirror index up to date, schedule a `git pull` of the
241
- official index. How to do this depends on how you are hosting your index,
242
- but could be done through `cron` or a scheduled CI job, for example.
243
-
244
- ### Local Cargo Setup
245
-
246
- NOTE: The following configuration requires Cargo from Rust 1.12.0
247
- distribution or later.
248
-
249
- In the project where you want to use your mirror, change your `.cargo/config`
250
- to replace the crates.io source to point to your crates index:
251
-
252
- ```toml
253
- [source ]
254
-
255
- [source.mirror ]
256
- registry = "https://[host and path to your git server]/crates.io-index"
51
+ ## Running a mirror
257
52
258
- [source.crates-io ]
259
- replace-with = "mirror"
260
- ```
53
+ Please see [ docs/MIRROR.md] ( https://github.com/rust-lang/crates.io/blob/master/docs/MIRROR.md ) for instructions on setting up a mirror of crates.io.
0 commit comments