diff --git a/README.md b/README.md index 5e4c244..a337ccc 100644 --- a/README.md +++ b/README.md @@ -276,8 +276,117 @@ The last step is to publish it! ## Install Garage +See: https://garagehq.deuxfleurs.fr/download/ + +``` +docker pull dxflrs/garage:v0.8.1 +``` + +We will use a simple config file you can generate as follow: + +```toml +cat > garage.toml < /tmp/index.html +aws s3 cp /tmp/index.html s3://my-blog/ +curl -I http://my-blog.web.localhost:3902 +``` + ## Configure Drone to deploy your website on Garage +Add your keys as a drone secret in your repository. +See here: https://docs.drone.io/secret/repository/ + +And then add this to your `.drone.yml`: + +```yaml +- name: upload + image: plugins/s3 + settings: + bucket: my-blog + access_key: + from_secret: aws_access_key_id + secret_key: + from_secret: aws_secret_acess_key + source: _site/**/* + target: / +``` + ## Profit + +Your blog should be available at this URL: http://my-blog.web.localhost:3902 +You can administrate it at this URL: http://my-blog.web.localhost:3902/admin/ +Publishing an article will trigger a build, you can follow it: http://localhost:3002/quentin/my-blog/ + +## TODO + + - [ ] Nettoyer les inter-connexions entre les services pour ne pas avoir à drop iptables + - [ ] Voir comment speed up le build + - [ ] Peut-être passer la démo sur Hugo (aiderait le point précédent) + - [ ] Tester avec des templates plus complexes (avec des images en bannière) + - [ ] Porter ce test sur le guide Zola avec les nested collections diff --git a/awsrc b/awsrc new file mode 100644 index 0000000..e4cfa91 --- /dev/null +++ b/awsrc @@ -0,0 +1,6 @@ +export AWS_ACCESS_KEY_ID=GKdac05807405e200f8153595f +export AWS_SECRET_ACCESS_KEY=5c5710356eafc7d401fd3f5ecf5b50a5f0994f2e68d9fbaf678d91287abbd467 +export AWS_DEFAULT_REGION='garage' + +function aws { command aws --endpoint-url http://localhost:3900 $@ ; } +aws --version diff --git a/docker-compose.yml b/docker-compose.yml index fdea027..ac43899 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,3 +66,12 @@ services: - DRONE_HTTP_BIND=3003 volumes: - /var/run/docker.sock:/var/run/docker.sock + + garage: + image: dxflrs/garage:v0.8.1 + container_name: garage + network_mode: host + restart: always + volumes: + - ./garage.toml:/etc/garage.toml + diff --git a/garage.toml b/garage.toml new file mode 100644 index 0000000..87e25dd --- /dev/null +++ b/garage.toml @@ -0,0 +1,26 @@ +metadata_dir = "/var/lib/garage/meta" +data_dir = "/var/lib/garage/data" +db_engine = "lmdb" + +replication_mode = "none" + +rpc_bind_addr = "[::]:3901" +rpc_public_addr = "127.0.0.1:3901" +rpc_secret = "9ec6d97e54b2a55e939f0ba761ba565595691f0d42eb6511f4cb6cb69e906cad" + +[s3_api] +s3_region = "garage" +api_bind_addr = "[::]:3900" +root_domain = ".s3.localhost" + +[s3_web] +bind_addr = "[::]:3902" +root_domain = ".web.localhost" +index = "index.html" + +[k2v_api] +api_bind_addr = "[::]:3904" + +[admin] +api_bind_addr = "0.0.0.0:3903" +admin_token = "vRbXiYk1SXEp6Ic9x3bx39WyZtPapDZWngSjgX1pgPQ="