-
Notifications
You must be signed in to change notification settings - Fork 0
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
mike-petrov
wants to merge
5
commits into
master
Choose a base branch
from
feature/1-initial_version
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,666
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c2192cf
github: add build workflow
mike-petrov 04c0f17
dockerignore: add one
mike-petrov f354003
makefile: add one
mike-petrov b89e19a
readme: add one with logo
mike-petrov 979cde4
web: Init first version with downloading snapshots, closes #1
mike-petrov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)/about | ||
@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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"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", | ||
"base-58": "^0.0.1", | ||
"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" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be updated when we're done with the content.