Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@xieve
Copy link
Contributor

@xieve xieve commented Jul 29, 2025

Adhering to systemd standards for the environment variables.

Description

All hard-coded paths can now be configured via environment variables. The names of the environment variables are chosen so that they can be read directly from systemd, if arm is started as a systemd service, see systemd.exec(5).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Ripped and transcoded a DVD successfully

  • Docker
  • Other (NixOS Module)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have tested that my fix is effective or that my feature works

Changelog:

  • Configs are read from $CONFIGURATION_DIRECTORY
  • $RUNTIME_DIRECTORY is used for mountpoints
  • $STATE_DIRECTORY is used for the DB
  • $LOGS_DIRECTORY is used for the logs
  • The default values are as before
  • Read $PATH from /etc/environment in the docker wrapper so we can call makemkv without an absolute path
    • In my opinion, this is the better approach vs. a1df08d, because it is more general, that is why I haven't rebased onto main yet

Logs

EN-102281_175380153613.log

@sonarqubecloud
Copy link

@xieve
Copy link
Contributor Author

xieve commented Jul 29, 2025

Example for a systemd service: (rough sketch, will work later with more changes from my fork)

Details
# /etc/systemd/system/armui.service
[Unit]
After=network-online.target
Description=Automatic Ripping Machine Web UI
Wants=network-online.target

[Service]
BindPaths=/mnt/frail/srv/rips/raw/
BindPaths=/mnt/frail/srv/rips/transcoded/
BindPaths=/mnt/frail/srv/rips/completed/
ConfigurationDirectory=arm # /etc/arm
DeviceAllow=block-sr rw
ExecStart=/usr/bin/armui
LogsDirectory=arm # /var/log/arm
LogsDirectory=arm/progress
PrivateTmp=true
ProtectHome=true
ProtectSystem=strict
Restart=always
RestartSec=3
StateDirectory=arm # /var/lib/arm
Type=exec
User=arm

[Install]
WantedBy=multi-user.target
# /etc/systemd/system/arm@.service
[Unit]
Description=Automatic Ripping Machine Worker

[Service]
ConfigurationDirectory=arm # /etc/arm
ExecStart=/usr/bin/arm --no-syslog --devpath "%I"
LogsDirectory=arm
PrivateTmp=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=/mnt/frail/srv/rips/raw/
ReadWritePaths=/mnt/frail/srv/rips/transcoded/
ReadWritePaths=/mnt/frail/srv/rips/completed/
ReadWritePaths=/dev/%I
RuntimeDirectory=arm # /run/arm
StateDirectory=arm # /var/lib/arm
User=arm

@xieve xieve mentioned this pull request Jul 30, 2025
Copy link
Collaborator

@microtechno9000 microtechno9000 left a comment

Choose a reason for hiding this comment

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

Good idea and will help make changes easier, as some users have been keen to not run ARM from /opt.
However, I dont see where the environment variables are being defined. Is there a .env file thats missing, or maybe I miss understand what's happening here.

arm/config/config.py Outdated Show resolved Hide resolved
arm/config/config.py Show resolved Hide resolved
@microtechno9000 microtechno9000 added Awaiting feedback Waiting for user to test fixes Bugfix Bugfixes in PR labels Aug 9, 2025
@microtechno9000 microtechno9000 added the documentation This issue contains info about documentation or is helpful label Sep 16, 2025
@xieve xieve force-pushed the feat-no-hardcoded-paths branch 5 times, most recently from 8f670a8 to 6465320 Compare November 9, 2025 11:09
@xieve xieve requested a review from microtechno9000 November 9, 2025 11:24
@xieve xieve force-pushed the feat-no-hardcoded-paths branch from 6465320 to deeb9d3 Compare November 12, 2025 20:49
@xieve xieve marked this pull request as draft November 12, 2025 21:05
@xieve
Copy link
Contributor Author

xieve commented Nov 12, 2025

Okay, basically rewrote the PR, imo it is much clearer now what I'm doing. Instead of five env vars, I'm now using just ARM_CONFIG_FILE, and all other parameters are read from the config. I need to make some finishing touches now though.

@xieve xieve force-pushed the feat-no-hardcoded-paths branch 3 times, most recently from 46482af to 4fb8a06 Compare November 12, 2025 22:04
@xieve
Copy link
Contributor Author

xieve commented Nov 12, 2025

I would like to use mount --all /dev/sr<number> to mount the drives, but all the documentation on manual installs instructs users to add these mount options to their fstab:

