@into-cps-association/libms 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPER.md +6 -10
- package/DOCKER.md +72 -5
- package/README.md +15 -15
- package/compose.lib.dev.yml +3 -2
- package/compose.lib.yml +1 -0
- package/config/libms.dev.yaml +14 -0
- package/config/libms.yaml.default +8 -6
- package/package.json +1 -1
- package/libms.yaml.sample +0 -12
package/DEVELOPER.md
CHANGED
|
@@ -116,17 +116,13 @@ running the following commands.
|
|
|
116
116
|
|
|
117
117
|
The microservices require configuration and the docker version
|
|
118
118
|
of the microservices uses the configuration
|
|
119
|
-
file available in `config
|
|
119
|
+
file available in `config/libms.dev.yaml`.
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
e.g.
|
|
121
|
+
For more see [configuration documentation](./README.md#gear-configure).
|
|
122
|
+
The `config/libms.dev.yaml` file is used for configuration of the container.
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
MODE='local'
|
|
128
|
-
LOCAL_PATH='..\..\files'
|
|
129
|
-
```
|
|
124
|
+
A new directory named `files` is created in `servers/lib` directory and
|
|
125
|
+
files are saved and served from the `files` directory.
|
|
130
126
|
|
|
131
127
|
### Use
|
|
132
128
|
|
|
@@ -140,7 +136,7 @@ docker compose -f compose.lib.dev.yml up -d
|
|
|
140
136
|
|
|
141
137
|
This command brings up the lib docker container and makes
|
|
142
138
|
the website available at <http://localhost:4001>.
|
|
143
|
-
The `config
|
|
139
|
+
The `config/libms.dev.yaml` file is used as the microservice configuration.
|
|
144
140
|
If the configuration values are changed, please restart the container.
|
|
145
141
|
|
|
146
142
|
```bash
|
package/DOCKER.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
The **
|
|
4
|
-
It
|
|
3
|
+
The **lib microservice** is a simplified file manager which serves files
|
|
4
|
+
from local file system or public git repositories. It is possible to
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Upload and download files from web browser
|
|
7
|
+
* Query available files and download them using GraphQL API
|
|
8
|
+
* Clone public git repositories and serve them as local files
|
|
8
9
|
|
|
9
10
|
## Use in Docker Environment
|
|
10
11
|
|
|
@@ -19,12 +20,13 @@ services:
|
|
|
19
20
|
image: intocps/libms:latest
|
|
20
21
|
restart: unless-stopped
|
|
21
22
|
volumes:
|
|
23
|
+
- ./libms.yaml:/dtaas/libms/libms.yaml
|
|
22
24
|
- ./files:/dtaas/libms/files
|
|
23
25
|
ports:
|
|
24
26
|
- "4001:4001"
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
### Create Files Directory
|
|
29
|
+
### Create Files Directory (optional)
|
|
28
30
|
|
|
29
31
|
The **libms microservice** serves files available from
|
|
30
32
|
`files` directory.
|
|
@@ -47,6 +49,71 @@ files/
|
|
|
47
49
|
Please create this `files` directory
|
|
48
50
|
in the same file system location as that of the `compose.lib.yml` file.
|
|
49
51
|
|
|
52
|
+
:label: The directory structure is optional if you are using
|
|
53
|
+
libms as a standalone service.
|
|
54
|
+
|
|
55
|
+
## :gear: Configure
|
|
56
|
+
|
|
57
|
+
The microservices requires config specified in `libms.yaml` file.
|
|
58
|
+
The template configuration file is:
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
port: '4001'
|
|
62
|
+
mode: 'local' #git or local
|
|
63
|
+
local-path: 'files'
|
|
64
|
+
log-level: 'debug'
|
|
65
|
+
apollo-path: '/lib'
|
|
66
|
+
graphql-playground: 'true'
|
|
67
|
+
|
|
68
|
+
git-repos: #only used in git mode
|
|
69
|
+
- user1:
|
|
70
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
71
|
+
- user2:
|
|
72
|
+
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
73
|
+
- common:
|
|
74
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The `local-path` variable is the relative filepath to the
|
|
78
|
+
location of the local directory which will be served to users
|
|
79
|
+
by the Library microservice.
|
|
80
|
+
|
|
81
|
+
Replace the default values the appropriate values for your setup.
|
|
82
|
+
Please save this config in `libms.yaml`.
|
|
83
|
+
|
|
84
|
+
### Operation Modes
|
|
85
|
+
|
|
86
|
+
The mode indicates the backend storage for the files.
|
|
87
|
+
There are two possible modes - `local` and `git`.
|
|
88
|
+
The files available in the `local-path` are served to users in `local` mode.
|
|
89
|
+
In the `git` mode, the remote git repos are cloned and they are
|
|
90
|
+
served to users as local files. Only public git repositories
|
|
91
|
+
are supported at present.
|
|
92
|
+
|
|
93
|
+
#### git mode
|
|
94
|
+
|
|
95
|
+
A fragment of the config for `git` mode is:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
...
|
|
99
|
+
git-repos:
|
|
100
|
+
- user1:
|
|
101
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
102
|
+
- user2:
|
|
103
|
+
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
104
|
+
- common:
|
|
105
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Here, `user1`, `user2` and `common` are the local directories into which
|
|
109
|
+
the remote git repositories get cloned. The name of the repository need not
|
|
110
|
+
match with the local directory name. For example, the above configuration
|
|
111
|
+
enables library microservice to clone
|
|
112
|
+
`https://gitlab.com/dtaas/user1.git` repository into
|
|
113
|
+
`user1` directory. Any git server accessible over
|
|
114
|
+
HTTP(S) protocol is supported.
|
|
115
|
+
The `.git` suffix is optional.
|
|
116
|
+
|
|
50
117
|
### Run
|
|
51
118
|
|
|
52
119
|
Use the following commands to start and stop the container respectively:
|
package/README.md
CHANGED
|
@@ -38,24 +38,24 @@ needs to have _read:packages_ scope.
|
|
|
38
38
|
|
|
39
39
|
## :gear: Configure
|
|
40
40
|
|
|
41
|
-
The microservices requires config specified in
|
|
41
|
+
The microservices requires config specified in yaml format.
|
|
42
42
|
The template configuration file is:
|
|
43
43
|
|
|
44
44
|
```yaml
|
|
45
45
|
port: '4001'
|
|
46
|
-
mode: '
|
|
47
|
-
local-path: 'files'
|
|
46
|
+
mode: 'local' #git or local
|
|
47
|
+
local-path: '..\..\files'
|
|
48
48
|
log-level: 'debug'
|
|
49
49
|
apollo-path: '/lib'
|
|
50
50
|
graphql-playground: 'true'
|
|
51
51
|
|
|
52
|
-
git-repos:
|
|
53
|
-
-
|
|
54
|
-
repo-url: 'https://
|
|
55
|
-
-
|
|
52
|
+
git-repos: #only used in git mode
|
|
53
|
+
- user1:
|
|
54
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
55
|
+
- user2:
|
|
56
56
|
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
57
57
|
- common:
|
|
58
|
-
repo-url: 'https://gitlab.com/dtaas/common'
|
|
58
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
The `local-path` variable is the relative filepath to the
|
|
@@ -80,20 +80,20 @@ A fragment of the config for `git` mode is:
|
|
|
80
80
|
```yaml
|
|
81
81
|
...
|
|
82
82
|
git-repos:
|
|
83
|
-
-
|
|
84
|
-
repo-url: 'https://
|
|
85
|
-
-
|
|
83
|
+
- user1:
|
|
84
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
85
|
+
- user2:
|
|
86
86
|
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
87
87
|
- common:
|
|
88
|
-
repo-url: 'https://gitlab.com/dtaas/common'
|
|
88
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Here, `
|
|
91
|
+
Here, `user1`, `user2` and `common` are the local directories into which
|
|
92
92
|
the remote git repositories get cloned. The name of the repository need not
|
|
93
93
|
match with the local directory name. For example, the above configuration
|
|
94
94
|
enables library microservice to clone
|
|
95
|
-
`https://
|
|
96
|
-
`
|
|
95
|
+
`https://gitlab.com/dtaas/user1.git` repository into
|
|
96
|
+
`user1` directory. Any git server accessible over
|
|
97
97
|
HTTP(S) protocol is supported.
|
|
98
98
|
The `.git` suffix is optional.
|
|
99
99
|
|
package/compose.lib.dev.yml
CHANGED
package/compose.lib.yml
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
port: '4001'
|
|
2
|
+
mode: 'local' #git or local
|
|
3
|
+
local-path: '/dtaas/libms/files'
|
|
4
|
+
log-level: 'debug'
|
|
5
|
+
apollo-path: '/lib'
|
|
6
|
+
graphql-playground: 'true'
|
|
7
|
+
|
|
8
|
+
git-repos: #only used in git mode
|
|
9
|
+
- user1:
|
|
10
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
11
|
+
- user2:
|
|
12
|
+
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
13
|
+
- common:
|
|
14
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
port: '4001'
|
|
2
|
-
mode: 'git
|
|
2
|
+
mode: 'local' #git or local
|
|
3
3
|
local-path: '..\..\files'
|
|
4
4
|
log-level: 'debug'
|
|
5
5
|
apollo-path: '/lib'
|
|
6
6
|
graphql-playground: 'true'
|
|
7
7
|
|
|
8
|
-
git-repos:
|
|
9
|
-
-
|
|
10
|
-
repo-url: 'https://
|
|
11
|
-
-
|
|
12
|
-
repo-url: 'https://
|
|
8
|
+
git-repos: #only used in git mode
|
|
9
|
+
- user1:
|
|
10
|
+
repo-url: 'https://gitlab.com/dtaas/user1.git'
|
|
11
|
+
- user2:
|
|
12
|
+
repo-url: 'https://gitlab.com/dtaas/user2.git'
|
|
13
|
+
- common:
|
|
14
|
+
repo-url: 'https://gitlab.com/dtaas/common.git'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@into-cps-association/libms",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "microservices that handles request by fetching and returning the file-names and folders of given directory",
|
|
5
5
|
"author": "phillip.boe.jensen@gmail.com",
|
|
6
6
|
"contributors": [
|
package/libms.yaml.sample
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
port: '4001'
|
|
2
|
-
mode: 'git'
|
|
3
|
-
local-path: '..\..\files'
|
|
4
|
-
log-level: 'debug'
|
|
5
|
-
apollo-path: '/lib'
|
|
6
|
-
graphql-playground: 'true'
|
|
7
|
-
|
|
8
|
-
git-repos:
|
|
9
|
-
- user-1:
|
|
10
|
-
repo-url: 'https://github.com/isomorphic-git/lightning-fs'
|
|
11
|
-
- user-2:
|
|
12
|
-
repo-url: 'https://github.com/isomorphic-git/lightning-fs'
|