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

Podman on systems with SELinux needs a :z or :Z suffix #8

Open
ambiamber opened this issue Sep 13, 2022 · 4 comments
Open

Podman on systems with SELinux needs a :z or :Z suffix #8

ambiamber opened this issue Sep 13, 2022 · 4 comments

Comments

@ambiamber
Copy link

Hello to you!

Thanks for working on this! I can't wait to deploy it. I'm new to PartKeepr but I've been using computers for 45 years now.

Today I wanted a way of keeping track of the food in my home because I'm forgetting what I have and can't plan to make recipes. I went poking around and I found PartKeepr and I immediacy wanted it in a virtual machine or a container or a snap for risk reduction (A.K.A "security" but my mindset is that "security" is not the best term for protection as it implies false things so I use "risk reduction" instead).

During my initial review (reading the README.md) I noticed that the volume names do that have the SELinux suffix. I will try to make a pull request when I am able so this is a notice about this issue.

For more information about SELinux Podman volume suffixes pleas see the Red Hat blog. Note that SELinux may be in use outside of Red Hat, for instance Android uses it too and probably others. There may be other issues with namespaces when using rootless Podman too.

https://www.redhat.com/sysadmin/user-namespaces-selinux-rootless-containers

@ambiamber
Copy link
Author

ambiamber commented Sep 14, 2022

I'm enjoying using Partkeepr in general. I feel that it really helping me organize my food better, I'm up to 53 different types of food and 83 items. Maybe someday I'll be able to integrate it into a recipe cookbook like NextCloud Cookbook but that's still sky-high on my wish list.

I have yet to deploy it in a container as I want more experience before doing that. I'm using a Debian 9 (Stretch) VM for exploration into Partkeepr for now.

Regarding risk management, my impression is that Alpine 3.10.3 is unfavorable.

$ podman run -t partkeepr cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.10.3
PRETTY_NAME="Alpine Linux v3.10"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

https://endoflife.date/alpine
Alpine 3.10.9 security support ended 1 year and 4 months ago (01 May 2021)

What should I do about that?

One possibility that I could work on to improve things slightly is to update from Alpine 3.10.3 to 3.10.9. That would entail extracting an old version from the Docker Library for PHP and updating that Dockerfile. Once the updated image is hosted this update would only need to be done once as there are no more Alpine 3.10.X updates.

The other thing that comes to mind quickly is to switch to Debian 9 with Extended LTS support. That would be more work and would still have PHP 7.1 which is required due to being on Symphony 2.

It might be the very best thing to become a Partkeepr contributor and work on migrating to Symphony 6. That would take me the most effort.

@Forceu
Copy link
Owner

Forceu commented Sep 14, 2022

Thanks a lot for your feedback! I will probably update the Dockerfile at some point to include an updated Alpine version.

At the moment Partkeepr is being rewritten, see partkeepr/PartKeepr#1239. That means in the near future this image might not be necessary any more to run Partkeepr.

Also if you are looking for an inventory system for food, grocy might be the better (and more modern) choice.

@ambiamber
Copy link
Author

ambiamber commented Sep 15, 2022

Thanks for the tip about grocy. I do dread having to enter 174 different types of items and so on. I will take a look at it to see if it has all the features that I'm using now.

Meanwhile I've updated Debian 9 (Squeeze) which comes with PHP 7.0.33-0+deb9u12 using the Freexian ELTS. Freexian is also on the Debian Gitlab instance. It provided me with 33 package updates.

On Debian 9 (Stretch) add the Apt key

Either

wget https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb && sudo dpkg -i freexian-archive-keyring_2022.06.08_all.deb

Or

sudo wget https://deb.freexian.com/extended-lts/archive-key.gpg -O /etc/apt/trusted.gpg.d/freexian-archive-extended-lts.gpg

Then the create the sources.list file

sudo -i
echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' > /etc/apt/sources.list.d/extended-lts.list
echo '# deb http://deb.freexian.com/extended-lts stretch main contrib non-free' >> /etc/apt/sources.list.d/extended-lts.list

apt update
33 packages can be upgraded. Run 'apt list --upgradable' to see them.

Ubuntu 22.04 may be viable using PPAs
There is no PHP 7.1 or 7.2 in Ubuntu 22.04 by default.
There is a PPA with PHP 7.2 and one for PHP 7.* modules.
https://launchpad.net/~sergey-dryabzhinsky/+archive/ubuntu/php72?field.series_filter=jammy
https://launchpad.net/~sergey-dryabzhinsky/+archive/ubuntu/php7-modules?field.series_filter=jammy
I think it might require the PPAs for certain packages:
https://launchpad.net/~sergey-dryabzhinsky/+archive/ubuntu/backports?field.series_filter=jammy
https://launchpad.net/~sergey-dryabzhinsky/+archive/ubuntu/packages?field.series_filter=jammy

It is easy for me to copy the database and data files from one test VM to another.

On the original VM
sudo mysqldump partkeepr > partkeepr.dump
copy partkeepr.dump to the new VM
On the new VM
sudo systemctl stop apache2.service
sudo mysql partkeepr < partkeepr.dump
sudo systemctl start apache2.service
http://partkeepr-git/setup/
cat /var/www/partkeepr/app/authkey.php
Copy /var/www/partkeepr/data/ from the original VM to the new one.
On the original VM
tar cjf partkeepr-data.tar.xz /var/www/partkeepr/data/
Copy partkeepr-data.tar.xz to the new VM
On the new VM
cd /
sudo tar xf partkeepr-data.tar.xz

@ambiamber
Copy link
Author

ambiamber commented Sep 18, 2022

I finally got grocy installed despite the lack of documentation. I know I could have used a container but a friend of mine told me he always installs a package from scratch to see if how easy it is to install it. Packages that are not easy to install are a bad sign.
Maybe they find it hard to write grocy documentation because their knowledge of English is poor.
https://github.com/grocy/docs/pull/18/files

Now I can't find a way to have nested Food Groups in grocy like I can in PartKeepr.
https://www.reddit.com/r/grocy/comments/xhgvky/nested_tree_of_product_groups/

I got PartKeepr to install on Ubuntu 22.04.
https://gist.github.com/ambiamber/23b3eb529bb10f255ef0d8ef65508d32
I think I'll stick with PartKeepr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants