Move config file to /etc/transmission-rss-manager
- Changed config location to /etc/transmission-rss-manager/config.json - Added fallback to maintain backward compatibility - Updated installers to create and use the new location - Added installPath property to configuration for updates - Enhanced documentation with new config location - Bumped version to 2.0.3 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
# Configuration variables with defaults
|
||||
INSTALL_DIR="/opt/transmission-rss-manager"
|
||||
CONFIG_DIR="/etc/transmission-rss-manager"
|
||||
SERVICE_NAME="transmission-rss-manager"
|
||||
PORT=3000
|
||||
|
||||
|
||||
@@ -163,6 +163,12 @@ function create_directories() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if CONFIG_DIR is defined
|
||||
if [ -z "$CONFIG_DIR" ]; then
|
||||
log "ERROR" "CONFIG_DIR is not defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create directories and check for errors
|
||||
DIRECTORIES=(
|
||||
"$INSTALL_DIR"
|
||||
@@ -171,6 +177,7 @@ function create_directories() {
|
||||
"$INSTALL_DIR/public/css"
|
||||
"$INSTALL_DIR/modules"
|
||||
"$INSTALL_DIR/data"
|
||||
"$CONFIG_DIR"
|
||||
)
|
||||
|
||||
for dir in "${DIRECTORIES[@]}"; do
|
||||
@@ -180,5 +187,9 @@ function create_directories() {
|
||||
fi
|
||||
done
|
||||
|
||||
# Set permissions for configuration directory
|
||||
chown -R "$USER:$USER" "$CONFIG_DIR"
|
||||
chmod 755 "$CONFIG_DIR"
|
||||
|
||||
log "INFO" "Directories created successfully."
|
||||
}
|
||||
@@ -4,6 +4,63 @@
|
||||
function create_config_files() {
|
||||
echo -e "${YELLOW}Creating configuration files...${NC}"
|
||||
|
||||
# Create initial config.json
|
||||
echo "Creating config.json..."
|
||||
cat > $CONFIG_DIR/config.json << EOF
|
||||
{
|
||||
"version": "2.0.3",
|
||||
"installPath": "$INSTALL_DIR",
|
||||
"transmissionConfig": {
|
||||
"host": "$TRANSMISSION_HOST",
|
||||
"port": $TRANSMISSION_PORT,
|
||||
"username": "$TRANSMISSION_USER",
|
||||
"password": "$TRANSMISSION_PASS",
|
||||
"path": "$TRANSMISSION_RPC_PATH"
|
||||
},
|
||||
"remoteConfig": {
|
||||
"isRemote": $TRANSMISSION_REMOTE,
|
||||
"directoryMapping": $TRANSMISSION_DIR_MAPPING
|
||||
},
|
||||
"destinationPaths": {
|
||||
"movies": "$MEDIA_DIR/movies",
|
||||
"tvShows": "$MEDIA_DIR/tvshows",
|
||||
"music": "$MEDIA_DIR/music",
|
||||
"books": "$MEDIA_DIR/books",
|
||||
"magazines": "$MEDIA_DIR/magazines",
|
||||
"software": "$MEDIA_DIR/software"
|
||||
},
|
||||
"seedingRequirements": {
|
||||
"minRatio": 1.0,
|
||||
"minTimeMinutes": 60,
|
||||
"checkIntervalSeconds": 300
|
||||
},
|
||||
"processingOptions": {
|
||||
"enableBookSorting": $ENABLE_BOOK_SORTING,
|
||||
"extractArchives": true,
|
||||
"deleteArchives": true,
|
||||
"createCategoryFolders": true,
|
||||
"ignoreSample": true,
|
||||
"ignoreExtras": true,
|
||||
"renameFiles": true,
|
||||
"autoReplaceUpgrades": true,
|
||||
"removeDuplicates": true,
|
||||
"keepOnlyBestVersion": true
|
||||
},
|
||||
"rssFeeds": [],
|
||||
"rssUpdateIntervalMinutes": 60,
|
||||
"autoProcessing": false,
|
||||
"securitySettings": {
|
||||
"authEnabled": false,
|
||||
"httpsEnabled": false,
|
||||
"sslCertPath": "",
|
||||
"sslKeyPath": "",
|
||||
"users": []
|
||||
},
|
||||
"port": $PORT,
|
||||
"logLevel": "info"
|
||||
}
|
||||
EOF
|
||||
|
||||
# Create package.json
|
||||
echo "Creating package.json..."
|
||||
cat > $INSTALL_DIR/package.json << EOF
|
||||
|
||||
@@ -21,6 +21,11 @@ function setup_service() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$CONFIG_DIR" ]; then
|
||||
log "ERROR" "CONFIG_DIR variable is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PORT" ]; then
|
||||
log "ERROR" "PORT variable is not set"
|
||||
exit 1
|
||||
@@ -71,6 +76,7 @@ Environment=PORT=$PORT
|
||||
Environment=NODE_ENV=production
|
||||
Environment=DEBUG_ENABLED=false
|
||||
Environment=LOG_FILE=$INSTALL_DIR/logs/transmission-rss-manager.log
|
||||
Environment=CONFIG_DIR=$CONFIG_DIR
|
||||
EOF
|
||||
|
||||
# Preserve the existing JWT_SECRET if available
|
||||
@@ -117,6 +123,7 @@ Environment=PORT=$PORT
|
||||
Environment=NODE_ENV=production
|
||||
Environment=DEBUG_ENABLED=false
|
||||
Environment=LOG_FILE=$INSTALL_DIR/logs/transmission-rss-manager.log
|
||||
Environment=CONFIG_DIR=$CONFIG_DIR
|
||||
# Generate a random JWT secret for security
|
||||
Environment=JWT_SECRET=$(openssl rand -hex 32)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user