mirror of
https://git.cloudron.io/cloudron/freshrss-app
synced 2025-09-25 22:37:25 +00:00
Using cli scripts & allowing config changes
This commit is contained in:
52
start.sh
52
start.sh
@@ -7,20 +7,13 @@ mkdir -p /run/php/sessions
|
||||
if ! [ -f /app/data/.installed ]; then
|
||||
echo "Fresh installation, setting up..."
|
||||
rsync -a /app/code/data-orig/ /app/data/
|
||||
dd if=/dev/urandom bs=1 count=1024 2>/dev/null | sha1sum | awk '{ print $1 }' > /app/data/.salt
|
||||
mkdir -p /app/data/users/admin
|
||||
cat > /app/data/users/admin/config.php <<EOF
|
||||
<?php
|
||||
return array (
|
||||
'language' => 'en',
|
||||
'passwordHash' => '\$2a\$09\$lO5xTAsfRCG1rSssJgHtTeiweXj2VwGN/JfuexIMpsQWzKoFVoklm',
|
||||
'apiPasswordHash' => '',
|
||||
);
|
||||
?>
|
||||
EOF
|
||||
touch /app/data/users/admin/log.txt
|
||||
rm /app/data/do-install.txt
|
||||
php /app/code/setup_db.php
|
||||
php cli/do-install.php \
|
||||
--environment production --default_user admin \
|
||||
--db-type mysql --db-host "${MYSQL_HOST}:${MYSQL_PORT}" \
|
||||
--db-user "${MYSQL_USERNAME}" --db-password "${MYSQL_PASSWORD}" \
|
||||
--db-base "${MYSQL_DATABASE}"
|
||||
php cli/create-user.php --user admin --password password --language en
|
||||
php cli/actualize-user.php --user admin
|
||||
touch /app/data/.installed
|
||||
echo "Done."
|
||||
fi
|
||||
@@ -32,34 +25,15 @@ for f in $(ls /app/code/extensions-orig); do
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Creating config file"
|
||||
SALT=$(cat /app/data/.salt)
|
||||
cat > /app/data/config.php <<EOF
|
||||
<?php
|
||||
return array (
|
||||
'salt' => '${SALT}',
|
||||
'base_url' => 'https://${APP_DOMAIN}/p',
|
||||
'title' => 'FreshRSS',
|
||||
'default_user' => 'admin',
|
||||
'auth_type' => 'form',
|
||||
'db' =>
|
||||
array (
|
||||
'type' => 'mysql',
|
||||
'host' => '${MYSQL_HOST}',
|
||||
'user' => '${MYSQL_USERNAME}',
|
||||
'password' => '${MYSQL_PASSWORD}',
|
||||
'base' => '${MYSQL_DATABASE}',
|
||||
'prefix' => '',
|
||||
'pdo_options' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pubsubhubbub_enabled' => true,
|
||||
);
|
||||
EOF
|
||||
|
||||
echo "Creating config file"
|
||||
php set_config.php
|
||||
|
||||
|
||||
echo "Setting permissions"
|
||||
chown -R www-data.www-data /run/php /app/data
|
||||
|
||||
|
||||
echo "Starting apache"
|
||||
APACHE_CONFDIR="" source /etc/apache2/envvars
|
||||
rm -f "${APACHE_PID_FILE}"
|
||||
|
Reference in New Issue
Block a user