2021-11-30 18:20:42 +08:00
{% extends "layout.twig" %}
{% block body %}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<header>
<div class="">
<div class="logo"></div>
</div>
<form method="POST" action="/api/auth/logout">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Log out" />
</form>
</header>
<div class="content">
2022-03-09 19:39:51 +08:00
<h1>Nextcloud AIO Beta v0.7.0</h1>
2021-11-30 18:20:42 +08:00
This is beta software and not production ready.<br><br>
{% set isAnyRunning = false %}
2022-03-15 19:45:31 +08:00
{% set isAnyRestarting = false %}
2021-11-30 18:20:42 +08:00
{% set isWatchtowerRunning = false %}
{% set isBackupContainerRunning = false %}
{% set isRestoreRunning = false %}
{% set isBackupOrRestoreRunning = false %}
{% set isApacheStarting = false %}
{% for container in containers %}
{% if class ( container . G etRunningState ( ) ) == 'AIO\\Container\\State\\RunningState' and container . G etIdentifier ( ) != 'nextcloud-aio-domaincheck' and container . G etIdentifier ( ) != 'nextcloud-aio-borgbackup' and container . G etIdentifier ( ) != 'nextcloud-aio-watchtower' %}
{% set isAnyRunning = true %}
{% endif %}
2022-03-15 19:45:31 +08:00
{% if ( container . G etIdentifier ( ) starts with 'nextcloud-aio-redis' or container . G etIdentifier ( ) starts with 'nextcloud-aio-database' or container . G etIdentifier ( ) starts with 'nextcloud-aio-nextcloud' or container . G etIdentifier ( ) starts with 'nextcloud-aio-apache' ) and class ( container . G etRestartingState ( ) ) == 'AIO\\Container\\State\\RestartingState' %}
{% set isAnyRestarting = true %}
{% endif %}
2021-11-30 18:20:42 +08:00
{% if container . G etIdentifier ( ) == 'nextcloud-aio-watchtower' and class ( container . G etRunningState ( ) ) == 'AIO\\Container\\State\\RunningState' %}
{% set isWatchtowerRunning = true %}
{% endif %}
{% if container . G etIdentifier ( ) == 'nextcloud-aio-apache' and class ( container . G etStartingState ( ) ) == 'AIO\\Container\\State\\StartingState' %}
{% set isApacheStarting = true %}
{% endif %}
{% if container . G etIdentifier ( ) == 'nextcloud-aio-borgbackup' and class ( container . G etRunningState ( ) ) == 'AIO\\Container\\State\\RunningState' %}
{% set isBackupContainerRunning = true %}
{% if borg_backup_mode == 'restore' %}
{% set isRestoreRunning = true %}
{% endif %}
{% if borg_backup_mode == 'backup' or borg_backup_mode == 'restore' %}
{% set isBackupOrRestoreRunning = true %}
{% endif %}
{% endif %}
{% endfor %}
{% if isWatchtowerRunning == true %}
2022-02-21 22:56:55 +08:00
Mastercontainer update currently running. It will restart the mastercontainer soon which will make it unavailable for a moment. Please wait until that's done.<br /><br />
2021-11-30 18:20:42 +08:00
<a href="" class="button reload">Reload ↻</a><br/>
{% else %}
{% if isBackupOrRestoreRunning == false and domain == "" %}
2022-02-21 22:56:55 +08:00
{% if is_mastercontainer_update_available == true %}
<h2>Mastercontainer update</h2>
⚠ A mastercontainer update is available. Please click on the button below to update it. Afterwards, you will be able to proceed with the setup.<br><br>
<form method="POST" action="/api/docker/watchtower" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Update mastercontainer" />
</form>
{% else %}
Please type in the domain that will be used for Nextcloud:<br><br />
<form method="POST" action="/api/configuration" class="xhr">
<input type="text" name="domain" value=" {{ domain }} " placeholder="nextcloud.yourdomain.com"/>
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Submit" />
</form>
Make sure that this server is reachable on Port 443 and you've correctly set up the DNS config for the domain that you enter. <br><br>
If you have a dynamic IP-address, you can use e.g. <a href="https://ddclient.net/">DDclient</a> with a compatible domain provider for DNS updates.
{% endif %}
2021-11-30 18:20:42 +08:00
{% endif %}
{% if domain != "" %}
{% if isAnyRunning == true %}
{% if isApacheStarting != true %}
2021-12-03 20:34:19 +08:00
Initial Nextcloud username: admin<br />
Initial Nextcloud password: {{ nextcloud_password }} <br /><br/>
2021-11-30 18:20:42 +08:00
<a href="https:// {{ domain }} " class="button" target="_blank" rel="noopener">Open your Nextcloud ↗</a><br/>
{% else %}
2022-03-15 19:45:31 +08:00
{% if isAnyRestarting == false %}
Containers are currently starting.<br /><br />
<a href="" class="button reload">Reload ↻</a><br/><br>
{% else %}
It seems like at least one container is currently restarting which means it is not able to start correctly.<br><br>
To break out this endless loop, you can stop the containers below and investigate the issue by having a look at the container logs before starting them again.<br><br>
<form method="POST" action="/api/docker/stop" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Stop containers" />
</form>
{% endif %}
2021-11-30 18:20:42 +08:00
{% endif %}
{% endif %}
{% if was_start_button_clicked == true %}
<h2>Containers</h2>
<ul>
{# @var containers \AIO\Container\Container[] #}
{% for container in containers %}
{% if container . G etIdentifier ( ) != 'nextcloud-aio-borgbackup' and container . G etIdentifier ( ) != 'nextcloud-aio-watchtower' and container . G etIdentifier ( ) != 'nextcloud-aio-domaincheck' %}
<li>
{% if class ( container . G etStartingState ( ) ) == 'AIO\\Container\\State\\StartingState' %}
<span class="status running"></span>
<span> {{ container . G etDisplayName ( ) }} (<a href="/api/docker/logs?id= {{ container . G etIdentifier ( ) }} ">Starting</a>)</span>
{% elseif class ( container . G etRunningState ( ) ) == 'AIO\\Container\\State\\RunningState' %}
<span class="status success"></span>
<span> {{ container . G etDisplayName ( ) }} (<a href="/api/docker/logs?id= {{ container . G etIdentifier ( ) }} ">Running</a>)</span>
{% else %}
<span class="status error"></span>
<span> {{ container . G etDisplayName ( ) }} (<a href="/api/docker/logs?id= {{ container . G etIdentifier ( ) }} ">Stopped</a>)</span>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% if has_update_available == true %}
2022-02-21 22:56:55 +08:00
{% if is_mastercontainer_update_available == false %}
2022-03-15 19:45:31 +08:00
⚠ Container updates are available. Click on 'Stop Containers' and 'Start Containers' to update them. You should consider creating a backup first.<br><br>
2022-02-21 22:56:55 +08:00
{% endif %}
2021-11-30 18:20:42 +08:00
{% else %}
2022-01-10 00:58:56 +08:00
{% if is_mastercontainer_update_available == false %}
Your containers are up-to-date.<br><br>
{% endif %}
2021-11-30 18:20:42 +08:00
{% endif %}
{% endif %}
{% if isAnyRunning == true %}
{% if isApacheStarting != true %}
2022-02-21 22:56:55 +08:00
{% if is_mastercontainer_update_available == true %}
⚠ A mastercontainer update is available. Please click on the button below to stop your containers in order to be able to update the mastercontainer.<br /><br />
{% endif %}
2021-11-30 18:20:42 +08:00
<form method="POST" action="/api/docker/stop" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Stop containers" />
</form>
{% endif %}
{% else %}
{% if isRestoreRunning == true %}
Restore currently running. Cannot start the containers until that's done.<br /><br />
{% elseif has_update_available == true and isBackupOrRestoreRunning == true %}
Restore or Backup currently running and container update available. Cannot start the containers until that's done.<br /><br />
{% else %}
{% if was_start_button_clicked == false %}
Clicking on the button below will download all docker containers and start them. This can take a lot of time depending on your internect connection. Since the overall size is a few GB, this will take around 5-10 min or more. So be aware and patient!<br><br>
{% endif %}
2022-02-21 22:56:55 +08:00
{% if is_mastercontainer_update_available == true %}
⚠ Please update your mastercontainer. Afterwards, you will be able to start your containers again.<br><br>
2021-11-30 18:20:42 +08:00
{% else %}
2022-02-21 22:56:55 +08:00
{% if was_start_button_clicked == false or has_update_available == false %}
<form method="POST" action="/api/docker/start" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Start containers" />
</form>
{% else %}
<form method="POST" action="/api/docker/start" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button " type="submit" value="Start and update containers" onclick="return confirm('Start and update containers? You should consider creating a backup first.')" />
</form>
{% endif %}
2021-11-30 18:20:42 +08:00
{% endif %}
{% endif %}
{% endif %}
2022-03-09 04:16:33 +08:00
{% if was_start_button_clicked == true %}
2021-11-30 18:20:42 +08:00
{% if isBackupOrRestoreRunning == false %}
2022-03-09 04:16:33 +08:00
<h2>Mastercontainer</h2>
2022-03-09 23:50:53 +08:00
You are currently running the {{ current_channel }} channel. (<a href="/api/docker/logs?id=nextcloud-aio-mastercontainer">Logs</a>)<br><br>
2022-03-09 04:16:33 +08:00
{% if is_mastercontainer_update_available == true %}
{% if isAnyRunning == false %}
⚠ A mastercontainer update is available. Please click on the button below to update it.<br><br>
<form method="POST" action="/api/docker/watchtower" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Update mastercontainer" />
</form>
{% else %}
⚠ A mastercontainer update is available. Please stop your containers in order to be able to update the mastercontainer.<br><br>
{% endif %}
{% if current_channel starts with 'latest' %}
You can find the changelog <a href="https://github.com/nextcloud/all-in-one/releases/latest">here</a><br><br>
{% elseif current_channel starts with 'beta' %}
You can find the changelog <a href="https://github.com/nextcloud/all-in-one/releases">here</a><br><br>
{% elseif current_channel starts with 'develop' %}
You can find all changes <a href="https://github.com/nextcloud-releases/all-in-one/commits/main">here</a><br><br>
{% endif %}
2022-02-21 22:56:55 +08:00
{% endif %}
2022-03-09 21:28:03 +08:00
{% if isApacheStarting == false %}
2022-03-11 16:25:38 +08:00
<h3>AIO password change</h3>
2022-03-09 21:28:03 +08:00
You can change your AIO password below:<br><br />
<form method="POST" action="/api/configuration" class="xhr">
<input type="text" autocomplete="current-password" name="current-master-password" placeholder="your current aio password"/>
<input type="text" autocomplete="new-password" name="new-master-password" placeholder="your new aio password"/>
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Submit" />
</form>
The new password needs to be at least 24 characters long. Allowed characters are the <a href="https://en.wikipedia.org/wiki/Latin_alphabet#/media/File:Abecedarium.png">latin characters</a> 'a-z', 'A-Z', '0-9' and spaces.<br><br>
{% endif %}
2022-03-09 04:16:33 +08:00
{% endif %}
2021-11-30 18:20:42 +08:00
{% if isBackupOrRestoreRunning == false and borg_backup_host_location == "" and isApacheStarting != true %}
<h2>Backup and restore</h2>
Please type in the directory where backups will get created on the host system:<br><br>
<form method="POST" action="/api/configuration" class="xhr">
<input type="text" name="borg_backup_host_location" value="/mnt/backup" placeholder="/mnt/backup"/>
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Submit" />
</form>
2022-01-15 01:23:13 +08:00
The folder path that you enter must start with <b>/mnt/</b> or <b>/media/</b> or be equal to <b>/var/backups</b>. So e.g. <b>/mnt/backup</b> or <b>/var/backups</b>
2021-11-30 18:20:42 +08:00
{% endif %}
{% if borg_backup_host_location != "" %}
<h2>Backup and restore</h2>
2021-12-08 01:18:36 +08:00
{% if isBackupContainerRunning == false %}
2021-11-30 18:20:42 +08:00
{% if backup_exit_code > 0 %}
<span class="status error"></span> Last {{ borg_backup_mode }} failed! (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
{% elseif backup_exit_code == 0 %}
{% if borg_backup_mode == "backup" %}
2022-02-11 19:48:27 +08:00
<span class="status success"></span> Last {{ borg_backup_mode }} successful on {{ last_backup_time }} ! (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
2021-11-30 18:20:42 +08:00
{% else %}
2022-02-11 19:48:27 +08:00
<span class="status success"></span> Last {{ borg_backup_mode }} successful! (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
2021-11-30 18:20:42 +08:00
{% endif %}
{% endif %}
{% endif %}
{% if isBackupContainerRunning == false %}
2022-03-11 16:25:38 +08:00
<h3>Backup information</h3>
2021-11-30 18:20:42 +08:00
This is your encryption password for backups: {{ borgbackup_password }} <br /><br/>
Please save it at a safe place since you won't be able to restore from backup if you loose this password! <br /><br/>
Backed up will get all important data of your Nextcloud AIO instance like the database, your files and configuration files of the mastercontainer and else. <br /><br/>
The backup itself will use a tool that is called <a href="https://github.com/borgbackup/borg#what-is-borgbackup">BorgBackup<a/> which is a well-known server backup tool that efficiently backs up your files and encrypts them on the fly. <br /><br/>
Backups get created in the following directory on the host: {{ borg_backup_host_location }} /borg <br /><br/>
2022-02-24 08:27:14 +08:00
Be aware that this solution does not back up files and folders that are mounted into Nextcloud using the external storage app. <br /><br/>
2021-11-30 18:20:42 +08:00
{% if isApacheStarting != true %}
2022-03-11 16:25:38 +08:00
<h3>Backup creation</h3>
Clicking on the button below will create a backup.<br><br/>
2021-11-30 18:20:42 +08:00
<form method="POST" action="/api/docker/backup" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Create backup" onclick="return confirm('Create backup? Are you sure that you want to create a backup? This will stop all running containers and create the backup.')" />
</form>
{% if has_backup_run_once == true %}
2022-03-11 16:25:38 +08:00
<h3>Backup check</h3>
2021-11-30 18:20:42 +08:00
Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact but it should't be needed in most situtations.<br><br/>
<form method="POST" action="/api/docker/backup-check" class="xhr">
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
<input class="button" type="submit" value="Check backup integrity" onclick="return confirm('Check backup integrity? Are you sure that you want to check the backup? This can take a long time depending on the size of your backup.')" /><br/>
</form>
2022-03-11 16:25:38 +08:00
<h3>Backup restore</h3>
2021-12-08 02:10:05 +08:00
Choose the backup that you want to restore and click on the button below to restore the selected backup. This will overwrite all your files with the state of the backup so you should consider creating a backup first. It also makes sense to run an integrity check before restoring your files but is not mandatory since it shouldn't be needed in most situations.<br><br>
<form method="POST" action="/api/docker/restore" class="xhr" id="restore_selection">
2021-11-30 18:20:42 +08:00
<input type="hidden" name=" {{ csrf .keys .name }} " value=" {{ csrf .name }} ">
<input type="hidden" name=" {{ csrf .keys .value }} " value=" {{ csrf .value }} ">
2021-12-08 02:10:05 +08:00
<select id="selected_restore_time" name="selected_restore_time" form="restore_selection">
{% for restore_time in backup_times %}
2022-02-16 22:05:04 +08:00
<option value=" {{ restore_time }} "> {{ restore_time }} </option>
2021-12-08 02:10:05 +08:00
{% endfor %}
</select>
<input class="button" type="submit" value="Restore selected backup" onclick="return confirm('Restore the selected backup? Are you sure that you want to restore the selected backup? This will stop all running containers and restore the selected backup. It is recommended to create a backup first. You might also want to check the backup integrity.')" />
2021-11-30 18:20:42 +08:00
</form>
{% endif %}
{% endif %}
{% else %}
<span class="status running"></span> Backup container currently running. (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
<a href="" class="button reload">Reload ↻</a><br/>
{% endif %}
{% endif %}
{% endif %}
2022-03-09 05:06:02 +08:00
<h2>Optional</h2>
In this section, you will find optional addons in the future.
It will disable the ability to change them when any containers are running and allow to change them when they are stopped.
Also, it will display possible sections for optional addons. (which itself will be displayed when enabled and running).
2021-11-30 18:20:42 +08:00
{% endif %}
{% endif %}
{% if isApacheStarting == true or isBackupContainerRunning == true or isWatchtowerRunning == true %}
<script>
if (document.hasFocus()) {
// hide reload button if the site reloads automatically
var list = document.getElementsByClassName("reload button");
for (var i = 0; i < list.length; i++) {
// list[i] is a node with the desired class name
list[i].style.display = 'none';
}
// set timeout for reload
setTimeout(function() {
window.location.reload(1);
}, 5000);
}
</script>
{% endif %}
</div>
<div id="overlay">
<div class="loader"></div>
</div>
{% endblock %}