Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust the readme and fix the mastercontainer #33

Merged
merged 2 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Containers/mastercontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN curl "https://caddyserver.com/api/download?os=linux&arch=amd64" -o "/usr/bin

RUN cd /var/www/docker-aio; \
git clone https://github.com/nextcloud/all-in-one.git .; \
chmod 770 -R ./
chmod 770 -R ./; \
chown www-data:www-data -R ./

RUN mkdir -p /etc/apache2/certs && \
cd /etc/apache2/certs && \
Expand Down
2 changes: 1 addition & 1 deletion Containers/mastercontainer/cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -eu

while true; do
php /var/www/docker-aio/php/src/Cron/cron.php
sudo -u www-data php /var/www/docker-aio/php/src/Cron/cron.php
sleep 1d
done
26 changes: 12 additions & 14 deletions Containers/mastercontainer/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,17 @@ print_green() {
if ! [ -a "/var/run/docker.sock" ]; then
echo "Docker socket is not available. Cannot continue."
exit 1
elif ! test -r /var/run/docker.sock; then
elif ! sudo -u www-data test -r /var/run/docker.sock; then
echo "Trying to fix docker.sock permissions internally..."
GROUP="$(stat -c '%g' /var/run/docker.sock)"
groupadd -g "$GROUP" docker && \
usermod -aG docker root
if ! test -r /var/run/docker.sock; then
echo "Docker socket is not readable by the root user. Cannot continue."
usermod -aG docker www-data
if ! sudo -u www-data test -r /var/run/docker.sock; then
echo "Docker socket is not readable by the www-data user. Cannot continue."
exit 1
fi
fi

# Adjust permissions for all instances
chown root:root -R /mnt/docker-aio-config
chmod 770 -R /mnt/docker-aio-config

# Check if volume is writeable
if ! [ -w /mnt/docker-aio-config ]; then
echo "/mnt/docker-aio-config is not writeable."
exit 1
fi

# Check if api version is supported
API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)"
API_VERSION="$(grep -oP 'const API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP [0-9]+.[0-9]+ | head -1)"
Expand All @@ -50,6 +40,14 @@ fi
mkdir -p /mnt/docker-aio-config/data/
mkdir -p /mnt/docker-aio-config/session/
mkdir -p /mnt/docker-aio-config/caddy/
mkdir -p /mnt/docker-aio-config/certs/

# Adjust permissions for all instances
chmod 770 -R /mnt/docker-aio-config
chown www-data:www-data -R /mnt/docker-aio-config/data/
chown www-data:www-data -R /mnt/docker-aio-config/session/
chown root:root -R /mnt/docker-aio-config/caddy/
chown root:root -R /mnt/docker-aio-config/certs/

# Adjust certs
GENERATED_CERTS="/mnt/docker-aio-config/certs"
Expand Down
11 changes: 3 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ Included are:
```
curl -fsSL get.docker.com | sudo sh
```
2. Make sure that the docker group has the correct groupid:

```
sudo groupmod -g 998 docker
```
3. Make sure to pull the latest image:
2. Make sure to pull the latest image:

```
sudo docker pull nextcloud/all-in-one:latest
```
4. Run the following command in order to start the container:
3. Run the following command in order to start the container:

```
sudo docker run -it \
Expand All @@ -43,7 +38,7 @@ sudo docker run -it \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest
```
5. After the initial startup, you should be able to open the Nextcloud AIO Interface now on port 8080 of this server.<br>
4. After the initial startup, you should be able to open the Nextcloud AIO Interface now on port 8080 of this server.<br>
E.g. https://internal.ip.of.this.server:8080<br>
If your server has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatially by opening the Nextcloud AIO Interface via:<br>
https://your-domain-that-points-to-this-server.tld:8443
Expand Down