-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path001_onboot
45 lines (36 loc) · 1.54 KB
/
001_onboot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Install dependency updates
# sudo apt-get -qqy update
# sudo apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' full-upgrade
# sudo apt-get -qqy clean
# Pull the image another time
sudo docker pull nextcloud/all-in-one:latest
# Install Nextcloud AIO
sudo docker run -d \
--name nextcloud-aio-mastercontainer \
--restart always \
-p 80:80 \
-p 8080:8080 \
-p 8443:8443 \
-e NEXTCLOUD_MOUNT=/mnt/ \
-e NEXTCLOUD_DATADIR=/mnt/ncdata \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest
# Some Info
cat << EOF > /etc/motd
# # ###### # # ##### #### # #### # # #####
## # # # # # # # # # # # # # #
# # # ##### ## # # # # # # # # #
# # # # ## # # # # # # # # #
# ## # # # # # # # # # # # # #
# # ###### # # # #### ###### #### #### #####
If you point a domain to this server ($(hostname -I | cut -f1 -d' ')), you can open the admin interface at https://yourdomain.com:8443
Otherwise you can open the admin interface at https://$(hostname -I | cut -f1 -d' '):8080
Further documentation is available here: https://github.com/nextcloud/all-in-one
EOF
# Remove the ssh force logout command
sed -e '/Match User root/d' \
-e '/.*ForceCommand.*droplet.*/d' \
-i /etc/ssh/sshd_config
systemctl restart ssh