-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit acb9a11
Showing
14 changed files
with
1,171 additions
and
0 deletions.
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,4 @@ | ||
node_modules/ | ||
.git/ | ||
dist/ | ||
.env |
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 @@ | ||
POSTGRES_HOST= | ||
POSTGRES_DATABASE= | ||
POSTGRES_USER= | ||
POSTGRES_PASSWORD= | ||
POSTGRES_PORT= | ||
REPOV1_PATH= | ||
REPOV2_PATH= |
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,3 @@ | ||
dist | ||
node_modules | ||
.env |
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 @@ | ||
# Changelog for `stats-gen` | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## sourcify-stats@1.0.0 - 2024-08-01 | ||
|
||
No changes this release. This marks the start of the changelog for this service |
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,8 @@ | ||
FROM node:22-alpine | ||
WORKDIR /app | ||
COPY * ./ | ||
RUN npm install | ||
COPY . . | ||
RUN npm run build | ||
EXPOSE 3000 | ||
CMD ["npm", "start"] |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,49 @@ | ||
# stats-gen | ||
|
||
Service to generate sourcify chain stats | ||
|
||
## Env variables | ||
|
||
- **POSTGRES_HOST:** Database host | ||
- **POSTGRES_DATABASE:** Database name | ||
- **POSTGRES_USER:** Database user | ||
- **POSTGRES_PASSWORD:** Database password | ||
- **POSTGRES_PORT:** Database port | ||
- **REPOV1_PATH:** Path to repositoryV1 | ||
- **REPOV2_PATH:** Path to repositoryV2 | ||
|
||
## Running locally | ||
|
||
1. Copy .env.template to .env and fill values | ||
|
||
2. Install dependencies | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
3. Build | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
4. Run | ||
|
||
``` | ||
npm start | ||
``` | ||
|
||
## Running locally with Docker | ||
|
||
1. Build image | ||
|
||
``` | ||
docker build -t statsgen . | ||
``` | ||
|
||
2. Run container | ||
|
||
``` | ||
docker run -v /path/to/sourcify/repositories:/repositories -e POSTGRES_HOST=host.docker.internal -e POSTGRES_DATABASE=sourcify-staging -e POSTGRES_USER=xxxxx -e POSTGRES_PASSWORD=xxxxx -e POSTGRES_PORT=5432 -e REPOV1_PATH=/repositories/repoV1 -e REPOV2_PATH=/repositories/repoV2 statsgen | ||
``` |
Oops, something went wrong.