Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Oct 22, 2023
1 parent 8a807e3 commit 13b84e9
Show file tree
Hide file tree
Showing 190 changed files with 300 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ contact_links:
url: https://github.com/PowerDNS-Admin/PowerDNS-Admin/discussions
about: "If you're just looking for help, try starting a discussion instead"
- name: 💬 Project Chat
url: https://mattermost.powerdnsadmin.org/
url: https://mattermost.gundnsadmin.org/
about: "Join our Mattermost chat to discuss the project with other users and developers"
16 changes: 8 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ on:
- docker/**
- docker-test/**
- docs/**
- powerdnsadmin/static/assets/**
- powerdnsadmin/static/custom/css/**
- powerdnsadmin/static/img/**
- powerdnsadmin/swagger-spec.yaml
- gundnsadmin/static/assets/**
- gundnsadmin/static/custom/css/**
- gundnsadmin/static/img/**
- gundnsadmin/swagger-spec.yaml
- .dockerignore
- .gitattributes
- .gitignore
Expand Down Expand Up @@ -61,10 +61,10 @@ on:
- docker/**
- docker-test/**
- docs/**
- powerdnsadmin/static/assets/**
- powerdnsadmin/static/custom/css/**
- powerdnsadmin/static/img/**
- powerdnsadmin/swagger-spec.yaml
- gundnsadmin/static/assets/**
- gundnsadmin/static/custom/css/**
- gundnsadmin/static/img/**
- gundnsadmin/swagger-spec.yaml
- .dockerignore
- .gitattributes
- .gitignore
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ db_repository/*
tmp/*

node_modules
powerdnsadmin/static/generated
gundnsadmin/static/generated
.webassets-cache
.venv*
venv*
Expand Down
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--*.modules-folder "./powerdnsadmin/static/node_modules"
--*.modules-folder "./gundnsadmin/static/node_modules"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ You can then access GunDNS-Admin by pointing your browser to http://localhost:91

**Looking for help?** Try taking a look at the project's
[Support Guide](https://github.com/nicelizhi/GunDNS-Admin/blob/master/.github/SUPPORT.md) or joining
our [Discord Server](https://discord.powerdnsadmin.org).
our [Discord Server](https://discord.gundnsadmin.org).

## Security Policy

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you believe you've uncovered a security vulnerability and wish to report it c

Please note that we **DO NOT** accept reports generated by automated tooling which merely suggest that a file or file(s) _may_ be vulnerable under certain conditions, as these are most often innocuous.

If you believe that you've found a vulnerability which meets all of these conditions, please [submit a draft security advisory](https://github.com/PowerDNS-Admin/PowerDNS-Admin/security/advisories/new) on GitHub, or email a brief description of the suspected bug and instructions for reproduction to **admin@powerdnsadmin.org**.
If you believe that you've found a vulnerability which meets all of these conditions, please [submit a draft security advisory](https://github.com/PowerDNS-Admin/PowerDNS-Admin/security/advisories/new) on GitHub, or email a brief description of the suspected bug and instructions for reproduction to **admin@gundnsadmin.org**.

### Bug Bounties

Expand Down
2 changes: 1 addition & 1 deletion configs/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
# ### If the user is a member of this group, and that group name is included in the collection,
# ### the user will be set as an administrator.
# #SAML_ATTRIBUTE_GROUP = 'https://example.edu/pdns-groups'
# #SAML_GROUP_ADMIN_NAME = 'PowerDNSAdmin-Administrators'
# #SAML_GROUP_ADMIN_NAME = 'gundnsadmin-Administrators'

# SAML_SP_ENTITY_ID = 'http://<SAML SP Entity ID>'
# SAML_SP_CONTACT_NAME = '<contact name>'
Expand Down
6 changes: 3 additions & 3 deletions deploy/auto-setup/setup_linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

# Create a new group for PowerDNS-Admin
groupadd powerdnsadmin
groupadd gundnsadmin

# Create a user for PowerDNS-Admin
useradd --system -g powerdnsadmin powerdnsadmin
useradd --system -g gundnsadmin gundnsadmin

# Make the new user and group the owners of the PowerDNS-Admin files
chown -R powerdnsadmin:powerdnsadmin /opt/web/powerdns-admin
chown -R gundnsadmin:gundnsadmin /opt/web/powerdns-admin

# Start the PowerDNS-Admin service
systemctl start powerdns-admin
Expand Down
6 changes: 3 additions & 3 deletions deploy/auto-setup/setup_win.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@echo off

rem Create a new group for PowerDNS-Admin
net localgroup powerdnsadmin /add
net localgroup gundnsadmin /add

rem Create a user for PowerDNS-Admin
net user powerdnsadmin /add /passwordchg:no /homedir:nul /active:yes /expires:never /passwordreq:no /s
net user gundnsadmin /add /passwordchg:no /homedir:nul /active:yes /expires:never /passwordreq:no /s

rem Make the new user and group the owners of the PowerDNS-Admin files
icacls "C:\path\to\powerdns-admin" /setowner "powerdnsadmin"
icacls "C:\path\to\powerdns-admin" /setowner "gundnsadmin"

rem Start the PowerDNS-Admin service
net start powerdns-admin
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker/portainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.3'
services:

core:
image: powerdnsadmin/pda-legacy:latest
image: gundnsadmin/pda-legacy:latest
restart: unless-stopped
environment:
- SECRET_KEY=INSECURE-CHANGE-ME-9I0DAtfkfj5JmBkPSaHah3ECAa8Df5KK
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes/configmap.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: powerdnsadmin-env
name: gundnsadmin-env
data:
FLASK_APP: powerdnsadmin/__init__.py
FLASK_APP: gundnsadmin/__init__.py
SECRET_KEY: changeme_secret
SQLALCHEMY_DATABASE_URI: 'mysql://user:password@host/database'
14 changes: 7 additions & 7 deletions deploy/kubernetes/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: powerdnsadmin
name: gundnsadmin
labels:
app: powerdnsadmin
app: gundnsadmin
spec:
strategy:
type: RollingUpdate
replicas: 1
selector:
matchLabels:
app: powerdnsadmin
app: gundnsadmin
template:
metadata:
labels:
app: powerdnsadmin
app: gundnsadmin
spec:
containers:
- name: powerdnsadmin
image: powerdnsadmin/pda-legacy
- name: gundnsadmin
image: gundnsadmin/pda-legacy
ports:
- containerPort: 80
protocol: TCP
envFrom:
- configMapRef:
name: powerdnsadmin-env
name: gundnsadmin-env
imagePullPolicy: Always
restartPolicy: Always
8 changes: 4 additions & 4 deletions deploy/kubernetes/service.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: powerdnsadmin
namespace: powerdnsadmin
name: gundnsadmin
namespace: gundnsadmin
labels:
app: powerdnsadmin
app: gundnsadmin
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: powerdnsadmin
app: gundnsadmin

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
app:
image: powerdnsadmin/pda-legacy:latest
image: gundnsadmin/pda-legacy:latest
container_name: powerdns_admin
ports:
- "9191:80"
Expand Down
2 changes: 1 addition & 1 deletion docker-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN pip3 install -r requirements.txt

COPY . /app

ENV FLASK_APP=powerdnsadmin/__init__.py
ENV FLASK_APP=gundnsadmin/__init__.py
RUN yarn install --pure-lockfile --production \
&& yarn cache clean \
&& flask assets build
Expand Down
30 changes: 15 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ARG BUILD_DEPENDENCIES="build-base \
ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
FLASK_APP=/build/powerdnsadmin/__init__.py
FLASK_APP=/build/gundnsadmin/__init__.py

# Get dependencies
# py3-pip should not belong to BUILD_DEPENDENCIES. Otherwise, when we remove
Expand All @@ -39,17 +39,17 @@ COPY . /build
# Prepare assets
RUN yarn install --pure-lockfile --production && \
yarn cache clean && \
sed -i -r -e "s|'rcssmin',\s?'cssrewrite'|'rcssmin'|g" /build/powerdnsadmin/assets.py && \
sed -i -r -e "s|'rcssmin',\s?'cssrewrite'|'rcssmin'|g" /build/gundnsadmin/assets.py && \
flask assets build

RUN mv /build/powerdnsadmin/static /tmp/static && \
mkdir /build/powerdnsadmin/static && \
cp -r /tmp/static/generated /build/powerdnsadmin/static && \
cp -r /tmp/static/assets /build/powerdnsadmin/static && \
cp -r /tmp/static/img /build/powerdnsadmin/static && \
find /tmp/static/node_modules -name 'webfonts' -exec cp -r {} /build/powerdnsadmin/static \; && \
find /tmp/static/node_modules -name 'fonts' -exec cp -r {} /build/powerdnsadmin/static \; && \
find /tmp/static/node_modules/icheck/skins/square -name '*.png' -exec cp {} /build/powerdnsadmin/static/generated \;
RUN mv /build/gundnsadmin/static /tmp/static && \
mkdir /build/gundnsadmin/static && \
cp -r /tmp/static/generated /build/gundnsadmin/static && \
cp -r /tmp/static/assets /build/gundnsadmin/static && \
cp -r /tmp/static/img /build/gundnsadmin/static && \
find /tmp/static/node_modules -name 'webfonts' -exec cp -r {} /build/gundnsadmin/static \; && \
find /tmp/static/node_modules -name 'fonts' -exec cp -r {} /build/gundnsadmin/static \; && \
find /tmp/static/node_modules/icheck/skins/square -name '*.png' -exec cp {} /build/gundnsadmin/static/generated \;

RUN { \
echo "from flask_assets import Environment"; \
Expand All @@ -59,18 +59,18 @@ RUN { \
echo "assets.register('css_login', 'generated/login.css')"; \
echo "assets.register('js_main', 'generated/main.js')"; \
echo "assets.register('css_main', 'generated/main.css')"; \
} > /build/powerdnsadmin/assets.py
} > /build/gundnsadmin/assets.py

# Move application
RUN mkdir -p /app && \
cp -r /build/migrations/ /build/powerdnsadmin/ /build/run.py /app && \
cp -r /build/migrations/ /build/gundnsadmin/ /build/run.py /app && \
mkdir -p /app/configs && \
cp -r /build/configs/docker_config.py /app/configs

# Build image
FROM alpine:3.17

ENV FLASK_APP=/app/powerdnsadmin/__init__.py \
ENV FLASK_APP=/app/gundnsadmin/__init__.py \
USER=pda

RUN apk add --no-cache mariadb-connector-c postgresql-client py3-gunicorn py3-pyldap py3-flask py3-psycopg2 xmlsec tzdata libcap && \
Expand All @@ -88,10 +88,10 @@ COPY ./docker/entrypoint.sh /usr/bin/

WORKDIR /app
RUN chown ${USER}:${USER} ./configs /app && \
cat ./powerdnsadmin/default_config.py ./configs/docker_config.py > ./powerdnsadmin/docker_config.py
cat ./gundnsadmin/default_config.py ./configs/docker_config.py > ./gundnsadmin/docker_config.py

EXPOSE 80/tcp
USER ${USER}
HEALTHCHECK CMD ["wget","--output-document=-","--quiet","--tries=1","http://127.0.0.1/"]
ENTRYPOINT ["entrypoint.sh"]
CMD ["gunicorn","powerdnsadmin:create_app()"]
CMD ["gunicorn","gundnsadmin:create_app()"]
8 changes: 4 additions & 4 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ PDA has its own API, that should not be confused with the PowerDNS API. Keep in

The PDA API consists of two distinct parts:

- The /powerdnsadmin endpoints manages PDA content (accounts, users, apikeys) and also allow domain creation/deletion
- The /gundnsadmin endpoints manages PDA content (accounts, users, apikeys) and also allow domain creation/deletion
- The /server endpoints are proxying queries to the backend PowerDNS instance's API. PDA acts as a proxy managing several API Keys and permissions to the PowerDNS content.

The requests to the API needs two headers:

- The classic 'Content-Type: application/json' is required to all POST and PUT requests, though it's harmless to use it on each call
- The authentication header to provide either the login:password basic authentication or the Api Key authentication.

When you access the `/powerdnsadmin` endpoint, you must use the Basic Auth:
When you access the `/gundnsadmin` endpoint, you must use the Basic Auth:

```bash
# Encode your user and password to base64
Expand All @@ -44,7 +44,7 @@ Finally, the `/sync_domains` endpoint accepts both basic and apikey authenticati

#### Examples

Creating domain via `/powerdnsadmin`:
Creating domain via `/gundnsadmin`:

```bash
curl -L -vvv -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -X POST http://localhost:9191/api/v1/pdnsadmin/zones --data '{"name": "yourdomain.com.", "kind": "NATIVE", "nameservers": ["ns1.mydomain.com."]}'
Expand Down Expand Up @@ -132,5 +132,5 @@ docker-compose up -d
# Set environment variables
source .env
# Generate the diagrams
eralchemy -i 'mysql://${PDA_DB_USER}:${PDA_DB_PASSWORD}@'$(docker inspect powerdns-admin-mysql|jq -jr '.[0].NetworkSettings.Networks.powerdnsadmin_default.IPAddress')':3306/powerdns_admin' -o /tmp/output.pdf
eralchemy -i 'mysql://${PDA_DB_USER}:${PDA_DB_PASSWORD}@'$(docker inspect powerdns-admin-mysql|jq -jr '.[0].NetworkSettings.Networks.gundnsadmin_default.IPAddress')':3306/powerdns_admin' -o /tmp/output.pdf
```
2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [admin@powerdnsadmin.org](mailto:admin@powerdnsadmin.org). All
reported by contacting the project team at [admin@gundnsadmin.org](mailto:admin@gundnsadmin.org). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Looking for help?** Try taking a look at the project's
[Support Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.github/SUPPORT.md) or joining
our [Discord Server](https://discord.powerdnsadmin.org).
our [Discord Server](https://discord.gundnsadmin.org).

<div align="center">
<h3>
Expand Down Expand Up @@ -95,7 +95,7 @@ We do maintain an active Mattermost instance for internal communication, but we

Some maintainers petition their employer to grant some of their paid time to work on PDA.

Interested? You can contact our lead maintainer, Matt Scott, at admin@powerdnsadmin.org. We'd love to have you on the team!
Interested? You can contact our lead maintainer, Matt Scott, at admin@gundnsadmin.org. We'd love to have you on the team!

## :heart: Other Ways to Contribute

Expand Down
2 changes: 1 addition & 1 deletion docs/oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To link to Azure for authentication, you need to register PowerDNS-Admin in Azure. This requires your PowerDNS-Admin web interface to use an HTTPS URL.

* Under the Azure Active Directory, select App Registrations, and create a new one. Give it any name you want, and the Redirect URI shoule be type 'Web' and of the format https://powerdnsadmin/azure/authorized (replace the host name approriately).
* Under the Azure Active Directory, select App Registrations, and create a new one. Give it any name you want, and the Redirect URI shoule be type 'Web' and of the format https://gundnsadmin/azure/authorized (replace the host name approriately).
* Select the newly-created registration
* On the Overview page, the Application ID is your new Client ID to use with PowerDNS-Admin
* On the Overview page, make a note of your Directory/Tenant ID - you need it for the API URLs later
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/configuration/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SQLALCHEMY_DATABASE_URI = 'mysql://username:[email protected]/db_name'

For Postgres:
```
SQLALCHEMY_DATABASE_URI = 'postgresql://powerdnsadmin:powerdnsadmin@127.0.0.1/powerdnsadmindb'
SQLALCHEMY_DATABASE_URI = 'postgresql://gundnsadmin:gundnsadmin@127.0.0.1/gundnsadmindb'
```

Open your web browser and go to `http://localhost:9191` to visit PowerDNS-Admin web interface. Register a user. The first user will be in the Administrator role.
4 changes: 2 additions & 2 deletions docs/wiki/configuration/basic_settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### PowerDNSAdmin basic settings
### gundnsadmin basic settings

PowerDNSAdmin has many features and settings available to be turned either off or on.
gundnsadmin has many features and settings available to be turned either off or on.
In this docs those settings will be explain.
To find the settings in the the dashboard go to settings>basic.

Expand Down
6 changes: 3 additions & 3 deletions docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The following directions assume a default configuration and for productions setu

Connect to the database (Usually using `mysql -u root -p` if a password has been set on the root database user or `sudo mysql` if not), then enter the following:
```
CREATE DATABASE `powerdnsadmin` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `powerdnsadmin`.* TO 'pdnsadminuser'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD_HERE';
CREATE DATABASE `gundnsadmin` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `gundnsadmin`.* TO 'pdnsadminuser'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD_HERE';
FLUSH PRIVILEGES;
```
- If your database server is located on a different machine then change 'localhost' to '%'
Expand Down Expand Up @@ -51,6 +51,6 @@ Solution: Convert the column to MEDIUMTEXT:
1. Connect to the database shell as described in the setup database section:
2. Execute the following commands:
```
USE powerdnsadmin;
USE gundnsadmin;
ALTER TABLE history MODIFY detail MEDIUMTEXT;
```
Loading

0 comments on commit 13b84e9

Please sign in to comment.