Small web application to quickly access all your documentation !
Note that by default the BackEnd will require to be secured with HTTPS. If you want to be able to add documentation via unsecured HTTP you will need to pass the SHOULD_SECURE=FALSE
environment variable to your container.
You can refer to the production setup section to properly deploy an HostMyDocs instance with SSL enabled.
-
Launch the application and its server with
docker run -e CREDENTIALS=user:password -e SHOULD_SECURE=FALSE -v `pwd`:/data -p 8080:80 tracesoftware/hostmydocs
-
Put all the documentation files and the
index.html
file into a folderIt should looks like this :
documentation <- top folder that you will zip next ├── images ├── index.html ├── injectables └── styles
-
Zip that folder ! (by example
zip -r docs.zip documentation
) -
Now upload it with cURL by example :
curl --request POST \
--url http://localhost:8080/BackEnd/addProject \
--user user:password \
--header 'content-type: multipart/form-data;authorization: Basic dXNlcjpwYXNzd29yZA==' \
--header 'boundary=---011000010111000001101001' \
-F "name=DocumentationName" \
-F "version=1.0.0" \
-F "language=YourProgrammingLanguage" \
-F "archive=@docs.zip;type=application/zip"
- Open http://localhost:8080 to see your uploaded docs !
-
Launch the application and its server with
docker run -e CREDENTIALS=user:password -e SHOULD_SECURE=FALSE -v `pwd`:/data -p 8080:80 tracesoftware/hostmydocs
-
delete using cURL by example :
curl --request DELETE \
--url http://localhost:8080/BackEnd/deleteProject \
--user user:password \
-d "name=DocumentationName" \
-d "version=1.0.0" \
-d "language=YourProgrammingLanguage"
Note that you can write
-d "language="
to delete a whole
version
for the projectOR
-d "version=" \ -d "language="to delete the whole
project
- Open http://localhost:8080 to see your remainings docs !
You can visualize it in the Swagger editor
You only need to put the System
folder on your server to be able to deploy the application.
First, you must modify the System/.env
file to change the default credentials that are not secure.
Then, you can execute the System/install.sh
script. It will register a hostmydocs.service
in systemctl
so you can easily access to logs.
If you want to upgrade the application, just run System/install.sh
again !
The container provide two volumes, so you can mount your certificate and your private key
/etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/ssl/private/ssl-cert-snakeoil.key
-
Open a terminal at the root of the project
-
Build a local Docker image of HostMyDocs :
docker build -t hmd .
-
Start a Docker container containing the BackEnd :
docker run -p 3000:80 -e CREDENTIALS=user:password -e SHOULD_SECURE=FALSE -v `pwd`/BackEnd:/var/www/html/BackEnd hmd
-
Start the Webpack dev server :
cd FrontEnd && yarn start
-
Open http://localhost:8080 to see your changes automatically refreshed
-
Now you can develop with your favorite editor/IDE !