Giter VIP home page Giter VIP logo

cozy-coclyco's Introduction

Coclyco

Goal

cozy-coclyco is designed to create Cozy instances, manage nginx vhost and Let's encrypt certificate issuance.

A single prime256v1 private key /etc/ssl/private/cozy.pem is used to issue certificates. For each created instance with domain <fqdn>, it create

  • a /etc/ssl/private/<fqdn>.crt Let's encrypt certificate will be created
  • a /etc/nginx/sites-available/<fqdn> will be deployed and activated

The issued certificate must contain all subdomains needed for apps. By default,

  • <fqdn>
  • onboarding.<fqdn>
  • home.<fqdn>
  • store.<fqdn>
  • settings.<fqdn>
  • drive.<fqdn>
  • photos.<fqdn>

are added to the certificate.

Requirements

Before creating an instance and to be able to issue certificates with Let's Encrypt, you need to be able to pass the ACME challenge, and so you need to :

  • configure your DNS to point all needed subdomains <app>.<fqdn> to your web server
  • serve /etc/ssl/private/acme-challenge as http://*.<fqdn>/.well-known/acme-challenge/

The best way to configure your web server is to configure your default vhost like below

/etc/nginx/sites-available/default
server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/html;
	server_name _;

	location /.well-known/acme-challenge/ {
		alias /etc/ssl/private/acme-challenge/;
	}

	location / {
		return 301 https://$host$request_uri;
	}
}

Usage

To create an instance

cozy-coclyco create <fqdn> <email>

If you install an application on your Cozy, you need to regenerate the certificate to add the corresponding subdomain on it

cozy-coclyco regenerate <fqdn>

To renew your certificates before expiration (Let's Encrypt certificates have 90 days life)

cozy-coclyco renew

By default, the renewal is triggered each month by /etc/cron.monthly/cozy-coclyco

You can regenerate the nginx vhost with

cozy-coclyco vhost <fqdn>

To backup a Cozy

cozy-coclyco backup <fqdn>*

To restore a Cozy from a backup

cozy-coclyco restore <fqdn> <archive.tar.xz>

cozy-coclyco's People

Contributors

nono avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.