dev #2
@@ -2,20 +2,20 @@ FROM python:3.10-slim AS builder
|
|||||||
|
|
||||||
ARG DEBUG_MODE=0
|
ARG DEBUG_MODE=0
|
||||||
ENV FLASK_DEBUG=$DEBUG_MODE
|
ENV FLASK_DEBUG=$DEBUG_MODE
|
||||||
|
ENV FLASK_APP=app
|
||||||
|
|
||||||
ENV FLASK_APP=app.py
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt
|
||||||
|
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
ENTRYPOINT ["flask"]
|
ENTRYPOINT ["flask"]
|
||||||
CMD ["run", "--host=0.0.0.0", "--port=80"]
|
# CMD [ "run", "--host=0.0.0.0", "--port=80"]
|
||||||
# CMD ["--app", ".", "run", "--host=0.0.0.0", "--port=443"]
|
CMD ["--app", "app", "run", "--host=0.0.0.0", "--port=443"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
26
app/build.py
Normal file
26
app/build.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
from obsidian_parser import Vault
|
||||||
|
import shutil
|
||||||
|
from git import Repo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def clone_secure_repo(url: str, token: str = "", dest: str): # clone a gittea repo using optional security token into dest dirand return a path to the directory
|
||||||
|
return dest
|
||||||
|
|
||||||
|
def public_notes(src: str): # return a list of notes tagged with public from an obsidian directory
|
||||||
|
# build vault from source
|
||||||
|
vault = Vault(src)
|
||||||
|
if vault:
|
||||||
|
print ("found vault")
|
||||||
|
else:
|
||||||
|
print("could not find vault")
|
||||||
|
return []
|
||||||
|
|
||||||
|
# return a list ofnotes
|
||||||
|
return vault.get_notes_with_tag("public")
|
||||||
|
|
||||||
|
|
||||||
|
def buld_public_vault(src: str, dest: str): # build the public vault in dest from an obsidian repo in src
|
||||||
|
for note in public_notes(src):
|
||||||
|
print(note.title)
|
||||||
|
shutil.copy2(f"{note.path}", dest)
|
||||||
12
build.sh
12
build.sh
@@ -6,10 +6,12 @@ if [ -z "$1" ]; then
|
|||||||
elif [ "$1" = "-b" ]; then
|
elif [ "$1" = "-b" ]; then
|
||||||
build="--build"
|
build="--build"
|
||||||
echo building
|
echo building
|
||||||
elif [ "$1" = "-d" ]; then
|
elif [ "$1" = "-i" ]; then
|
||||||
up="-d"
|
vaultPath="/home/venus/Documents/Personal-Wiki"
|
||||||
echo daemon
|
echo building
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker compose down
|
#update the .env
|
||||||
docker compose up $up $build
|
|
||||||
|
#build public vault
|
||||||
|
docker compose up -d public_vault_builder
|
||||||
|
|||||||
11
compose.yml
11
compose.yml
@@ -8,9 +8,8 @@ services:
|
|||||||
- '80:80'
|
- '80:80'
|
||||||
volumes:
|
volumes:
|
||||||
- ./content:/content
|
- ./content:/content
|
||||||
public_vault_builder:
|
# public_vault_builder:
|
||||||
build:
|
# build:
|
||||||
context: public_vault_builder
|
# context: public_vault_builder
|
||||||
volumes:
|
# volumes:
|
||||||
- ${obsidian_vault}:/vault
|
# - ./public_vault:/content
|
||||||
- ./public_vault:/content
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
|
||||||
|
run mkdir /public-vault
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
from obsidian_parser import Vault
|
from obsidian_parser import Vault
|
||||||
import shutil
|
import shutil
|
||||||
|
from git import Repo
|
||||||
|
|
||||||
|
|
||||||
|
# repo_url = "https://gitlab.com/username/my-vault.git"
|
||||||
dest = "/content"
|
dest = "/content"
|
||||||
src = "/vault"
|
src = "Personal-Wiki"
|
||||||
# Load a vault
|
# Load a vault
|
||||||
vault = Vault(src)
|
vault = Vault(src)
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
obsidianmd-parser
|
obsidianmd-parser
|
||||||
|
GitPython
|
||||||
|
|||||||
Reference in New Issue
Block a user