Merge branch 'main' into main

This commit is contained in:
Akshay Nair authored and GitHub committed 2020-10-06 23:57:12 +05:30
commit ed5206d82a
20 files changed
+198 -19

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
version: 2.1
orbs:
node: circleci/node@4.1.0
jobs:
build:
executor: node/default
steps:
- checkout
- run: yarn
- run: yarn test
+14
View File
@@ -0,0 +1,14 @@
---
name: bug
about: Use this template to report any bugs you've encountered related to the project
title: 'What bug did you encounter?'
labels: bug
---
### Expected outcome
### Observed outcome
+10
View File
@@ -0,0 +1,10 @@
---
name: question
about: Use this template to ask any questions about the service
title: 'Whats your question'
labels: question
---
You can elaborate here
+13
View File
@@ -0,0 +1,13 @@
---
name: report-abuse
about: Use this template to report abusive domains
title: 'Report abuse'
labels: report-abuse
---
Domain you want to report:
### Reason
Explain why you think this domain is being abused
+8
View File
@@ -0,0 +1,8 @@
---
name: suggestion
about: Use this template for feedbacks and suggestions
title: 'Feedback/suggestion'
labels: suggestion
---
+12
View File
@@ -0,0 +1,12 @@
---
name: support
about: Use this template if you need any support with your domain
title: 'Support'
labels: support
---
Your domain name:
Explain any issues you are facing
+6
View File
@@ -0,0 +1,6 @@
domain:
- domains/*.json
documentation:
- ./*.md
- ./**/*.md
+24
View File
@@ -0,0 +1,24 @@
# https://github.com/actions/labeler
name: Checks
on: [pull_request_target]
jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- name: Running tests
uses: borales/actions-yarn@v2.0.0
with:
cmd: test
label:
runs-on: ubuntu-latest
steps:
- name: Labelling pull request
uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+25
View File
@@ -0,0 +1,25 @@
name: Publish records
on:
workflow_dispatch:
name: 'Publish records'
jobs:
publish:
runs-on: ubuntu-latest
env:
CI: '1'
ENV: production
NC_USER: ${{ secrets.NC_USER }}
NC_API_KEY: ${{ secrets.NC_API_KEY }}
NC_DOMAIN: ${{ secrets.NC_DOMAIN }}
IP_ADDRESS: ${{ secrets.IP_ADDRESS }}
steps:
- uses: actions/checkout@v2
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- name: Publishing records
uses: borales/actions-yarn@v2.0.0
with:
cmd: publish-records
+2
View File
@@ -22,6 +22,8 @@ Example (for github pages) -
}
```
NOTE: For github pages users, to fix the 404 you get after registering the domain, add `your-domain.is-a.dev` to your github pages repo in Settings > Github pages > Custom domain.
## Domains json file
The way you register your own domain name is through a pull request.
+24
View File
@@ -0,0 +1,24 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue before making a change.
You should also read up on this project's [code of conduct](./CODE_OF_CONDUCT.md)
## Pull requests
You can create an pull request for the following reasons -
* Adding, changing or removing a domain file you own
* Fixing a bug in the scripts or CI
* Fix an error in the documentation
#### Domains
Changes to domain files will follow the given process -
* PR will be reviewed and merged to `main` branch
* Currently, the publishing of records is done manually. This will be automated soon with releases
* The changes should reflect soon after publishing
## Issues
* **Report an abusive domain** - Create a new issue with the label `report-abuse`
* **Report a problem with your domain** - Create a new issue with the label `support`
* **Suggestions** - Create a new issue with the label `suggestion`
* **For any questions** - Create a new issue with the label `question`
* **Report any other issues related to this repository** - Create a new issue with any label that fits
+1
View File
@@ -1,4 +1,5 @@
{
"description": "The root domain for is-a.dev website",
"owner": {
"username": "phenax",
"email": "phenax5@gmail.com"
+12
View File
@@ -0,0 +1,12 @@
{
"description": "Abhinav Dalal's website",
"repo": "https://github.com/b-om/b-om.github.io",
"owner": {
"username": "abhinavdalal",
"email": "abhinavdalal@gmail.com"
},
"record": {
"CNAME": "b-om.github.io",
"URL": "https://abhinavdalal.is-a.dev"
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"description": "Alex's personal developer website",
"repo": "https://github.com/alexmorrisnz",
"owner": {
"username": "alexmorrisnz",
"email": "alex@navra.nz"
},
"record": {
"CNAME": "alexmorris.nz",
"URL": "https://alex.is-a.dev"
}
}
+1 -1
View File
@@ -7,6 +7,6 @@
},
"record": {
"CNAME": "the-garlic-os.github.io",
"URL": "https://the-garlic-os.is-a.dev"
"URL": "https://garlic-os.is-a.dev"
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"description": "/home/yorodm",
"repo": "https://github.com/yorodm/yorodm.github.io",
"owner": {
"username": "yorodm",
"email": "yoandy.rmartinez@gmail.com"
},
"record": {
"CNAME": "yorodm.github.io",
"URL": "https://yorodm.is-a.dev"
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Register *.is-a.dev domains for free",
"scripts": {
"test": "jest",
"test": "ENV=test jest",
"publish-records": "yarn test && node ./scripts/register-domains.js"
},
"repository": {
+4 -1
View File
@@ -35,7 +35,10 @@ const main = async () => {
};
if (require.main === module) {
main().catch(console.error);
main().catch(e => {
console.error(e);
process.exit(1);
});
} else {
module.exports = { toHostList, registerDomains };
}
+12 -6
View File
@@ -1,15 +1,21 @@
const path = require('path');
const { ENV = 'sandbox' } = process.env;
require('dotenv').config({ path: path.resolve(`.env.${ENV}`) });
const { ENV = 'sandbox', CI } = process.env;
if (!CI) {
require('dotenv').config({ path: path.resolve(`.env.${ENV}`) });
}
const { NC_USER, NC_API_KEY, NC_DOMAIN, IP_ADDRESS } = process.env;
const IS_TEST = ENV === 'test';
module.exports = {
ENV,
VALID_RECORD_TYPES: ['CNAME', 'A', 'ALIAS', 'URL'],
NC_DOMAIN: NC_DOMAIN || 'booboo.xyz',
NC_USER: NC_USER || 'test',
NC_API_KEY: NC_API_KEY || 'fake_key',
ENV,
TTL: 5*60,
NC_USER: IS_TEST ? 'testuser' : NC_USER,
NC_API_KEY: IS_TEST ? 'testkey' : NC_API_KEY,
IP_ADDRESS,
TTL: 5*60,
};
+5
View File
@@ -52,6 +52,11 @@ const getDomainService = ({ nc }) => {
return { getHosts, setHosts, updateHosts };
};
if (!NC_API_KEY) {
console.error('NC_API_KEY cannot be empty');
process.exit(1);
}
const nc = new Namecheap({
user: NC_USER,
key: NC_API_KEY,