Feature/2 rebranding #3
2
.github/CODEOWNERS
vendored
|
@ -1 +1 @@
|
||||||
* @alexvanin @masterSplinter01 @KirillovDenis
|
* @alexvanin @KirillovDenis
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
First, thank you for contributing! We love and encourage pull requests from
|
First, thank you for contributing! We love and encourage pull requests from
|
||||||
everyone. Please follow the guidelines:
|
everyone. Please follow the guidelines:
|
||||||
|
|
||||||
- Check the open [issues](https://github.com/nspcc-dev/neofs-http-gw/issues) and
|
- Check the open [issues](https://github.com/TrueCloudLab/frostfs-http-gw/issues) and
|
||||||
[pull requests](https://github.com/nspcc-dev/neofs-http-gw/pulls) for existing
|
[pull requests](https://github.com/TrueCloudLab/frostfs-http-gw/pulls) for existing
|
||||||
discussions.
|
discussions.
|
||||||
|
|
||||||
- Open an issue first, to discuss a new feature or enhancement.
|
- Open an issue first, to discuss a new feature or enhancement.
|
||||||
|
@ -23,24 +23,24 @@ everyone. Please follow the guidelines:
|
||||||
|
|
||||||
## Development Workflow
|
## Development Workflow
|
||||||
|
|
||||||
Start by forking the `neofs-http-gw` repository, make changes in a branch and then
|
Start by forking the `frostfs-http-gw` repository, make changes in a branch and then
|
||||||
send a pull request. We encourage pull requests to discuss code changes. Here
|
send a pull request. We encourage pull requests to discuss code changes. Here
|
||||||
are the steps in details:
|
are the steps in details:
|
||||||
|
|
||||||
### Set up your GitHub Repository
|
### Set up your GitHub Repository
|
||||||
Fork [NeoFS HTTP Gateway
|
Fork [FrostFS HTTP Gateway
|
||||||
upstream](https://github.com/nspcc-dev/neofs-http-gw/fork) source repository
|
upstream](https://github.com/TrueCloudLab/frostfs-http-gw/fork) source repository
|
||||||
to your own personal repository. Copy the URL of your fork (you will need it for
|
to your own personal repository. Copy the URL of your fork (you will need it for
|
||||||
the `git clone` command below).
|
the `git clone` command below).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git clone https://github.com/nspcc-dev/neofs-http-gw
|
$ git clone https://github.com/TrueCloudLab/frostfs-http-gw
|
||||||
```
|
```
|
||||||
|
|
||||||
### Set up git remote as ``upstream``
|
### Set up git remote as ``upstream``
|
||||||
```sh
|
```sh
|
||||||
$ cd neofs-http-gw
|
$ cd frostfs-http-gw
|
||||||
$ git remote add upstream https://github.com/nspcc-dev/neofs-http-gw
|
$ git remote add upstream https://github.com/TrueCloudLab/frostfs-http-gw
|
||||||
$ git fetch upstream
|
$ git fetch upstream
|
||||||
$ git merge upstream/master
|
$ git merge upstream/master
|
||||||
...
|
...
|
||||||
|
@ -107,7 +107,7 @@ contributors".
|
||||||
To sign your work, just add a line like this at the end of your commit message:
|
To sign your work, just add a line like this at the end of your commit message:
|
||||||
|
|
||||||
```
|
```
|
||||||
Signed-off-by: Samii Sakisaka <samii@nspcc.ru>
|
Signed-off-by: Samii Sakisaka <samii@frostfs.info>
|
||||||
```
|
```
|
||||||
|
|
||||||
This can be easily done with the `--signoff` option to `git commit`.
|
This can be easily done with the `--signoff` option to `git commit`.
|
||||||
|
|
|
@ -18,6 +18,6 @@ FROM scratch
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /src/bin/neofs-http-gw /bin/neofs-http-gw
|
COPY --from=builder /src/bin/frostfs-http-gw /bin/frostfs-http-gw
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/neofs-http-gw"]
|
ENTRYPOINT ["/bin/frostfs-http-gw"]
|
||||||
|
|
|
@ -3,6 +3,6 @@ RUN apk add --update --no-cache bash ca-certificates
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY bin/neofs-http-gw /bin/neofs-http-gw
|
COPY bin/frostfs-http-gw /bin/frostfs-http-gw
|
||||||
|
|
||||||
CMD ["neofs-http-gw"]
|
CMD ["frostfs-http-gw"]
|
||||||
|
|
10
Makefile
|
@ -6,13 +6,13 @@ GO_VERSION ?= 1.19
|
||||||
LINT_VERSION ?= 1.49.0
|
LINT_VERSION ?= 1.49.0
|
||||||
BUILD ?= $(shell date -u --iso=seconds)
|
BUILD ?= $(shell date -u --iso=seconds)
|
||||||
|
|
||||||
HUB_IMAGE ?= nspccdev/neofs-http-gw
|
HUB_IMAGE ?= truecloudlab/frostfs-http-gw
|
||||||
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
|
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
|
||||||
|
|
||||||
# List of binaries to build. For now just one.
|
# List of binaries to build. For now just one.
|
||||||
BINDIR = bin
|
BINDIR = bin
|
||||||
DIRS = $(BINDIR)
|
DIRS = $(BINDIR)
|
||||||
BINS = $(BINDIR)/neofs-http-gw
|
BINS = $(BINDIR)/frostfs-http-gw
|
||||||
|
|
||||||
.PHONY: all $(BINS) $(DIRS) dep docker/ test cover fmt image image-push dirty-image lint docker/lint version clean
|
.PHONY: all $(BINS) $(DIRS) dep docker/ test cover fmt image image-push dirty-image lint docker/lint version clean
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ fmt:
|
||||||
|
|
||||||
# Build clean Docker image
|
# Build clean Docker image
|
||||||
image:
|
image:
|
||||||
@echo "⇒ Build NeoFS HTTP Gateway docker image "
|
@echo "⇒ Build FrostFS HTTP Gateway docker image "
|
||||||
@docker build \
|
@docker build \
|
||||||
--build-arg REPO=$(REPO) \
|
--build-arg REPO=$(REPO) \
|
||||||
--build-arg VERSION=$(VERSION) \
|
--build-arg VERSION=$(VERSION) \
|
||||||
|
@ -89,7 +89,7 @@ image-push:
|
||||||
|
|
||||||
# Build dirty Docker image
|
# Build dirty Docker image
|
||||||
dirty-image:
|
dirty-image:
|
||||||
@echo "⇒ Build NeoFS HTTP Gateway dirty docker image "
|
@echo "⇒ Build FrostFS HTTP Gateway dirty docker image "
|
||||||
@docker build \
|
@docker build \
|
||||||
--build-arg REPO=$(REPO) \
|
--build-arg REPO=$(REPO) \
|
||||||
--build-arg VERSION=$(VERSION) \
|
--build-arg VERSION=$(VERSION) \
|
||||||
|
@ -120,7 +120,7 @@ clean:
|
||||||
|
|
||||||
# Package for Debian
|
# Package for Debian
|
||||||
debpackage:
|
debpackage:
|
||||||
dch --package neofs-http-gw \
|
dch --package frostfs-http-gw \
|
||||||
--controlmaint \
|
--controlmaint \
|
||||||
--newversion $(PKG_VERSION) \
|
--newversion $(PKG_VERSION) \
|
||||||
--distribution $(OS_RELEASE) \
|
--distribution $(OS_RELEASE) \
|
||||||
|
|
96
README.md
|
@ -1,30 +1,30 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./.github/logo.svg" width="500px" alt="NeoFS">
|
<img src="./.github/logo.svg" width="500px" alt="FrostFS">
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://fs.neo.org">NeoFS</a> is a decentralized distributed object storage integrated with the <a href="https://neo.org">NEO Blockchain</a>.
|
<a href="https://frostfs.info">FrostFS</a> is a decentralized distributed object storage integrated with the <a href="https://neo.org">NEO Blockchain</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
---
|
---
|
||||||
[![Report](https://goreportcard.com/badge/github.com/nspcc-dev/neofs-http-gw)](https://goreportcard.com/report/github.com/nspcc-dev/neofs-http-gw)
|
[![Report](https://goreportcard.com/badge/github.com/TrueCloudLab/frostfs-http-gw)](https://goreportcard.com/report/github.com/TrueCloudLab/frostfs-http-gw)
|
||||||
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/neofs-http-gw?sort=semver)
|
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/TrueCloudLab/frostfs-http-gw?sort=semver)
|
||||||
![License](https://img.shields.io/github/license/nspcc-dev/neofs-http-gw.svg?style=popout)
|
![License](https://img.shields.io/github/license/TrueCloudLab/frostfs-http-gw.svg?style=popout)
|
||||||
|
|
||||||
# NeoFS HTTP Gateway
|
# FrostFS HTTP Gateway
|
||||||
|
|
||||||
NeoFS HTTP Gateway bridges NeoFS internal protocol and HTTP standard.
|
FrostFS HTTP Gateway bridges FrostFS internal protocol and HTTP standard.
|
||||||
- you can download one file per request from the NeoFS Network
|
- you can download one file per request from the FrostFS Network
|
||||||
- you can upload one file per request into the NeoFS Network
|
- you can upload one file per request into the FrostFS Network
|
||||||
|
|
||||||
See available routes in [specification](./docs/api.md).
|
See available routes in [specification](./docs/api.md).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```go install github.com/nspcc-dev/neofs-http-gw```
|
```go install github.com/TrueCloudLab/frostfs-http-gw```
|
||||||
|
|
||||||
Or you can call `make` to build it from the cloned repository (the binary will
|
Or you can call `make` to build it from the cloned repository (the binary will
|
||||||
end up in `bin/neofs-http-gw`). To build neofs-http-gw binary in clean docker
|
end up in `bin/frostfs-http-gw`). To build frostfs-http-gw binary in clean docker
|
||||||
environment, call `make docker/bin/neofs-http-gw`.
|
environment, call `make docker/bin/frostfs-http-gw`.
|
||||||
|
|
||||||
Other notable make targets:
|
Other notable make targets:
|
||||||
|
|
||||||
|
@ -38,32 +38,32 @@ version Show current version
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can also use a [Docker
|
Or you can also use a [Docker
|
||||||
image](https://hub.docker.com/r/nspccdev/neofs-http-gw) provided for the released
|
image](https://hub.docker.com/r/truecloudlab/frostfs-http-gw) provided for the released
|
||||||
(and occasionally unreleased) versions of the gateway (`:latest` points to the
|
(and occasionally unreleased) versions of the gateway (`:latest` points to the
|
||||||
latest stable release).
|
latest stable release).
|
||||||
|
|
||||||
## Execution
|
## Execution
|
||||||
|
|
||||||
HTTP gateway itself is not a NeoFS node, so to access NeoFS it uses node's
|
HTTP gateway itself is not a FrostFS node, so to access FrostFS it uses node's
|
||||||
gRPC interface and you need to provide some node that it will connect to. This
|
gRPC interface and you need to provide some node that it will connect to. This
|
||||||
can be done either via `-p` parameter or via `HTTP_GW_PEERS_<N>_ADDRESS` and
|
can be done either via `-p` parameter or via `HTTP_GW_PEERS_<N>_ADDRESS` and
|
||||||
`HTTP_GW_PEERS_<N>_WEIGHT` environment variables (the gate supports multiple
|
`HTTP_GW_PEERS_<N>_WEIGHT` environment variables (the gate supports multiple
|
||||||
NeoFS nodes with weighted load balancing).
|
FrostFS nodes with weighted load balancing).
|
||||||
|
|
||||||
If you launch HTTP gateway in bundle with [neofs-dev-env](https://github.com/nspcc-dev/neofs-dev-env),
|
If you launch HTTP gateway in bundle with [frostfs-dev-env](https://github.com/TrueCloudLab/frostfs-dev-env),
|
||||||
you can get the IP address of the node in the output of `make hosts` command
|
you can get the IP address of the node in the output of `make hosts` command
|
||||||
(with s0*.neofs.devenv name).
|
(with s0*.neofs.devenv name).
|
||||||
|
|
||||||
These two commands are functionally equivalent, they run the gate with one
|
These two commands are functionally equivalent, they run the gate with one
|
||||||
backend node (and otherwise default settings):
|
backend node (and otherwise default settings):
|
||||||
```
|
```
|
||||||
$ neofs-http-gw -p 192.168.130.72:8080
|
$ frostfs-http-gw -p 192.168.130.72:8080
|
||||||
$ HTTP_GW_PEERS_0_ADDRESS=192.168.130.72:8080 neofs-http-gw
|
$ HTTP_GW_PEERS_0_ADDRESS=192.168.130.72:8080 frostfs-http-gw
|
||||||
```
|
```
|
||||||
It's also possible to specify uri scheme (grpc or grpcs) when using `-p`:
|
It's also possible to specify uri scheme (grpc or grpcs) when using `-p`:
|
||||||
```
|
```
|
||||||
$ neofs-http-gw -p grpc://192.168.130.72:8080
|
$ frostfs-http-gw -p grpc://192.168.130.72:8080
|
||||||
$ HTTP_GW_PEERS_0_ADDRESS=grpcs://192.168.130.72:8080 neofs-http-gw
|
$ HTTP_GW_PEERS_0_ADDRESS=grpcs://192.168.130.72:8080 frostfs-http-gw
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
@ -74,11 +74,11 @@ environment variables (see [example](./config/config.env)), so they're not speci
|
||||||
|
|
||||||
### Nodes: weights and priorities
|
### Nodes: weights and priorities
|
||||||
|
|
||||||
You can specify multiple `-p` options to add more NeoFS nodes, this will make
|
You can specify multiple `-p` options to add more FrostFS nodes, this will make
|
||||||
gateway spread requests equally among them (using weight 1 and priority 1 for every node):
|
gateway spread requests equally among them (using weight 1 and priority 1 for every node):
|
||||||
|
|
||||||
```
|
```
|
||||||
$ neofs-http-gw -p 192.168.130.72:8080 -p 192.168.130.71:8080
|
$ frostfs-http-gw -p 192.168.130.72:8080 -p 192.168.130.71:8080
|
||||||
```
|
```
|
||||||
If you want some specific load distribution proportions, use weights and priorities:
|
If you want some specific load distribution proportions, use weights and priorities:
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ If you want some specific load distribution proportions, use weights and priorit
|
||||||
$ HTTP_GW_PEERS_0_ADDRESS=192.168.130.71:8080 HTTP_GW_PEERS_0_WEIGHT=1 HTTP_GW_PEERS_0_PRIORITY=1 \
|
$ HTTP_GW_PEERS_0_ADDRESS=192.168.130.71:8080 HTTP_GW_PEERS_0_WEIGHT=1 HTTP_GW_PEERS_0_PRIORITY=1 \
|
||||||
HTTP_GW_PEERS_1_ADDRESS=192.168.130.72:8080 HTTP_GW_PEERS_1_WEIGHT=9 HTTP_GW_PEERS_1_PRIORITY=2 \
|
HTTP_GW_PEERS_1_ADDRESS=192.168.130.72:8080 HTTP_GW_PEERS_1_WEIGHT=9 HTTP_GW_PEERS_1_PRIORITY=2 \
|
||||||
HTTP_GW_PEERS_2_ADDRESS=192.168.130.73:8080 HTTP_GW_PEERS_2_WEIGHT=1 HTTP_GW_PEERS_2_PRIORITY=2 \
|
HTTP_GW_PEERS_2_ADDRESS=192.168.130.73:8080 HTTP_GW_PEERS_2_WEIGHT=1 HTTP_GW_PEERS_2_PRIORITY=2 \
|
||||||
neofs-http-gw
|
frostfs-http-gw
|
||||||
```
|
```
|
||||||
This command will make gateway use 192.168.130.71 while it is healthy. Otherwise, it will make the gateway use
|
This command will make gateway use 192.168.130.71 while it is healthy. Otherwise, it will make the gateway use
|
||||||
192.168.130.72 for 90% of requests and 192.168.130.73 for remaining 10%.
|
192.168.130.72 for 90% of requests and 192.168.130.73 for remaining 10%.
|
||||||
|
@ -94,13 +94,13 @@ This command will make gateway use 192.168.130.71 while it is healthy. Otherwise
|
||||||
### Keys
|
### Keys
|
||||||
You can provide a wallet via `--wallet` or `-w` flag. You can also specify the account address using `--address`
|
You can provide a wallet via `--wallet` or `-w` flag. You can also specify the account address using `--address`
|
||||||
(if no address provided default one will be used). If wallet is used, you need to set `HTTP_GW_WALLET_PASSPHRASE` variable to decrypt the wallet.
|
(if no address provided default one will be used). If wallet is used, you need to set `HTTP_GW_WALLET_PASSPHRASE` variable to decrypt the wallet.
|
||||||
If no wallet provided, the gateway autogenerates a key pair it will use for NeoFS requests.
|
If no wallet provided, the gateway autogenerates a key pair it will use for FrostFS requests.
|
||||||
```
|
```
|
||||||
$ neofs-http-gw -p $NEOFS_NODE -w $WALLET_PATH --address $ACCOUNT_ADDRESS
|
$ frostfs-http-gw -p $NEOFS_NODE -w $WALLET_PATH --address $ACCOUNT_ADDRESS
|
||||||
```
|
```
|
||||||
Example:
|
Example:
|
||||||
```
|
```
|
||||||
I thought we should wait for renaming in dev-env here I thought we should wait for renaming in dev-env [here](https://github.com/TrueCloudLab/frostfs-dev-env/blob/1099cdcef885efbbec56bc869dc04a64696ada23/.env#L2)
|
|||||||
$ neofs-http-gw -p 192.168.130.72:8080 -w wallet.json --address NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP
|
$ frostfs-http-gw -p 192.168.130.72:8080 -w wallet.json --address NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP
|
||||||
```
|
```
|
||||||
|
|
||||||
### Binding and TLS
|
### Binding and TLS
|
||||||
|
@ -116,7 +116,7 @@ external redirecting solution.
|
||||||
Example to bind to `192.168.130.130:443` and serve TLS there:
|
Example to bind to `192.168.130.130:443` and serve TLS there:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ neofs-http-gw -p 192.168.130.72:8080 --listen_address 192.168.130.130:443 \
|
$ frostfs-http-gw -p 192.168.130.72:8080 --listen_address 192.168.130.130:443 \
|
||||||
--tls_key=key.pem --tls_certificate=cert.pem
|
--tls_key=key.pem --tls_certificate=cert.pem
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -134,12 +134,12 @@ request with data stream after timeout.
|
||||||
|
|
||||||
`HTTP_GW_WEB_STREAM_REQUEST_BODY` environment variable can be used to disable
|
`HTTP_GW_WEB_STREAM_REQUEST_BODY` environment variable can be used to disable
|
||||||
request body streaming (effectively it'll make the gateway accept the file completely
|
request body streaming (effectively it'll make the gateway accept the file completely
|
||||||
first and only then try sending it to NeoFS).
|
first and only then try sending it to FrostFS).
|
||||||
|
|
||||||
`HTTP_GW_WEB_MAX_REQUEST_BODY_SIZE` controls maximum request body size
|
`HTTP_GW_WEB_MAX_REQUEST_BODY_SIZE` controls maximum request body size
|
||||||
limiting uploads to files slightly lower than this limit.
|
limiting uploads to files slightly lower than this limit.
|
||||||
|
|
||||||
### NeoFS parameters
|
### FrostFS parameters
|
||||||
|
|
||||||
Gateway can automatically set timestamps for uploaded files based on local
|
Gateway can automatically set timestamps for uploaded files based on local
|
||||||
time source, use `HTTP_GW_UPLOAD_HEADER_USE_DEFAULT_TIMESTAMP` environment
|
time source, use `HTTP_GW_UPLOAD_HEADER_USE_DEFAULT_TIMESTAMP` environment
|
||||||
|
@ -177,7 +177,7 @@ HTTP_GW_LOGGER_LEVEL=debug
|
||||||
Configuration file is optional and can be used instead of environment variables/other parameters.
|
Configuration file is optional and can be used instead of environment variables/other parameters.
|
||||||
It can be specified with `--config` parameter:
|
It can be specified with `--config` parameter:
|
||||||
```
|
```
|
||||||
$ neofs-http-gw --config your-config.yaml
|
$ frostfs-http-gw --config your-config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
See [config](./config/config.yaml) and [defaults](./docs/gate-configuration.md) for example.
|
See [config](./config/config.yaml) and [defaults](./docs/gate-configuration.md) for example.
|
||||||
|
@ -185,7 +185,7 @@ See [config](./config/config.yaml) and [defaults](./docs/gate-configuration.md)
|
||||||
## HTTP API provided
|
## HTTP API provided
|
||||||
|
|
||||||
This gateway intentionally provides limited feature set and doesn't try to
|
This gateway intentionally provides limited feature set and doesn't try to
|
||||||
substitute (or completely wrap) regular gRPC NeoFS interface. You can download
|
substitute (or completely wrap) regular gRPC FrostFS interface. You can download
|
||||||
and upload objects with it, but deleting, searching, managing ACLs, creating
|
and upload objects with it, but deleting, searching, managing ACLs, creating
|
||||||
containers and other activities are not supported and not planned to be
|
containers and other activities are not supported and not planned to be
|
||||||
supported.
|
supported.
|
||||||
|
@ -211,7 +211,7 @@ resolve_order:
|
||||||
- nns
|
- nns
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Make sure your container is registered in NNS contract. If you use [neofs-dev-env](https://github.com/nspcc-dev/neofs-dev-env)
|
2. Make sure your container is registered in NNS contract. If you use [frostfs-dev-env](https://github.com/TrueCloudLab/frostfs-dev-env)
|
||||||
you can check if your container (e.g. with `container-name` name) is registered in NNS:
|
you can check if your container (e.g. with `container-name` name) is registered in NNS:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -238,9 +238,9 @@ $ curl http://localhost:8082/get_by_attribute/container-name/FileName/object-nam
|
||||||
|
|
||||||
#### Create a container
|
#### Create a container
|
||||||
|
|
||||||
You can create a container via [neofs-cli](https://github.com/nspcc-dev/neofs-node/releases):
|
You can create a container via [frostfs-cli](https://github.com/TrueCloudLab/frostfs-node/releases):
|
||||||
```
|
```
|
||||||
$ neofs-cli -r $NEOFS_NODE -w $WALLET container create --policy $POLICY --basic-acl $ACL
|
$ frostfs-cli -r $NEOFS_NODE -w $WALLET container create --policy $POLICY --basic-acl $ACL
|
||||||
```
|
```
|
||||||
where `$WALLET` is a path to user wallet,
|
where `$WALLET` is a path to user wallet,
|
||||||
`$ACL` -- hex encoded basic ACL value or keywords 'private, 'public-read', 'public-read-write' and
|
`$ACL` -- hex encoded basic ACL value or keywords 'private, 'public-read', 'public-read-write' and
|
||||||
|
@ -248,18 +248,18 @@ where `$WALLET` is a path to user wallet,
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
$ neofs-cli -r 192.168.130.72:8080 -w ./wallet.json container create --policy "REP 3" --basic-acl public --await
|
$ frostfs-cli -r 192.168.130.72:8080 -w ./wallet.json container create --policy "REP 3" --basic-acl public --await
|
||||||
```
|
```
|
||||||
|
|
||||||
If you have launched nodes via [neofs-dev-env](https://github.com/nspcc-dev/neofs-dev-env),
|
If you have launched nodes via [frostfs-dev-env](https://github.com/TrueCloudLab/frostfs-dev-env),
|
||||||
you can get the key value from `wallets/wallet.json` or write the path to
|
you can get the key value from `wallets/wallet.json` or write the path to
|
||||||
the file `wallets/wallet.key`.
|
the file `wallets/wallet.key`.
|
||||||
|
|
||||||
#### Prepare a file in a container
|
#### Prepare a file in a container
|
||||||
|
|
||||||
To create a file via [neofs-cli](https://github.com/nspcc-dev/neofs-node/releases), run a command below:
|
To create a file via [frostfs-cli](https://github.com/TrueCloudLab/frostfs-node/releases), run a command below:
|
||||||
```
|
```
|
||||||
$ neofs-cli -r $NEOFS_NODE -k $KEY object put --file $FILENAME --cid $CID
|
$ frostfs-cli -r $NEOFS_NODE -k $KEY object put --file $FILENAME --cid $CID
|
||||||
```
|
```
|
||||||
where
|
where
|
||||||
`$KEY` -- the key, please read the information [above](#create-a-container),
|
`$KEY` -- the key, please read the information [above](#create-a-container),
|
||||||
|
@ -267,7 +267,7 @@ where
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
$ neofs-cli -r 192.168.130.72:8080 -w ./wallet.json object put --file cat.png --cid Dxhf4PNprrJHWWTG5RGLdfLkJiSQ3AQqit1MSnEPRkDZ --attributes img_type=cat,my_attr=cute
|
$ frostfs-cli -r 192.168.130.72:8080 -w ./wallet.json object put --file cat.png --cid Dxhf4PNprrJHWWTG5RGLdfLkJiSQ3AQqit1MSnEPRkDZ --attributes img_type=cat,my_attr=cute
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ set of reply headers generated using the following rules:
|
||||||
* `x-container-id` contains container ID
|
* `x-container-id` contains container ID
|
||||||
* `x-object-id` contains object ID
|
* `x-object-id` contains object ID
|
||||||
* `x-owner-id` contains owner address
|
* `x-owner-id` contains owner address
|
||||||
* all the other NeoFS attributes are converted to `X-Attribute-*` headers (but only
|
* all the other FrostFS attributes are converted to `X-Attribute-*` headers (but only
|
||||||
if they can be safely represented in HTTP header), for example `FileName`
|
if they can be safely represented in HTTP header), for example `FileName`
|
||||||
attribute becomes `X-Attribute-FileName` header
|
attribute becomes `X-Attribute-FileName` header
|
||||||
|
|
||||||
|
@ -452,25 +452,25 @@ operations for a request signed with your HTTP Gateway keys.
|
||||||
If your don't want to manage gateway's secret keys and adjust eACL rules when
|
If your don't want to manage gateway's secret keys and adjust eACL rules when
|
||||||
gateway configuration changes (new gate, key rotation, etc) or you plan to use
|
gateway configuration changes (new gate, key rotation, etc) or you plan to use
|
||||||
public services, there is an option to let your application backend (or you) to
|
public services, there is an option to let your application backend (or you) to
|
||||||
issue Bearer Tokens ans pass them from the client via gate down to NeoFS level
|
issue Bearer Tokens ans pass them from the client via gate down to FrostFS level
|
||||||
to grant access.
|
to grant access.
|
||||||
|
|
||||||
NeoFS Bearer Token basically is a container owner-signed ACL data (refer to NeoFS
|
FrostFS Bearer Token basically is a container owner-signed ACL data (refer to FrostFS
|
||||||
documentation for more details). There are two options to pass them to gateway:
|
documentation for more details). There are two options to pass them to gateway:
|
||||||
* "Authorization" header with "Bearer" type and base64-encoded token in
|
* "Authorization" header with "Bearer" type and base64-encoded token in
|
||||||
credentials field
|
credentials field
|
||||||
* "Bearer" cookie with base64-encoded token contents
|
* "Bearer" cookie with base64-encoded token contents
|
||||||
|
|
||||||
For example, you have a mobile application frontend with a backend part storing
|
For example, you have a mobile application frontend with a backend part storing
|
||||||
data in NeoFS. When a user authorizes in the mobile app, the backend issues a NeoFS
|
data in FrostFS. When a user authorizes in the mobile app, the backend issues a FrostFS
|
||||||
Bearer token and provides it to the frontend. Then, the mobile app may generate
|
Bearer token and provides it to the frontend. Then, the mobile app may generate
|
||||||
some data and upload it via any available NeoFS HTTP Gateway by adding
|
some data and upload it via any available FrostFS HTTP Gateway by adding
|
||||||
the corresponding header to the upload request. Accessing the ACL protected data
|
the corresponding header to the upload request. Accessing the ACL protected data
|
||||||
works the same way.
|
works the same way.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
In order to generate a bearer token, you need to know the container owner key and
|
In order to generate a bearer token, you need to know the container owner key and
|
||||||
the address of the sender who will do the request to NeoFS (in our case, it's a gateway wallet address).
|
the address of the sender who will do the request to FrostFS (in our case, it's a gateway wallet address).
|
||||||
|
|
||||||
Suppose we have:
|
Suppose we have:
|
||||||
* **KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr** (container owner key)
|
* **KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr** (container owner key)
|
||||||
|
@ -521,7 +521,7 @@ Now, we can form a Bearer token (10000 is liftetime expiration in epoch) and sav
|
||||||
|
|
||||||
Next, sign it with the container owner key:
|
Next, sign it with the container owner key:
|
||||||
```
|
```
|
||||||
$ neofs-cli util sign bearer-token --from bearer.json --to signed.json -w ./wallet.json
|
$ frostfs-cli util sign bearer-token --from bearer.json --to signed.json -w ./wallet.json
|
||||||
```
|
```
|
||||||
Encoding to base64 to use via the header:
|
Encoding to base64 to use via the header:
|
||||||
```
|
```
|
||||||
|
@ -548,12 +548,12 @@ For the token to work correctly, you need to create a container with a basic ACL
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
$ neofs-cli -w ./wallet.json --basic-acl 0x0FFFCFFF -r 192.168.130.72:8080 container create --policy "REP 3" --await
|
$ frostfs-cli -w ./wallet.json --basic-acl 0x0FFFCFFF -r 192.168.130.72:8080 container create --policy "REP 3" --await
|
||||||
```
|
```
|
||||||
|
|
||||||
To deny access to a container without a token, set the eACL rules:
|
To deny access to a container without a token, set the eACL rules:
|
||||||
```
|
```
|
||||||
$ neofs-cli -w ./wallet.json -r 192.168.130.72:8080 container set-eacl --table eacl.json --await --cid BJeErH9MWmf52VsR1mLWKkgF3pRm3FkubYxM7TZkBP4K
|
$ frostfs-cli -w ./wallet.json -r 192.168.130.72:8080 container set-eacl --table eacl.json --await --cid BJeErH9MWmf52VsR1mLWKkgF3pRm3FkubYxM7TZkBP4K
|
||||||
```
|
```
|
||||||
|
|
||||||
File **eacl.json**:
|
File **eacl.json**:
|
||||||
|
|
4
app.go
|
@ -111,7 +111,7 @@ func newApp(ctx context.Context, opt ...Option) App {
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- setup FastHTTP server --
|
// -- setup FastHTTP server --
|
||||||
a.webServer.Name = "neofs-http-gw"
|
a.webServer.Name = "frost-http-gw"
|
||||||
a.webServer.ReadBufferSize = a.cfg.GetInt(cfgWebReadBufferSize)
|
a.webServer.ReadBufferSize = a.cfg.GetInt(cfgWebReadBufferSize)
|
||||||
a.webServer.WriteBufferSize = a.cfg.GetInt(cfgWebWriteBufferSize)
|
a.webServer.WriteBufferSize = a.cfg.GetInt(cfgWebWriteBufferSize)
|
||||||
a.webServer.ReadTimeout = a.cfg.GetDuration(cfgWebReadTimeout)
|
a.webServer.ReadTimeout = a.cfg.GetDuration(cfgWebReadTimeout)
|
||||||
|
@ -327,7 +327,7 @@ func getKeyFromWallet(w *wallet.Wallet, addrStr string, password *string) (*ecds
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *app) Wait() {
|
func (a *app) Wait() {
|
||||||
a.log.Info("starting application", zap.String("app_name", "neofs-http-gw"), zap.String("version", Version))
|
a.log.Info("starting application", zap.String("app_name", "frostfs-http-gw"), zap.String("version", Version))
|
||||||
|
|
||||||
a.setHealthStatus()
|
a.setHealthStatus()
|
||||||
|
|
||||||
|
|
4
debian/changelog
vendored
|
@ -1,5 +1,5 @@
|
||||||
neofs-http-gw (0.0.0) stable; urgency=medium
|
frostfs-http-gw (0.0.0) stable; urgency=medium
|
||||||
|
|
||||||
* Please see CHANGELOG.md
|
* Please see CHANGELOG.md
|
||||||
|
|
||||||
-- NeoSPCC <tech@nspcc.ru> Wed, 24 Aug 2022 18:29:49 +0300
|
-- TrueCloudLab <tech@frostfs.info> Wed, 24 Aug 2022 18:29:49 +0300
|
||||||
|
|
16
debian/control
vendored
|
@ -1,15 +1,15 @@
|
||||||
Source: neofs-http-gw
|
Source: frostfs-http-gw
|
||||||
Section: neofs
|
Section: frostfs
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: NeoSPCC <tech@nspcc.ru>
|
Maintainer: TrueCloudLab <tech@frostfs.info>
|
||||||
Build-Depends: debhelper-compat (= 13), dh-sysuser, git, devscripts
|
Build-Depends: debhelper-compat (= 13), dh-sysuser, git, devscripts
|
||||||
Standards-Version: 4.5.1
|
Standards-Version: 4.5.1
|
||||||
Homepage: https://fs.neo.org/
|
Homepage: https://frostfs.info/
|
||||||
Vcs-Git: https://github.com/nspcc-dev/neofs-http-gw.git
|
Vcs-Git: https://github.com/TrueCloudLab/frostfs-http-gw.git
|
||||||
Vcs-Browser: https://github.com/nspcc-dev/neofs-http-gw
|
Vcs-Browser: https://github.com/TrueCloudLab/frostfs-http-gw
|
||||||
|
|
||||||
Package: neofs-http-gw
|
Package: frostfs-http-gw
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${misc:Depends}
|
Depends: ${misc:Depends}
|
||||||
Description: NeoFS HTTP Gateway bridges NeoFS internal protocol and HTTP standard.
|
Description: FrostFS HTTP Gateway bridges FrostFS internal protocol and HTTP standard.
|
||||||
|
|
||||||
|
|
10
debian/copyright
vendored
|
@ -1,11 +1,13 @@
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: neofs-http-gw
|
Upstream-Name: frostfs-http-gw
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
Upstream-Contact: tech@nspcc.ru
|
Upstream-Contact: tech@frostfs.info
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
Source: https://github.com/nspcc-dev/neofs-http-gw
|
Source: https://github.com/TrueCloudLab/frostfs-http-gw
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
|
|
||||||
Files: *
|
Files: *
|
||||||
Copyright: 2018-2022 NeoSPCC (@nspcc-dev), contributors of neofs-http-gw project
|
Copyright: 2018-2022 NeoSPCC (@nspcc-dev), contributors of neofs-http-gw project
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
(https://github.com/nspcc-dev/neofs-http-gw/blob/master/CREDITS.md)
|
(https://github.com/nspcc-dev/neofs-http-gw/blob/master/CREDITS.md)
|
||||||
|
2022 True Cloud Lab (@TrueCloudLab), contributors of frostfs-http-gw project
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
|
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
|||||||
|
|
||||||
|
|
||||||
License: GPL-3
|
License: GPL-3
|
||||||
|
|
||||||
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
```suggestion
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```
```suggestion
(https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```
I think it is just 2022. /cc @realloc I think it is just 2022. /cc @realloc
FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC. FrostFS development by TrueCloudLab started at 2022, so we need to add a line, not t replace NSPCC.
|
2
debian/frostfs-http-gw.dirs
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
etc/frostfs
|
||||||
|
srv/frostfs_cache
|
2
debian/frostfs-http-gw.install
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bin/frostfs-http-gw usr/bin
|
||||||
|
config/config.yaml etc/frostfs/http
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# postinst script for neofs-http-gw
|
# postinst script for frostfs-http-gw
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
@ -21,16 +21,16 @@ set -e
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
USERNAME=http
|
USERNAME=http
|
||||||
id -u neofs-$USERNAME >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /srv/neofs_cache --system -M -U -c "NeoFS HTTP gateway" neofs-$USERNAME
|
id -u frostfs-$USERNAME >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /srv/frostfs_cache --system -M -U -c "FrostFS HTTP gateway" frostfs-$USERNAME
|
||||||
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
|
if ! dpkg-statoverride --list /etc/frostfs/$USERNAME >/dev/null; then
|
||||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME
|
chown -f root:frostfs-$USERNAME /etc/frostfs/$USERNAME
|
||||||
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/config.yaml || true
|
chown -f root:frostfs-$USERNAME /etc/frostfs/$USERNAME/config.yaml || true
|
||||||
chmod -f 0750 /etc/neofs/$USERNAME
|
chmod -f 0750 /etc/frostfs/$USERNAME
|
||||||
chmod -f 0640 /etc/neofs/$USERNAME/config.yaml || true
|
chmod -f 0640 /etc/frostfs/$USERNAME/config.yaml || true
|
||||||
fi
|
fi
|
||||||
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
|
USERDIR=$(getent passwd "frostfs-$USERNAME" | cut -d: -f6)
|
||||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then
|
||||||
chown -f neofs-$USERNAME: $USERDIR
|
chown -f frostfs-$USERNAME: $USERDIR
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# postrm script for neofs-http-gw
|
# postrm script for frostfs-http-gw
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ set -e
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
purge)
|
purge)
|
||||||
rm -rf /srv/neofs_cache
|
rm -rf /srv/frostfs_cache
|
||||||
;;
|
;;
|
||||||
|
|
||||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# preinst script for neofs-http-gw
|
# preinst script for frostfs-http-gw
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# prerm script for neofs-http-gw
|
# prerm script for frostfs-http-gw
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
|
16
debian/frostfs-http-gw.service
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=FrostFS HTTP Gateway
|
||||||
|
Requires=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/frostfs-http-gw --config /etc/frostfs/http/config.yaml
|
||||||
|
User=frostfs-http
|
||||||
|
Group=frostfs-http
|
||||||
|
WorkingDirectory=/srv/frostfs_cache
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
PrivateTmp=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
2
debian/neofs-http-gw.dirs
vendored
|
@ -1,2 +0,0 @@
|
||||||
etc/neofs
|
|
||||||
srv/neofs_cache
|
|
2
debian/neofs-http-gw.install
vendored
|
@ -1,2 +0,0 @@
|
||||||
bin/neofs-http-gw usr/bin
|
|
||||||
config/config.yaml etc/neofs/http
|
|
16
debian/neofs-http-gw.service
vendored
|
@ -1,16 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=NeoFS HTTP Gateway
|
|
||||||
Requires=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/usr/bin/neofs-http-gw --config /etc/neofs/http/config.yaml
|
|
||||||
User=neofs-http
|
|
||||||
Group=neofs-http
|
|
||||||
WorkingDirectory=/srv/neofs_cache
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5
|
|
||||||
PrivateTmp=true
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
2
debian/rules
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Do not try to strip Go binaries and do not run test
|
# Do not try to strip Go binaries and do not run test
|
||||||
export DEB_BUILD_OPTIONS := nostrip nocheck
|
export DEB_BUILD_OPTIONS := nostrip nocheck
|
||||||
SERVICE = neofs-http-gw
|
SERVICE = frostfs-http-gw
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@
|
dh $@
|
||||||
|
|
|
@ -50,7 +50,7 @@ Route: `/upload/{cid}`
|
||||||
|
|
||||||
#### POST
|
#### POST
|
||||||
|
|
||||||
Upload file as object with attributes to NeoFS.
|
Upload file as object with attributes to FrostFS.
|
||||||
|
|
||||||
##### Request
|
##### Request
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# NeoFS HTTP Gateway configuration file
|
# FrostFS HTTP Gateway configuration file
|
||||||
|
|
||||||
This section contains detailed NeoFS HTTP Gateway configuration file description
|
This section contains detailed FrostFS HTTP Gateway configuration file description
|
||||||
including default config values and some tips to set up configurable values.
|
including default config values and some tips to set up configurable values.
|
||||||
|
|
||||||
There are some custom types used for brevity:
|
There are some custom types used for brevity:
|
||||||
|
@ -23,19 +23,19 @@ $ kill -s SIGHUP <app_pid>
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ./bin/neofs-http-gw --config config.yaml &> http.log &
|
$ ./bin/frostfs-http-gw --config config.yaml &> http.log &
|
||||||
[1] 998346
|
[1] 998346
|
||||||
|
|
||||||
$ cat http.log
|
$ cat http.log
|
||||||
# ...
|
# ...
|
||||||
2022-10-03T09:37:25.826+0300 info neofs-http-gw/app.go:332 starting application {"app_name": "neofs-http-gw", "version": "v0.24.0"}
|
2022-10-03T09:37:25.826+0300 info frostfs-http-gw/app.go:332 starting application {"app_name": "frostfs-http-gw", "version": "v0.24.0"}
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
$ kill -s SIGHUP 998346
|
$ kill -s SIGHUP 998346
|
||||||
|
|
||||||
$ cat http.log
|
$ cat http.log
|
||||||
# ...
|
# ...
|
||||||
2022-10-03T09:38:16.205+0300 info neofs-http-gw/app.go:470 SIGHUP config reload completed
|
2022-10-03T09:38:16.205+0300 info frostfs-http-gw/app.go:470 SIGHUP config reload completed
|
||||||
```
|
```
|
||||||
|
|
||||||
# Structure
|
# Structure
|
||||||
|
|
|
@ -123,7 +123,7 @@ func settings() *viper.Viper {
|
||||||
flags.String(cmdListenAddress, "0.0.0.0:8080", "addresses to listen")
|
flags.String(cmdListenAddress, "0.0.0.0:8080", "addresses to listen")
|
||||||
flags.String(cfgTLSCertFile, "", "TLS certificate path")
|
flags.String(cfgTLSCertFile, "", "TLS certificate path")
|
||||||
flags.String(cfgTLSKeyFile, "", "TLS key path")
|
flags.String(cfgTLSKeyFile, "", "TLS key path")
|
||||||
peers := flags.StringArrayP(cfgPeers, "p", nil, "NeoFS nodes")
|
peers := flags.StringArrayP(cfgPeers, "p", nil, "FrostFS nodes")
|
||||||
|
|
||||||
resolveMethods := flags.StringSlice(cfgResolveOrder, []string{resolver.NNSResolver, resolver.DNSResolver}, "set container name resolve order")
|
resolveMethods := flags.StringSlice(cfgResolveOrder, []string{resolver.NNSResolver, resolver.DNSResolver}, "set container name resolve order")
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ func settings() *viper.Viper {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case help != nil && *help:
|
case help != nil && *help:
|
||||||
fmt.Printf("NeoFS HTTP Gateway %s\n", Version)
|
fmt.Printf("FrostFS HTTP Gateway %s\n", Version)
|
||||||
flags.PrintDefaults()
|
flags.PrintDefaults()
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -229,7 +229,7 @@ func settings() *viper.Viper {
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
case version != nil && *version:
|
case version != nil && *version:
|
||||||
fmt.Printf("NeoFS HTTP Gateway\nVersion: %s\nGoVersion: %s\n", Version, runtime.Version())
|
fmt.Printf("FrostFS HTTP Gateway\nVersion: %s\nGoVersion: %s\n", Version, runtime.Version())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
I assume we are going to rename it to
s0*.frostfs.devenv
. Mention that explicitly in #2 or fix it here. There are plenty of dev-env links and usage of$NEOFS_NODE
.