❯ nvm install node Downloading and installing node v20.4.0... Downloading https://nodejs.org/dist/v20.4.0/node-v20.4.0-linux-x64.tar.xz... ######################################################################################################################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v20.4.0 (npm v9.7.2) Creating default alias: default -> node (-> v20.4.0)
❯ node --version v20.4.0
❯ npm --version 9.7.2
[ Keystone JS ]
npm을 이용해서 keystone-app을 생성할 수 있다.
나의 app 이름을 지어주면 기본적인 boilerplate를 생성해준다.
❯ mkdir keystone
❯ cd keystone
❯ npm init keystone-app@latest Need to install the following packages: create-keystone-app@9.0.1 Ok to proceed? (y)
✨ You're about to generate a project using Keystone 6 packages.
✔ What directory should create-keystone-app generate your app into? · my-app
⠋ Installing dependencies with yarn. This may take a few minutes. ⚠ Failed to install with yarn. ✔ Installed dependencies with npm.
🎉 Keystone created a starter project in: my-app
To launch your app, run:
- cd my-app - npm run dev
Next steps:
- Read my-app/README.md for additional getting started details. - Edit my-app/keystone.ts to customize your app. - Open the Admin UI - Open the Graphql API - Read the docs - Star Keystone on GitHub
❯ cd my-app/
❯ ls -al 합계 484 drwxrwxr-x 4 chani22 chani22 4096 7월 12 16:28 . drwxrwxr-x 3 chani22 chani22 4096 7월 12 16:26 .. -rw-rw-r-- 1 chani22 chani22 46 7월 12 16:26 .gitignore drwxr-xr-x 2 chani22 chani22 4096 7월 12 16:28 .keystone -rw-rw-r-- 1 chani22 chani22 2874 7월 12 16:26 README.md -rw-rw-r-- 1 chani22 chani22 2710 7월 12 16:26 auth.ts -rw-rw-r-- 1 chani22 chani22 1014 7월 12 16:26 keystone.ts drwxrwxr-x 570 chani22 chani22 20480 7월 12 16:28 node_modules -rw-rw-r-- 1 chani22 chani22 410056 7월 12 16:28 package-lock.json -rw-rw-r-- 1 chani22 chani22 397 7월 12 16:26 package.json -rw-rw-r-- 1 chani22 chani22 9506 7월 12 16:26 schema.graphql -rw-rw-r-- 1 chani22 chani22 1056 7월 12 16:26 schema.prisma -rw-rw-r-- 1 chani22 chani22 5178 7월 12 16:26 schema.ts -rw-rw-r-- 1 chani22 chani22 195 7월 12 16:26 tsconfig.json 3.8.16 chani22@chani22-VBox /srv/workspace/ks/my-app
❯ nano keystone.ts
❯ npm run dev
> keystone-app@1.0.2 dev > keystone dev
✨ Starting Keystone ⭐️ Server listening on :3000 (http://localhost:3000/) ⭐️ GraphQL API available at /api/graphql ✨ Generating GraphQL and Prisma schemas ✨ sqlite database "keystone.db" created at file:./keystone.db ✨ Your database is now in sync with your schema ✨ Connecting to the database ✨ Creating server ✅ GraphQL API ready ✨ Generating Admin UI code ✨ Preparing Admin UI app - warn You have enabled experimental feature (appDir) in next.config.js. - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
- event compiled client and server successfully in 195 ms (18 modules) ✅ Admin UI ready - wait compiling /_error (client and server)... - event compiled client and server successfully in 6.5s (1706 modules)
❯ sudo add-apt-repository ppa:git-core/ppa The most current stable version of Git for Ubuntu.
For release candidates, go to https://launchpad.net/~git-core/+archive/candidate . 더 많은 정보: https://launchpad.net/~git-core/+archive/ubuntu/ppa [ENTER]을 눌러 진행하거나 Ctrl-c를 눌러 추가하는것을 취소합니다.
❯ sudo apt upgrade 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 업그레이드를 계산하는 중입니다... 완료 다음 패키지를 업그레이드할 것입니다: git git-man 2개 업그레이드, 0개 새로 설치, 0개 제거 및 0개 업그레이드 안 함. 9,438 k바이트 아카이브를 받아야 합니다. 이 작업 후 10.1 M바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까? [Y/n] 받기:1 http://ppa.launchpad.net/git-core/ppa/ubuntu focal/main amd64 git amd64 1:2.41.0-0ppa1~ubuntu20.04.1 [7,325 kB] 받기:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal/main amd64 git-man all 1:2.41.0-0ppa1~ubuntu20.04.1 [2,113 kB] 내려받기 9,438 k바이트, 소요시간 31초 (302 k바이트/초) (데이터베이스 읽는중 ...현재 186326개의 파일과 디렉터리가 설치되어 있습니다.) Preparing to unpack .../git_1%3a2.41.0-0ppa1~ubuntu20.04.1_amd64.deb ... Unpacking git (1:2.41.0-0ppa1~ubuntu20.04.1) over (1:2.25.1-1ubuntu3.11) ... Preparing to unpack .../git-man_1%3a2.41.0-0ppa1~ubuntu20.04.1_all.deb ... Unpacking git-man (1:2.41.0-0ppa1~ubuntu20.04.1) over (1:2.25.1-1ubuntu3.11) ... git-man (1:2.41.0-0ppa1~ubuntu20.04.1) 설정하는 중입니다 ... git (1:2.41.0-0ppa1~ubuntu20.04.1) 설정하는 중입니다 ... Processing triggers for man-db (2.9.1-1) ...
❯ git --version git version 2.41.0
이걸로 끝이다.
이렇게 하면 너무 쉽기에 추천할만한 방법이지만...
간혹 내부망 등의 이슈로 PPA 추가가 어려운 경우가 있으니 다른 방법도 알아보자.
[ Install ② Source Build ]
좀 번거로울 수도 있지만, 소스코드를 내려 받아서 직접 빌드를 해보자.
일단 apt로 설치한 git 패키지를 삭제하자.
❯ sudo apt purge git 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다: git-man liberror-perl 'sudo apt autoremove'를 이용하여 제거하십시오. 다음 패키지를 지울 것입니다: git* 0개 업그레이드, 0개 새로 설치, 1개 제거 및 0개 업그레이드 안 함. 이 작업 후 46.6 M바이트의 디스크 공간이 비워집니다. 계속 하시겠습니까? [Y/n] (데이터베이스 읽는중 ...현재 186489개의 파일과 디렉터리가 설치되어 있습니다.) git (1:2.41.0-0ppa1~ubuntu20.04.1)를 제거합니다... (데이터베이스 읽는중 ...현재 185600개의 파일과 디렉터리가 설치되어 있습니다.) Purging configuration files for git (1:2.41.0-0ppa1~ubuntu20.04.1) ...
빌드에 필요한 것들을 미리 설치해두자.
❯ sudo apt install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev make gettext libz-dev libssl-dev libghc-zlib-dev asciidoc docbook2x 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 주의, 'libz-dev' 대신에 'zlib1g-dev' 패키지를 선택합니다 패키지 make는 이미 최신 버전입니다 (4.2.1-1.2). 패키지 libexpat1-dev는 이미 최신 버전입니다 (2.2.9-1ubuntu0.6). libexpat1-dev 패키지는 수동설치로 지정합니다. 패키지 libssl-dev는 이미 최신 버전입니다 (1.1.1f-1ubuntu2.19). 패키지 zlib1g-dev는 이미 최신 버전입니다 (1:1.2.11.dfsg-2ubuntu1.5). 다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다: git-man liberror-perl 'sudo apt autoremove'를 이용하여 제거하십시오. 다음의 추가 패키지가 설치될 것입니다 : autoconf automake autopoint autotools-dev debhelper dh-strip-nondeterminism dwz ghc intltool-debian libarchive-cpio-perl libarchive-zip-perl libbsd-dev libcroco3 libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl libsigsegv2 libsub-override-perl libsys-hostname-long-perl libtool m4 po-debconf 제안하는 패키지: autoconf-archive gnu-standards autoconf-doc dh-make gettext-doc libasprintf-dev libgettextpo-dev ghc-prof ghc-doc haskell-doc llvm-6.0 libcurl4-doc libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev libghc-zlib-doc libghc-zlib-prof libtool-doc gfortran | fortran95-compiler gcj-jdk m4-doc libmail-box-perl 다음 새 패키지를 설치할 것입니다: autoconf automake autopoint autotools-dev debhelper dh-autoreconf dh-strip-nondeterminism dwz gettext ghc intltool-debian libarchive-cpio-perl libarchive-zip-perl libbsd-dev libcroco3 libcurl4-gnutls-dev libdebhelper-perl libfile-stripnondeterminism-perl libghc-zlib-dev libltdl-dev libmail-sendmail-perl libsigsegv2 libsub-override-perl libsys-hostname-long-perl libtool m4 po-debconf 0개 업그레이드, 27개 새로 설치, 0개 제거 및 0개 업그레이드 안 함. 74.8 M바이트 아카이브를 받아야 합니다. 이 작업 후 799 M바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까? [Y/n]
❯ make prefix=/usr/local all doc info GIT_VERSION = 2.41.0 * new build flags CC oss-fuzz/fuzz-commit-graph.o CC oss-fuzz/fuzz-pack-headers.o CC oss-fuzz/fuzz-pack-idx.o CC daemon.o * new link flags CC common-main.o CC abspath.o CC add-interactive.o ...
❯ sudo make prefix=/usr/local install install-doc install-html install-info
ubuntu@instance-20230626-2355:~$ timedatectl Local time: Tue 2023-06-27 00:32:32 KST Universal time: Mon 2023-06-26 15:32:32 UTC RTC time: Mon 2023-06-26 15:32:32 Time zone: Asia/Seoul (KST, +0900) System clock synchronized: yes NTP service: active RTC in local TZ: no
굳이 왜 이렇게까지 하냐면.... ^^
예전에 이렇게 만들어놓고 잊어먹어서.... 접속을 하지 않다가.... 결국은 삭제를 당했기에....
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server: server.login(sender_email, app_password) server.sendmail(sender_email, receiver_email, message.as_string())