notes

Dash Eclipse's Notes
git clone git://ezup.dev/notes.git
Log | Files | Refs | Submodules | README | LICENSE

self-hosting.org (2182B)


      1#+STARTUP: content
      2* Self-hosting
      3  :PROPERTIES:
      4  :CUSTOM_ID: self-host
      5  :END:
      6** HTTP server
      7   :PROPERTIES:
      8   :CUSTOM_ID: http-server
      9   :END:
     10   #+BEGIN_SRC sh
     11     # install docker
     12     xi docker docker-compose
     13   #+END_SRC
     14** Git
     15   :PROPERTIES:
     16   :CUSTOM_ID: git
     17   :END:
     18*** [[https://git-scm.com/book/en/v2/Git-on-the-Server-Git-Daemon][Git Daemon]]
     19    :PROPERTIES:
     20    :CUSTOM_ID: git-daemon
     21    :END:
     22    #+BEGIN_SRC sh
     23      #!/bin/sh
     24      # /etc/sv/git-daemon/run
     25      exec chpst -u username:username git daemon \
     26	   --reuseaddr \
     27	   --base-path=/home/username/git/repo \
     28	   /home/username/git/repo
     29    #+END_SRC
     30*** [[https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server][Bare repository]]
     31    :PROPERTIES:
     32    :CUSTOM_ID: bare-repo
     33    :END:
     34    #+BEGIN_SRC sh
     35      cd $HOME/git/repo
     36      mkdir reponame.git && cd $_
     37      git init --bare --shared=group
     38      touch git-daemon-export-ok
     39      vim decription owner url
     40      # change denyNonFastforwards to false
     41      vim config
     42    #+END_SRC
     43*** Static Git Page
     44    :PROPERTIES:
     45    :CUSTOM_ID: static-git-page
     46    :END:
     47    Install ~stagit~ and add ~repo/.git/hooks/post-receive~
     48** WebDAV
     49   :PROPERTIES:
     50   :CUSTOM_ID: webdav
     51   :END:
     52   #+BEGIN_SRC sh
     53     #!/bin/sh
     54     # /etc/sv/rclone-webdav/run
     55     exec rclone serve webdav \
     56	  --addr domain.tld:1234 \
     57	  --user username \
     58	  --pass password \
     59	  --cert /etc/letsencrypt/live/domain.tld/fullchain.pem \
     60	  --key /etc/letsencrypt/live/domain.tld/privkey.pem \
     61	  /home/username/webdav 2>&1
     62   #+END_SRC
     63** Pastebin
     64   :PROPERTIES:
     65   :CUSTOM_ID: pastebin
     66   :END:
     67   */etc/sv/fiche/run*
     68   #+BEGIN_SRC sh
     69     #!/bin/sh
     70     exec chpst -u _fiche:_fiche fiche \
     71	  -S -d domain.tld/pastebin \
     72	  -o /var/tmp/fiche \
     73	  -l /var/log/fiche/log
     74   #+END_SRC
     75** Other
     76   :PROPERTIES:
     77   :CUSTOM_ID: other-self-hosting
     78   :END:
     79*** IRC network bouncer
     80    znc
     81*** Music radio
     82    #+BEGIN_SRC sh
     83      #!/bin/sh
     84      # /etc/sv/vlc-stream/run
     85      exec chpst -u username:username cvlc \
     86	   /home/username/music \
     87	   ':sout=#http{mux=ogg,dst=:12345/}' ':no-sout-all' ':sout-keep' \
     88	   --intf \
     89	   http 1>/dev/null
     90    #+END_SRC