Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
cleanup and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
nyiyui committed Oct 12, 2023
1 parent 276a2f7 commit 2ea9a54
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 93 deletions.
6 changes: 3 additions & 3 deletions airy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ RUN python -m poetry config virtualenvs.in-project true && \
python -m poetry install --no-root
USER root
RUN rm -rf /var/cache/* && \
mkdir /var/kyii-upload -p && \
chown app:app /var/kyii-upload && \
chmod 770 /var/kyii-upload
mkdir /var/kankin-upload -p && \
chown app:app /var/kankin-upload && \
chmod 770 /var/kankin-upload
USER app

COPY . /app/
Expand Down
22 changes: 11 additions & 11 deletions airy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ install: install-main install-service

install-main:
$(PRE_INSTALL)
useradd -m -c "Kyii Airy" -d "/opt/kyii-airy-home" kyii-airy
useradd -m -c "Kyii Airy" -d "/opt/kankin-airy-home" kankin-airy
$(NORMAL_INSTALL)
cp -r . /opt/kyii-airy-home/airy
cp -r ./deploy/* /opt/kyii-airy-home/
chown kyii-airy:kyii-airy /opt/kyii-airy-home/ -R
chmod u+x /opt/kyii-airy-home/start.sh
cp -r . /opt/kankin-airy-home/airy
cp -r ./deploy/* /opt/kankin-airy-home/
chown kankin-airy:kankin-airy /opt/kankin-airy-home/ -R
chmod u+x /opt/kankin-airy-home/start.sh
$(POST_INSTALL)
su -s /bin/bash -c 'bash /opt/kyii-airy-home/setup.sh' kyii-airy
su -s /bin/bash -c 'bash /opt/kankin-airy-home/setup.sh' kankin-airy

install-service:
$(NORMAL_INSTALL)
cp ./deploy/kyii-airy.service /usr/lib/systemd/system/kyii-airy.service
cp ./deploy/kankin-airy.service /usr/lib/systemd/system/kankin-airy.service
$(POST_INSTALL)
systemctl daemon-reload
systemctl enable kyii-airy.service
systemctl enable kankin-airy.service

uninstall: uninstall-main uninstall-service

uninstall-main:
userdel kyii-airy
rm -r /opt/kyii-airy-home
userdel kankin-airy
rm -r /opt/kankin-airy-home

uninstall-service:
rm /usr/lib/systemd/system/kyii-airy.service
rm /usr/lib/systemd/system/kankin-airy.service

messages.pot:
pybabel extract -F ./babel.cfg -k _l -o messages.pot .
Expand Down
2 changes: 1 addition & 1 deletion airy/airy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Config:

# Verifiers
VERIFIER_WEBAUTHN = dict(
rp_id="https://yuui.kyii.nyiyui.ca",
rp_id="https://yuui.kankin.nyiyui.ca",
rp_name="Airy",
)

Expand Down
2 changes: 1 addition & 1 deletion airy/airy/docker_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
def init_app(app):
app.config["UPLOAD_PATH"] = "/var/kyii-upload"
app.config["UPLOAD_PATH"] = "/var/kankin-upload"
app.config["SILICA_IMAGES_TMP_PATH"] = "/tmp"
4 changes: 2 additions & 2 deletions airy/airy/local_config_sample.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
def init_app(app):
app.config["SECRET_KEY"] = "change me!"
app.config["HOST"] = "localhost"
app.config["UPLOAD_PATH"] = ".local/kyii-upload"
app.config["UPLOAD_PATH"] = ".local/kankin-upload"
app.config["VERIFIER_WEBAUTHN_ORIGIN"] = "http://localhost:5000"
app.config["VERIFIER_WEBAUTHN"] = dict(
rp_id="localhost",
rp_name="local testing airy",
)
app.config["CACHE_TYPE"] = "SimpleCache"
app.config["SILICA_IMAGES_TMP_PATH"] = ".local/tmp-kyii-upload/"
app.config["SILICA_IMAGES_TMP_PATH"] = ".local/tmp-kankin-upload/"
Binary file removed airy/airy/routes/silica/.ax.py.kate-swp
Binary file not shown.
2 changes: 1 addition & 1 deletion airy/airy/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def seed():
"client_uri": "http://localhost:8001",
"grant_types": ["authorization_code"],
"redirect_uris": [
"http://localhost:8001/accounts/kyii/login/callback/"
"http://localhost:8001/accounts/kankin/login/callback/"
],
"response_types": ["code"],
"scope": "openid profile",
Expand Down
Binary file modified airy/airy/translations/en/LC_MESSAGES/messages.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion airy/airy/translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: +kyii@nyiyui.ca\n"
"Report-Msgid-Bugs-To: +kankin@nyiyui.ca\n"
"POT-Creation-Date: 2023-10-12 14:47-0400\n"
"PO-Revision-Date: 2022-11-03 02:29-0400\n"
"Last-Translator: nyiyui <@nyiyui.ca>\n"
Expand Down
6 changes: 3 additions & 3 deletions airy/deploy/kyii-airy.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Description=main process for Kyii Airy

[Service]
ExecStart=/opt/kyii-airy-home/start.sh
User=kyii-airy
WorkingDirectory=/opt/kyii-airy-home
ExecStart=/opt/kankin-airy-home/start.sh
User=kankin-airy
WorkingDirectory=/opt/kankin-airy-home

[Install]
WantedBy=network.target
6 changes: 3 additions & 3 deletions airy/deploy/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/env bash

cd /opt/kyii-airy-home/airy
cd /opt/kankin-airy-home/airy
python3 -m pip install --user pipenv
/opt/kyii-airy-home/.local/bin/pipenv install --skip-lock
/opt/kyii-airy-home/.local/bin/pipenv install --skip-lock uwsgi
/opt/kankin-airy-home/.local/bin/pipenv install --skip-lock
/opt/kankin-airy-home/.local/bin/pipenv install --skip-lock uwsgi
4 changes: 2 additions & 2 deletions airy/deploy/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env sh

cd /opt/kyii-airy-home/airy
cd /opt/kankin-airy-home/airy

/opt/kyii-airy-home/.local/bin/pipenv run uwsgi --ini /opt/kyii-airy-home/uwsgi.ini
/opt/kankin-airy-home/.local/bin/pipenv run uwsgi --ini /opt/kankin-airy-home/uwsgi.ini
6 changes: 3 additions & 3 deletions airy/deploy/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[uwsgi]
chdir = /opt/kyii-airy-home/airy
socket = /opt/kyii-airy-home/uwsgi.sock
chdir = /opt/kankin-airy-home/airy
socket = /opt/kankin-airy-home/uwsgi.sock
chmod-socket = 660
chown-socket = kyii-airy:www-data
chown-socket = kankin-airy:www-data
module = airy.wsgi:app

master = true
6 changes: 3 additions & 3 deletions airy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
airy:
build: ./
volumes:
- ./airy/docker/local_config.py:/opt/kyii-airy/airy/local_config.py
- ./airy/docker/local_config.py:/opt/kankin-airy/airy/local_config.py
networks:
- main
nginx:
Expand All @@ -24,8 +24,8 @@ services:
volumes:
- database:/var/lib/mysql
environment:
MYSQL_DATABASE: kyii_airy_db
MYSQL_USER: kyii_airy_user
MYSQL_DATABASE: kankin_airy_db
MYSQL_USER: kankin_airy_user
MYSQL_PASSWORD: very_secure_password
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
networks:
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
airy:
build: ./airy/
volumes:
- ./airy/docker/local_config.py:/opt/kyii-airy/airy/local_config.py
- ./airy/docker/local_config.py:/opt/kankin-airy/airy/local_config.py
networks:
- main
yuui:
Expand All @@ -16,7 +16,7 @@ services:
ports:
- 8080:8080
environment:
NGINX_HOST: "kyii2.nyiyui.ca"
NGINX_HOST: "kankin2.nyiyui.ca"
NGINX_PORT: "8080"
networks:
- main
Expand All @@ -31,8 +31,8 @@ services:
volumes:
- database:/var/lib/mysql
environment:
MYSQL_DATABASE: kyii_airy_db
MYSQL_USER: kyii_airy_user
MYSQL_DATABASE: kankin_airy_db
MYSQL_USER: kankin_airy_user
MYSQL_PASSWORD: very_secure_password
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
networks:
Expand Down
3 changes: 0 additions & 3 deletions nginx/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions nginx/Makefile

This file was deleted.

11 changes: 0 additions & 11 deletions nginx/Pipfile

This file was deleted.

30 changes: 0 additions & 30 deletions nginx/nginx.conf

This file was deleted.

0 comments on commit 2ea9a54

Please sign in to comment.