Compare commits
5 Commits
edbfafd951
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f850bc326 | |||
| 55122123c2 | |||
| c0920dd46f | |||
| 4939f18c26 | |||
| b4f72fa1c5 |
@@ -10,7 +10,7 @@ URL: %(make url)
|
|||||||
Source0: %(make source0)
|
Source0: %(make source0)
|
||||||
Buildarch: %(make arch)
|
Buildarch: %(make arch)
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
Requires: netoik-rp netoik-db netoik-cache php php-cli php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-opcache php-json php-zip php-redis php-imagick php-fpm
|
Requires: netoik-rp netoik-db netoik-cache php php-cli php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-opcache php-json php-zip php-redis php-imagick php-fpm php-posix php-pgsql
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Install the cloud server called Nextcloud.
|
Install the cloud server called Nextcloud.
|
||||||
@@ -28,22 +28,22 @@ set -xe
|
|||||||
# Create nextcloud user
|
# Create nextcloud user
|
||||||
if ! id nextcloud >/dev/null 2>&1; then
|
if ! id nextcloud >/dev/null 2>&1; then
|
||||||
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system nextcloud
|
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system nextcloud
|
||||||
|
runuser --user=nextcloud -- mkdir --parents %{_sharedstatedir}/nextcloud/data
|
||||||
|
runuser --user=nextcloud -- printf 'alias occ="php /var/www/nextcloud/occ"\n' > %{_sharedstatedir}/nextcloud/.bash_profile
|
||||||
|
usermod --groups postgres,valkey --append nextcloud
|
||||||
fi
|
fi
|
||||||
runuser --user=nextcloud -- mkdir --parents %{_sharedstatedir}/nextcloud/data
|
|
||||||
|
|
||||||
# Create config file
|
# Create config file
|
||||||
if ! -f %{_sysconfdir}/nextcloud/config.php; then
|
if ! -f %{_sysconfdir}/nextcloud/config.php; then
|
||||||
export INSTANCE_ID=$(openssl rand -hex 16)
|
export INSTANCE_ID=$(openssl rand -hex 16)
|
||||||
export PASSWORD_SALT=$(openssl rand -hex 16)
|
export PASSWORD_SALT=$(openssl rand -hex 16)
|
||||||
export SECRET=$(openssl rand -hex 16)
|
export SECRET=$(openssl rand -hex 16)
|
||||||
|
export CONFIG='$CONFIG'
|
||||||
envsubst < %{_sysconfdir}/nextcloud/config.php.tpl > %{_sysconfdir}/nextcloud/config.php
|
envsubst < %{_sysconfdir}/nextcloud/config.php.tpl > %{_sysconfdir}/nextcloud/config.php
|
||||||
chown root:nextcloud %{_sysconfdir}/nextcloud/config.php
|
chown root:nextcloud %{_sysconfdir}/nextcloud/config.php
|
||||||
chmod 640 %{_sysconfdir}/nextcloud/config.php
|
chmod 640 %{_sysconfdir}/nextcloud/config.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add nextcloud to postgres and valkey groups
|
|
||||||
usermod --groups postgres,valkey --append nextcloud
|
|
||||||
|
|
||||||
# Create postgres user and db
|
# Create postgres user and db
|
||||||
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet nextcloud; then
|
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet nextcloud; then
|
||||||
runuser --user=postgres -- createuser nextcloud
|
runuser --user=postgres -- createuser nextcloud
|
||||||
@@ -60,15 +60,11 @@ if ! -d /var/www/nextcloud; then
|
|||||||
gpg --import %{_tmppath}/nextcloud.asc
|
gpg --import %{_tmppath}/nextcloud.asc
|
||||||
gpg --verify %{_tmppath}/nextcloud-latest.tar.bz2.asc %{_tmppath}/nextcloud-latest.tar.bz2
|
gpg --verify %{_tmppath}/nextcloud-latest.tar.bz2.asc %{_tmppath}/nextcloud-latest.tar.bz2
|
||||||
tar --extract --file=%{_tmppath}/nextcloud-latest.tar.bz2 --directory=/var/www
|
tar --extract --file=%{_tmppath}/nextcloud-latest.tar.bz2 --directory=/var/www
|
||||||
|
chown --recursive nextcloud:nextcloud /var/www/nextcloud
|
||||||
|
chmod 755 /var/www/nextcloud
|
||||||
|
runuser --user=nextcloud -- ln --symbolic --force %{_sysconfdir}/nextcloud/config.php /var/www/nextcloud/config/config.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change rights and owner
|
|
||||||
chown --recursive nextcloud:nextcloud /var/www/nextcloud
|
|
||||||
chmod 755 /var/www/nextcloud
|
|
||||||
|
|
||||||
# Create symbolic link to config
|
|
||||||
runuser --user=nextcloud -- ln --symbolic --force %{_sysconfdir}/nextcloud/config.php /var/www/nextcloud/config/config.php
|
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl reenable nginx.service php-fpm.service
|
systemctl reenable nginx.service php-fpm.service
|
||||||
|
|||||||
Reference in New Issue
Block a user