some arrangements
- removed search_index - initial POC for release creatiom - rearranged notes (temporarily)
This commit is contained in:
parent
79b8e5114d
commit
7b01123159
|
|
@ -1,12 +1,6 @@
|
||||||
name: Build and Push Docker Image to GHCR
|
name: Build and Push Docker Image to GHCR
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- closed
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
|
|
@ -18,19 +12,16 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
# Only run if PR was merged (not just closed) or if triggered by tag/manual
|
|
||||||
if: |
|
|
||||||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
|
|
||||||
github.event_name == 'push' ||
|
|
||||||
github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Fetch all history for release notes
|
||||||
|
|
||||||
- name: Set up QEMU for multi-architecture builds
|
- name: Set up QEMU for multi-architecture builds
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
@ -73,3 +64,70 @@ jobs:
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo "Image pushed with digest ${{ steps.build-push.outputs.digest }}"
|
run: echo "Image pushed with digest ${{ steps.build-push.outputs.digest }}"
|
||||||
|
|
||||||
|
- name: Generate release notes
|
||||||
|
id: release_notes
|
||||||
|
run: |
|
||||||
|
# Get the previous tag
|
||||||
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
# Generate commit log - extract PR descriptions from merge commits
|
||||||
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
|
# First release, get only merge commits (PR merges)
|
||||||
|
RAW_COMMITS=$(git log --merges --pretty=format:"%s|||%b|||%h" --first-parent)
|
||||||
|
else
|
||||||
|
# Get merge commits since last tag
|
||||||
|
RAW_COMMITS=$(git log ${PREVIOUS_TAG}..HEAD --merges --pretty=format:"%s|||%b|||%h" --first-parent)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Process commits to extract meaningful messages
|
||||||
|
COMMITS=""
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [ -n "$line" ]; then
|
||||||
|
SUBJECT=$(echo "$line" | cut -d'|' -f1)
|
||||||
|
BODY=$(echo "$line" | cut -d'|' -f4 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
HASH=$(echo "$line" | cut -d'|' -f7)
|
||||||
|
|
||||||
|
# If body exists and is not empty, use it; otherwise use subject
|
||||||
|
if [ -n "$BODY" ] && [ "$BODY" != "" ]; then
|
||||||
|
# Capitalize first letter of body
|
||||||
|
MESSAGE=$(echo "$BODY" | sed 's/^./\U&/')
|
||||||
|
COMMITS="${COMMITS}- ${MESSAGE} (${HASH})"$'\n'
|
||||||
|
else
|
||||||
|
COMMITS="${COMMITS}- ${SUBJECT} (${HASH})"$'\n'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done <<< "$RAW_COMMITS"
|
||||||
|
|
||||||
|
# Create release notes
|
||||||
|
echo "## What's Changed" > release_notes.md
|
||||||
|
echo "" >> release_notes.md
|
||||||
|
if [ -z "$COMMITS" ]; then
|
||||||
|
echo "- Minor updates and improvements" >> release_notes.md
|
||||||
|
else
|
||||||
|
echo "$COMMITS" >> release_notes.md
|
||||||
|
fi
|
||||||
|
echo "" >> release_notes.md
|
||||||
|
echo "## Docker Images" >> release_notes.md
|
||||||
|
echo "" >> release_notes.md
|
||||||
|
echo "This release is available as a Docker image:" >> release_notes.md
|
||||||
|
echo '```bash' >> release_notes.md
|
||||||
|
echo "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF_NAME#v}" >> release_notes.md
|
||||||
|
echo '```' >> release_notes.md
|
||||||
|
echo "" >> release_notes.md
|
||||||
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
|
echo "**Full Changelog**: https://github.com/${{ github.repository }}/commits/${GITHUB_REF_NAME}" >> release_notes.md
|
||||||
|
else
|
||||||
|
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${GITHUB_REF_NAME}" >> release_notes.md
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat release_notes.md
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
body_path: release_notes.md
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ COPY plugins ./plugins
|
||||||
COPY themes ./themes
|
COPY themes ./themes
|
||||||
COPY generate_password.py .
|
COPY generate_password.py .
|
||||||
|
|
||||||
# Create data directories
|
# Create data directory
|
||||||
RUN mkdir -p data/notes data/search_index
|
RUN mkdir -p data
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ Use the pre-built image directly from GHCR - no building required!
|
||||||
> # Now you have everything - run docker-compose below
|
> # Now you have everything - run docker-compose below
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
> **🔐 Security Note**: Authentication is **enabled by default** with password `admin`. For testing/local use, this is fine. If exposing to a network, **change the password immediately** - see [AUTHENTICATION.md](data/notes/AUTHENTICATION.md) for instructions.
|
> **🔐 Security Note**: Authentication is **enabled by default** with password `admin`. For testing/local use, this is fine. If exposing to a network, **change the password immediately** - see [AUTHENTICATION.md](data/AUTHENTICATION.md) for instructions.
|
||||||
|
|
||||||
**Option 1: Docker Compose (Recommended)**
|
**Option 1: Docker Compose (Recommended)**
|
||||||
|
|
||||||
|
|
@ -98,6 +98,7 @@ curl -O https://raw.githubusercontent.com/gamosoft/notediscovery/main/docker-com
|
||||||
docker-compose -f docker-compose.ghcr.yml up -d
|
docker-compose -f docker-compose.ghcr.yml up -d
|
||||||
|
|
||||||
# Access at http://localhost:8000
|
# Access at http://localhost:8000
|
||||||
|
# Login with default password: admin
|
||||||
|
|
||||||
# View logs
|
# View logs
|
||||||
docker-compose -f docker-compose.ghcr.yml logs -f
|
docker-compose -f docker-compose.ghcr.yml logs -f
|
||||||
|
|
@ -207,7 +208,7 @@ Once you've started NoteDiscovery, you'll find comprehensive guides on:
|
||||||
- 🌐 **API.md** - REST API documentation and examples
|
- 🌐 **API.md** - REST API documentation and examples
|
||||||
- 🔐 **AUTHENTICATION.md** - Enable password protection for your instance
|
- 🔐 **AUTHENTICATION.md** - Enable password protection for your instance
|
||||||
|
|
||||||
**Can't wait to start the app?** Browse the documentation notes directly on GitHub in the [`data/notes/`](data/notes/) folder!
|
**Can't wait to start the app?** Browse the documentation notes directly on GitHub in the [`data/`](data/) folder!
|
||||||
|
|
||||||
💡 **Tip:** These documentation files are regular markdown notes—edit them, add your own notes, or use them as templates. It's your knowledge base!
|
💡 **Tip:** These documentation files are regular markdown notes—edit them, add your own notes, or use them as templates. It's your knowledge base!
|
||||||
|
|
||||||
|
|
@ -228,14 +229,14 @@ NoteDiscovery is designed for **self-hosted, private use**. Please keep these se
|
||||||
### Authentication
|
### Authentication
|
||||||
- **Password protection is ENABLED by default** with password: `admin`
|
- **Password protection is ENABLED by default** with password: `admin`
|
||||||
- ⚠️ **CHANGE THE DEFAULT PASSWORD IMMEDIATELY** if exposing to a network!
|
- ⚠️ **CHANGE THE DEFAULT PASSWORD IMMEDIATELY** if exposing to a network!
|
||||||
- See **[AUTHENTICATION.md](data/notes/AUTHENTICATION.md)** for complete setup instructions
|
- See **[AUTHENTICATION.md](data/AUTHENTICATION.md)** for complete setup instructions
|
||||||
- To disable auth, set `security.enabled: false` in `config.yaml`
|
- To disable auth, set `security.enabled: false` in `config.yaml`
|
||||||
- Change password with Docker: `docker-compose exec notediscovery python generate_password.py`
|
- Change password with Docker: `docker-compose exec notediscovery python generate_password.py`
|
||||||
- Perfect for single-user or small team deployments
|
- Perfect for single-user or small team deployments
|
||||||
- For multi-user setups, consider a reverse proxy with OAuth/SSO
|
- For multi-user setups, consider a reverse proxy with OAuth/SSO
|
||||||
|
|
||||||
### Data Privacy
|
### Data Privacy
|
||||||
- Your notes are stored as **plain text markdown files** in `data/notes/`
|
- Your notes are stored as **plain text markdown files** in `data/`
|
||||||
- No data is sent to external services
|
- No data is sent to external services
|
||||||
- Regular backups are recommended
|
- Regular backups are recommended
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ def ensure_directories(config: dict):
|
||||||
config['storage']['notes_dir'],
|
config['storage']['notes_dir'],
|
||||||
config['storage']['plugins_dir'],
|
config['storage']['plugins_dir'],
|
||||||
]
|
]
|
||||||
if config['search']['enabled']:
|
|
||||||
dirs.append(config['search']['index_dir'])
|
|
||||||
|
|
||||||
for dir_path in dirs:
|
for dir_path in dirs:
|
||||||
Path(dir_path).mkdir(parents=True, exist_ok=True)
|
Path(dir_path).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,11 @@ server:
|
||||||
reload: false # Set to true for development
|
reload: false # Set to true for development
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
notes_dir: "./data/notes"
|
notes_dir: "./data"
|
||||||
plugins_dir: "./plugins"
|
plugins_dir: "./plugins"
|
||||||
|
|
||||||
search:
|
search:
|
||||||
enabled: true
|
enabled: true
|
||||||
index_dir: "./data/search_index"
|
|
||||||
|
|
||||||
security:
|
security:
|
||||||
# Authentication settings
|
# Authentication settings
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
# Persist notes and data (inside 'notes' folder)
|
# Persist notes and data
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
# Custom plugins
|
# Custom plugins
|
||||||
- ./plugins:/app/plugins
|
- ./plugins:/app/plugins
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
# Persist notes and data (inside 'notes' folder)
|
# Persist notes and data
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
# Custom plugins
|
# Custom plugins
|
||||||
- ./plugins:/app/plugins
|
- ./plugins:/app/plugins
|
||||||
|
|
|
||||||
5
run.py
5
run.py
|
|
@ -20,8 +20,7 @@ def main():
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
||||||
|
|
||||||
# Create data directories
|
# Create data directories
|
||||||
Path("data/notes").mkdir(parents=True, exist_ok=True)
|
Path("data").mkdir(parents=True, exist_ok=True)
|
||||||
Path("data/search_index").mkdir(parents=True, exist_ok=True)
|
|
||||||
Path("plugins").mkdir(parents=True, exist_ok=True)
|
Path("plugins").mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
print("✓ Dependencies installed")
|
print("✓ Dependencies installed")
|
||||||
|
|
@ -32,7 +31,7 @@ def main():
|
||||||
print("\n📝 Open your browser to: http://localhost:8000")
|
print("\n📝 Open your browser to: http://localhost:8000")
|
||||||
print("\n💡 Tips:")
|
print("\n💡 Tips:")
|
||||||
print(" - Press Ctrl+C to stop the server")
|
print(" - Press Ctrl+C to stop the server")
|
||||||
print(" - Your notes are in ./data/notes/")
|
print(" - Your notes are in ./data/")
|
||||||
print(" - Plugins go in ./plugins/")
|
print(" - Plugins go in ./plugins/")
|
||||||
print("\n" + "="*50 + "\n")
|
print("\n" + "="*50 + "\n")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue