Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
npm-debug.log
build
.dockerignore
**/.git
**/.DS_Store
**/node_modules
129 changes: 129 additions & 0 deletions .github/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build

on:
pull_request:
branches:
- master
types: [opened, synchronize]
paths-ignore:
- '**/*.md'
push:
# Build for the master branch.
branches:
- master
release:
types:
- published
workflow_dispatch:
inputs:
ref:
description: 'Ref to build [default: latest master; examples: v0.4.0, 9595da7d83efc330ca0bc94bef482e4edfbcf8fd]'
required: false
default: ''
deploy:
description: 'Deploy to production [default: false; examples: true, false]'
required: false
default: 'false'

jobs:
build_release:
name: Build and deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
# Allows to fetch all history for all branches and tags. Need this for proper versioning.
fetch-depth: 0

- name: Build
run: make release

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release
path: ./archive.fs.neo.org-*.tar.gz
if-no-files-found: error

- name: Attach binary to the release as an asset
if: ${{ github.event_name == 'release' }}
run: gh release upload ${{ github.event.release.tag_name }} ./archive.fs.neo.org-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NeoFS
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') }}
uses: nspcc-dev/gh-push-to-neofs@master
with:
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
PATH_TO_FILES_DIR: archive.fs.neo.org
STRIP_PREFIX: true
REPLACE_CONTAINER_CONTENTS: true
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

Changelog for NeoFS Archive

## [Unreleased]


## [0.1.0] - 2025-01-15

First public review release.


[0.1.0]: https://github.com/nspcc-dev/archive-fs-neo-org/tree/v0.1.0
[Unreleased]: https://github.com/nspcc-dev/archive-fs-neo-org/compare/v0.1.0...master
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/make -f

SHELL = bash

VERSION ?= "$(shell git describe --tags --match "v*" --abbrev=8 2>/dev/null | sed -r 's,^v([0-9]+\.[0-9]+)\.([0-9]+)(-.*)?$$,\1 \2 \3,' | while read mm patch suffix; do if [ -z "$$suffix" ]; then echo $$mm.$$patch; else patch=`expr $$patch + 1`; echo $$mm.$${patch}-pre$$suffix; fi; done)"
SITE_DIR ?= archive.fs.neo.org
RELEASE_DIR ?= $(SITE_DIR)-$(VERSION)
RELEASE_PATH ?= $(SITE_DIR)-$(VERSION).tar.gz
CURRENT_UID ?= $(shell id -u $$USER)

PORT = 3000

$(SITE_DIR):
docker run \
-v $$(pwd)/src:/usr/src/app/src \
-v $$(pwd)/public:/usr/src/app/public \
-v $$(pwd)/package.json:/usr/src/app/package.json \
-v $$(pwd)/$(SITE_DIR):/usr/src/app/$(SITE_DIR) \
-e CURRENT_UID=$(CURRENT_UID) \
-w /usr/src/app node:14-alpine \
sh -c 'npm install && REACT_APP_VERSION=$(VERSION) npm run build && chown -R $$CURRENT_UID: $(SITE_DIR)'

start:
docker run \
-p $(PORT):3000 \
-v `pwd`:/usr/src/app \
-w /usr/src/app node:14-alpine \
sh -c 'npm install --silent && npm run build && npm install -g serve && serve -s $(SITE_DIR) -p 3000'

release: $(SITE_DIR)
cp $(SITE_DIR)/index.html $(SITE_DIR)/agreement
@ln -sf $(SITE_DIR) $(RELEASE_DIR)
@tar cfvhz $(RELEASE_PATH) $(RELEASE_DIR)

clean:
@echo "Cleaning up ..."
@rm -rf $(SITE_DIR) $(RELEASE_DIR) $(RELEASE_PATH)

release_name:
@echo $(RELEASE_PATH)

version:
@echo $(VERSION)
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<p align="center">
<img src="./.github/logo.svg" width="500px" alt="NeoFS">
</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>.
</p>

---
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/archive-fs-neo-org?sort=semver)
![License](https://img.shields.io/github/license/nspcc-dev/archive-fs-neo-org.svg?style=popout)

# Overview

Archive.NeoFS – Download Blockchain Data Snapshot. Download an offline package of the blockchain data up to a certain block height. This web application is built on the React framework.

# Requirements

- docker
- make
- node (`14+`)

# Make instructions

* Compile the build using `make` (will be generated in `archive-fs-neo-org` dir)
* Start app using `make start PORT=3000` (PORT=3000 by default)
* Clean up cache directories using `make clean`
* Get release directory with tar.gz using `make release`

# License

- [GNU General Public License v3.0](LICENSE)
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "archive-fs-neo-org",
"version": "0.0.1",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@types/react": "^18.2.41",
"@types/react-dom": "^18.2.17",
"bulma": "^0.9.4",
"react": "^17.0.2",
"react-bulma-components": "^4.1.0",
"react-dom": "^17.0.2",
"react-router-dom": "^6.10.0"
},
"scripts": {
"start": "REACT_APP_VERSION=$(make version) GENERATE_SOURCEMAP=false react-scripts start",
"build": "GENERATE_SOURCEMAP=false BUILD_PATH='./archive.fs.neo.org' react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"devDependencies": {
"dotenv": "^16.0.3",
"react-scripts": "^5.0.1",
"typescript": "^4.9.5"
}
}
1 change: 1 addition & 0 deletions public/img/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/favicon.ico
Binary file not shown.
Loading
Loading