Compare commits

...

18 Commits

Author SHA1 Message Date
Alex
bc0e63aac8 Release v0.45.0 (#3187)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-01-10 21:48:08 -08:00
Alex
343ff575e6 Removed heal backend (#3188)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-01-10 21:16:08 -08:00
Alex
08c922dca6 Deprecated Heal (Drives) functionality (#3186)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-01-10 22:33:18 -06:00
Alex
4dd6519cc6 Updated Section titles & labels (#3185)
Renamed Subscription to Subnet in menus
Renamed Settings to Configuration
Renamed Diagnostics to Heath

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-01-10 22:16:24 -06:00
Prakash Senthil Vel
cdffdae289 Fix life cycle rule edit for transition (#3183) 2024-01-08 08:43:07 -06:00
Shireesh Anjal
27e3b82223 Use subnet package in pkg for license validation (#3156) 2023-12-29 12:12:27 -06:00
Daniel Valdivia
239b31748a Rename portal-ui to web-app (#3178)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-29 11:44:01 -06:00
Daniel Valdivia
b465b74326 Release v0.44.0 (#3177)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-27 00:11:15 -08:00
Daniel Valdivia
616f262d09 Rename restapi to api (#3176)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-26 15:07:30 -06:00
Harshavardhana
8aa0ec17c5 simplify the provider config init, loading and allow reachable IDPs (#3168)
fixes https://github.com/minio/console/issues/3018
2023-12-26 14:38:42 -06:00
Daniel Valdivia
a8c5b53a2c Pkg Subnet Utils Tests (#3173)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-26 14:29:11 -06:00
Cesar Celis Hernandez
e96dbd444e Add all possible tests under restapi (#3174) 2023-12-26 14:17:40 -06:00
Prakash Senthil Vel
939e2acb0b fix event dest icons not loading when subpath is configured (#3169)
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-26 14:03:25 -06:00
Daniel Valdivia
a04955dc70 Save all coverage files to play (#3170)
* Save all coverage files to play

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Save them to latest as well

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

---------

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-26 13:52:18 -06:00
Cesar Celis Hernandez
ba04a22492 Adjusting the threshold of the coverage (#3172) 2023-12-26 13:52:03 -06:00
Cesar Celis Hernandez
a281fe129f To include pkg tests in the coverage (#3171)
Execute and include pkg tests in the coverage
2023-12-26 13:34:25 -06:00
Daniel Valdivia
a655cc8d3b Upgrade Go Dependencies (#3167) 2023-12-23 08:26:57 -06:00
Daniel Valdivia
63b584c83d Change Loading Logic for Metrics Page (#3166)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-22 10:25:54 -06:00
1713 changed files with 2961 additions and 3434 deletions

View File

@@ -3,5 +3,5 @@ dist/
target/
console
!console/
portal-ui/node_modules/
web-app/node_modules/
.git/

View File

@@ -19,11 +19,11 @@ concurrency:
jobs:
lint-job:
name: Checking Lint
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
steps:
- name: Check out source code
uses: actions/checkout@v3
@@ -58,15 +58,15 @@ jobs:
# https://github.com/actions/checkout/issues/334
sudo apt install -y python3-pip || apt install -y python3-pip
pip3 install semgrep
semgrep --config semgrep.yaml $(pwd)/portal-ui --error
semgrep --config semgrep.yaml $(pwd)/web-app --error
ui-assets:
name: "React Code Has No Warnings & Prettified"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -77,31 +77,31 @@ jobs:
with:
node-version: ${{ env.NVMRC }}
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
cache-dependency-path: web-app/yarn.lock
- uses: actions/cache@v3
id: assets-cache
name: Assets Cache
with:
path: |
./portal-ui/build/
./web-app/build/
key: ${{ runner.os }}-assets-${{ github.run_id }}
- name: Install Dependencies
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
yarn install --frozen-lockfile --immutable
- name: Check for Warnings in build output
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
./check-warnings.sh
- name: Check if Files are Prettified
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
./check-prettier.sh
- name: Check for dead code
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
./check-deadcode.sh
@@ -110,8 +110,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -130,10 +130,10 @@ jobs:
latest-minio:
name: Build latest MinIO
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
go-version: [ 1.21.x ]
steps:
# To build minio image, we need to clone the repository first
- name: Clone github.com/minio/minio
@@ -168,8 +168,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -191,7 +191,7 @@ jobs:
name: Assets Cache
with:
path: |
./portal-ui/build/
./web-app/build/
key: ${{ runner.os }}-assets-${{ github.run_id }}
- name: Build on ${{ matrix.os }}
env:
@@ -204,12 +204,12 @@ jobs:
name: Test Subpath with Nginx
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
timeout-minutes: 10
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -242,7 +242,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/subpath-nginx/ -q --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/subpath-nginx/ -q --skip-js-errors -c 3
- name: Clean up docker
if: always()
@@ -253,12 +253,12 @@ jobs:
name: Permissions Tests Part 1
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
timeout-minutes: 10
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -291,7 +291,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-1/ -q --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/permissions-1/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -301,12 +301,12 @@ jobs:
name: Permissions Tests Part 2
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
timeout-minutes: 10
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -338,7 +338,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-2/ -q --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/permissions-2/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -348,12 +348,12 @@ jobs:
name: Permissions Tests Part 3
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
timeout-minutes: 10
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -385,7 +385,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-3/ -q --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/permissions-3/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -395,12 +395,12 @@ jobs:
name: Permissions Tests Part 4
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
timeout-minutes: 15
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -433,17 +433,17 @@ jobs:
- name: Run TestCafe Tests
timeout-minutes: 10
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-4/ --skip-js-errors
run: npx testcafe "chrome:headless" web-app/tests/permissions-4/ --skip-js-errors
all-permissions-5:
name: Permissions Tests Part 5
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -476,17 +476,17 @@ jobs:
- name: Run TestCafe Tests
timeout-minutes: 5
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-5/ --skip-js-errors
run: npx testcafe "chrome:headless" web-app/tests/permissions-5/ --skip-js-errors
all-permissions-6:
name: Permissions Tests Part 6
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -519,17 +519,17 @@ jobs:
- name: Run TestCafe Tests
timeout-minutes: 5
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-6/ --skip-js-errors
run: npx testcafe "chrome:headless" web-app/tests/permissions-6/ --skip-js-errors
all-permissions-7:
name: Permissions Tests Part 7
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -561,17 +561,17 @@ jobs:
- name: Run TestCafe Tests
timeout-minutes: 5
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-7/ --skip-js-errors
run: npx testcafe "chrome:headless" web-app/tests/permissions-7/ --skip-js-errors
all-permissions-8:
name: Permissions Tests Part 8
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -604,63 +604,17 @@ jobs:
- name: Run TestCafe Tests
timeout-minutes: 5
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors
all-permissions-9:
name: Permissions Tests Part 9
needs:
- compile-binary
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
- name: Install MinIO JS
working-directory: ./
continue-on-error: false
run: |
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
path: |
./console
key: ${{ runner.os }}-binary-${{ github.run_id }}
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
make cleanup-permissions
run: npx testcafe "chrome:headless" web-app/tests/permissions-8/ --skip-js-errors
all-permissions-A:
name: Permissions Tests Part A
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -692,7 +646,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-A/ --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/permissions-A/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -702,11 +656,11 @@ jobs:
name: Permissions Tests Part B
needs:
- compile-binary
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -738,7 +692,7 @@ jobs:
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-B/ --skip-js-errors -c 3
run: npx testcafe "chrome:headless" web-app/tests/permissions-B/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -754,8 +708,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -781,8 +735,8 @@ jobs:
path: |
./pkg/coverage/
key: ${{ runner.os }}-coverage-pkg-2-${{ github.run_id }}
test-restapi-on-go:
name: Test Restapi on Go ${{ matrix.go-version }} and ${{ matrix.os }}
test-api-on-go:
name: Test API on Go ${{ matrix.go-version }} and ${{ matrix.os }}
needs:
- lint-job
- ui-assets
@@ -791,8 +745,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -812,12 +766,12 @@ jobs:
make test
- uses: actions/cache@v3
id: coverage-cache-restapi
name: Coverage Cache RestAPI
id: coverage-cache-api
name: Coverage Cache API
with:
path: |
./restapi/coverage/
key: ${{ runner.os }}-coverage-restapi-2-${{ github.run_id }}
./api/coverage/
key: ${{ runner.os }}-coverage-api-2-${{ github.run_id }}
b-integration-tests:
name: Integration Tests with Latest Distributed MinIO
needs:
@@ -830,7 +784,7 @@ jobs:
strategy:
matrix:
go-version: [1.21.x]
go-version: [ 1.21.x ]
steps:
- name: Check out code
@@ -902,10 +856,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install modules
working-directory: ./portal-ui
working-directory: ./web-app
run: yarn
- name: Run tests
working-directory: ./portal-ui
working-directory: ./web-app
run: yarn test
replication:
name: Site Replication Test
@@ -915,11 +869,11 @@ jobs:
- reuse-golang-dependencies
- semgrep-static-code-analysis
- latest-minio
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]
strategy:
matrix:
go-version: [1.21.x]
go-version: [ 1.21.x ]
steps:
- name: Check out code
@@ -994,7 +948,7 @@ jobs:
strategy:
matrix:
go-version: [1.21.x]
go-version: [ 1.21.x ]
steps:
- name: Check out code
@@ -1058,15 +1012,15 @@ jobs:
name: "Coverage Limit Check"
needs:
- b-integration-tests
- test-restapi-on-go
- test-api-on-go
- test-pkg-on-go
- sso-integration
- replication
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -1107,12 +1061,12 @@ jobs:
key: ${{ runner.os }}-replication-coverage-2-${{ github.run_id }}
- uses: actions/cache@v3
id: coverage-cache-restapi
name: Coverage Cache RestAPI
id: coverage-cache-api
name: Coverage Cache API
with:
path: |
./restapi/coverage/
key: ${{ runner.os }}-coverage-restapi-2-${{ github.run_id }}
./api/coverage/
key: ${{ runner.os }}-coverage-api-2-${{ github.run_id }}
- uses: actions/cache@v3
id: coverage-cache-pkg
@@ -1139,7 +1093,7 @@ jobs:
echo "go build gocoverage.go"
go build gocovmerge.go
echo "put together the outs for final coverage resolution"
./gocovmerge ../integration/coverage/system.out ../replication/coverage/replication.out ../sso-integration/coverage/sso-system.out ../restapi/coverage/coverage.out ../pkg/coverage/coverage-pkg.out > all.out
./gocovmerge ../integration/coverage/system.out ../replication/coverage/replication.out ../sso-integration/coverage/sso-system.out ../api/coverage/coverage.out ../pkg/coverage/coverage-pkg.out > all.out
echo "Download mc for Ubuntu"
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
echo "Change the permissions to execute mc command"
@@ -1162,6 +1116,33 @@ jobs:
go tool cover -html=all.out -o coverage.html
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
# save all other coverage
go tool cover -html=../integration/coverage/system.out -o system.html
./mc cp system.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp system.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc cp ../integration/coverage/system.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp ../integration/coverage/system.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=../replication/coverage/replication.out -o replication.html
./mc cp replication.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp replication.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc cp ../replication/coverage/replication.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp ../replication/coverage/replication.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=../sso-integration/coverage/sso-system.out -o sso-system.html
./mc cp sso-system.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp sso-system.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc cp ../sso-integration/coverage/sso-system.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp ../sso-integration/coverage/sso-system.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=../api/coverage/coverage.out -o coverage.html
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc cp ../api/coverage/coverage.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp ../api/coverage/coverage.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=../pkg/coverage/coverage-pkg.out -o coverage-pkg.html
./mc cp coverage-pkg.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp coverage-pkg.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc cp ../pkg/coverage/coverage-pkg.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp ../pkg/coverage/coverage-pkg.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
./mc anonymous set public play/builds
else
echo "Play is down, please report it on hack channel, no coverage is going to be uploaded!!!"
fi
@@ -1169,7 +1150,7 @@ jobs:
go tool cover -func=all.out | grep total > tmp2
result=`cat tmp2 | awk 'END {print $3}'`
result=${result%\%}
threshold=71.3
threshold=65.0
echo "Result:"
echo "$result%"
if (( $(echo "$result >= $threshold" |bc -l) )); then
@@ -1184,8 +1165,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -1196,21 +1177,21 @@ jobs:
with:
node-version: ${{ env.NVMRC }}
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
cache-dependency-path: web-app/yarn.lock
- uses: actions/cache@v3
id: assets-cache-istanbul-coverage
name: Assets Cache Istanbul Coverage
with:
path: |
./portal-ui/build/
./web-app/build/
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
- name: Install Dependencies
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
yarn install --frozen-lockfile --immutable
- name: Check for Warnings in build output
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
./check-warnings-istanbul-coverage.sh
@@ -1225,8 +1206,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -1248,7 +1229,7 @@ jobs:
name: Assets Cache Istanbul Coverage
with:
path: |
./portal-ui/build/
./web-app/build/
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
- name: Build on ${{ matrix.os }}
env:
@@ -1271,7 +1252,7 @@ jobs:
- name: Install dependencies
run: |
echo "Install dependencies"
cd $GITHUB_WORKSPACE/portal-ui
cd $GITHUB_WORKSPACE/web-app
yarn add -D playwright
yarn add -D babel-plugin-istanbul
yarn add -D nyc
@@ -1299,7 +1280,7 @@ jobs:
- name: Run Playwright tests
run: |
echo "Run tests under playwright folder only"
cd $GITHUB_WORKSPACE/portal-ui
cd $GITHUB_WORKSPACE/web-app
yarn remove playwright
yarn add --dev @playwright/test
echo "npx playwright test"

View File

@@ -45,9 +45,9 @@ jobs:
with:
node-version: ${{ env.NVMRC }}
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
cache-dependency-path: web-app/yarn.lock
- name: Checks for known security issues with the installed packages
working-directory: ./portal-ui
working-directory: ./web-app
continue-on-error: false
run: |
yarn audit --groups dependencies

10
.gitignore vendored
View File

@@ -1,12 +1,12 @@
# Playwright Data
portal-ui/storage/
portal-ui/playwright/.auth/admin.json
web-app/storage/
web-app/playwright/.auth/admin.json
# Report from Playwright
portal-ui/playwright-report/
web-app/playwright-report/
# Coverage from Playwright
portal-ui/.nyc_output/
web-app/.nyc_output/
# Binaries for programs and plugins
*.exe
@@ -37,7 +37,7 @@ dist/
# Ignore node_modules
portal-ui/node_modules/
web-app/node_modules/
# Ignore tls cert and key
private.key

View File

@@ -46,4 +46,4 @@ run:
skip-dirs:
- pkg/clientgen
- pkg/apis/networking.gke.io
- restapi/operations
- api/operations

View File

@@ -5,7 +5,7 @@
# Common large paths
node_modules/
portal-ui/node_modules/
web-app/node_modules/
build/
dist/
.idea/

View File

@@ -2,6 +2,27 @@
# Changelog
## Release v0.45.0
Deprecated:
- Deprecated Heal / Drives page
Features:
- Updated tines on menus & pages
Bug Fix:
- Upgraded project dependencies
## Release v0.44.0
Bug Fix:
- Upgraded project dependencies
- Fixed events icons not loading in subpaths
## Release v0.43.1
Bug Fix:

View File

@@ -4,56 +4,80 @@ This is a REST portal server created using [go-swagger](https://github.com/go-sw
The API handlers are created using a YAML definition located in `swagger.YAML`.
To add new api, the YAML file needs to be updated with all the desired apis using the [Swagger Basic Structure](https://swagger.io/docs/specification/2-0/basic-structure/), this includes paths, parameters, definitions, tags, etc.
To add new api, the YAML file needs to be updated with all the desired apis using
the [Swagger Basic Structure](https://swagger.io/docs/specification/2-0/basic-structure/), this includes paths,
parameters, definitions, tags, etc.
## Generate server from YAML
Once the YAML file is ready we can autogenerate the code needed for the new api by just running:
Validate it:
```
swagger validate ./swagger.yml
```
Update server code:
```
make swagger-gen
```
This will update all the necessary code.
`./restapi/configure_console.go` is a file that contains the handlers to be used by the application, here is the only place where we need to update our code to support the new apis. This file is not affected when running the swagger generator and it is safe to edit.
`./api/configure_console.go` is a file that contains the handlers to be used by the application, here is the only place
where we need to update our code to support the new apis. This file is not affected when running the swagger generator
and it is safe to edit.
## Unit Tests
`./restapi/handlers_test.go` needs to be updated with the proper tests for the new api.
`./api/handlers_test.go` needs to be updated with the proper tests for the new api.
To run tests:
```
go test ./restapi
go test ./api
```
## Commit changes
After verification, commit your changes. This is a [great post](https://chris.beams.io/posts/git-commit/) on how to write useful commit messages
After verification, commit your changes. This is a [great post](https://chris.beams.io/posts/git-commit/) on how to
write useful commit messages
```
$ git commit -am 'Add some feature'
```
### Push to the branch
Push your locally committed changes to the remote origin (your fork)
```
$ git push origin my-new-feature
```
### Create a Pull Request
Pull requests can be created via GitHub. Refer to [this document](https://help.github.com/articles/creating-a-pull-request/) for detailed steps on how to create a pull request. After a Pull Request gets peer reviewed and approved, it will be merged.
Pull requests can be created via GitHub. Refer
to [this document](https://help.github.com/articles/creating-a-pull-request/) for detailed steps on how to create a pull
request. After a Pull Request gets peer reviewed and approved, it will be merged.
## FAQs
### How does ``console`` manages dependencies?
``MinIO`` uses `go mod` to manage its dependencies.
- Run `go get foo/bar` in the source folder to add the dependency to `go.mod` file.
To remove a dependency
- Edit your code and remove the import reference.
- Run `go mod tidy` in the source folder to remove dependency from `go.mod` file.
### What are the coding guidelines for console?
``console`` is fully conformant with Golang style. Refer: [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project. If you observe offending code, please feel free to send a pull request or ping us on [Slack](https://slack.min.io).
``console`` is fully conformant with Golang style.
Refer: [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project. If you observe
offending code, please feel free to send a pull request or ping us on [Slack](https://slack.min.io).

View File

@@ -1,15 +1,20 @@
# Developing MinIO Console
The MinIO Console requires the [MinIO Server](https://github.com/minio/minio). For development purposes, you also need to run both the MinIO Console web app and the MinIO Console server.
The MinIO Console requires the [MinIO Server](https://github.com/minio/minio). For development purposes, you also need
to run both the MinIO Console web app and the MinIO Console server.
## Running MinIO Console server
Build the server in the main folder by running:
```
make
```
> Note: If it's the first time running the server, you might need to run `go mod tidy` to ensure you have all modules required.
To start the server run:
> Note: If it's the first time running the server, you might need to run `go mod tidy` to ensure you have all modules
> required.
> To start the server run:
```
CONSOLE_ACCESS_KEY=<your-access-key>
CONSOLE_SECRET_KEY=<your-secret-key>
@@ -19,8 +24,8 @@ CONSOLE_DEV_MODE=on
```
## Running MinIO Console web app
Refer to `/portal-ui` [instructions](/portal-ui/README.md) to run the web app locally.
Refer to `/web-app` [instructions](/web-app/README.md) to run the web app locally.
# Building with MinIO

View File

@@ -3,11 +3,11 @@ FROM node:$NODE_VERSION as uilayer
WORKDIR /app
COPY ./portal-ui/package.json ./
COPY ./portal-ui/yarn.lock ./
COPY ./web-app/package.json ./
COPY ./web-app/yarn.lock ./
RUN yarn install
COPY ./portal-ui .
COPY ./web-app .
RUN make build-static
@@ -29,7 +29,7 @@ WORKDIR /go/src/github.com/minio/console/
ENV CGO_ENABLED=0
COPY --from=uilayer /app/build /go/src/github.com/minio/console/portal-ui/build
COPY --from=uilayer /app/build /go/src/github.com/minio/console/web-app/build
RUN go build --tags=kqueue,operator -ldflags "-w -s" -a -o console ./cmd/console
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7

View File

@@ -3,11 +3,11 @@ FROM node:$NODE_VERSION as uilayer
WORKDIR /app
COPY ./portal-ui/package.json ./
COPY ./portal-ui/yarn.lock ./
COPY ./web-app/package.json ./
COPY ./web-app/yarn.lock ./
RUN yarn install
COPY ./portal-ui .
COPY ./web-app .
RUN yarn install && make build-static

View File

@@ -48,19 +48,19 @@ apply-gofmt:
clean-swagger:
@echo "cleaning"
@rm -rf models
@rm -rf restapi/operations
@rm -rf api/operations
swagger-console:
@echo "Generating swagger server code from yaml"
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
@swagger generate server -A console --main-package=management --server-package=api --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
@echo "Generating typescript api"
@npx swagger-typescript-api -p ./swagger.yml -o ./portal-ui/src/api -n consoleApi.ts
@git restore restapi/server.go
@npx swagger-typescript-api -p ./swagger.yml -o ./web-app/src/api -n consoleApi.ts
@git restore api/server.go
assets:
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
cd web-app; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
test-integration:
@(docker stop pgsqlcontainer || true)
@@ -78,7 +78,7 @@ test-integration:
@echo "Postgres"
@(docker run --net=mynet123 --ip=173.18.0.4 --name pgsqlcontainer --rm -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres && sleep 5)
@echo "execute test and get coverage for test-integration:"
@(cd integration && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && ./integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/system.out)
@(cd integration && go test -coverpkg=../api -c -tags testrunmain . && mkdir -p coverage && ./integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/system.out)
@(docker stop pgsqlcontainer)
@(docker stop minio)
@(docker stop minio2)
@@ -126,7 +126,7 @@ test-replication:
$(MINIO_VERSION) server /data{1...4} \
--address :9002 \
--console-address :6002)
@(cd replication && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && ./replication.test -test.v -test.run "^Test*" -test.coverprofile=coverage/replication.out)
@(cd replication && go test -coverpkg=../api -c -tags testrunmain . && mkdir -p coverage && ./replication.test -test.v -test.run "^Test*" -test.coverprofile=coverage/replication.out)
@(docker stop minio || true)
@(docker stop minio1 || true)
@(docker stop minio2 || true)
@@ -180,45 +180,45 @@ test-sso-integration:
@echo "add python module"
@(pip3 install bs4)
@echo "Executing the test:"
@(cd sso-integration && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && ./sso-integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/sso-system.out)
@(cd sso-integration && go test -coverpkg=../api -c -tags testrunmain . && mkdir -p coverage && ./sso-integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/sso-system.out)
test-permissions-1:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-1/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-1/")
@(docker stop minio)
test-permissions-2:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-2/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-2/")
@(docker stop minio)
test-permissions-3:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-3/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-3/")
@(docker stop minio)
test-permissions-4:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-4/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-4/")
@(docker stop minio)
test-permissions-5:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-5/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-5/")
@(docker stop minio)
test-permissions-6:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-6/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-6/")
@(docker stop minio)
test-permissions-7:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-7/")
@(env bash $(PWD)/web-app/tests/scripts/permissions.sh "web-app/tests/permissions-7/")
@(docker stop minio)
test-apply-permissions:
@(env bash $(PWD)/portal-ui/tests/scripts/initialize-env.sh)
@(env bash $(PWD)/web-app/tests/scripts/initialize-env.sh)
test-start-docker-minio:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@@ -227,7 +227,7 @@ initialize-permissions: test-start-docker-minio test-apply-permissions
@echo "Done initializing permissions test"
cleanup-permissions:
@(env bash $(PWD)/portal-ui/tests/scripts/cleanup-env.sh)
@(env bash $(PWD)/web-app/tests/scripts/cleanup-env.sh)
@(docker stop minio)
initialize-docker-network:
@@ -246,7 +246,7 @@ test-start-docker-nginx-w-subpath:
--network host \
-d --rm \
--add-host=host.docker.internal:host-gateway \
-v ./portal-ui/tests/subpath-nginx/nginx.conf:/etc/nginx/nginx.conf \
-v ./web-app/tests/subpath-nginx/nginx.conf:/etc/nginx/nginx.conf \
--name test-nginx nginx)
test-initialize-minio-nginx: test-start-docker-minio-w-redirect-url test-start-docker-nginx-w-subpath
@@ -254,17 +254,23 @@ test-initialize-minio-nginx: test-start-docker-minio-w-redirect-url test-start-d
cleanup-minio-nginx:
@(docker stop minio test-nginx & docker network rm test-network)
# https://stackoverflow.com/questions/19200235/golang-tests-in-sub-directory
# Note: go test ./... will run tests on the current folder and all subfolders.
# This is needed because tests can be in the folder or sub-folder(s), let's include them all please!.
test:
@echo "execute test and get coverage"
@(cd restapi && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage.out)
@(cd api && mkdir -p coverage && GO111MODULE=on go test ./... -test.v -coverprofile=coverage/coverage.out)
# https://stackoverflow.com/questions/19200235/golang-tests-in-sub-directory
# Note: go test ./... will run tests on the current folder and all subfolders.
# This is since tests in pkg folder are in subfolders and were not executed.
test-pkg:
@echo "execute test and get coverage"
@(cd pkg && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage-pkg.out)
@(cd pkg && mkdir -p coverage && GO111MODULE=on go test ./... -test.v -coverprofile=coverage/coverage-pkg.out)
coverage:
@(GO111MODULE=on go test -v -coverprofile=coverage.out github.com/minio/console/restapi/... && go tool cover -html=coverage.out && open coverage.html)
@(GO111MODULE=on go test -v -coverprofile=coverage.out github.com/minio/console/api/... && go tool cover -html=coverage.out && open coverage.html)
clean:
@echo "Cleaning up all the generated files"
@@ -279,4 +285,4 @@ release: swagger-gen
@echo "Generating Release: $(RELEASE)"
@make assets
@git add -u .
@git add portal-ui/build/
@git add web-app/build/

View File

@@ -14,16 +14,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
systemApi "github.com/minio/console/restapi/operations/system"
systemApi "github.com/minio/console/api/operations/system"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
)
func registerAdminArnsHandlers(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -25,11 +25,11 @@ import (
"testing"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations/system"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations/system"
"github.com/go-openapi/loads"
"github.com/minio/console/restapi/operations"
"github.com/minio/console/api/operations"
"github.com/minio/madmin-go/v3"
asrt "github.com/stretchr/testify/assert"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -24,11 +24,11 @@ import (
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/swag"
"github.com/minio/console/api/operations"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
madmin "github.com/minio/madmin-go/v3"
cfgApi "github.com/minio/console/restapi/operations/configuration"
cfgApi "github.com/minio/console/api/operations/configuration"
)
func registerConfigHandlers(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,18 +14,18 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
"github.com/minio/console/pkg/utils"
"github.com/minio/console/restapi/operations"
"github.com/minio/madmin-go/v3"
groupApi "github.com/minio/console/restapi/operations/group"
groupApi "github.com/minio/console/api/operations/group"
"github.com/minio/console/models"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
import (
"context"
@@ -23,9 +23,9 @@ import (
"time"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
"github.com/minio/console/api/operations/idp"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
"github.com/minio/console/restapi/operations/idp"
"github.com/minio/madmin-go/v3"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -27,9 +27,9 @@ import (
"github.com/minio/madmin-go/v3"
"github.com/minio/console/api/operations"
"github.com/minio/console/api/operations/idp"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
"github.com/minio/console/restapi/operations/idp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -31,9 +31,9 @@ import (
"github.com/minio/console/pkg/utils"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
systemApi "github.com/minio/console/api/operations/system"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
systemApi "github.com/minio/console/restapi/operations/system"
)
func registerAdminInfoHandlers(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -25,9 +25,9 @@ import (
"github.com/minio/console/pkg/utils"
"github.com/minio/console/api/operations"
systemApi "github.com/minio/console/api/operations/system"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
systemApi "github.com/minio/console/restapi/operations/system"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"encoding/base64"
@@ -26,9 +26,9 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
inspectApi "github.com/minio/console/api/operations/inspect"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
inspectApi "github.com/minio/console/restapi/operations/inspect"
"github.com/minio/madmin-go/v3"
"github.com/secure-io/sio-go"
)

View File

@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
import (
"context"
@@ -23,9 +23,9 @@ import (
"sort"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
kmsAPI "github.com/minio/console/api/operations/k_m_s"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
kmsAPI "github.com/minio/console/restapi/operations/k_m_s"
"github.com/minio/madmin-go/v3"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -23,9 +23,9 @@ import (
"os"
"testing"
"github.com/minio/console/api/operations"
kmsAPI "github.com/minio/console/api/operations/k_m_s"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
kmsAPI "github.com/minio/console/restapi/operations/k_m_s"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

View File

@@ -14,15 +14,15 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
systemApi "github.com/minio/console/api/operations/system"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
systemApi "github.com/minio/console/restapi/operations/system"
)
func registerNodesHandler(api *operations.ConsoleAPI) {

View File

@@ -14,16 +14,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"errors"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
configurationApi "github.com/minio/console/api/operations/configuration"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
configurationApi "github.com/minio/console/restapi/operations/configuration"
)
func registerAdminNotificationEndpointsHandlers(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -24,8 +24,8 @@ import (
"github.com/go-openapi/swag"
cfgApi "github.com/minio/console/api/operations/configuration"
"github.com/minio/console/models"
cfgApi "github.com/minio/console/restapi/operations/configuration"
)
func Test_addNotificationEndpoint(t *testing.T) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"
@@ -24,17 +24,17 @@ import (
"sort"
"strings"
bucketApi "github.com/minio/console/api/operations/bucket"
policyApi "github.com/minio/console/api/operations/policy"
"github.com/minio/console/pkg/utils"
bucketApi "github.com/minio/console/restapi/operations/bucket"
policyApi "github.com/minio/console/restapi/operations/policy"
s3 "github.com/minio/minio-go/v7"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
iampolicy "github.com/minio/pkg/v2/policy"
policies "github.com/minio/console/restapi/policy"
policies "github.com/minio/console/api/policy"
)
func registersPoliciesHandler(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -27,9 +27,9 @@ import (
"github.com/minio/console/pkg/utils"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
release "github.com/minio/console/api/operations/release"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
release "github.com/minio/console/restapi/operations/release"
"github.com/minio/pkg/v2/env"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"encoding/json"
@@ -24,9 +24,9 @@ import (
"os"
"testing"
"github.com/minio/console/api/operations"
release "github.com/minio/console/api/operations/release"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
release "github.com/minio/console/restapi/operations/release"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -30,9 +30,9 @@ import (
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/swag"
"github.com/minio/console/api/operations"
bucketApi "github.com/minio/console/api/operations/bucket"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
bucketApi "github.com/minio/console/restapi/operations/bucket"
"github.com/minio/minio-go/v7/pkg/replication"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -27,9 +27,9 @@ import (
"github.com/minio/console/pkg/utils"
"github.com/go-openapi/swag"
"github.com/minio/console/api/operations"
bucketApi "github.com/minio/console/api/operations/bucket"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
bucketApi "github.com/minio/console/restapi/operations/bucket"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"

View File

@@ -14,15 +14,15 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
siteRepApi "github.com/minio/console/api/operations/site_replication"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
siteRepApi "github.com/minio/console/restapi/operations/site_replication"
"github.com/minio/madmin-go/v3"
)

View File

@@ -14,17 +14,17 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"time"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
svcApi "github.com/minio/console/restapi/operations/service"
svcApi "github.com/minio/console/api/operations/service"
)
func registerServiceHandlers(api *operations.ConsoleAPI) {

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,15 +14,15 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
siteRepApi "github.com/minio/console/api/operations/site_replication"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
siteRepApi "github.com/minio/console/restapi/operations/site_replication"
"github.com/minio/madmin-go/v3"
)

View File

@@ -16,7 +16,7 @@
// These tests are for AdminAPI Tag based on swagger-console.yml
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
import (
"context"
@@ -30,10 +30,10 @@ import (
xhttp "github.com/minio/console/pkg/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
subnetApi "github.com/minio/console/api/operations/subnet"
"github.com/minio/console/models"
"github.com/minio/console/pkg/subnet"
"github.com/minio/console/restapi/operations"
subnetApi "github.com/minio/console/restapi/operations/subnet"
"github.com/minio/madmin-go/v3"
)
@@ -356,7 +356,7 @@ func GetSubnetInfoResponse(session *models.Principal, params subnetApi.SubnetInf
return nil, ErrorWithContext(ctx, ErrSubnetLicenseNotFound)
}
licenseInfo, err := subnet.ParseLicense(client, seededLicense)
licenseInfo, err := getLicenseInfo(*client.Client, seededLicense)
if err != nil {
return nil, ErrorWithContext(ctx, err)
}

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -24,9 +24,9 @@ import (
"os"
"testing"
"github.com/minio/console/api/operations"
subnetApi "github.com/minio/console/api/operations/subnet"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
subnetApi "github.com/minio/console/restapi/operations/subnet"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -23,9 +23,9 @@ import (
"github.com/dustin/go-humanize"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
tieringApi "github.com/minio/console/api/operations/tiering"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
tieringApi "github.com/minio/console/restapi/operations/tiering"
"github.com/minio/madmin-go/v3"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -22,8 +22,8 @@ import (
"fmt"
"testing"
tieringApi "github.com/minio/console/api/operations/tiering"
"github.com/minio/console/models"
tieringApi "github.com/minio/console/restapi/operations/tiering"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/assert"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"
@@ -26,11 +26,11 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/api/operations"
accountApi "github.com/minio/console/api/operations/account"
bucketApi "github.com/minio/console/api/operations/bucket"
userApi "github.com/minio/console/api/operations/user"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
accountApi "github.com/minio/console/restapi/operations/account"
bucketApi "github.com/minio/console/restapi/operations/bucket"
userApi "github.com/minio/console/restapi/operations/user"
"github.com/minio/madmin-go/v3"
iampolicy "github.com/minio/pkg/v2/policy"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"bytes"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import "testing"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"crypto/x509"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"os"

View File

@@ -16,7 +16,7 @@
// This file is safe to edit. Once it exists it will not be overwritten
package restapi
package api
import (
"bytes"
@@ -43,16 +43,16 @@ import (
"github.com/klauspost/compress/gzhttp"
portal_ui "github.com/minio/console/portal-ui"
portal_ui "github.com/minio/console/web-app"
"github.com/minio/pkg/v2/env"
"github.com/minio/pkg/v2/mimedb"
xnet "github.com/minio/pkg/v2/net"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/minio/console/api/operations"
"github.com/minio/console/models"
"github.com/minio/console/pkg/auth"
"github.com/minio/console/restapi/operations"
"github.com/unrolled/secure"
)

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"os"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
// list of all console environment constants
const (

View File

@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
import (
"context"
@@ -39,7 +39,7 @@ import (
flags "github.com/jessevdk/go-flags"
"golang.org/x/net/netutil"
"github.com/minio/console/restapi/operations"
"github.com/minio/console/api/operations"
)
const (

View File

@@ -16,7 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Package restapi MinIO Console Server
// Package api MinIO Console Server
//
// Schemes:
// http
@@ -35,4 +35,4 @@
// - application/json
//
// swagger:meta
package restapi
package api

View File

@@ -17,7 +17,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"context"

View File

@@ -14,12 +14,14 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"net/http"
"os"
"github.com/minio/console/pkg/subnet"
"github.com/minio/pkg/v2/licverifier"
"github.com/minio/pkg/v2/subnet"
)
type SubnetPlan int
@@ -43,8 +45,18 @@ func (sp SubnetPlan) String() string {
var InstanceLicensePlan = PlanAGPL
func getLicenseInfo(client http.Client, license string) (*licverifier.LicenseInfo, error) {
lv := subnet.LicenseValidator{
Client: client,
ExpiryGracePeriod: 0,
}
lv.Init(getConsoleDevMode())
return lv.ParseLicense(license)
}
func fetchLicensePlan() {
licenseInfo, err := subnet.ParseLicense(GetConsoleHTTPClient("", "127.0.0.1"), os.Getenv(EnvSubnetLicense))
client := GetConsoleHTTPClient("", "127.0.0.1")
licenseInfo, err := getLicenseInfo(*client, os.Getenv(EnvSubnetLicense))
if err != nil {
return
}

View File

@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package restapi
package api
import (
"context"
@@ -58,7 +58,7 @@ type Context struct {
TLSCertificate, TLSKey, TLSca string
}
// Load loads restapi Context from command line context.
// Load loads api Context from command line context.
func (c *Context) Load(ctx *cli.Context) error {
*c = Context{
Host: ctx.String("host"),

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package restapi
package api
import (
"flag"

Some files were not shown because too many files have changed in this diff Show More