-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Docker Support (#40) * create sample env file * delete sample env file * added todo for me * added instructions to run in docker too * fix typos * Ignore .idea/ * Removed todo * Minor README edits * Formatting; fixes #38 * README.md updates with Docker instructions * Kubernetes documentation; closes #43 * Updated welcome question; closes #46 * Move files and update .gitignore * Handle invalid tokens and allow dockerfile to only copy what is needed. Also split email into its own module (#53) * handle no token and invalid token passed to the bot * change docker to copy only needed folder * Changed from string.format to fstring. Let black handle some formatting * Move send_email into its own module. It works! * Add hostname to INFO output. * Updated text. * Initial batch of DB functionality (#58) * Populate first joined time, member ID, and permanent roles for existing users. * Populate DB appropriately on join and on accept; add "myinfo" command * Add join time and member info to joining users. * Display permanent roles for users * Actually add the Db class to git ಠ_ಠ * Upsert new users instead of inserting. * Readd permanent roles on join * Add first join time to myinfo * Update README and example Co-authored-by: Mark <[email protected]> Co-authored-by: Rahul Sundaresan <[email protected]> Co-authored-by: rahul-sundaresan <[email protected]>
- Loading branch information
1 parent
2eef929
commit 7b1af61
Showing
9 changed files
with
385 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
FROM python:3.7 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
COPY network_ranger ./network_ranger | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
CMD [ "python3", "network_ranger" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ SMTP_SERVER=in-v3.mailjet.com | |
SMTP_PORT=587 | ||
[email protected] | ||
SECRETKEY=Secret key from Step 1 | ||
DB_HOST=mongodb.hostname | ||
DB_PORT=27017 | ||
DB_NAME=network_ranger | ||
DB_USER=<dbuser> | ||
DB_PASS=<dbpass> | ||
``` | ||
If you're running this directly instead of as a container, you will need to load each one of these as an environment | ||
variable. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: network-ranger | ||
|
||
--- | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
namespace: network-ranger | ||
name: network-ranger | ||
labels: | ||
app: network-ranger | ||
|
||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: network-ranger | ||
template: | ||
metadata: | ||
labels: | ||
app: network-ranger | ||
spec: | ||
containers: | ||
- name: network-ranger | ||
image: netdiscord/network-ranger:latest | ||
env: | ||
- name: TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: TOKEN | ||
- name: BOT_DESCRIPTION | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: BOT_DESCRIPTION | ||
- name: COMMAND_PREFIX | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: COMMAND_PREFIX | ||
- name: LOGCHANNEL_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: LOGCHANNEL_NAME | ||
- name: MEMBERCHANNEL_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: MEMBERCHANNEL_NAME | ||
- name: MEMBERROLE_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: MEMBERROLE_NAME | ||
- name: EGGSROLE_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: EGGSROLE_NAME | ||
- name: WELCOMECHANNEL_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: WELCOMECHANNEL_NAME | ||
- name: GUILD_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: GUILD_NAME | ||
- name: MIRRORCHANNEL_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: MIRRORCHANNEL_NAME | ||
- name: SMTP_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SMTP_USERNAME | ||
- name: SMTP_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SMTP_PASSWORD | ||
- name: SMTP_SERVER | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SMTP_SERVER | ||
- name: SMTP_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SMTP_PORT | ||
- name: SMTP_FROMEMAIL | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SMTP_FROMEMAIL | ||
- name: SECRETKEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: network-ranger | ||
key: SECRETKEY | ||
- name: DB_HOST | ||
value: "mongodb" | ||
- name: DB_PORT | ||
value: "27017" | ||
- name: DB_USER | ||
value: "root" | ||
- name: DB_NAME | ||
value: "network_ranger" | ||
- name: DB_PASS | ||
valueFrom: | ||
secretKeyRef: | ||
name: mongodb | ||
key: mongodb-root-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.