Skip to content

Commit

Permalink
Docs path (#1055)
Browse files Browse the repository at this point in the history
* move to /docs/

* branding

* add alternative domain

* update footer
  • Loading branch information
0x4c6565 authored Nov 22, 2023
1 parent cf8846d commit a499dcb
Show file tree
Hide file tree
Showing 16 changed files with 142 additions and 226 deletions.
24 changes: 24 additions & 0 deletions .ci/kustomize/base/app-ingress-ans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress-ans
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
cert-manager.io/cluster-issuer: letsencrypt-http
spec:
rules:
- host: docs.ans.co.uk
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: app
port:
number: 80
tls:
- hosts:
- docs.ans.co.uk
secretName: docs-ans-co-uk-tls
50 changes: 0 additions & 50 deletions .gitlab-ci.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

18 changes: 2 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ FROM python:3.8-alpine3.13 as builder

RUN pip install Sphinx recommonmark
RUN apk add build-base
#RUN apt update
#RUN apt install make -y

WORKDIR /build/

ADD Makefile rasterize.js tests.sh /build/
ADD ./files/ ./files/
# ADD ./ukf/ ./ukf/
# Do two copies, the above wont change much, adds a layer but saves time
ADD ./source/ ./source/

RUN make clean && \
sphinx-build -n -b html -d build/doctrees source/ build/html && \
sphinx-build -n -b dirhtml -d build/doctrees source/ build/html && \
make build/html/_static/css/app.css && \
make build/html/_static/app.js

Expand All @@ -25,19 +21,9 @@ ARG essvc=elasticsearch
RUN apt update
RUN apt install curl -y

# RUN mkdir /usr/share/nginx/docs.ukfast.co.uk
# RUN mkdir /usr/share/nginx/search-docs.ukfast.co.uk
# RUN mkdir /usr/share/nginx/search.docs.ukfast.co.uk
# RUN mkdir /usr/share/nginx/docs.ukfast.co.uk/logs

# Grab the resources from the python builder so we can bin it off.
COPY --from=builder /build/build/html /usr/share/nginx/docs.ukfast.co.uk/html
COPY --from=builder /build/build/html /usr/share/nginx/docs.ukfast.co.uk/html/docs

COPY /nginx/nginx.conf /etc/nginx/nginx.conf

RUN sed -i "s/elasticsearch/$essvc/" /etc/nginx/nginx.conf

# Get the nginx confs in there.
# COPY /nginx/docs-search.ukfast.co.uk.conf /etc/nginx/conf.d/docs-search.ukfast.co.uk.conf
# COPY /nginx/docs.ukfast.co.uk.conf /etc/nginx/conf.d/docs.ukfast.co.uk.conf
# COPY /nginx/search.docs.devops.ukfast.co.uk.conf /etc/nginx/conf.d/search.docs.devops.ukfast.co.uk.conf
6 changes: 3 additions & 3 deletions contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

### Adding content

Log into github.com, and go to the UKFast docs repository, [located here](https://github.com/ukfast/docs.ukfast.co.uk).
Log into github.com, and go to the UKFast docs repository, [located here](https://github.com/ans-group/docs.ukfast.co.uk).

As you're likely not an authorised user on the repository, the 'git way' of making changes to it is to first 'fork' the repository, then make the changes to that one and then propose that the changes be pushed back to the main ukfast repository via a 'pull request'. It may sound complex, but we'll walk through the steps now.

First, we have to fork the repository, which you can do using the 'fork' button in top right of the [UKFast docs repository page](https://github.com/ukfast/docs.ukfast.co.uk):
First, we have to fork the repository, which you can do using the 'fork' button in top right of the [UKFast docs repository page](https://github.com/ans-group/docs.ukfast.co.uk):

<kbd>![Fork button](files/5.png)</kbd>

Expand Down Expand Up @@ -80,7 +80,7 @@ To do this, right click on your new commit and select 'Start a pull request to o

<kbd>![Raising a pull](files/12.png)</kbd>

Adjust the 'To Repo' so that it's going to the `ukfast/docs.ukfast.co.uk` repository and then fill in the `Title` and `Description` fields with something descriptive. Filled out, you'll have something like this:
Adjust the 'To Repo' so that it's going to the `ans-group/docs.ukfast.co.uk` repository and then fill in the `Title` and `Description` fields with something descriptive. Filled out, you'll have something like this:

<kbd>![Complete pull](files/13.png)</kbd>

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
ports:
- 80:80
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
test: ["CMD", "curl", "-f", "http://localhost/docs"]
interval: 10s
timeout: 10s
retries: 5
33 changes: 0 additions & 33 deletions nginx/docs-search.ukfast.co.uk.conf

This file was deleted.

36 changes: 15 additions & 21 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,21 @@ http {
}
proxy_pass http://elasticsearch:9200/;
}

rewrite ^/cloud/(.*)$ /ecloud/$1 permanent;
rewrite ^/ecloud/hybridandprivate/(.*)$ /ecloud/private/$1 permanent;
rewrite ^/Domains/(.*)$ /domains/$1 permanent;
rewrite /ecommercestacks/magento/magento2/nginxphpfilewhitelist.html /ecommercestacks/magento/magento2/nginxphpfileallowlist.html permanent;
rewrite /operatingsystems/linux/mail/blacklists.html /email/blocklists.html permanent;
rewrite /security/threatmonitoring/alert-remediation-tips/ip-whitelist.html /security/threatmonitoring/alert-remediation-tips/ip-allowlist.html permanent;
rewrite ^/operatingsystems/linux/mail/(.*)$ /email/$1 permanent;
rewrite /operatingsystems/windows/hmail/antispamsetup.html /email/hmail-antispam-setup.html permanent;


error_page 404 /404.html;
location = /40x.html {

rewrite ^(?!(\/docs|\/search))\/(.*)$ /docs/$2 permanent;
rewrite ^\/docs\/(((?!index).)*)\.html$ /docs/$1/ permanent;

rewrite ^/docs/cloud/(.*)$ /docs/ecloud/$1 permanent;
rewrite ^/docs/ecloud/hybridandprivate/(.*)$ /docs/ecloud/private/$1 permanent;
rewrite ^/docs/Domains/(.*)$ /docs/domains/$1 permanent;
rewrite ^/docs/ecommercestacks/magento/magento2/nginxphpfilewhitelist.html /docs/ecommercestacks/magento/magento2/nginxphpfileallowlist.html permanent;
rewrite ^/docs/operatingsystems/linux/mail/blacklists.html /docs/email/blocklists.html permanent;
rewrite ^/docs/security/threatmonitoring/alert-remediation-tips/ip-whitelist.html /docs/security/threatmonitoring/alert-remediation-tips/ip-allowlist.html permanent;
rewrite ^/docs/operatingsystems/linux/mail/(.*)$ /docs/email/$1 permanent;
rewrite ^/docs/operatingsystems/windows/hmail/antispamsetup.html /docs/email/hmail-antispam-setup.html permanent;

location /docs/robots.txt {
alias /usr/share/nginx/docs.ukfast.co.uk/html/docs/_static/robots.txt;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}

location /robots.txt {
alias /usr/share/nginx/docs.ukfast.co.uk/html/_static/robots.txt;
}
}
}
2 changes: 1 addition & 1 deletion populator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def format_markdown_text(text, file):
if missing_metadata:
missing_meta.append(file)

output['url'] = re.sub(r'^source/', '/', file.replace('.md', '.html'))
output['url'] = '/docs' + re.sub(r'^source/', '/', file.replace('.md', '/'))
es.index(index=index_name, body=output)

logging.info('Total documents missing meta tags {}/{}:'.format(len(missing_meta), len(files)))
Expand Down
20 changes: 10 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ If you would like to contribute a guide or amendment to an existing one, please

To get started, please visit:

* [the "how to contribute" guide](https://github.com/ukfast/docs.ukfast.co.uk/blob/master/contribute.md)
* [the terminology and style guide](https://github.com/ukfast/docs.ukfast.co.uk/blob/master/guide.md)
* [the "how to contribute" guide](https://github.com/ans-group/docs.ukfast.co.uk/blob/master/contribute.md)
* [the terminology and style guide](https://github.com/ans-group/docs.ukfast.co.uk/blob/master/guide.md)

## Developing locally

Expand Down Expand Up @@ -111,7 +111,7 @@ Please ensure pages and folders are easy to read and sensibly structured.

Please keep the page URLs lowercase and use hyphens instead of spaces, e.g.

* `/desktop/fastdesk/getting-started/windows.html`
* `/docs/desktop/fastdesk/getting-started/windows/`

### Navigation, Page Heading and Meta

Expand Down Expand Up @@ -310,7 +310,7 @@ If you wish to use text other than the heading for the section that you're linki
:doc:`/ecloud/flex/general/openstackcli`
```

This will make a hyperlink using the title of the page `/ecloud/flex/general/openstackcli` as the text.
This will make a hyperlink using the title of the page `/docs/ecloud/flex/general/openstackcli` as the text.

If you wish to use text other than the heading for the section that you're linking to, use the following format:

Expand All @@ -321,7 +321,7 @@ If you wish to use text other than the heading for the section that you're linki
You can also use this syntax:

```rst
`Custom Text</ecloud/flex/general/openstackcli>`_
`Custom Text</docs/ecloud/flex/general/openstackcli>`_
```

If you need to link headings (anchors) in other pages, you may need to use this format, which separates the display text away from the hyperlink target:
Expand All @@ -330,7 +330,7 @@ If you need to link headings (anchors) in other pages, you may need to use this
.. note::
Please see our user guide on `connecting to your website via FTP`_ for further assistance.
.. _connecting to your website via FTP: /operatingsystems/windows/commonissues/copyfiletoserver.html#connecting-to-your-ftp-server
.. _connecting to your website via FTP: /docs/operatingsystems/windows/commonissues/copyfiletoserver/#connecting-to-your-ftp-server
```

You'll notice that `connecting to your website via FTP` is used as a reference to associate the two.
Expand All @@ -354,8 +354,8 @@ These must be done using reStructuredText, and the format is like this:
</pre>

See the file in path `/domains/ssl/extended_validation_ssl` as an example.
* [Markdown source](https://github.com/ukfast/docs.ukfast.co.uk/edit/master/source/domains/ssl/extended_validation_ssl.md)
* [Rendered page](https://docs.ukfast.co.uk/domains/ssl/extended_validation_ssl.html#)
* [Markdown source](https://github.com/ans-group/docs.ukfast.co.uk/edit/master/source/domains/ssl/extended_validation_ssl.md)
* [Rendered page](https://docs.ukfast.co.uk/docs/domains/ssl/extended_validation_ssl.html#)

#### Adding the Registered Trademark ®

Expand All @@ -370,9 +370,9 @@ Renders like this: DDoSX<sup>®</sup>
Ensure you have `docker` and `docker-compose` installed.

```bash
git clone https://github.com/ukfast/docs.ukfast.co.uk.git ukfast_docs
git clone https://github.com/ans-group/docs.ukfast.co.uk.git ukfast_docs
cd ukfast_docs
docker-compose -f docker-compose.dev.yml up --build
```

Open a browser to 'http://localhost:80'
Open a browser to 'http://localhost/docs'
Loading

0 comments on commit a499dcb

Please sign in to comment.