Skip to content

Commit 9098890

Browse files
authored
Merge branch 'main' into 907
2 parents 61b2278 + 0a754c8 commit 9098890

File tree

102 files changed

+10328
-2437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+10328
-2437
lines changed

.github/scripts/auto_fix.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
3+
import openai
4+
5+
# Load OpenAI API Key
6+
openai.api_key = os.getenv("OPENAI_API_KEY")
7+
8+
# Read Issue Body from GitHub
9+
issue_body = os.getenv("ISSUE_BODY", "No issue details provided.")
10+
11+
# AI Prompt to Generate Code Fix
12+
prompt = f"""
13+
Sentry reported an issue:
14+
{issue_body}
15+
16+
Provide a concise fix in Python.
17+
"""
18+
19+
# Get AI-Generated Fix using the new API format
20+
response = openai.ChatCompletion.create(
21+
model="gpt-4",
22+
messages=[
23+
{
24+
"role": "system",
25+
"content": "You are an experienced software engineer. Provide a concise and effective bug fix.",
26+
},
27+
{"role": "user", "content": prompt},
28+
],
29+
)
30+
31+
# Extract the AI-generated fix
32+
fix_code = response.choices[0].message.content
33+
34+
# Write Fix to a File (Example: Modify `app.py`)
35+
with open("app.py", "a") as f:
36+
f.write("\n# Auto-Fix by AI\n")
37+
f.write(fix_code + "\n")
38+
39+
print("Fix generated and written to app.py")

.github/workflows/assign-issues.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Auto Assign
1+
name: OWASP BLT Action
22

33
on:
44
issue_comment:
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
issues: write
1515
steps:
16-
- name: Assign Issues
16+
- name: OWASP BLT Action
1717
uses: OWASP-BLT/BLT-Action@main
1818
with:
1919
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-cd.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -80,72 +80,6 @@ jobs:
8080
- name: Print memory usage
8181
run: free -h
8282

83-
code-ql:
84-
name: Run CodeQL
85-
needs: setup
86-
runs-on: ubuntu-latest
87-
permissions:
88-
security-events: write
89-
actions: read
90-
contents: read
91-
steps:
92-
- uses: actions/checkout@v4
93-
with:
94-
fetch-depth: 2
95-
96-
- name: Detect file changes
97-
id: changes
98-
uses: dorny/paths-filter@v2
99-
with:
100-
filters: |
101-
python:
102-
- '**/*.py'
103-
- 'requirements.txt'
104-
- 'poetry.lock'
105-
- 'pyproject.toml'
106-
javascript:
107-
- '**/*.js'
108-
- '**/*.jsx'
109-
- '**/*.ts'
110-
- '**/*.tsx'
111-
- 'package.json'
112-
- 'yarn.lock'
113-
114-
- name: Set languages matrix
115-
id: set-matrix
116-
run: |
117-
languages=""
118-
if [[ "${{ steps.changes.outputs.python }}" == "true" ]]; then
119-
languages="python"
120-
fi
121-
if [[ "${{ steps.changes.outputs.javascript }}" == "true" ]]; then
122-
if [[ -n "$languages" ]]; then
123-
languages="$languages,javascript"
124-
else
125-
languages="javascript"
126-
fi
127-
fi
128-
if [[ -z "$languages" ]]; then
129-
echo "No relevant file changes detected, skipping CodeQL"
130-
exit 0
131-
fi
132-
echo "languages=$languages" >> $GITHUB_OUTPUT
133-
134-
- uses: github/codeql-action/init@v3
135-
if: ${{ steps.set-matrix.outputs.languages != '' }}
136-
with:
137-
languages: ${{ steps.set-matrix.outputs.languages }}
138-
139-
- uses: github/codeql-action/autobuild@v3
140-
if: ${{ steps.set-matrix.outputs.languages != '' }}
141-
142-
- uses: github/codeql-action/analyze@v3
143-
if: ${{ steps.set-matrix.outputs.languages != '' }}
144-
with:
145-
category: "/language:${{ matrix.language }}"
146-
147-
- name: Print memory usage
148-
run: free -h
14983

15084
test:
15185
name: Run Tests

.github/workflows/codeql.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '15 15 * * 5'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: javascript-typescript
47+
build-mode: none
48+
- language: python
49+
build-mode: none
50+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
67+
68+
# Initializes the CodeQL tools for scanning.
69+
- name: Initialize CodeQL
70+
uses: github/codeql-action/init@v3
71+
with:
72+
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
74+
# If you wish to specify custom queries, you can do so here or in a config file.
75+
# By default, queries listed here will override any specified in a config file.
76+
# Prefix the list here with "+" to use these queries and those in the config file.
77+
78+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79+
# queries: security-extended,security-and-quality
80+
81+
# If the analyze step fails for one of the languages you are analyzing with
82+
# "We were unable to automatically build your code", modify the matrix above
83+
# to set the build mode to "manual" for that language. Then modify this step
84+
# to build your code.
85+
# ℹ️ Command-line programs to run using the OS shell.
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87+
- if: matrix.build-mode == 'manual'
88+
shell: bash
89+
run: |
90+
echo 'If you are using a "manual" build mode for one or more of the' \
91+
'languages you are analyzing, replace this with the commands to build' \
92+
'your code, for example:'
93+
echo ' make bootstrap'
94+
echo ' make release'
95+
exit 1
96+
97+
- name: Perform CodeQL Analysis
98+
uses: github/codeql-action/analyze@v3
99+
with:
100+
category: "/language:${{matrix.language}}"

.github/workflows/qodo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
pull_request:
3-
types: [opened, reopened, ready_for_review]
3+
types: [opened, reopened, ready_for_review, synchronize, edited]
44
issue_comment:
55
jobs:
66
pr_agent_job:

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ repos:
3636

3737
- repo: local
3838
hooks:
39+
- id: django-collectstatic
40+
name: Django Collect Static
41+
entry: bash -c 'if [ -z "$GITHUB_ACTIONS" ]; then poetry run python manage.py collectstatic --noinput; fi'
42+
language: system
43+
types: [python]
44+
pass_filenames: false
45+
always_run: true
46+
verbose: true
3947
- id: django-test
4048
name: Django Tests
4149
entry: bash -c 'if [ -z "$GITHUB_ACTIONS" ]; then poetry run python manage.py test --failfast; fi'
@@ -45,4 +53,5 @@ repos:
4553
always_run: true
4654
verbose: true
4755

56+
4857
fail_fast: true

BACON/ord-api.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

BACON/ord-server/.env.example

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Ordinal CLI Path
2+
ORD_PATH=/usr/local/bin/ord
3+
4+
# Temporary YAML File Path
5+
YAML_FILE_PATH=/blockchain/ord-flask-server/tmp-batch.yaml
6+
7+
# Mainnet Bitcoin RPC Configuration
8+
BITCOIN_RPC_USER_MAINNET=bitcoin_mainnet
9+
BITCOIN_RPC_PASSWORD_MAINNET=password_mainnet
10+
BITCOIN_RPC_URL_MAINNET=http://bitcoin-node-ip:8332
11+
12+
# Regtest Bitcoin RPC Configuration
13+
BITCOIN_RPC_USER_REGTEST=bitcoin_regtest
14+
BITCOIN_RPC_PASSWORD_REGTEST=password_regtest
15+
BITCOIN_RPC_URL_REGTEST=http://regtest-node-ip:18443
16+
17+
# Ordinal Server URLs
18+
ORD_SERVER_URL_MAINNET=http://ord-server-ip:9003
19+
ORD_SERVER_URL_REGTEST=http://regtest-server-ip:9001
20+
21+
# Wallet Configs
22+
WALLET_NAME_MAINNET=master-wallet
23+
WALLET_NAME_REGTEST=regtest-wallet
24+
WALLET_ADDRESS_REGTEST=bcrt1
25+
26+
# Flask Server Port
27+
FLASK_PORT=9002

BACON/example-split.yaml renamed to BACON/ord-server/example-split.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
# value: output bitcoin value (optional, defaults to minimal-non dust value for `address`)
66
# runes: output rune value map (values respect rune divisibility)
77
outputs:
8-
- address: bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297
9-
value: 10 sat
10-
runes:
11-
UNCOMMON•GOODS: 1234
12-
GRIEF•WAGE: 5000000
13-
- address: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
8+
9+
- address: bcrt1pvn4u72tm3c6jzg2ea6h0ldhvlr60mzfnlrn587el82ug4lasrdwqvqgrst
1410
runes:
15-
HELLO•WORLD: 22.5
11+
BLT•BACON•TOKENS: 1

BACON/regtest/regtest.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ User=bitcoin
66
Group=bitcoin
77
WorkingDirectory=/blockchain/regtest/data
88
Type=simple
9-
ExecStart=/opt/bitcoin/28.0/bin/bitcoind -conf=/blockchain/regtest/data/bitcoin.conf
9+
ExecStart=/opt/bitcoin/28.1/bin/bitcoind -conf=/blockchain/regtest/data/bitcoin.conf
1010

1111
[Install]
1212
WantedBy=multi-user.target

0 commit comments

Comments
 (0)