Skip to content

Commit

Permalink
Merge pull request #415 from fairDataSociety/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
asabya authored Feb 15, 2023
2 parents e271fcd + 149da1d commit 569fc86
Show file tree
Hide file tree
Showing 167 changed files with 4,983 additions and 785 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.17
go-version: 1.19
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -24,6 +24,6 @@ jobs:
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
go test -coverprofile=cover.out ./...
go test -coverprofile=cover.out $(go list ./... | grep -v wasm)
curl https://deepsource.io/cli | sh
./bin/deepsource report --analyzer test-coverage --key go --value-file ./cover.out
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [1.17]
go: [1.19]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup Go
Expand All @@ -39,11 +39,11 @@ jobs:
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Lint
if: matrix.os == 'ubuntu-latest'
run: make lint
- name: Vet
if: matrix.os == 'ubuntu-latest'
run: make vet
- name: Build
run: make build
- name: Test with Race Detector
if: matrix.os == 'ubuntu-latest'
run: make test-race
Expand Down
47 changes: 46 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -38,3 +38,48 @@ jobs:
run: |-
sudo rm -rf dist
make release
build-mobile:
runs-on: ubuntu-latest
steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Android SDK
run: |
curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip sdk-tools.zip -d $HOME/android-sdk
echo "y" | $HOME/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platform-tools" "build-tools;30.0.3"
export PATH=$PATH:$HOME/android-sdk/platform-tools
- name: Install gomobile
run: go install golang.org/x/mobile/cmd/gomobile@latest
- name: Build android aar
run: |
make android
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist --config .goreleaser-mobile.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-wasm:
runs-on: ubuntu-latest
steps:
- name: Build wasm
run: |
make wasm
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist --config .goreleaser-wasm.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ cover.out

# goreleaser environment resources
.release-env
.docker-creds
.docker-creds

fairos.aar
fairos-sources.jar
8 changes: 8 additions & 0 deletions .goreleaser-mobile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
project_name: fairos

release:
prerelease: auto
extra_files:
- glob: ./fairos.aar
builds:
- skip: true
9 changes: 9 additions & 0 deletions .goreleaser-wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project_name: fairos

release:
prerelease: auto
extra_files:
- glob: ./dist/fairos.wasm
- glob: ./dist/fairos.wasm.gz
builds:
- skip: true
32 changes: 0 additions & 32 deletions DISCLAIMER
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,3 @@ Reference herein to any specific commercial product, process, or service by trad
name, trademark, manufacturer, or otherwise, in this Work does not constitute an
endorsement, recommendation, or favoring by the any Government and
shall not be used for advertising or product endorsement purposes.
=======
# DISCLAIMER
Account integrity persistence and security are not assured. Expect that funds
used for account might be lost, as well as any data the account uses.

Use of this service is limited only to **non-sensitive and publicly available
data**. Users must not use, share, or store any kind of sensitive data like
health status, provision or payment of healthcare, Personally Identifiable
Information (PII) and/or Protected Health Information (PHI), etc. under **ANY**
circumstance.

Administrators for this service can not moderate any information
used, shared, or stored with this service at any time. Any user that cannot
abide by this disclaimer and Code of Conduct must refrain from using this service.

The material embodied in this software is provided to you "as-is" and without
warranty of any kind, express, implied or otherwise, including without
limitation, any warranty of fitness for a particular purpose. In no event shall
the any government be liable to you or anyone else for any direct, special, incidental,
indirect or consequential damages of any kind, or any damages whatsoever,
including without limitation, loss of profit, loss of use, savings or revenue,
or the claims of third parties, whether or not any government has
been advised of the possibility of such loss, however caused and on any theory
of liability, arising out of or in connection with the possession, use or
performance of this software.


# Disclaimer of Endorsement
Reference herein to any specific commercial product, process, or service by trade
name, trademark, manufacturer, or otherwise, in this Work does not constitute an
endorsement, recommendation, or favoring by the any Government and
shall not be used for advertising or product endorsement purposes.
40 changes: 28 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ GOGOPROTOBUF_VERSION ?= v1.3.1
COMMIT ?= "$(shell git describe --long --dirty --always --match "" || true)"
VERSION ?= "$(shell git describe --tags --abbrev=0 || true)"
LDFLAGS ?= -s -w -X github.com/fairdatasociety/fairOS-dfs.commit="$(COMMIT)" -X github.com/fairdatasociety/fairOS-dfs.version="$(VERSION)"
DEST ?= "$(shell (go list ./... | grep -v wasm))"

.PHONY: all
all: build lint vet test-race binary
all: lint vet test-race binary

.PHONY: binary
binary: export CGO_ENABLED=1
Expand All @@ -23,7 +24,7 @@ dist:

.PHONY: lint
lint: linter
$(GOLANGCI_LINT) run
$(GOLANGCI_LINT) run --skip-dirs wasm

.PHONY: linter
linter:
Expand All @@ -36,19 +37,15 @@ swagger:

