diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000000000000000000000000000000000000..47c320842f28ea075e999c611e82796851ad823c --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,13 @@ +FROM composer:1.10.1 + +ARG uid=1000 +ARG gid=1000 + +RUN addgroup -g ${gid} dev \ + && adduser -h /home/dev -D -G dev -u ${uid} dev + +USER dev + +ENTRYPOINT ["/bin/bash"] + +# vim:set syntax=dockerfile: diff --git a/README.md b/README.md index f2bf98b803c7e35b28010e0cbc3e5f49422780c9..905e82eb556fe6b57a37e57915ca57b272146d7e 100644 --- a/README.md +++ b/README.md @@ -119,3 +119,26 @@ In altre parole, se ne teniamo una copia in locale per comodità, questa verrà Questo due tipi di plugin sono un po' buffi: i mu-plugins sono distribuiti come i plugin normali, e purtroppo il repository ```wpackagist``` categorizza tutti come ```wordpress-plugin```. Bisogna quindi elencarli manualmente nell'elenco dei ```drop-in``` (vedi il file ```composer.json```). Simile la situazione dei plugin dropin, tipo ```hyperdb``` e ```r2db```, dove dobbiamo specificare a mano cosa fa messo dove.b```. + +## Creare un container di sviluppo + +Si può creare un container per lo sviluppo in locale con docker + +```bash +docker build \ + --build-arg=uid=$(id -u) \ + --build-arg=gid=$(id -g) \ + -f Dockerfile.dev \ + -t registry.git.autistici.org/noblogs/noblogs-composer-dev \ + . +``` + +Per lo sviluppo poi + +``` +docker run \ + --rm \ + -v $PWD:$PWD \ + -w $PWD \ + -ti registry.git.autistici.org/noblogs/noblogs-composer-dev:latest +``` diff --git a/composer.json b/composer.json index 5af9bb83924693fc007afefdacaaf850f806068d..61765adcc56c6add278242765d7fcd8baa197f22 100644 --- a/composer.json +++ b/composer.json @@ -7,30 +7,32 @@ "authors": [ { "name": "lucha", - "email": "lucha@paranoici.org" - } + "email": "lucha@paranoici.org" + } ], "repositories": [ { "type": "composer", - "url" : "https://wpackagist.org" + "url": "https://wpackagist.org" }, - { - "type": "composer", + { + "type": "composer", "url": "https://asset-packagist.org" - }, - { - "type": "composer", - "url": "https://git.autistici.org/api/v4/group/90/-/packages/composer/packages.json" - } + }, + { + "type": "composer", + "url": "https://git.autistici.org/api/v4/group/90/-/packages/composer/packages.json" + } ], "config": { - "gitlab-domains": ["git.autistici.org"] + "gitlab-domains": [ + "git.autistici.org" + ] }, "require": { "php": ">=7.1", "composer/installers": "1.11.0", - "oomphinc/composer-installers-extender": "2.0.0", + "oomphinc/composer-installers-extender": "2.0.0", "cweagans/composer-patches": "1.7.1", "koodimonni/composer-dropin-installer": "1.3", "johnpbloch/wordpress": "5.8.1", @@ -42,7 +44,7 @@ "wpackagist-plugin/wp-piwik": "1.0.26", "wpackagist-plugin/wp-statusnet": "1.4.2", "wpackagist-plugin/wp-syntax": "1.1", - "wpackagist-plugin/wpmu-custom-css": "^1.06", + "wpackagist-plugin/wpmu-custom-css": "^1.06", "wpackagist-theme/azul": "1.51", "wpackagist-theme/bliss": "1.2.0", "wpackagist-theme/carrington-blog": "2.3.1", @@ -56,7 +58,7 @@ "wpackagist-theme/hybrid": "1.2", "wpackagist-theme/launchpad": "1.6", "wpackagist-theme/micro": "1.5.4", - "wpackagist-theme/minimalism": "1.0.3", + "wpackagist-theme/minimalism": "1.0.3", "wpackagist-theme/mnml": "1.3", "wpackagist-theme/ocular-professor": "1.3.1", "wpackagist-theme/primepress": "1.4.1", @@ -112,44 +114,82 @@ "noblogs/eu-compliance": "0.1.0", "noblogs/nospam": "0.2.2", "noblogs/themes-misc": "0.1.2", - "stuttter/ludicrousdb": "5.0.0", + "stuttter/ludicrousdb": "5.0.0", "wpackagist-plugin/creative-commons": "^2021.04", "wpackagist-plugin/disable-remove-google-fonts": "1.3.1", "wpackagist-plugin/footnotes": "2.7.3", "wpackagist-plugin/wpuntexturize": "2.2" - }, + }, "extra": { "wordpress-install-dir": "app", - "installer-types": ["bower-asset", "npm-asset"], + "installer-types": [ + "bower-asset", + "npm-asset" + ], "installer-paths": { - "app/wp-content/db-plugins/{$name}/": [ - "stuttter/ludicrousdb" - ], - "app/{$name}": ["type:wordpress-dropin"], - "app/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"], - "app/wp-content/plugins/{$name}/": ["type:wordpress-plugin"], - "app/wp-content/themes/{$name}/": ["type:wordpress-theme"], - "app/wp-includes/js/{$name}/": ["type:npm-asset", "type:bower-asset"] + "app/wp-content/db-plugins/{$name}/": [ + "stuttter/ludicrousdb" + ], + "app/{$name}": [ + "type:wordpress-dropin" + ], + "app/wp-content/mu-plugins/{$name}/": [ + "type:wordpress-muplugin" + ], + "app/wp-content/plugins/{$name}/": [ + "type:wordpress-plugin" + ], + "app/wp-content/themes/{$name}/": [ + "type:wordpress-theme" + ], + "app/wp-includes/js/{$name}/": [ + "type:npm-asset", + "type:bower-asset" + ] }, "wordpress-language-dir": "app/wp-content/languages/", - "wordpress-languages": ["ar", "ca","cy","da_DK","de_DE","el", "en_GB", "es_ES","fi","fr_FR", "it_IT","ja", "nl_NL", "nn_NO","pt_PT","ru_RU","sk_SK", "sv_SE", "ro_RO"], + "wordpress-languages": [ + "ar", + "ca", + "cy", + "da_DK", + "de_DE", + "el", + "en_GB", + "es_ES", + "fi", + "fr_FR", + "it_IT", + "ja", + "nl_NL", + "nn_NO", + "pt_PT", + "ru_RU", + "sk_SK", + "sv_SE", + "ro_RO" + ], "patches-file": "composer.patches.json", "composer-exit-on-patch-failure": true, "dropin-paths": { - "app/wp-content/mu-plugins" : [ + "app/wp-content/mu-plugins": [ "package:wpackagist-plugin/disable-wordpress-updates", "package:wpackagist-plugin/wpmu-new-blog-defaults", "package:wpackagist-plugin/disable-emojis", "package:wpackagist-plugin/disable-remove-google-fonts", - "type:wordpress-muplugin" + "type:wordpress-muplugin" + ], + "app/wp-content/themes": [ + "package:noblogs/themes-child", + "package:noblogs/themes-misc" + ], + "app/wp-content": [ + "package:stuttter/ludicrousdb:ludicrousdb/drop-ins/db.php,ludicrousdb/drop-ins/db-error.php", + "package:wpackagist-plugin/wp-super-cache:advanced-cache.php" ], - "app/wp-content/themes" : [ - "package:noblogs/themes-child", - "package:noblogs/themes-misc" - ], - "app/wp-content": ["package:stuttter/ludicrousdb:ludicrousdb/drop-ins/db.php,ludicrousdb/drop-ins/db-error.php", - "package:wpackagist-plugin/wp-super-cache:advanced-cache.php"], - "app": ["package:noblogs/r2db:db-config.php,nginx-map/wp-nginx-map-json.php,nginx-map/wp-nginx-map.php"] + "app": [ + "package:noblogs/r2db:db-config.php,nginx-map/wp-nginx-map-json.php,nginx-map/wp-nginx-map.php" + ] } } } diff --git a/composer.patches.json b/composer.patches.json index 56b21bdae4536f1e17ca59151a7e28e965464ced..9fd0f6f6937c77947767324e25e112d77046ba75 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -1,38 +1,38 @@ { "patches": { "johnpbloch/wordpress-core": { - "Patch definition of WP_CONTENT_URL to include SSL when it might not ": "patches/core/0052-fix-ssl-wp-content-url.patch", - "Anonymize requests to api.wordpress.org for updates": "patches/core/anonymize-update.php.patch", - "Do not perform pingbacks and trackbacks when we update via cron": "patches/core/0103-Remove-pingback-trackback.patch", - "Load JS library locally instead than from Googleapis": "patches/core/0155-Removing-reference-to-googleapis-from-wp-includes-up.patch", + "Patch definition of WP_CONTENT_URL to include SSL when it might not ": "patches/core/0052-fix-ssl-wp-content-url.patch", + "Anonymize requests to api.wordpress.org for updates": "patches/core/anonymize-update.php.patch", + "Do not perform pingbacks and trackbacks when we update via cron": "patches/core/0103-Remove-pingback-trackback.patch", + "Load JS library locally instead than from Googleapis": "patches/core/0155-Removing-reference-to-googleapis-from-wp-includes-up.patch", "Remove Google Fonts API calls": "patches/core/0165-remove-google-fonts.patch" }, "wpackagist-plugin/disable-wordpress-updates": { "Run update checks during cron": "patches/plugins/disable-wordpress-updates.patch" - }, + }, "wpackagist-plugin/more-privacy-options": { "Do send mail on privacy setting change": "patches/plugins/more-privacy-options.patch" }, - "wpackagist-plugin/mathjax-latex": { - "Remove unneeded options for mathjax-latex": "patches/plugins/191-mathjax-latex.patch", - "Added some instructions on mathjax latex plugin": "patches/plugins/192-mathjax-latex.patch" - }, - "wpackagist-plugin/creative-commons-license-widget": { + "wpackagist-plugin/mathjax-latex": { + "Remove unneeded options for mathjax-latex": "patches/plugins/191-mathjax-latex.patch", + "Added some instructions on mathjax latex plugin": "patches/plugins/192-mathjax-latex.patch" + }, + "wpackagist-plugin/creative-commons-license-widget": { "Remove hotlinking of images": "patches/plugins/creative-commons-license.patch" }, - "wpackagist-plugin/buddypress": { - "Disable gravatar": "patches/buddypress/0053-Patch-buddypress.patch", - "Force https on buddypress login redirect": "patches/buddypress/0147-forced-https-on-buddypress-login-redirect.patch" - }, + "wpackagist-plugin/buddypress": { + "Disable gravatar": "patches/buddypress/0053-Patch-buddypress.patch", + "Force https on buddypress login redirect": "patches/buddypress/0147-forced-https-on-buddypress-login-redirect.patch" + }, "wpackagist-plugin/wp-piwik": { "Disable Piwik global updates": "patches/plugins/wp-piwik.patch" }, "wpackagist-plugin/wp-recaptcha-bp": { "Support for global recaptcha keys": "patches/plugins/wp-recaptcha-bp.patch" }, - "wpackagist-plugin/simply-exclude": { + "wpackagist-plugin/simply-exclude": { "Small workaround to fix simplyexclude plugin broken with wordpress 4": "patches/plugins/0117-simplyexclude.patch" - }, + }, "wpackagist-theme/azul": { "Teme footer": "patches/themes/0056-Patch-theme-azul.patch" }, @@ -103,33 +103,32 @@ "wpackagist-theme/wp-andreas01": { "Theme footer": "patches/themes/0090-Patch-theme-wp-andreas01.patch" }, - "wpackagist-theme/twentyten": { - "Footer credits": "patches/themes/0187-twentyten.patch" - }, + "wpackagist-theme/twentyten": { + "Footer credits": "patches/themes/0187-twentyten.patch" + }, "wpackagist-theme/twentyeleven": { "Footer credits": "patches/themes/0165-twentyeleven-footer.patch" }, - "wpackagist-theme/twentytwelve": { - "Footer credits": "patches/themes/0165-twentytwelve-footer.patch" + "wpackagist-theme/twentytwelve": { + "Footer credits": "patches/themes/0165-twentytwelve-footer.patch" }, "wpackagist-theme/twentythirteen": { - "Footer credits": "patches/themes/0165-twentythirteen-footer.patch" - }, - "wpackagist-theme/twentyfourteen": { - "Footer credits": "patches/themes/0187-twentyfourteen.patch" - }, - "wpackagist-theme/twentyfifteen": { - "Footer credits": "patches/themes/0187-twentyfifteen.patch" - }, - "wpackagist-theme/twentysixteen": { - "Footer credits": "patches/themes/0223-twentysixteen-footer.patch" - }, - "wpackagist-theme/bliss": { - "Footer credits": "patches/themes/0223-bliss-footer.patch" - }, - "wpackagist-theme/thematic": { - "Footer credits": "patches/themes/0223-thematic-footer.patch" - } - + "Footer credits": "patches/themes/0165-twentythirteen-footer.patch" + }, + "wpackagist-theme/twentyfourteen": { + "Footer credits": "patches/themes/0187-twentyfourteen.patch" + }, + "wpackagist-theme/twentyfifteen": { + "Footer credits": "patches/themes/0187-twentyfifteen.patch" + }, + "wpackagist-theme/twentysixteen": { + "Footer credits": "patches/themes/0223-twentysixteen-footer.patch" + }, + "wpackagist-theme/bliss": { + "Footer credits": "patches/themes/0223-bliss-footer.patch" + }, + "wpackagist-theme/thematic": { + "Footer credits": "patches/themes/0223-thematic-footer.patch" + } } }