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

add audiobookshelf install sh #1028

Closed
wants to merge 9 commits into from

Conversation

lupu60
Copy link

@lupu60 lupu60 commented Jun 14, 2023

Add installation for audiobookshelf

Description

Add installation for audiobookshelf

Change Categories

  • New feature

Checklist

  • Branch was made off the develop branch and the PR is targetting the develop branch
  • Docs have been made OR are not necessary
    • PR link:
  • Changes to panel have been made OR are not necessary
    • PR link:
  • Code is formatted (See more)
  • Code conforms to project structure (See more)
  • Shellcheck isn't screaming (See more)
  • Prints to terminal are handled (See more)
  • I have commented my code, particularly in hard-to-understand areas
  • Testing was done
    • Tests created or no new tests necessary
    • Tests executed

Test scenarios

Architectures

amd64 armhf arm64 Unspecified
Jammy
Focal
Bionic
Bullseye
Buster
Stretch
Raspbian ⚫️ ⚫️ ⚫️

✅❎ Passed

🛠🛠 TODO

❌❌ Currently failing

@liaralabs
Copy link
Member

Thanks for the contribution lupu60. I have a few items of feedback:

  • At the moment we are requiring contributors of new applications to be willing to maintain these applications long term. The core maintainers are already stretched thin with maintaining the existing packages. Are you willing to commit to this?
  • The package is missing nginx proxy configs
  • Dashboard integration: You should submit a PR to the swizzin_dashboard repository to make this changes there rather than echoing these changes into the profiles. The method you have chosen is not guaranteed to not be clobbered during box updates

@lupu60
Copy link
Author

lupu60 commented Jun 15, 2023

Hello @liaralabs.

Copy link
Member

@flying-sausages flying-sausages left a comment

Choose a reason for hiding this comment

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

Mostly what Liara said, let me know if there's anything I can help you with!

Comment on lines +16 to +33
__add_to_pannel(){
curl -o /opt/swizzin/static/img/apps/audiobookshelf.png https://www.audiobookshelf.org/Logo.png
# Content to write
content='from core.profiles import *\n\n
class audiobookshelf_meta:\n
name = "audiobookshelf"\n
pretty_name = "Audiobookshelf"\n
baseurl = "/audiobookshelf"\n
systemd = "audiobookshelf"\n
check_theD = True'

# Write content to the file
echo -e "$content" > /opt/swizzin/core/custom/profiles.py

echo "Content has been written to /opt/swizzin/core/custom/profiles.py"
touch /install/.audiobookshelf.lock
systemctl restart panel
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this and make a PR on the panel repo please? Let me know if you need help in the discord

# Audiobookshelf installer

_install_audiobookshelf() {
echo_progress_start "Installing audiobookshelf apt sources"
Copy link
Member

Choose a reason for hiding this comment

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

echo_progress_start kind of expects an echo_progress_done, think of the two as the slices of bread in a waiting sandwich


_install_audiobookshelf() {
echo_progress_start "Installing audiobookshelf apt sources"
apt install gnupg curl
Copy link
Member

Choose a reason for hiding this comment

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

We have apt_install defined which helps handle these without the interactivity

Copy link
Member

Choose a reason for hiding this comment

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

You can use it like this, it is imported into the environment anytime you run box, you can check sources/globals.sh to see what else there is

Suggested change
apt install gnupg curl
apt_install gnupg curl

curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | apt-key add -
curl -s -o /etc/apt/sources.list.d/audiobookshelf.list https://advplyr.github.io/audiobookshelf-ppa/audiobookshelf.list
apt update
apt install audiobookshelf
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, would be nice to keep the apt installs to one call with one big list in my opinion

Comment on lines +15 to +18
__remove_from_pannel() {
content= 'from core.profiles import *\n\n'
echo -e "$content" > /opt/swizzin/core/custom/profiles.py
}
Copy link
Member

Choose a reason for hiding this comment

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

Again, not really needed if it's in the panel repo

Comment on lines +10 to +11
apt update
apt autoremove
Copy link
Member

Choose a reason for hiding this comment

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

We've got apt functions for these two, but I don't think you need to do the update here, just takes time. The apt tools will auto-update themselves as they're being called if necessary

Comment on lines +6 to +7
systemctl stop audiobookshelf.service
sysctl disable audiobookshelf.service
Copy link
Member

Choose a reason for hiding this comment

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

disable also takes --now parameter so you can get these done in one line. Would also be nice to pass the -q flag so it's quiet

@lupu60 lupu60 closed this Aug 18, 2023
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

Successfully merging this pull request may close these issues.

3 participants