Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gdamjan/nextcloud-service
nextcloud systemd portable service built on Nix
https://github.com/gdamjan/nextcloud-service
nextcloud nix nixos nixpkgs php portable-service uwsgi
Last synced: 24 days ago
JSON representation
nextcloud systemd portable service built on Nix
- Host: GitHub
- URL: https://github.com/gdamjan/nextcloud-service
- Owner: gdamjan
- Created: 2020-11-24T23:30:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T12:53:41.000Z (about 1 month ago)
- Last Synced: 2024-12-02T13:22:03.710Z (about 1 month ago)
- Topics: nextcloud, nix, nixos, nixpkgs, php, portable-service, uwsgi
- Language: Nix
- Homepage:
- Size: 86.9 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![CI](https://github.com/gdamjan/nextcloud-service/actions/workflows/ci.yml/badge.svg)](https://github.com/gdamjan/nextcloud-service/actions/workflows/ci.yml)
# `Nextcloud as a systemd portable service`
Build an immutable [Nextcloud](https://nextcloud.com/) image for a systemd [portable service](https://systemd.io/PORTABLE_SERVICES/).
Made with uwsgi and nixos.## Quick Start
Get the latest image from [Github releases](https://github.com/gdamjan/nextcloud-service/releases/), into
`/var/lib/portables`, then attach the portable service, and enable/start it. For ex:```sh
importctl pull-raw --class=portable --verify=checksum https://github.com/gdamjan/nextcloud-service/releases/download/v/nextcloud_.raw # or use curl
portablectl attach nextcloud_
systemctl enable --now nextcloud-uwsgi.socket nextcloud-cron.timer
```> ⚠️ Warning ⚠️
>
> On the first install wizard, don't enable the "Default Applications" in nextcloud (click cancel).
> For more info see [issues](https://github.com/gdamjan/nextcloud-service/issues/2).## Nginx configuration
The portable service will operate on the `/run/nextcloud.sock` uwsgi socket. We gonna let the host nginx handle
all the http, https and letsencrypt work. The config is simple, just proxy everything back to the uwsgi socket:
```
server {
…
client_body_buffer_size 512k;
client_max_body_size 512M;
client_body_timeout 300s;
location / {
include uwsgi_params;
uwsgi_pass unix:/run/nextcloud.sock;
uwsgi_intercept_errors on;
uwsgi_request_buffering off;
}
…
}
```
> Note: even static files are served by the uwsgi server, but uwsgi has a good enough static files server, which doesn't
> block the application workers.> Note²: Consult the [nextcloud nginx installation docs](https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html)
> for non-fastcgi nginx parameters.## Units provided
The cron timer and service, periodically call `php -f cron.php` to run some
nextcloud bookkeeping jobs:
* `nextcloud-cron.timer`
* `nextcloud-cron.service`The socket and uwsgi socket (`/run/nextcloud.sock`) is the main service:
* `nextcloud-uwsgi.socket`
* `nextcloud-uwsgi.service`The firstrun service, scaffolds `/var/lib/nextcloud` with the minimal
configuration needed for a portable service to run successfully:
* `nextcloud-first-run.service`## More info
See the [wiki](https://github.com/gdamjan/nextcloud-service/wiki/) for more info.
## Build and update
Have nix flakes enabled, and then:
```
nix flake update # will update flake.lock
nix build # will create an image in ./result/
```