Skip to content

Commit 5289835

Browse files
Merge pull request #75 from pdsinterop/setup-test-server
Add script for setting up a test server
2 parents 2654859 + 531f6c4 commit 5289835

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ RUN php /install/composer.phar update
2323
RUN php /install/composer.phar install --no-dev --prefer-dist
2424
WORKDIR /var/www/html
2525
ADD init.sh /
26+
ADD init-live.sh /
2627
EXPOSE 443

init-live.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
export PHP_MEMORY_LIMIT="512M"
3+
php console.php maintenance:install --admin-user admin --admin-pass $MARIADB_ROOT_PASSWORD --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "$MARIADB_ROOT_PASSWORD" --database-host "127.0.0.1"
4+
php console.php status
5+
php console.php app:enable solid
6+
sed -i '96 i\ RewriteRule ^\\.well-known/openid-configuration /apps/solid/openid [R=302,L]' /var/www/html/.htaccess
7+
sed -i "25 i\ 1 => 'server'," /var/www/html/config/config.php
8+
sed -i "26 i\ 2 => 'nextcloud.local'," /var/www/html/config/config.php
9+
sed -i "27 i\ 3 => 'thirdparty'," /var/www/html/config/config.php
10+
sed -i "28 i\ 4 => '$HOST'," /var/www/html/config/config.php
11+
echo configured

setup-test-server.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
# when you ssh into a new empty ubuntu server:
4+
#
5+
# git clone https://github.com/pdsinterop/solid-nextcloud
6+
# cd solid-nextcloud
7+
# export HOST=your.host.com
8+
# export MARIADB_ROOT_PASSWORD=...
9+
# /bin/bash ./setup-test-server.sh
10+
#
11+
# that runs this script :)
12+
# you will get some interactive questions from LetsEncrypt certbot.
13+
14+
echo Setting up full nextcloud-solid server for $HOST
15+
16+
apt update
17+
apt install -y docker certbot
18+
certbot certonly --standalone
19+
mkdir -p /root/tls
20+
cp /etc/letsencrypt/live/$HOST/fullchain.pem /root/tls/server.cert
21+
cp /etc/letsencrypt/live/$HOST/privkey.pem /root/tls/server.key
22+
cd /root/solid-nextcloud
23+
docker build -t solid-nextcloud .
24+
docker build -t pubsub-server https://github.com/pdsinterop/php-solid-pubsub-server.git#main
25+
26+
27+
docker run -d --network=host -e MARIADB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD --name=db mariadb --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
28+
docker run -d --name=nextcloud --network=host -v /root/tls:/tls solid-nextcloud
29+
# docker run -d --name-pubsub --network=host -v /root/tls:/tls pubsub-server
30+
31+
sleep 15
32+
33+
docker exec -u www-data -it -e HOST=$HOST -e MARIADB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD nextcloud sh /init-live.sh

0 commit comments

Comments
 (0)