From ca7e09e09f97c36cfa7644d20d619fa01eeae99a Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 30 Apr 2023 16:30:26 +0200 Subject: Set up a ddev env for development/testing og Hubzilla --- .ddev/config.yaml | 24 +++++++ .ddev/nginx_full/nginx-hubzilla.conf.example | 94 ++++++++++++++++++++++++++++ .editorconfig | 3 + .gitmodules | 3 + core | 1 + 5 files changed, 125 insertions(+) create mode 100644 .ddev/config.yaml create mode 100644 .ddev/nginx_full/nginx-hubzilla.conf.example create mode 100644 .editorconfig create mode 100644 .gitmodules create mode 160000 core diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 0000000..2d25e44 --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,24 @@ +--- +name: hubzilla +type: php +docroot: "" +php_version: "8.1" +webserver_type: nginx-fpm +router_http_port: "80" +router_https_port: "443" +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: postgres + version: "14" +nfs_mount_enabled: false +mutagen_enabled: false +use_dns_when_possible: true +composer_version: "2" +web_environment: [] +nodejs_version: "16" + +hooks: + post-start: + - exec: 'cp .ddev/nginx_full/nginx-hubzilla.conf.example .ddev/nginx_full/nginx-site.conf' diff --git a/.ddev/nginx_full/nginx-hubzilla.conf.example b/.ddev/nginx_full/nginx-hubzilla.conf.example new file mode 100644 index 0000000..29646a7 --- /dev/null +++ b/.ddev/nginx_full/nginx-hubzilla.conf.example @@ -0,0 +1,94 @@ +# ddev nginx config for Hubzilla + +server { + listen 80 default_server; + listen 443 ssl default_server; + + root /var/www/html/core; + + ssl_certificate /etc/ssl/certs/master.crt; + ssl_certificate_key /etc/ssl/certs/master.key; + + include /etc/nginx/monitoring.conf; + + index index.php; + charset utf-8; + + # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html + sendfile off; + error_log /dev/stdout info; + access_log /var/log/nginx/access.log; + + # allow uploads up to 20MB in size + client_max_body_size 20m; + client_body_buffer_size 128k; + + include mime.types; + + # rewrite to front controller as default rule + location / { + # try_files $uri /index.php?q=$uri; + if (!-e $request_filename) { + rewrite ^(.*)$ /index.php?q=$1; + } + } + + # make sure webfinger and other well known services aren't blocked + # by denying dot files and rewrite request to the front controller + location ^~ /.well-known/ { + allow all; + try_files $uri /index.php?q=$uri; + } + + # statically serve these file types when possible + # otherwise fall back to front controller + # allow browser to cache them + # added .htm for advanced source code editor library + location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { + expires 30d; + try_files $uri /index.php?q=$uri&$args; + } + + # block these file types + location ~* \.(tpl|md|tgz|log|out)$ { + deny all; + } + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # or a unix socket + # pass the PHP scripts to FastCGI server listening on socket + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php-fpm.sock; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_intercept_errors off; + # fastcgi_read_timeout should match max_execution_time in php.ini + fastcgi_read_timeout 10m; + fastcgi_param SERVER_NAME $host; + fastcgi_param HTTPS $fcgi_https; + } + + # deny access to all dot files + location ~ /\. { + deny all; + } + + #deny access to store + location ~ /store { + deny all; + } + + #deny access to util + location ~ /util { + deny all; + } + + include /etc/nginx/common.d/*.conf; + include /mnt/ddev_config/nginx/*.conf; +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a54d21c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_style = tab +indent_size = 4 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..faf175a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "core"] + path = core + url = volse.net:repos/public/hubzilla/volse-hubzilla.git diff --git a/core b/core new file mode 160000 index 0000000..ca9491d --- /dev/null +++ b/core @@ -0,0 +1 @@ +Subproject commit ca9491d343cd03acfb0bb48017df48ca8ffb761d -- cgit v1.2.3