.PHONY: vet
vet:
$(GO) vet ./...
$(GO) vet "$(DEST)"

.PHONY: test-race
test-race:
$(GO) test -race -timeout 300000ms -v ./...
$(GO) test -race -timeout 300000ms -v "$(DEST)"

.PHONY: test
test:
$(GO) test -v ./...

.PHONY: build
build:
$(GO) build ./...
$(GO) test -v "$(DEST)"

.PHONY: githooks
githooks:
Expand All @@ -62,7 +59,7 @@ protobuftools:
.PHONY: protobuf
protobuf: GOFLAGS=-mod=mod # use modules for protobuf file include option
protobuf: protobuftools
$(GO) generate -run protoc ./...
$(GO) generate -run protoc "$(DEST)"

.PHONY: clean
clean:
Expand All @@ -77,17 +74,36 @@ release:
-v `pwd`:/go/src/github.com/fairDataSociety/fairOS-dfs \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/fairDataSociety/fairOS-dfs \
ghcr.io/goreleaser/goreleaser-cross:v1.19.0 release --rm-dist
ghcr.io/goreleaser/goreleaser-cross:v1.19.5 release --rm-dist

.PHONY: release-dry-run
release-dry-run:
docker run --rm --privileged \
-v ~/go/pkg/mod:/go/pkg/mod \
-v ~/go/bin:/go/bin \
-v `pwd`:/go/src/github.com/fairDataSociety/fairOS-dfs \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/fairDataSociety/fairOS-dfs \
ghcr.io/goreleaser/goreleaser-cross:v1.19.0 release --rm-dist \
ghcr.io/goreleaser/goreleaser-cross:v1.19.5 release --rm-dist \
--skip-validate=true \
--skip-publish


BUILD_DIR := $(PWD)
BIN_PATH := $(BUILD_DIR)/dist
EXEC_NAME := fairos.wasm
GZIP_EXEC_NAME := $(EXEC_NAME).gz

.PHONY: wasm
wasm:
@GOOS=js GOARCH=wasm $(GO) build -ldflags="-s -w" -o $(BIN_PATH)/$(EXEC_NAME)
@gzip -9 -v -c $(BIN_PATH)/$(EXEC_NAME) > $(BIN_PATH)/$(GZIP_EXEC_NAME)

.PHONY: android
android:
$(GO) get golang.org/x/mobile/bind
gomobile init
gomobile bind -androidapi 21 -o fairos.aar -target=android -ldflags "$(LDFLAGS)" github.com/fairdatasociety/fairOS-dfs/gomobile
$(GO) mod tidy

FORCE:
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It is a stateless thin layer which uses the building blocks provided by Swarm to
- Creation of logical drives
- User and Permission management
- Charging and Payments
- Mutable, Indexed data structures over immmutable file system
- Mutable, Indexed data structures over immutable file system

dfs can be used for the following use cases
1) Personal data store
Expand Down
10 changes: 10 additions & 0 deletions cmd/common/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,41 @@ limitations under the License.

package common

// UserSignupRequest
type UserSignupRequest struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
Mnemonic string `json:"mnemonic,omitempty"`
}

// UserLoginRequest
type UserLoginRequest struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}

// PodRequest
type PodRequest struct {
PodName string `json:"podName,omitempty"`
Password string `json:"password,omitempty"`
Reference string `json:"reference,omitempty"`
SharedPodName string `json:"sharedPodName,omitempty"`
}

// PodShareRequest
type PodShareRequest struct {
PodName string `json:"podName,omitempty"`
SharedPodName string `json:"sharedPodName,omitempty"`
}

// PodReceiveRequest
type PodReceiveRequest struct {
PodName string `json:"podName,omitempty"`
Reference string `json:"sharingRef,omitempty"`
SharedPodName string `json:"sharedPodName,omitempty"`
}

// FileSystemRequest
type FileSystemRequest struct {
PodName string `json:"podName,omitempty"`
DirectoryPath string `json:"dirPath,omitempty"`
Expand All @@ -54,18 +60,21 @@ type FileSystemRequest struct {
Destination string `json:"destUser,omitempty"`
}

// RenameRequest
type RenameRequest struct {
PodName string `json:"podName,omitempty"`
OldPath string `json:"oldPath,omitempty"`
NewPath string `json:"newPath,omitempty"`
}

// FileReceiveRequest
type FileReceiveRequest struct {
PodName string `json:"podName,omitempty"`
SharingReference string `json:"sharingRef,omitempty"`
DirectoryPath string `json:"dirPath,omitempty"`
}

// KVRequest
type KVRequest struct {
PodName string `json:"podName,omitempty"`
TableName string `json:"tableName,omitempty"`
Expand All @@ -78,6 +87,7 @@ type KVRequest struct {
Memory string `json:"memory,omitempty"`
}

// DocRequest
type DocRequest struct {
PodName string `json:"podName,omitempty"`
TableName string `json:"tableName,omitempty"`
Expand Down
Loading

0 comments on commit 569fc86

Please sign in to comment.