e-Preprint archive nrpl.xyz

Update README.md #3

merged opened by vaporize.me targeting master
- Add Installation section
- Add Configure section
  - TODO: This needs more detailed information (NEED HELP!)
- Add New User section
- Add Upload PDF section
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:y2rmteefnuyglpyoski6bzzv/sh.tangled.repo.pull/3mf2ronlass22
+149 -2
Diff #0
+149 -2
README.md
··· 1 1 # nomos 2 2 von, but more like a trusworthy clawhammer 3 3 4 + ## Installation 5 + 6 + ``` 7 + git clone https://tangled.org/0xlet0.dmrg.yokohama/nomos 8 + cd nomos 9 + ``` 10 + 11 + ### Run on HOST (Debian/Ubuntu) 12 + 13 + #### 1. Install System Packages 14 + ``` 15 + sudo apt update 16 + sudo apt install -y build-essential \ 17 + gpg \ 18 + gpg-agent \ 19 + libmagic1 20 + ``` 21 + 22 + #### 2. Create Virtual Environment 23 + ``` 24 + python3 -m venv venv 25 + source venv/bin/activate 26 + ``` 27 + 28 + #### 3. Install Python Packages 29 + ``` 30 + pip3 install -r requirements.txt 31 + ``` 32 + 33 + #### 4. Copy Configure Files 34 + ``` 35 + cp .env.sample .env 36 + cp handles.txt.sample handles.txt 37 + ``` 38 + 39 + Edit the files (See the 'Configure' section below) 40 + ``` 41 + nano .env 42 + nano handles.txt 43 + ``` 44 + 45 + #### 5. Create `gnupg` Directory 46 + ``` 47 + mkdir -p ./data/gnupg 48 + ``` 49 + 50 + #### 6. Run Application 4 51 ``` 5 52 fastapi dev main.py 6 53 ``` 7 54 55 + ### Run with Docker 56 + 57 + #### 1. Copy Configure Files 58 + ``` 59 + cp .env.sample .env 60 + cp handles.txt.sample handles.txt 61 + ``` 62 + 63 + Edit the files (See the 'Configure' section below) 64 + ``` 65 + nano .env 66 + nano handles.txt 67 + ``` 68 + 69 + #### 2. Create `gnupg` Directory 70 + ``` 71 + mkdir -p ./data/gnupg 72 + ``` 73 + 74 + #### 3. Build and Start Containers 75 + ``` 76 + docker compose up -d 77 + ``` 78 + 79 + ## Configuration 80 + 81 + ### `.env` 82 + 83 + - `BSKY_HANDLE`: Your Bluesky handle name. For example, `<USERNAME>.bsky.social`. 84 + - `BSKY_APP_PASSWORD`: Bluesky app password. You can generate it via `Settings - Privacy & Security`. 85 + - `BSKY_PDS`: Bluesky PDS hostname. For example, `https://bsky.social`. 86 + - `TR_USER`: Used for bittorrent client. 87 + - `TR_PASS`: Used for bittorrent client. 88 + - `DIST_NETWORK`: Select distribution client. (ipfs | bittorrent) 89 + - `PINATA_API_KEY`: Used for ipfs client. 90 + - `PINATA_SECRET_KEY`: Used for ipfs client. 91 + - `JWT_SECRET_KEY`: Used for ipfs client. 92 + 93 + ### `handles.txt` 94 + 95 + Bluesky user's PDS names to subscribe. Names are separated by newlines. 96 + 97 + ## Add a New User 98 + 99 + You have to login as a user to upload PDFs to nomos. 100 + Before creating a user, GPG (GnuPG) key should be generated. 101 + ``` 102 + gpg --full-generate-key 103 + ``` 104 + 105 + To export the GPG public key, you need the Key ID. 106 + ``` 107 + gpg --list-keys 108 + ``` 109 + 110 + The output should look similar like below: 111 + ``` 112 + $ gpg --list-keys 113 + <PATH>/.gnupg/pubring.kbx 114 + ------------------------------- 115 + pub ed25519 1970-01-01 [SC] 116 + ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890ABC 117 + uid [ultimate] user (Admin) <user@email.com> 118 + sub cv25519 1970-01-01 [E] 8 119 ``` 9 - gpg --output pubkey.gpg --export <keyid> 10 - python manage.py add <username> <keyid> --pubkey /location/to/the/armored/pubkey 120 + In this example, the Key ID is `ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890ABC`. 121 + 122 + Export the GPG public key. 123 + ``` 124 + gpg --output pubkey.gpg --export <Key ID> 125 + ``` 126 + 127 + Copy the GPG public key into the nomos directory. 11 128 ``` 129 + cp pubkey.gpg <PATH>/nomos/data/gnupg 130 + ``` 131 + 132 + Create the user. 133 + ``` 134 + python3 manage.py add <USERNAME> <Key ID> --pubkey <PATH>/nomos/data/gnupg 135 + ``` 136 + 137 + After this, you can login using the username and password. 138 + 139 + ## Upload the PDF 140 + 141 + To upload a PDF, you have to login and sign the PDF using GPG Key ID. 142 + 143 + First, check your Key ID. 144 + ``` 145 + gpg --list-keys 146 + ``` 147 + 148 + Create a detached signature. 149 + ``` 150 + gpg -u <Key ID> --detach-sign <PATH>/<FILENAME>.pdf 151 + ``` 152 + 153 + This will gernerate the signature file: 154 + ``` 155 + <FILENAME>.pdf.sig 156 + ``` 157 + 158 + Last, upload the PDF along with the signature file.

History

1 round 1 comment
sign up or login to add to the discussion
vaporize.me submitted #0
expand 1 comment

LGTM! Thanks for your contribution :)

pull request successfully merged