1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00
pixelfed_ynh/scripts/upgrade
lapineige 67c89ce394
Testing : fix some upgrade (composer 2) (#242)
* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix post-v2 issues

* Patch post v0.11.5 permissions

Why are they not correct by default ?

* Testing : fix images rights in package v2 (#224) (#227)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------





* Bump version

* Auto-update README

* Fix post-v2 issues

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix mail sendmail (#230)

* Testing : patch install permissions (#226)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix post-v2 issues

* Patch post v0.11.5 permissions

Why are they not correct by default ?

* Testing : fix images rights in package v2 (#224) (#227)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------





* Bump version

* Auto-update README

* Fix post-v2 issues

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Update .env

use sendmail for default mail sending, should work out of the box for fresh installs

* patch source

prevent privilege escalation

* patching source

prevent privilege escalation

* patching source

prevent privilege escalation

* Update manifest.toml

Enable authentication on the mail stack for the system user

* Update .env

authentication on the mail stack with app system user

* Fix old email configs

---------

Co-authored-by: lapineige <lapineige@users.noreply.github.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* remove full_domain

* Add manual email verification doc (#233)

* Add manual email verification doc

* email verification doc (fr)

* fix doc

* 0.11.9 (#236)

* v0.11.9

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* Update manifest.toml

* Auto-update README

* Fix php conf & image permissions (#238)

* Transfer to normal php conf

* Transfer to normal php conf

* Add running directory

* Rename php_fpm.conf to php-fpm.conf

* bump version

* Auto-update README

* bump minimum YNH version

* switch back to extra_php

* Set proper group owner for php

Using new helper 65d2571072

* Set proper group owner for php

* manifest: fix yunohost version requirement typo

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

* Upgrade to composer 2 (#241)

* Testing : fix php/pictures permissions (#239)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix post-v2 issues

* Patch post v0.11.5 permissions

Why are they not correct by default ?

* Testing : fix images rights in package v2 (#224) (#227)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------





* Bump version

* Auto-update README

* Fix post-v2 issues

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix mail sendmail (#230)

* Testing : patch install permissions (#226)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

* Fix post-v2 issues

* Patch post v0.11.5 permissions

Why are they not correct by default ?

* Testing : fix images rights in package v2 (#224) (#227)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

* Update extra_php-fpm.conf

Fix #223

* Testing : fix ≥0.11.5 installs (#222) (#225)

* v2

* v2

* Create tests.toml

* Auto-update README

* fix

* Update _common.sh

* Update install

* Update manifest.toml

* Update manifest.toml

* cleaning

* Auto-update README

* Auto-update README

* Add post edits (from dev branch)

Using lastest commit as most of the previous ones fix edits stuff + bugs
5cfe8cd56a

* bump version

* Auto-update README

* cleaning

* Update manifest.toml

* Auto-update README

* Update ADMIN.md

* Update change_url

* php8.2

* php8.2

* add ressources needed

* php8.2

* update PHP

* post edit formatting fixes

4479055e1e

* v0.11.8

* v0.11.8

* Auto-update README

* Master -> ynh V2 (v0.11.8)

* Auto-update README

* Update .env

* Fix .env + improvements

https://github.com/YunoHost-Apps/pixelfed_ynh/pull/219#issuecomment-1568049256

* Update manifest.toml

* Auto-update README

* Typo

* Patch file access right (fix post 0.11.5 installs)

* Bump version (post v0.11.5 install fixes)

* Auto-update README

---------





* Bump version

* Auto-update README

* Fix post-v2 issues

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Bump version

* Auto-update README

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* Update .env

use sendmail for default mail sending, should work out of the box for fresh installs

* patch source

prevent privilege escalation

* patching source

prevent privilege escalation

* patching source

prevent privilege escalation

* Update manifest.toml

Enable authentication on the mail stack for the system user

* Update .env

authentication on the mail stack with app system user

* Fix old email configs

---------

Co-authored-by: lapineige <lapineige@users.noreply.github.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>

* remove full_domain

* Add manual email verification doc (#233)

* Add manual email verification doc

* email verification doc (fr)

* fix doc

* 0.11.9 (#236)

* v0.11.9

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* Update manifest.toml

* Auto-update README

* Fix php conf & image permissions (#238)

* Transfer to normal php conf

* Transfer to normal php conf

* Add running directory

* Rename php_fpm.conf to php-fpm.conf

* bump version

* Auto-update README

* bump minimum YNH version

* switch back to extra_php

* Set proper group owner for php

Using new helper 65d2571072

* Set proper group owner for php

* manifest: fix yunohost version requirement typo

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: themancalledjakob <github@jrkb.land>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

* Upgrade to composer 2

---------

Co-authored-by: lapineige <lapineige@users.noreply.github.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: themancalledjakob <github@jrkb.land>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: themancalledjakob <github@jrkb.land>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
Co-authored-by: bg-wa <bg-wa@users.noreply.github.com>
2023-10-08 09:17:40 +02:00

250 lines
11 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SUPERVISOR SERVICE
#=================================================
ynh_script_progression --message="Stopping a supervisor service..." --weight=1
ynh_supervisor_action --service_name="${app}-horizon" --action="stop" --log_path="systemd" --line_match="stopped: ${app}-horizon"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If fpm_footprint doesn't exist, create it
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "${fpm_free_footprint:-}" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi
# If app_key doesn't exist, retrieve it
if [ -z "${app_key:-}" ]; then
ynh_script_progression --message="Retrieving app_key..."
app_key=$(grep -oP "APP_KEY=\Kbase64.*" "$install_dir/.env")
ynh_app_setting_set --app="$app" --key=app_key --value="$app_key"
fi
if dpkg --compare-versions "0.9.0~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_script_progression --message="Ensuring upgrade compatibility to 0.9.0~ynh3..."
ynh_script_progression --message="Configuring a systemd service..."
ynh_add_systemd_config --service="${app}-horizon" --template=horizon.conf
fi
if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_script_progression --message="Ensuring upgrade compatibility to 0.10.9~ynh2..."
ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config --service="${app}-horizon"
ynh_script_progression --message="Creating log file..."
mkdir -p "/var/log/$app/"
touch "/var/log/$app/${app}-horizon.log"
chown -R $app: "/var/log/$app/"
ynh_script_progression --message="Configuring a supervisor service..."
ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf
ynh_script_progression --message="Starting a supervisor service..."
ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon"
fi
if dpkg --compare-versions "0.10.9~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
ynh_script_progression --message="Ensuring upgrade compatibility to 0.10.9~ynh3..."
if ynh_exec_warn_less yunohost service status ${app}-horizon >/dev/null
then
ynh_script_progression --message="Removing ${app}-horizon service..."
yunohost service remove "${app}-horizon"
fi
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add "supervisor" --description="Supervisor daemon for $app" --log="/var/log/$app/${app}-horizon.log"
fi
# Fix old email configs
if ynh_compare_current_package_version --comparison lt --version "0.11.8~ynh5" ; then
ynh_replace_special_string --match_string="MAIL_DRIVER=[^\\n]*" --replace_string="MAIL_DRIVER=sendmail" --target_file="$install_dir/.env" # two \\ because it's in a ""
ynh_replace_special_string --match_string="MAIL_HOST=[^\\n]*" --replace_string="MAIL_HOST=127.0.0.1" --target_file="$install_dir/.env" # two \\ because it's in a ""
ynh_replace_special_string --match_string="MAIL_USERNAME=[^\\n]*" --replace_string="MAIL_USERNAME=$app" --target_file="$install_dir/.env" # two \\ because it's in a ""
ynh_replace_special_string --match_string="MAIL_PASSWORD=[^\\n]*" --replace_string="MAIL_PASSWORD=$mail_pwd" --target_file="$install_dir/.env" # two \\ because it's in a ""
ynh_replace_special_string --match_string="MAIL_FROM_ADDRESS=pixelfed" --replace_string=`MAIL_FROM_ADDRESS="$app"` --target_file="$install_dir/.env"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep=".env"
fi
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
# Pixelfed app should be able to edit its settings from the admin panel
chmod 600 "$install_dir"/.env
#=================================================
# PATCHING SOURCE
#=================================================
ynh_script_progression --message="Patching source files..." --weight=1
# Prevent privilege escalation by injecting commands in an email name
# This described in more detail on the manpage https://www.postfix.org/sendmail.1.html under security
ynh_replace_string --match_string="'/usr/sbin/sendmail -bs'" --replace_string="'/usr/sbin/sendmail -bs -- '" --target_file=$install_dir/config/mail.php
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --group=www-data
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE COMPOSER DEPENDENCIES
#=================================================
ynh_script_progression --message="Updating composer..." --weight=1
ynh_exec_warn_less ynh_composer_exec --workdir="$install_dir" --commands="self-update --2"
ynh_exec_warn_less ynh_composer_exec --workdir="$install_dir" --commands="update"
#=================================================
# PATCH PERMISSIONS for v0.11.5 versions and higher
#=================================================
ynh_script_progression --message="Patching permissions (for version 0.11.5 and newer)..." --weight=1
# Default configuration doesn't work
ynh_replace_string --match_string="'private' => 0700," --replace_string="'private' => 0750," --target_file=$install_dir/config/filesystems.php
# Repair permissions for files created after v0.11.5 and before this patch
if [ -d "$install_dir/public/storage/m/_v2/" ]; then
chmod 750 -R "$install_dir/public/storage/m/_v2/"* # all files subdirectories (picture folders) should be readable and executable. But if there is no picture, there is no /*/*
chmod 770 "$install_dir/public/storage/m/_v2/"* # users folders should be 770
chmod 770 "$install_dir/public/storage/m/_v2/" # this should be 770
chown -R :www-data "$install_dir/public/storage/m/_v2/" # Fix the mess following packaging v2 upgrade - and make sure proper group owner is set.
fi
#=================================================
# DEPLOYMENT
#=================================================
ynh_script_progression --message="Deploying..."
pushd "$install_dir"
php$phpversion artisan horizon:install
php$phpversion artisan horizon:publish
php$phpversion artisan passport:keys --force
php$phpversion artisan config:clear
php$phpversion artisan config:cache
php$phpversion artisan route:clear
php$phpversion artisan route:cache
php$phpversion artisan view:clear
php$phpversion artisan view:cache
php$phpversion artisan storage:link
php$phpversion artisan migrate --force
php$phpversion artisan update
php$phpversion artisan horizon:purge
php$phpversion artisan import:cities 2>/dev/null
php$phpversion artisan instance:actor
php$phpversion artisan passport:client --personal <<< "\\n"
popd
#=================================================
# CREATE LOG FILE
#=================================================
ynh_script_progression --message="Creating log file..." --weight=1
mkdir -p "/var/log/$app/"
touch "/var/log/$app/${app}-horizon.log"
chown -R $app: "/var/log/$app/"
chmod -R 600 "/var/log/$app/"
#=================================================
# UPGRADE THE CRON FILE
#=================================================
ynh_script_progression --message="Upgrading cron file..." --weight=1
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
#=================================================
# SETUP SUPERVISOR
#=================================================
ynh_script_progression --message="Upgrading supervisor configuration..." --weight=1
# Create a dedicated supervisor config
ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "supervisor" --description="Supervisor daemon for $app" --log="/var/log/$app/${app}-horizon.log"
#=================================================
# START SUPERVISOR SERVICE
#=================================================
ynh_script_progression --message="Starting a supervisor service..." --weight=1
ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last