users,noauto,exec,utf8,ro

Which strikes me as odd twice:

  1. Why noauto? (It inhibits the use of mount --all <devpath>)
  2. Why exec? AFAIK ARM never wants to run binaries off of optical media

Here's what I would suggest (maybe I'll open another PR):

defaults,users,utf8,ro

Anyway, while this would be easy to change for docker users, the setups of people with a manual install would likely break. I deemed this probably bad and worked around it by querying fstab via findmnt, but IMO the resulting code is much more convoluted and unclear than it needs to be. LMK if you would be fine with this breaking change.

Edit: testing is now gone through, here's the new log:

2_MULES_FOR_SISTER_SARAH_176298319677.log

Landing this PR would now be fine for me, if you don't want me to make the change I outlined above.

@xieve xieve marked this pull request as ready for review November 12, 2025 22:18
@xieve xieve force-pushed the feat-no-hardcoded-paths branch from 4fb8a06 to 09f0283 Compare November 13, 2025 12:07
Copy link
Collaborator

@microtechno9000 microtechno9000 left a comment

Choose a reason for hiding this comment

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

some minor comments

arm/ripper/main.py Show resolved Hide resolved
@microtechno9000
Copy link
Collaborator

I would like to use mount --all /dev/sr<number> to mount the drives, but all the documentation on manual installs instructs users to add these mount options to their fstab:

users,noauto,exec,utf8,ro

Which strikes me as odd twice:

1. Why `noauto`? (It inhibits the use of `mount --all <devpath>`)

2. Why `exec`? AFAIK ARM never wants to run binaries off of optical media

Here's what I would suggest (maybe I'll open another PR):

defaults,users,utf8,ro

Anyway, while this would be easy to change for docker users, the setups of people with a manual install would likely break. I deemed this probably bad and worked around it by querying fstab via findmnt, but IMO the resulting code is much more convoluted and unclear than it needs to be. LMK if you would be fine with this breaking change.

Edit: testing is now gone through, here's the new log:

2_MULES_FOR_SISTER_SARAH_176298319677.log

Landing this PR would now be fine for me, if you don't want me to make the change I outlined above.

The existing fstab rules are possibly a hang over from when ARM was not installed and maintained within docker. If a user installed arm on a system with Gnome or KDE, then the automount would mount the drive within the OS.
Noting that docker is the main supported installation method, adjusting to suit is fine. A warning can be added to the manual user wiki install guides that modification to their fstab would be required for ARM to work.

@xieve
Copy link
Contributor Author

xieve commented Nov 15, 2025

Alright! I'll make the change right now, but I'm not home, so it might take until monday before I can test that.

@xieve xieve force-pushed the feat-no-hardcoded-paths branch 2 times, most recently from 355d533 to a54bdcd Compare November 15, 2025 14:38
@xieve
Copy link
Contributor Author

xieve commented Nov 15, 2025

Here's the interdiff for the latest change:
https://github.com/automatic-ripping-machine/automatic-ripping-machine/compare/09f0283f610e525c1a9132a6b17d0243570b2c42..1e877f23e1110fc4e548c7e195211f124c6f1d03

IMO it's much simpler now. Should I make it clear on the alternate install method pages that there has been a change to the fstab, or is it fine as it is?

@xieve xieve force-pushed the feat-no-hardcoded-paths branch 2 times, most recently from 1e877f2 to e7a899a Compare November 16, 2025 11:34
@xieve

This comment was marked as resolved.

- Location of arm.yaml can now optionally be set via the ARM_CONFIG_FILE environment variable
- The default location stays the same (/etc/arm/config/arm.yaml)
- All settings concerning paths in arm.yaml should now work as expected,
  the following have had their behavior fixed:
	- INSTALLPATH
	- APPRISE
	- ABCDE_CONFIG_FILE
	- LOGPATH
- Mountpoints for discs are not hardcoded any more, instead:
	- If the disc is already mounted anywhere and the mountpoint is
	  readable, it is used
	- Otherwise, the disc is mounted via `mount --all <devpath>` (aka. auto-mount) to wherever specified in `fstab`
	- That is the reason why the default `fstab` has changed, to allow for auto-mount
@xieve xieve force-pushed the feat-no-hardcoded-paths branch from e7a899a to aff6896 Compare November 16, 2025 17:12
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting feedback Waiting for user to test fixes Bugfix Bugfixes in PR documentation This issue contains info about documentation or is helpful

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.