Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade cops 1.0.1 => 1.1.3 + DSM 7 #5192

Merged
merged 1 commit into from
Oct 2, 2022

Conversation

smaarn
Copy link
Contributor

@smaarn smaarn commented Apr 3, 2022

Description

Two objectives:

  1. Bring cops to DSM 7
  2. Upgrade cops (while we're at it

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Package update
  • Includes small framework changes

Binaries are available here: https://github.com/smaarn/spksrc/releases/tag/cops-1.1.3-rc-2

@smaarn smaarn marked this pull request as ready for review April 30, 2022 17:51
@smaarn
Copy link
Contributor Author

smaarn commented Apr 30, 2022

There is an open question regarding the beta flag: personally I would flag it as non beta on DSM 7 since the PHP configuration is really native.

But then that's just me :)

Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and indeed, the beta flag probably can be removed along with updating #4524

Comment on lines 61 to 74
if [ "${BUILDNUMBER}" -ge "4458" ]; then
# DSM5+
# Set permissions on directory structure
set_syno_permissions "${wizard_calibre_dir}"
# Set permissions on metadata.db
if [ ! "`synoacltool -get "${wizard_calibre_dir}/metadata.db"| grep "group:${SC_GROUP}:allow:rwxpdDaARWc."`" ]; then
synoacltool -add "${wizard_calibre_dir}/metadata.db" "group:${SC_GROUP}:allow:rwxpdDaARWc:----" > /dev/null 2>&1
fi
else
#DSM4
chown ${USER} ${wizard_calibre_dir:=/volume1/calibre/}
chmod u+rw ${wizard_calibre_dir:=/volume1/calibre/}
chown ${USER} ${wizard_calibre_dir:=/volume1/calibre/}/metadata.db
chmod u+rw ${wizard_calibre_dir:=/volume1/calibre/}/metadata.db
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Given the comment I guess it can be removed safely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I removed everything which sounded like DSM 4 specifics.

The only thing is that I don't own a DSM 6 to validate it still works on those :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got one, let me know the specifics you'd need testing on and I'll check it out.

Copy link
Contributor

@th0ma7 th0ma7 May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a plain default install result on DSM6 (6.2.4) e.g. I've only hit next, no kobo selection:
Capture d’écran du 2022-05-01 07-33-40

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's supposed to be the path to an existing calibre directory...

I haven't noticed if this was clearly mentionned. Couldn't it generate an "empty" db file in case it's non-existant? On the other hand, I don't know exactly what this app is for nor how to use it so take this comment with a grain of salt.

The idea of this app is to come as a companion to an existing calibre installation which would be handling the writing and organizing part. cops is "merely" a browser component which integrates smoothly with web browsers and is compliant with other ebook readers (for example Kobo ones, and it happens I use one :) ).

I believe we could generate an empty DB but I'm not sure of the added value here (nor that it would be maintainable). Will be checking.

Otherwise, if you want me to test that out could you provide me with an default db file that I could confirm testing with on DSM6? Perhaps that "empty" db file could actually be provided with the package... just a thought.

That's for sure. I'll attach one to the PR right away.

Copy link
Contributor

@th0ma7 th0ma7 May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a git pull and rebuilt the package and extracted your zip into /volume1:

root@th0ma7-nas:/volume1# ll -R calibre/
calibre/:
total 352
d---------+ 1 th0ma7 1000     80 May  1 10:25 .
drwxr-xr-x  1 root   root   1054 May  1 15:53 ..
----------+ 1 th0ma7 1000 348160 May  1 10:25 metadata.db
-rw-r--r--  1 th0ma7 1000  11977 May  1 10:25 metadata_db_prefs_backup.json

It's nice to mention which PHP extensions are needed but having a URL to point for help would be beneficial as otherwise the user will ask himself : am I missing something? We could probably create a WebStation wiki page on our spksrc github and include our finding for creating packages and al (just a thought).

Additionally, perhaps you should include an additional SPK_DEPENDS for php?

An error occured while changing permissions:

