2021-03-02 16:38:38 +00:00
# Nextcloud
2020-06-26 23:47:19 +00:00
2021-03-02 17:55:58 +00:00
[![Build Status ](https://drone.autonomic.zone/api/badges/coop-cloud/nextcloud/status.svg )](https://drone.autonomic.zone/coop-cloud/nextcloud)
2020-09-27 23:21:14 +00:00
2020-09-08 23:21:30 +00:00
Fully automated luxury Nextcloud via docker-swarm.
2021-03-02 16:38:38 +00:00
<!-- metadata -->
* **Category**: Apps
* **Status**: ❷💛
* **Image**: [`nextcloud` ](https://hub.docker.com/_/nextcloud ), ❶💚, upstream
* **Healthcheck**: Yes
* **Backups**: No
* **Email**: ❶💚
* **Tests**: ❷💛
* **SSO**: ❸🍎 (OAuth)
<!-- endmetadata -->
## Basic usage
2020-09-08 00:38:09 +00:00
2020-09-27 23:21:14 +00:00
1. Set up Docker Swarm and [`abra`]
2021-03-02 17:55:58 +00:00
2. Deploy [`coop-cloud/traefik`]
2021-03-02 16:38:38 +00:00
3. `abra app new nextcloud --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass` )
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
2020-09-08 00:38:09 +00:00
your Docker swarm box
2021-03-02 16:38:38 +00:00
5. `abra app YOURAPPDOMAIN deploy`
2021-10-30 15:40:00 +00:00
## How do I customise the default home page when logging in?
2021-03-02 16:38:38 +00:00
2021-10-30 15:40:00 +00:00
- Delete the dashboard app since it is so corporate
- Follow [these docs ](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/default_files_configuration.html ) to set the default files list for each user in the Files app
- Configure a `defaultapp` in your `config.php` or use [apporder ](https://apps.nextcloud.com/apps/apporder )
2020-09-08 00:39:08 +00:00
2021-10-30 15:40:00 +00:00
## Running `occ`
2021-06-06 17:35:20 +00:00
2021-10-30 15:40:00 +00:00
`abra app run --user www-data YOURAPPDOMAIN app occ user:list --help`
2021-06-06 17:35:20 +00:00
## Upgrading Nextcloud apps
2021-10-30 15:40:00 +00:00
`abra app run --user www-data YOURAPPDOMAIN app occ app:update --all`
## How do I integrate with Keycloak SSO?
Use [this plugin ](https://github.com/pulsejet/nextcloud-oidc-login ). Unlike the plugin it's forked from, there is no configuration UI, so you'll need to edit `/var/www/html/config/config.php` :
```
'oidc_login_client_id' => 'nextcloud',
'oidc_login_client_secret' => 'mysecret',
'oidc_login_provider_url' => 'https://example.com/auth/realms/myrealm',
'oidc_login_disable_registration' => false,
'oidc_login_hide_password_form' => true,
'oidc_login_button_text' => 'Log in with your myssodomain',
'oidc_login_default_group' => 'mygroup',
'oidc_login_attributes' =>
array (
'id' => 'sub',
'name' => 'name',
'mail' => 'email',
),
'oidc_create_groups' => true,
```
You can use [this trick ](https://janikvonrotz.ch/2020/10/20/openid-connect-with-nextcloud-and-keycloak/ ) (see "Cryptic Usernames" work-around) to get proper usernames.
If you ever need to change the realm, you'll need to reset the cache with:
```
docker exec -u www-data < container-id > php occ config:app:delete oidc_login last_updated_well_known
docker exec -u www-data < container-id > php occ config:app:delete oidc_login last_updated_jwks
```
## How can I customise the CSS?
There is some basic stuff in the admin settings.
To go a little deeper, you can use [this handy app ](https://apps.nextcloud.com/apps/theming_customcss ).
Here is an example CSS config which hides the local login and makes space for a central image:
```css
#body-login .wrapper main form[name="login"],
#body-login .wrapper main form[name="login"] ~ a {
display: none;
}
#body-login .logo {
visibility: hidden;
}
#body-login #alternative-logins a.button[href*="oidc"] {
background: #233b4a ;
color: #fff ;
transition: all 0.2s ease-in-out;
}
#body-login #alternative-logins a.button[href*="oidc"]:hover {
background: linear-gradient(-35deg, #233b4a 40%, #486c83 100%);
}
#body-login #alternative-logins a.button[href*="/sociallogin/oauth/google"] {
border: 0;
color: #db4437 !important;
background-color: #fff ;
}
#body-login
#alternative -logins
a.button[href*="/sociallogin/oauth/google"]::before {
width: 25px;
background-color: #db4437 ;
border-radius: 100%;
background-size: 60%;
background-position: center;
height: 25px;
vertical-align: middle;
margin-right: 4px;
}
#body-login main {
padding: 50vh 0 0 0;
}
#body-login a[href*="#body-login"] {
visibility: hidden;
}
#body-login footer a,
#body-login footer p {
color: #233b4a ;
}
#body-login footer a:hover {
color: #fff ;
}
#body-login footer p.info {
text-shadow: none;
}
```
2021-06-06 17:35:20 +00:00
2020-09-08 23:21:30 +00:00
[nextcloud-docker]: https://hub.docker.com/_/nextcloud/
2020-09-27 23:21:14 +00:00
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
2021-03-02 17:55:58 +00:00
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik