Code Monkey home page Code Monkey logo

blog's Introduction

blog

okay I'm officially that kind of person

Development

Blog content

If power is plentiful: make devserver

If every joule has to be accounted for:

  • python -m http.server 8000
  • make html to rebuild when wanted

Comment server

cd comment-server
poetry install
CONTENT_DIR=../output/ COMMENT_DIR=../comments/ poetry run gunicorn -b 0.0.0.0:5000 app:app

""""infrastructure""""

html comments form

always submits to /newcomment, with the article slug in its url-encoded payload (via an <input type="hidden" />)

comments """server"""

dockerized flask server, running with gunicorn on my 4-year-uptime vps, port 5000

build images

cd comment-server
docker build -t jpcapurro/comment-server-base -f base.Dockerfile .
docker build -t jpcapurro/comment-server .

push image:

docker save comment-server:latest |xz|pv | ssh selfhost docker load

run it:

ssh selfhost 'docker run -v $HOME/comments:/home/app/comments -v /var/www/blog.capu.tech:/home/app/output -p 5000:5000 -d --restart always comment-server:latest'

writes comments to a directory on the host, one file per valid article slug.

What I do is pull the files with a good ol' rsync -av selfhost:comments .

And then git add -p comments to review them before rebuilding

web server

good ol' nginx running on my 4-year-uptime vps.

serves static files for the blog itself, which are updated with make rsync_upload

requests for /newcomment are reverse-proxied to port 5000

blog's People

Contributors

juanpcapurro avatar

Watchers

James Cloos avatar  avatar

blog's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.