2022/05/01 15:58:31	===> Step postinst. USER=http GROUP= SHARE_PATH=
2022/05/01 15:58:31	Begin save_wizard_variables
2022/05/01 15:58:31	End save_wizard_variables
2022/05/01 15:58:31	Begin service_postinst
2022/05/01 15:58:31	ACL version: 1 
2022/05/01 15:58:31	Archive: has_ACL,is_support_ACL 
2022/05/01 15:58:31	Owner: [th0ma7(user)] 
2022/05/01 15:58:31	--------------------- 
2022/05/01 15:58:31		 [0] group:administrators:allow:rwxpdDaARWc--:fd--  (level:0)
2022/05/01 15:58:31	Granting '' group permissions on /volume1/calibre
2022/05/01 15:58:31	(synoacltool.c, 125)No such Group 
2022/05/01 15:58:31	Granting '' group basic permissions on /volume1/calibre
2022/05/01 15:58:31	(synoacltool.c, 125)No such Group 
2022/05/01 15:58:32	End service_postinst
2022/05/01 15:58:32	install cops 1.1.3-6 End postinst ret=[0]
2022/05/01 15:58:32	install cops 1.1.3-6 Begin /bin/rm -rf /volume1/@tmp/pkginstall
2022/05/01 15:58:32	install cops 1.1.3-6 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0]
2022/05/01 15:58:36	install cops 1.1.3-6 Begin start-stop-status start
2022/05/01 15:58:36	install cops 1.1.3-6 End start-stop-status start ret=[0]

This leads to the same output as previously (e.g. Database error) as it can't find the db file, and I assume that's the reason why.

EDIT: I now wonder, perhaps I should have created the folder first through the web interface and grant ACL on it then extract the DB in the directory? ... humm. Will revisit later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested but this time I made sure to create a /volume1/calibre folder using the GUI and that ACL was enabled. Errors are now different which makes me think you would be better off adding a warning that ACL must be turned on.

Errors:

2022/05/03 10:05:24	===> Step postinst. USER=http GROUP= SHARE_PATH=
2022/05/03 10:05:24	Begin save_wizard_variables
2022/05/03 10:05:24	End save_wizard_variables
2022/05/03 10:05:24	Begin service_postinst
2022/05/03 10:05:24	Granting '' group permissions on /volume1/calibre
2022/05/03 10:05:24	(synoacltool.c, 125)No such Group 
2022/05/03 10:05:24	Granting '' group basic permissions on /volume1/calibre
2022/05/03 10:05:24	(synoacltool.c, 125)No such Group 
2022/05/03 10:05:24	End service_postins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actualy this is related to another issue (which I will be fixing).

But agree on the permissions message to add !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added permissions related message + fixed the GROUP logic to not have the failures reported

@smaarn
Copy link
Contributor Author

smaarn commented May 1, 2022

Attaching an "empty" library folder:
calibre.zip

@smaarn smaarn requested a review from th0ma7 May 7, 2022 11:53
@smaarn
Copy link
Contributor Author

smaarn commented May 21, 2022

Rebased @ head.

@th0ma7
Copy link
Contributor

th0ma7 commented Jun 30, 2022

@smaarn cycles have been limited lately. Is there a need for another review before merging or where you good to go?

@smaarn
Copy link
Contributor Author

smaarn commented Jul 1, 2022

@smaarn cycles have been limited lately. Is there a need for another review before merging or where you good to go?

@smaarn cycles have been limited lately. Is there a need for another review before merging or where you good to go?

@th0ma7 thanks for circling back, and no worries I had no cycles available lately so can't complain :D

Actually an extra review could be appreciated regarding the pseudo fragment mechanism used for the wizards (basically they are brutally concatenated). Since it can be seen as pretty ugly just wanted to know if it was ok.

Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@th0ma7
Copy link
Contributor

th0ma7 commented Jul 1, 2022

@smaarn Let me give it a shot on some of my NAS over the week-end to confirm it works all-right. Now I need to find back the metadata :)

BTW, I see you have a really good handle on WebStation type packages. Perhaps you could help me out to make rutorrent compatible on DSM7 part of your free-time? I could then update it to the latest version.

@hgy59
Copy link
Contributor

hgy59 commented Jul 1, 2022

@smaarn as you use a resource worker to define a package specific php profile with the required extensions enabled, what is the wizard page for, that tells to activate php extensions?

BTW: resource worker works with DSM 6 and DSM 7.

@smaarn
Copy link
Contributor Author

smaarn commented Jul 1, 2022

@smaarn as you use a resource worker to define a package specific php profile with the required extensions enabled, what is the wizard page for, that tells to activate php extensions?

BTW: resource worker works with DSM 6 and DSM 7.

@hgy59 I'm not sure I'm understanding what you mean. The resource worker doesn't require in itself any wizard page, it's basically replacing what you can configure through Web Station and PHP profiles (which is documented in the installation wizard of DSM 6 on how to do it manually), was it your question ?

Unfortunately the web resource worker don't work in DSM 6 from what I recall.

@smaarn
Copy link
Contributor Author

smaarn commented Jul 1, 2022

@smaarn Let me give it a shot on some of my NAS over the week-end to confirm it works all-right. Now I need to find back the metadata :)

BTW, I see you have a really good handle on WebStation type packages. Perhaps you could help me out to make rutorrent compatible on DSM7 part of your free-time? I could then update it to the latest version.

