Skip to content
Snippets Groups Projects
Unverified Commit 63a2a734 authored by Martin Weise's avatar Martin Weise
Browse files

Remove the idea files, added documentation to the website, added docker hub descriptions

parent bbd835e5
No related branches found
No related tags found
No related merge requests found
Showing
with 134 additions and 55 deletions
...@@ -3,6 +3,16 @@ site/ ...@@ -3,6 +3,16 @@ site/
node_modules/ node_modules/
*.bkp *.bkp
## macOS
.DS_Store
.idea/
## Docker Hub
dockerhub/.env
## Virtual Environment
venv/
## Core latex/pdflatex auxiliary files: ## Core latex/pdflatex auxiliary files:
*.aux *.aux
*.lof *.lof
......
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/fda-docs.iml" filepath="$PROJECT_DIR$/.idea/fda-docs.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -4,13 +4,21 @@ ENV PYTHONUNBUFFERED=1 ...@@ -4,13 +4,21 @@ ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y python3 python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 RUN apt-get update && apt-get install -y python3 python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0
COPY ./requirements.txt ./requirements.txt COPY requirements.txt ./requirements.txt
RUN pip3 install -r ./requirements.txt RUN pip3 install -r ./requirements.txt
RUN python3 --version RUN python3 --version
RUN mkdocs --version RUN mkdocs --version
COPY ./docs ./docs COPY ./docs/images ./docs/images
COPY ./docs/operation ./docs/operation
COPY ./docs/stylesheets ./docs/stylesheets
COPY ./docs/videos ./docs/videos
COPY ./docs/contact.md ./docs/contact.md
COPY ./docs/getting-started.md ./docs/getting-started.md
COPY ./docs/index.md ./docs/index.md
COPY ./docs/publications.md ./docs/publications.md
COPY ./docs/system.md ./docs/system.md
COPY ./mkdocs.yml ./mkdocs.yml COPY ./mkdocs.yml ./mkdocs.yml
RUN echo 'plugins:\n\ RUN echo 'plugins:\n\
......
phony: .PHONY: clean
all: all: build
clean:
build: build:
docker-compose build docker-compose build
run: build
docker-compose up docker-compose up
sudo mv ./site/pdf/document.pdf ./site/pdf/documentation.pdf sudo mv ./site/pdf/document.pdf ./site/pdf/documentation.pdf
docs: install: build
widdershins --environment ./misc/env.json ./misc/api-authentication.yaml -o ./docs/operation/endpoints/authentication.md
widdershins --environment ./misc/env.json ./misc/api-container.yaml -o ./docs/operation/endpoints/container.md
widdershins --environment ./misc/env.json ./misc/api-database.yaml -o ./docs/operation/endpoints/database.md
widdershins --environment ./misc/env.json ./misc/api-identifier.yaml -o ./docs/operation/endpoints/identifier.md
widdershins --environment ./misc/env.json ./misc/api-query.yaml -o ./docs/operation/endpoints/query.md
deploy: run
sudo cp -r ./site/* /usr/share/nginx/html/ sudo cp -r ./site/* /usr/share/nginx/html/
\ No newline at end of file
...@@ -14,7 +14,7 @@ services: ...@@ -14,7 +14,7 @@ services:
build: . build: .
image: fda-docs-builder image: fda-docs-builder
volumes: volumes:
- "./site:/site" - ./site:/site
networks: networks:
- fda-public - fda-public
environment: environment:
......
USERNAME=...
PASSWORD=...
\ No newline at end of file
# Quick Reference
* **Maintained by**:
[the DBRepo Maintainers](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/graphs/master)
* **Where to get help**:
[the official documentation](https://dbrepo-docs.ossdip.at/), [IDCC'22 paper](https://doi.org/10.5281/zenodo.6637333),
[iPRES'21 paper](https://doi.org/10.17605/OSF.IO/B7NX5)
# Supported tags and respective `Dockerfile` links
* [`latest`](https://hub.docker.com/repository/docker/dbrepo/metadata-db/tags?page=1&ordering=last_updated&name=latest)
# Quick reference (cont.)
* **Where to file issues**:
Send us an [email](https://tiss.tuwien.ac.at/person/287722.html)
* **Supported architectures:**
`amd64`
* **Source of this description:**
[docs repo's `dockerhub/` directory](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-docs/-/tree/master/dockerhub)
([history](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-docs/-/commits/master/dockerhub))
# What is DBRepo?
tbd
import requests as rq
import os
from py_dotenv import read_dotenv
class Dockerhub:
"""A simple Dockerhub client"""
baseurl = "https://hub.docker.com"
username = ""
registry = "registry-1.docker.io"
workpath = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
headers = {
"Content-Type": "application/json",
"Authorization": None
}
def __init__(self):
read_dotenv(self.workpath + "/.env")
self.username = os.getenv("USERNAME")
response = rq.post(self.baseurl + "/v2/users/login", {
"username": self.username,
"password": os.getenv("PASSWORD")
})
if response.status_code == 200:
self.headers["Authorization"] = "Bearer " + response.json()["token"]
else:
raise "Failed to authenticate"
def modify_description(self, repository):
header = self.__read__(self.workpath + "/_header.md")
body = self.__read__(self.workpath + "/fda-" + repository + ".md")
response = rq.patch(self.baseurl + "/v2/repositories/" + self.username + "/" + repository + "/", headers=self.headers,
json={
"description": "Official repository of DBRepo.",
"full_description": header + "\n\n" + body,
"registry": self.registry
})
if response.status_code == 200:
return response.json()
else:
print(response)
def __read__(self, path):
with open(path, "r") as f:
return ' '.join([line for line in f.readlines()])
\ No newline at end of file
File moved
File added
File added
# How to use this image
```console
$ docker run -p 9090:9090 -e SPRING_PROFILES_ACTIVE=docker
```
# How to use this image
```console
$ docker run -v ./data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=fda
```
The environment variables come from the official [PostgreSQL](https://hub.docker.com/_/postgres) image. They are briefly
explained here:
* `POSTGRES_USER` is used in conjunction with password to set a user and its password.
* `POSTGRES_PASSWORD` must not be empty or undefined.
* `POSTGRES_DB` is used to create a database with this name.
requests==2.28.1
py-dotenv==0.1
\ No newline at end of file
from client.Dockerhub import Dockerhub
dockerhub = Dockerhub()
for component in ["discovery-service", "metadata-db"]:
response = dockerhub.modify_description(component)
print(response)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment