Feature/2 rebranding #3

Merged
KirillovDenis merged 3 commits from feature/2-rebranding into master 2022-12-20 10:34:42 +00:00
26 changed files with 129 additions and 127 deletions

2
.github/CODEOWNERS vendored
View file

@ -1 +1 @@
* @alexvanin @masterSplinter01 @KirillovDenis
* @alexvanin @KirillovDenis

View file

@ -3,8 +3,8 @@
First, thank you for contributing! We love and encourage pull requests from
everyone. Please follow the guidelines:
- Check the open [issues](https://github.com/nspcc-dev/neofs-http-gw/issues) and
[pull requests](https://github.com/nspcc-dev/neofs-http-gw/pulls) for existing
- Check the open [issues](https://github.com/TrueCloudLab/frostfs-http-gw/issues) and
[pull requests](https://github.com/TrueCloudLab/frostfs-http-gw/pulls) for existing
discussions.
- Open an issue first, to discuss a new feature or enhancement.
@ -23,24 +23,24 @@ everyone. Please follow the guidelines:
## 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
are the steps in details:
### Set up your GitHub Repository
Fork [NeoFS HTTP Gateway
upstream](https://github.com/nspcc-dev/neofs-http-gw/fork) source repository
Fork [FrostFS HTTP Gateway
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
the `git clone` command below).
```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``
```sh
$ cd neofs-http-gw
$ git remote add upstream https://github.com/nspcc-dev/neofs-http-gw
$ cd frostfs-http-gw
$ git remote add upstream https://github.com/TrueCloudLab/frostfs-http-gw
$ git fetch upstream
$ 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:
```
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`.

View file

@ -18,6 +18,6 @@ FROM scratch
WORKDIR /
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"]

View file

@ -3,6 +3,6 @@ RUN apk add --update --no-cache bash ca-certificates
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"]

View file

@ -6,13 +6,13 @@ GO_VERSION ?= 1.19
LINT_VERSION ?= 1.49.0
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//')"
# List of binaries to build. For now just one.
BINDIR = bin
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
@ -74,7 +74,7 @@ fmt:
# Build clean Docker image
image:
@echo "⇒ Build NeoFS HTTP Gateway docker image "
@echo "⇒ Build FrostFS HTTP Gateway docker image "
@docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \
@ -89,7 +89,7 @@ image-push:
# Build dirty Docker image
dirty-image:
@echo "⇒ Build NeoFS HTTP Gateway dirty docker image "
@echo "⇒ Build FrostFS HTTP Gateway dirty docker image "
@docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \
@ -120,7 +120,7 @@ clean:
# Package for Debian
debpackage:
dch --package neofs-http-gw \
dch --package frostfs-http-gw \
--controlmaint \
--newversion $(PKG_VERSION) \
--distribution $(OS_RELEASE) \

View file

@ -1,30 +1,30 @@
<p align="center">
<img src="./.github/logo.svg" width="500px" alt="NeoFS">
<img src="./.github/logo.svg" width="500px" alt="FrostFS">
</p>
<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>
---
[![Report](https://goreportcard.com/badge/github.com/nspcc-dev/neofs-http-gw)](https://goreportcard.com/report/github.com/nspcc-dev/neofs-http-gw)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/neofs-http-gw?sort=semver)
![License](https://img.shields.io/github/license/nspcc-dev/neofs-http-gw.svg?style=popout)
[![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/TrueCloudLab/frostfs-http-gw?sort=semver)
![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.
- you can download one file per request from the NeoFS Network
- you can upload one file per request into the NeoFS Network
FrostFS HTTP Gateway bridges FrostFS internal protocol and HTTP standard.
- you can download one file per request from the FrostFS Network
- you can upload one file per request into the FrostFS Network
See available routes in [specification](./docs/api.md).
## 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
end up in `bin/neofs-http-gw`). To build neofs-http-gw binary in clean docker
environment, call `make docker/bin/neofs-http-gw`.
end up in `bin/frostfs-http-gw`). To build frostfs-http-gw binary in clean docker
environment, call `make docker/bin/frostfs-http-gw`.
Other notable make targets:
@ -38,32 +38,32 @@ version Show current version
```
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
latest stable release).
## 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
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
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
(with s0*.neofs.devenv name).
These two commands are functionally equivalent, they run the gate with one
backend node (and otherwise default settings):
```
$ neofs-http-gw -p 192.168.130.72:8080
$ HTTP_GW_PEERS_0_ADDRESS=192.168.130.72:8080 neofs-http-gw
$ frostfs-http-gw -p 192.168.130.72:8080
$ 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`:
```
$ neofs-http-gw -p grpc://192.168.130.72:8080
$ HTTP_GW_PEERS_0_ADDRESS=grpcs://192.168.130.72:8080 neofs-http-gw
$ frostfs-http-gw -p grpc://192.168.130.72:8080
$ HTTP_GW_PEERS_0_ADDRESS=grpcs://192.168.130.72:8080 frostfs-http-gw
```
## Configuration
@ -74,11 +74,11 @@ environment variables (see [example](./config/config.env)), so they're not speci
### 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):
```
$ 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:
@ -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_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 \
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
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
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 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:
```
alexvanin commented 2022-12-19 12:47:36 +00:00 (Migrated from github.com)
Review

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.

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`.
KirillovDenis commented 2022-12-19 13:50:07 +00:00 (Migrated from github.com)
Review

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
@ -116,7 +116,7 @@ external redirecting solution.
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
```
@ -134,12 +134,12 @@ request with data stream after timeout.
`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
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
limiting uploads to files slightly lower than this limit.
### NeoFS parameters
### FrostFS parameters
Gateway can automatically set timestamps for uploaded files based on local
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.
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.
@ -185,7 +185,7 @@ See [config](./config/config.yaml) and [defaults](./docs/gate-configuration.md)
## HTTP API provided
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
containers and other activities are not supported and not planned to be
supported.
@ -211,7 +211,7 @@ resolve_order:
- 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:
```shell
@ -238,9 +238,9 @@ $ curl http://localhost:8082/get_by_attribute/container-name/FileName/object-nam
#### 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,
`$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:
```
$ 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
the file `wallets/wallet.key`.
#### 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
`$KEY` -- the key, please read the information [above](#create-a-container),
@ -267,7 +267,7 @@ where
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-object-id` contains object ID
* `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`
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
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
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.
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:
* "Authorization" header with "Bearer" type and base64-encoded token in
credentials field
* "Bearer" cookie with base64-encoded token contents
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
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
works the same way.
##### Example
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:
* **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:
```
$ 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:
```
@ -548,12 +548,12 @@ For the token to work correctly, you need to create a container with a basic ACL
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:
```
$ 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**:

4
app.go
View file

@ -111,7 +111,7 @@ func newApp(ctx context.Context, opt ...Option) App {
}
// -- setup FastHTTP server --
a.webServer.Name = "neofs-http-gw"
a.webServer.Name = "frost-http-gw"
a.webServer.ReadBufferSize = a.cfg.GetInt(cfgWebReadBufferSize)
a.webServer.WriteBufferSize = a.cfg.GetInt(cfgWebWriteBufferSize)
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() {
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()

4
debian/changelog vendored
View file

@ -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
-- 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
View file

@ -1,15 +1,15 @@
Source: neofs-http-gw
Section: neofs
Source: frostfs-http-gw
Section: frostfs
Priority: optional
Maintainer: NeoSPCC <tech@nspcc.ru>
Maintainer: TrueCloudLab <tech@frostfs.info>
Build-Depends: debhelper-compat (= 13), dh-sysuser, git, devscripts
Standards-Version: 4.5.1
Homepage: https://fs.neo.org/
Vcs-Git: https://github.com/nspcc-dev/neofs-http-gw.git
Vcs-Browser: https://github.com/nspcc-dev/neofs-http-gw
Homepage: https://frostfs.info/
Vcs-Git: https://github.com/TrueCloudLab/frostfs-http-gw.git
Vcs-Browser: https://github.com/TrueCloudLab/frostfs-http-gw
Package: neofs-http-gw
Package: frostfs-http-gw
Architecture: any
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
View file

@ -1,11 +1,13 @@
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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.
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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/
Upstream-Name: neofs-http-gw
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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-Name: frostfs-http-gw
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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@frostfs.info
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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/TrueCloudLab/frostfs-http-gw
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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: *
Copyright: 2018-2022 NeoSPCC (@nspcc-dev), contributors of neofs-http-gw project
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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.
Copyright: 2018-2022 NeoSPCC (@nspcc-dev), contributors of neofs-http-gw project
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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)
2022 True Cloud Lab (@TrueCloudLab), contributors of frostfs-http-gw project
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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)
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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

alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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.
alexvanin commented 2022-12-19 12:43:08 +00:00 (Migrated from github.com)
Review
Source: https://github.com/TrueCloudLab/frostfs-http-gw
```suggestion Source: https://github.com/TrueCloudLab/frostfs-http-gw ```
alexvanin commented 2022-12-19 12:43:41 +00:00 (Migrated from github.com)
Review
           (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md)
```suggestion (https://github.com/TrueCloudLab/frostfs-http-gw/blob/master/CREDITS.md) ```
alexvanin commented 2022-12-19 14:36:26 +00:00 (Migrated from github.com)
Review

I think it is just 2022. /cc @realloc

I think it is just 2022. /cc @realloc
realloc commented 2022-12-20 08:52:04 +00:00 (Migrated from github.com)
Review

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
View file

@ -0,0 +1,2 @@
etc/frostfs
srv/frostfs_cache

2
debian/frostfs-http-gw.install vendored Normal file
View file

@ -0,0 +1,2 @@
bin/frostfs-http-gw usr/bin
config/config.yaml etc/frostfs/http

View file

@ -1,5 +1,5 @@
#!/bin/sh
# postinst script for neofs-http-gw
# postinst script for frostfs-http-gw
#
# see: dh_installdeb(1)
@ -21,16 +21,16 @@ set -e
case "$1" in
configure)
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
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME
chown -f root:neofs-$USERNAME /etc/neofs/$USERNAME/config.yaml || true
chmod -f 0750 /etc/neofs/$USERNAME
chmod -f 0640 /etc/neofs/$USERNAME/config.yaml || true
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/frostfs/$USERNAME >/dev/null; then
chown -f root:frostfs-$USERNAME /etc/frostfs/$USERNAME
chown -f root:frostfs-$USERNAME /etc/frostfs/$USERNAME/config.yaml || true
chmod -f 0750 /etc/frostfs/$USERNAME
chmod -f 0640 /etc/frostfs/$USERNAME/config.yaml || true
fi
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
chown -f neofs-$USERNAME: $USERDIR
USERDIR=$(getent passwd "frostfs-$USERNAME" | cut -d: -f6)
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then
chown -f frostfs-$USERNAME: $USERDIR
fi
;;

View file

@ -1,5 +1,5 @@
#!/bin/sh
# postrm script for neofs-http-gw
# postrm script for frostfs-http-gw
#
# see: dh_installdeb(1)
@ -21,7 +21,7 @@ set -e
case "$1" in
purge)
rm -rf /srv/neofs_cache
rm -rf /srv/frostfs_cache
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

View file

@ -1,5 +1,5 @@
#!/bin/sh
# preinst script for neofs-http-gw
# preinst script for frostfs-http-gw
#
# see: dh_installdeb(1)

View file

@ -1,5 +1,5 @@
#!/bin/sh
# prerm script for neofs-http-gw
# prerm script for frostfs-http-gw
#
# see: dh_installdeb(1)

16
debian/frostfs-http-gw.service vendored Normal file
View 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

View file

@ -1,2 +0,0 @@
etc/neofs
srv/neofs_cache

View file

@ -1,2 +0,0 @@
bin/neofs-http-gw usr/bin
config/config.yaml etc/neofs/http

View file

@ -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
View file

@ -2,7 +2,7 @@
# Do not try to strip Go binaries and do not run test
export DEB_BUILD_OPTIONS := nostrip nocheck
SERVICE = neofs-http-gw
SERVICE = frostfs-http-gw
%:
dh $@

View file

@ -50,7 +50,7 @@ Route: `/upload/{cid}`
#### POST
Upload file as object with attributes to NeoFS.
Upload file as object with attributes to FrostFS.
##### Request

View file

@ -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.
There are some custom types used for brevity:
@ -23,19 +23,19 @@ $ kill -s SIGHUP <app_pid>
Example:
```shell
$ ./bin/neofs-http-gw --config config.yaml &> http.log &
$ ./bin/frostfs-http-gw --config config.yaml &> http.log &
[1] 998346
$ 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
$ 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

View file

@ -123,7 +123,7 @@ func settings() *viper.Viper {
flags.String(cmdListenAddress, "0.0.0.0:8080", "addresses to listen")
flags.String(cfgTLSCertFile, "", "TLS certificate 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")
@ -197,7 +197,7 @@ func settings() *viper.Viper {
switch {
case help != nil && *help:
fmt.Printf("NeoFS HTTP Gateway %s\n", Version)
fmt.Printf("FrostFS HTTP Gateway %s\n", Version)
flags.PrintDefaults()
fmt.Println()
@ -229,7 +229,7 @@ func settings() *viper.Viper {
os.Exit(0)
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)
}