Skip to content

Commit b89bbec

Browse files
committed
[chore] fixes website publishing and updates website content
1 parent b0c0890 commit b89bbec

File tree

57 files changed

+1477
-8590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1477
-8590
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ on:
1616
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717
jobs:
1818
test:
19-
name: "Node ${{ matrix.node }} - ${{ matrix.os }}"
19+
name: 'Node ${{ matrix.node }} - ${{ matrix.os }}'
2020
runs-on: ${{ matrix.os }}-latest
2121

2222
strategy:
2323
matrix:
24-
node: ["14", "16", "latest"]
24+
node: ['14', '16', 'latest']
2525
os: [ubuntu, macOS, windows]
2626

2727
steps:
@@ -47,12 +47,10 @@ jobs:
4747
- uses: actions/checkout@v2
4848
- uses: actions/setup-node@v2
4949
with:
50-
node-version: "16.x"
50+
node-version: '16.x'
5151
- uses: webfactory/[email protected]
5252
with:
5353
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
54-
- name: install dependencies
55-
run: npm i
5654
- name: Release to GitHub Pages
5755
env:
5856
USE_SSH: true
@@ -61,4 +59,5 @@ jobs:
6159
git config --global user.email "[email protected]"
6260
git config --global user.name "Gabriel J. Csapo"
6361
cd website
62+
npm install
6463
npm run deploy

README.md

Lines changed: 1 addition & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -18,199 +18,7 @@ npm install node-git-server
1818

1919
# Usage
2020

21-
## Simple
22-
23-
```typescript
24-
import { Git } from 'node-git-server';
25-
import { join } from 'path';
26-
27-
const port = !process.env.PORT || isNaN(process.env.PORT)
28-
? 7005
29-
: parseInt(process.env.PORT);
30-
31-
const repos = new Git(
32-
join(__dirname, '../repo'),
33-
{
34-
autoCreate: true,
35-
}
36-
);
37-
38-
repos.on('push', push => {
39-
console.log(`push ${push.repo}/${push.commit} ( ${push.branch} )`);
40-
push.accept();
41-
});
42-
43-
repos.on("fetch", fetch => {
44-
console.log(`fetch ${fetch.commit}`);
45-
fetch.accept();
46-
});
47-
48-
repos.listen(port, () => {
49-
console.log(`node-git-server running at http://localhost:${port}`);
50-
});
51-
```
52-
53-
then start up the node-git-server server...
54-
55-
```
56-
$ node example/index.js
57-
node-git-server running at http://localhost:7005
58-
```
59-
60-
meanwhile...
61-
62-
```
63-
$ git push http://localhost:7005/beep master
64-
Counting objects: 356, done.
65-
Delta compression using up to 2 threads.
66-
Compressing objects: 100% (133/133), done.
67-
Writing objects: 100% (356/356), 46.20 KiB, done.
68-
Total 356 (delta 210), reused 355 (delta 210)
69-
To http://localhost:7005/beep
70-
* [new branch] master -> master
71-
```
72-
73-
## Sending logs
74-
75-
```typescript
76-
import { Git } from 'node-git-server';
77-
import { join } from 'path';
78-
79-
const port = !process.env.PORT || isNaN(process.env.PORT)
80-
? 7005
81-
: parseInt(process.env.PORT);
82-
83-
const repos = new Git(
84-
join(__dirname, '../repo'),
85-
{
86-
autoCreate: true,
87-
}
88-
);
89-
90-
repos.on('push', async push => {
91-
console.log(`push ${push.repo}/${push.commit} ( ${push.branch} )`);
92-
93-
push.log();
94-
push.log('Hey!');
95-
push.log('Checkout these other repos:');
96-
for (const repo of await repo.list()) {
97-
push.log(`- ${repo}`);
98-
}
99-
push.log();
100-
push.accept();
101-
});
102-
103-
repos.on("fetch", fetch => {
104-
console.log(`fetch ${fetch.commit}`);
105-
fetch.accept();
106-
});
107-
108-
repos.listen(port, () => {
109-
console.log(`node-git-server running at http://localhost:${port}`);
110-
});
111-
```
112-
113-
then start up the node-git-server server...
114-
115-
```
116-
$ node example/index.js
117-
node-git-server running at http://localhost:7005
118-
```
119-
120-
meanwhile...
121-
122-
```
123-
$ git push http://localhost:7005/beep master
124-
Counting objects: 356, done.
125-
Delta compression using up to 2 threads.
126-
Compressing objects: 100% (133/133), done.
127-
Writing objects: 100% (356/356), 46.20 KiB, done.
128-
Total 356 (delta 210), reused 355 (delta 210)
129-
remote:
130-
remote: Hey!
131-
remote: Checkout these other repos:
132-
remote: - test.git
133-
remote:
134-
To http://localhost:7005/test
135-
77bb26e..22918d5 master -> master
136-
```
137-
138-
### Authentication
139-
140-
```typescript
141-
import { Git } from 'node-git-server';
142-
import { join } from 'path';
143-
144-
const port = !process.env.PORT || isNaN(process.env.PORT)
145-
? 7005
146-
: parseInt(process.env.PORT);
147-
148-
const repos = new Git(
149-
join(__dirname, '../repo'),
150-
{
151-
autoCreate: true,
152-
autheficate: ({ type, user }, next) =>
153-
type == 'push'
154-
? user(([username, password]) => {
155-
console.log(username, password);
156-
next();
157-
})
158-
: next()
159-
}
160-
);
161-
162-
repos.on('push', push => {
163-
console.log(`push ${push.repo}/${push.commit} ( ${push.branch} )`);
164-
push.accept();
165-
});
166-
167-
repos.on("fetch", fetch => {
168-
console.log(`fetch ${fetch.commit}`);
169-
fetch.accept();
170-
});
171-
172-
repos.listen(port, () => {
173-
console.log(`node-git-server running at http://localhost:${port}`);
174-
});
175-
```
176-
177-
then start up the node-git-server server...
178-
179-
```
180-
$ node example/index.js
181-
node-git-server running at http://localhost:7005
182-
```
183-
184-
meanwhile...
185-
186-
```
187-
$ git push http://localhost:7005/beep master
188-
Counting objects: 356, done.
189-
Delta compression using up to 2 threads.
190-
Compressing objects: 100% (133/133), done.
191-
Writing objects: 100% (356/356), 46.20 KiB, done.
192-
Total 356 (delta 210), reused 355 (delta 210)
193-
To http://localhost:7005/beep
194-
* [new branch] master -> master
195-
```
196-
197-
# Example
198-
199-
Running the following command will start up a simple http server:
200-
201-
```
202-
node example/index.js
203-
```
204-
205-
If you want to try using https run the following
206-
207-
```
208-
node example/index.js --https
209-
```
210-
211-
> When running https with self-signed certs there are two ways to override the git-clients behavior using `git config http.sslVerify false` or `git config --global http.sslCAInfo /path/to/cert.pem`
212-
213-
For more information please visit the [docs](http://www.gabrielcsapo.com/node-git-server/code/index.html)
21+
Please visit our docs [https://gabrielcsapo.github.io/node-git-server](https://gabrielcsapo.github.io/node-git-server)!
21422

21523
# Philosophy
21624

0 commit comments

Comments
 (0)