How am I publishing this

How am I publishing this

September 5, 2025 || #tech

Dejo aquí el proceso detallado de cómo he publicado esto.

Mi intención es:

SETUP

  1. Construirlo con Obsidian en Markdown
    Pasted image 20250905231035.png

  2. Exportarlo en html con el plugin webpage html export en una carpeta local

Pasted image 20250905231515.png
Un grande Nathan George

Pasted image 20250905235909.png

  1. Configurar un repositorio de github donde hacer push

Create new repository.

Shell from project folder

echo "# digital-garden-test-i" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/atysen/digital-garden-test-i.git
git push -u origin main

Estas son instrucciones del mismo github. Yo además añado un "add ." para añadir todos los archivos al commit.

Pasted image 20250905235450.png
Pasted image 20250905235504.png
Pasted image 20250905235619.png
Pasted image 20250905235657.png

  1. En mi servidor linux, hacer un git clone de ese repositorio
git clone git@github.com:atysen/digital-garden-test-i.git
  1. Levantar esa carpeta apuntando a un puerto local 8000
cd digital-garden-test-i
python3 -m http.server 8000 --bind 127.0.0.1

Está configurado con nginx para apuntar a http://weye.duckdns.org, un dominio al mismo tiempo que ya tengo de dns. Resultados de otro proyecto. La idea más adelante es darle otro puerto para poder levantar más proyectos en el mismo server (o quizá al próximo proyecto más bien darle un puerto nuevo)

Posteriormente he copiado el archivo digital-garden-test-i y lo he puesto en el directorio principal como index.html, de esta manera hemos visto que aterriza directamente ahí.

Pasted image 20250906005021.png

UPDATE

El proceso luego de update será:

  1. Modificación
    -> Modificar notas en obsidian
    Hago mi modificación

  2. Exportar en html
    -> Exportar html
    Ctrl + P 'export using previous settings'

  3. Git push from my computer
    -> Locally

cd desktop
cd "Digital Garden Test I"
git status                  #opcional para comprobar
git add .
git commit -m "commit 2025.09.06"
git push
  1. Git clone from my linux server
    -> On server
ssh root@91.98.21.159
cd digital-garden-test-i
git pull
  1. Start server
    -> Luego levantar el servidor y comprobar cambios (Ctrl+C si estaba levantado para interrumpir)
python3 -m http.server 8000 --bind 127.0.0.1

AUTOMATION

Agilizo el proceso de pull and push con un .bat que meto en el directorio raíz de usuario

  1. htprev (obsidian)
  2. dgpush.bat
  3. serverconnect.bat
  4. ~/dgpull.sh
  5. ~/dgstart.sh
  6. weye.bat

Versión integrada:
0. htprev (obsidian)

  1. idgpush.bat
  2. ./idgpull.sh
  3. weye.bat (display)

Pasted image 20250906005438.png
Pasted image 20250906005405.png

Pasted image 20250906005503.png

dgpush.bat

cd desktop
cd "Digital Garden Test I"
git status                  #opcional para comprobar
git add .
git commit -m "commit 2025.09.06"
git push

serverconnect.bat

ssh root@91.98.21.159

~/dgpull.sh

cd digital-garden-test-i
git pull

~/dgstart.sh

cd digital-garden-test-i
python3 -m http.server 8000 --bind 127.0.0.1

Versiones integradas para agilizar el proceso:
idgpush.bat

cd desktop
cd "Digital Garden Test I"
git status                  #opcional para comprobar
git add .
git commit -m "commit 2025.09.06"
git push
ssh root@91.98.21.159

~/idgpull.sh

cd digital-garden-test-i
git pull
python3 -m http.server 8000 --bind 127.0.0.1

HTTPS, NGINX, SERVICE

Lo siguiente ha sido configurar nginx puerto 8002 url http://tysengarden.duckdns.org
A ese dominio hacerle un certificado HTTPS.
Después crear un servicio en el server de linux parametrizado para levantar el server en el arranque y dejarlo funcionando

NGINX
Crear un archivo

nano /etc/nginx/sites-available/digital-garden

Prepararlo con esto

server {
    listen 80;
    server_name tysengarden.duckdns.org;

    location / {
        proxy_pass http://127.0.0.1:8002; 
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

configurado para el puerto 8002

HTTPS

certbot --nginx -d tysengarden.duckdns.org

SERVICE
Crear un archivo

nano /etc/systemd/system/tysengarden.service

Con esto

[Unit]
Description=Tysengarden Server
After=network.target

[Service]
ExecStart=/usr/bin/python3 -m http.server 8002 --bind 127.0.0.1
WorkingDirectory=/root/digital-garden-test-i   
Restart=always
User=www-data
Group=www-data

[Install]
WantedBy=multi-user.target

Luego:

sudo systemctl daemon-reload
sudo systemctl enable tysengarden
sudo systemctl start tysengarden
sudo systemctl status tysengarden
journalctl -u tysengarden -f  #opcional - para ver el log

Y queda corriendo. Si en algún momento quiero pararlo:

sudo systemctl stop tysengarden

NOTES

UPDATE COMMANDS (service version):

  1. Ctrl + P (obsidian) -> htprev // update local html files
  2. Win + R -> idgpush // push to github and open server shell
  3. Linux bash -> ~/idgpull.sh // pull from github
  4. Win + R -> tysengarden // open http://tysengarden.duckdns.org with chrome
htprev
idgpush
~/idgpull.sh
tysengarden