Thanks for your help !

I'll try having a look at rutorrent but it may prove to be a little bit more complex since it requires a set of authorization mechanisms which I'm not totally operational with (basically some folders need to be both writable for the web part and the non web part... I remember last time I played with it it was kind of a nightmare :) ).

Things are going a little bit more quiet over here so I may have some cycles over the coming weeks to check it.

* Add explicit wizard message regarding DSM permissions
* Add explicit wizard message regarding directory and library structure requirements
* Removal of DSM 4 specificities (???)
* Migrated to SERVICE_SETUP
@smaarn
Copy link
Contributor Author

smaarn commented Oct 2, 2022

Squashing all the commits after rebase at head in order to be able to merge by EOD (CET time) if everything goes fine.

@smaarn smaarn merged commit afad119 into SynoCommunity:master Oct 2, 2022
@smaarn smaarn deleted the cops/upgrade-1.0.1-1.1.3 branch October 2, 2022 20:48
@mreid-tt
Copy link
Contributor

mreid-tt commented May 26, 2023

@hgy59, I was trying to publish some packages that were previously merged. I noted that for the noarch-6.0 version I was getting an upload error (409) in the build which indicates that it was already present but not visible in the admin interface. After some checks it seems that in the INFO file there is a line firmware="3.1-1594" which is not appropriate for this build. Need some assistance in fixing this in the framework.

@hgy59
Copy link
Contributor

hgy59 commented May 27, 2023

expected versions in INFO file

  • firmware="3.1-1594"
  • os_min_ver="6.1-15047"

This is correct with my scripts to build and publish noarch packages

make_all_noarch.sh

#!/bin/bash

# make all noarch packages
echo ""
echo "===> MAKE noarch (default = DSM 3.1) <==="
make
echo ""
echo "===> MAKE noarch for SRM 1.1  <==="
make TCVERSION=1.1
echo ""
echo "===> MAKE noarch for DSM 6.1  <==="
make TCVERSION=6.1
echo ""
echo "===> MAKE noarch for DSM 7.0  <==="
make TCVERSION=7.0
echo ""

publish_all_noarch.sh

#!/bin/bash

# publish all noarch packages
echo ""
echo "===> PUBLISH noarch (default = DSM 3.1) <==="
make publish
echo ""
echo "===> PUBLISH noarch for SRM 1.1  <==="
make publish TCVERSION=1.1
echo ""
echo "===> PUBLISH noarch for DSM 6.1  <==="
make publish TCVERSION=6.1
echo ""
echo "===> PUBLISH noarch for DSM 7.0  <==="
make publish TCVERSION=7.0
echo ""

@hgy59
Copy link
Contributor

hgy59 commented May 27, 2023

@mreid-tt I have deleted the two packages of cops 1.1.3 now, so you can restart the deployment.

@mreid-tt
Copy link
Contributor

expected versions in INFO file

  • firmware="3.1-1594"
  • os_min_ver="6.1-15047"

hmm, recall I don't have a local build instance and only publish via GitHub. Would a possible solution be to update the matrix in this line:

arch: [noarch, noarch-6.0, noarch-7.0, x64-6.1, x64-7.1, evansport-6.1, evansport-7.1, aarch64-6.1, aarch64-7.1, armv7-6.1, armv7-7.1, hi3535-6.1, 88f6281-6.1, qoriq-6.1, comcerto2k-7.1]

Perhaps changing noarch-6.0 to noarch-6.1? Not sure if this would resolve the GitHub based builds...

@hgy59
Copy link
Contributor

hgy59 commented May 28, 2023

@mreid-tt indeed it was the 6.0 vs 6.1 version
see lines 61-63 in mk/spksrc.spk.mk

else ifeq ($(call version_ge, $(TCVERSION), 6.1),1)
SPK_TCVERS = dsm6
TC_OS_MIN_VER = 6.1-15047

building with TCVERSION=6.0 creates the same package as without TCVERSION (i.e. the same as noarch)

it is now fixed on head on master branch.

@mreid-tt mreid-tt added status/published Published and activated (may take up to 48h until visible in DSM package manager) and removed status/to-publish labels May 28, 2023
@mreid-tt
Copy link
Contributor

@mreid-tt indeed it was the 6.0 vs 6.1 version [---snip---]
building with TCVERSION=6.0 creates the same package as without TCVERSION (i.e. the same as noarch)

it is now fixed on head on master branch.

Thanks so much for this @hgy59, thanks for merging the fix into the master branch.

@mreid-tt I have deleted the two packages of cops 1.1.3 now, so you can restart the deployment.

I was able to run a new job and all builds completed successfully. The package has now been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsm 7 status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants