couch
This commit is contained in:
@@ -20,11 +20,11 @@ services:
|
||||
CADDY_INGRESS_NETWORKS: ${COMPOSE_PROJECT_NAME}_caddy_net
|
||||
volumes:
|
||||
- caddy_config:/config
|
||||
- caddy_data:/data
|
||||
- ./caddy:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./data:/srv/www:ro
|
||||
labels:
|
||||
caddy: "static.localhost"
|
||||
caddy: "localhost"
|
||||
caddy.root: "* /srv/www"
|
||||
caddy.file_server: "" # Active le serveur de fichiers statiques
|
||||
caddy.tls: internal # HTTPS auto-signé géré par Caddy
|
||||
|
||||
@@ -31,10 +31,9 @@ payload = {
|
||||
"password": PASSWORD,
|
||||
"bind_address": "0.0.0.0"
|
||||
}
|
||||
r1 = requests.post(f'{COUCHDB_URL}/_cluster_setup', json=payload)
|
||||
r2 = requests.post(f'{COUCHDB_URL}/_cluster_setup', json={"action": "finish_cluster"})
|
||||
r1 = requests.post(f'{COUCHDB_URL}/_cluster_setup', auth=(USER, PASSWORD), json=payload)
|
||||
|
||||
if r1.ok and r2.ok:
|
||||
if r1.ok:
|
||||
print('✅ CouchDB initialisé avec succès.')
|
||||
else:
|
||||
print('❌ Erreur lors de l\'initialisation :', r1.text, r2.text)
|
||||
print('❌ Erreur lors de l\'initialisation :', r1.text)
|
||||
|
||||
14
couchdb.http
14
couchdb.http
@@ -1,8 +1,9 @@
|
||||
@couchDB = http://{{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}@couchdb.localhost
|
||||
@couchDB = http://couchdb.localhost
|
||||
|
||||
### Init
|
||||
|
||||
POST {{couchDB}}/_cluster_setup
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
@@ -13,20 +14,20 @@ Content-Type: application/json
|
||||
"port": 5984
|
||||
}
|
||||
|
||||
### Creates a new database.
|
||||
GET {{couchDB}}/_users
|
||||
|
||||
###
|
||||
|
||||
GET {{couchDB}}/_all_dbs
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
|
||||
### Creates a new database.
|
||||
PUT {{couchDB}}/db
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
|
||||
### Creates a new document in the specified database, using the supplied JSON document structure.
|
||||
POST {{couchDB}}/db
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
|
||||
{
|
||||
"servings": 4,
|
||||
@@ -36,12 +37,15 @@ Content-Type: application/json
|
||||
|
||||
###
|
||||
GET {{couchDB}}/db/_all_docs
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
|
||||
###
|
||||
GET {{couchDB}}/db/df9679762e2630b609a69ecf9c000d67
|
||||
GET {{couchDB}}/db/2c2135ff744c3b98407572ed4f000cad
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
|
||||
###
|
||||
POST {{couchDB}}/db/_find
|
||||
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Content-Length: 168
|
||||
|
||||
Reference in New Issue
Block a user