diff options
author | Andreas Fankhauser hiddenalpha.ch | 2024-09-04 02:29:06 +0200 |
---|---|---|
committer | Andreas Fankhauser hiddenalpha.ch | 2024-09-04 02:29:06 +0200 |
commit | 3701ac7007f4b02f72d4f984149d0e5a9bc64fdf (patch) | |
tree | 6612745444d727e6c335927cf8c74d610baddafa /doc | |
parent | 4d2708679f64f46d5644b785ccddbc28666941ff (diff) | |
download | UnspecifiedGarbage-3701ac7007f4b02f72d4f984149d0e5a9bc64fdf.zip UnspecifiedGarbage-3701ac7007f4b02f72d4f984149d0e5a9bc64fdf.tar.gz |
tinker around with minimal rspi file hoster.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/note/nginx/nginx.txt | 20 | ||||
-rw-r--r-- | doc/note/qemu/qemu.txt | 5 | ||||
-rw-r--r-- | doc/note/setup/brgmt-home-server.txt | 67 | ||||
-rw-r--r-- | doc/note/setup/setup-debian.txt | 4 |
4 files changed, 89 insertions, 7 deletions
diff --git a/doc/note/nginx/nginx.txt b/doc/note/nginx/nginx.txt index 75f2431..c841831 100644 --- a/doc/note/nginx/nginx.txt +++ b/doc/note/nginx/nginx.txt @@ -1,6 +1,11 @@ ## Basic nginx config +ALWAYS test the config for mistakes: + nginx -t + +WARN: Do NOT use 'alias' directive! It is broken as hell. Use 'root'. + [looks promising](https://stackoverflow.com/a/73297125/4415884) # Basic setup: @@ -16,19 +21,26 @@ #worker_processes auto; pid /run/nginx.pid; events {} + access_log /dev/stderr combined; + error_log /dev/stderr error; # debug, info, notice, warn, error, crit, alert, emerg. http { - access_log /dev/stdout; # Directories nginx needs configured to start up. client_body_temp_path /tmp/nginx; proxy_temp_path /tmp/nginx; fastcgi_temp_path /tmp/nginx; uwsgi_temp_path /tmp/nginx; scgi_temp_path /tmp/nginx; + server_tokens off; server { - # public access: "80" and "[::]:80" - # local access: "127.0.0.1:80" and "[::1]:80" + # Example: Serve localhost: listen 127.0.0.1:80; listen [::1]:80; + # Example: Serve any: + #listen 80; + #listen [::]:80; + # Example: Serve for any 'Host' header (Todo remove server_name): + #listen 127.0.0.1:80 default_server; + #listen [::1]:80 default_server; server_name localhost; root /srv/www; location /foo { @@ -36,7 +48,7 @@ try_files $uri $uri/ =404; } location /example { - return 200 "Example says hi"; + return 418 "Teapod says hi\n"; } } } diff --git a/doc/note/qemu/qemu.txt b/doc/note/qemu/qemu.txt index 18f6789..d36e5e2 100644 --- a/doc/note/qemu/qemu.txt +++ b/doc/note/qemu/qemu.txt @@ -31,6 +31,10 @@ Example fstab entries: ### Create Standalone image based on snapshot image qemu-img convert -O qcow2 derived.qcow2 standalone.qcow2 +## Convert to based from standalone + qemu-img create -f qcow2 -b old.qcow2 new.qcow2 + qemu-img rebase -b base.qcow2 new.qcow2 + ## Shrink/compact img Normal systems: @@ -40,7 +44,6 @@ Windoof: sdelete -z C: qemu-img convert -O qcow2 input.qcow output.qcow2 - ## Shrink snapshot layer qemu-img convert -O qcow2 snapLayer.qcow2 tmpFullClone.qcow2 diff --git a/doc/note/setup/brgmt-home-server.txt b/doc/note/setup/brgmt-home-server.txt new file mode 100644 index 0000000..227500a --- /dev/null +++ b/doc/note/setup/brgmt-home-server.txt @@ -0,0 +1,67 @@ + +WARN: not working yet! + + && SUDO=sudo \ + && $SUDO apt install --no-install-recommends -y nginx fcgiwrap \ + && $SUDO /etc/init.d/fcgiwrap start \ + && $SUDO mkdir -p /srv/www/cgi-bin \ + && $SUDO mkdir -p /srv/www/homeauto/beispiel-anlage-1 \ + && $SUDO find /srv -exec chown root:www-data {} + \ + && $SUDO find /srv -type d -exec chmod 755 {} + \ + && $SUDO find /srv -type f -exec chmod 644 {} + \ + && $SUDO find /srv/www/homeauto/beispiel-anlage-1 -type d -exec chmod 775 {} + \ + && $SUDO find /srv/www/homeauto/beispiel-anlage-1 -type f -exec chmod 664 {} + \ + && echo 'H4sIAKad12YAA1NW1E/KzNNPzStTyClN5CooyswrUfIICQnQN9QzUDAxtFAISU1VcM44vCcpNSdTCarAOT+vJDWvRDeksiDVSqEktaJEP6MkNwcmDaPdS9NLi4HaFMozUxXSUzNLiu0VfEoTFYqBTIXUYrCQQnppaomeEhcAokc+ZYkAAAA='|base64 -d|gunzip|$SUDO tee >/dev/null /srv/www/cgi-bin/fileserver.lua \ + && $SUDO chmod +x /srv/www/cgi-bin/fileserver.lua \ + && $SUDO rm -rf /etc/nginx/* \ + && echo ' + +pid /run/nginx.pid; +events {} +error_log /var/log/nginx/error.log info; # debug, info, notice, warn, error, crit, alert, emerg. +http { + client_body_temp_path /tmp/nginx; + proxy_temp_path /tmp/nginx; + fastcgi_temp_path /tmp/nginx; + uwsgi_temp_path /tmp/nginx; + scgi_temp_path /tmp/nginx; + server_tokens off; + server { + listen 80 default_server; + listen [::]:80 default_server; + root /srv/www; + location ~ "/beispiel-anlage-1/?$" { + root /srv/www/homeauto; + autoindex on; + } + location ~ "/beispiel-anlage-1/([0-9a-zA-Z-.]+)$" { + gzip off; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + fastcgi_param SCRIPT_FILENAME /srv/www/cgi-bin/fileserver.lua; + fastcgi_param SCRIPT_NAME fileserver.lua; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param CONTENT_TYPE $content_type; + fastcgi_param CONTENT_LENGTH $content_length; + #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + #fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param REQUEST_URI $request_uri; + fastcgi_param DOCUMENT_URI $document_uri; + fastcgi_param DOCUMENT_ROOT $document_root; + fastcgi_param SERVER_PROTOCOL $server_protocol; + fastcgi_param GATEWAY_INTERFACE CGI/1.1; + fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + fastcgi_param REMOTE_ADDR $remote_addr; + fastcgi_param REMOTE_PORT $remote_port; + fastcgi_param SERVER_ADDR $server_addr; + fastcgi_param SERVER_PORT $server_port; + fastcgi_param SERVER_NAME $host; + } + } +} + +' |base64 -d|gunzip|$SUDO tee >/dev/null /etc/nginx/nginx.conf \ + && nginx -t || true \ + && $SUDO /etc/init.d/nginx reload \ + && printf '\nDONE\n\n' \ + diff --git a/doc/note/setup/setup-debian.txt b/doc/note/setup/setup-debian.txt index a6129dc..3fd4fac 100644 --- a/doc/note/setup/setup-debian.txt +++ b/doc/note/setup/setup-debian.txt @@ -95,8 +95,8 @@ Populate "/etc/environment" as described by "./etc-environment". `# basic CLI` \ vim htop pv openssh-client iptables iptables-persistent xxd zip unzip xz-utils p7zip-full \ file trash-cli ncat curl \ - `# basic UI` \ - firefox-esr file-roller thunderbird chromium okular \ + `# basic UI (vim-gtk required for system clipboard)` \ + vim-gtk3 firefox-esr file-roller thunderbird chromium okular \ `# software devel` \ git sqlite3 manpages-dev gdb qemu-utils qemu-system-x86 qemu-system-arm wireshark samba \ tigervnc-viewer jq universal-ctags \ |