summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blog/2021-07-15.md60
-rwxr-xr-xindex.md2
-rw-r--r--public/emoji/imagemagick.pngbin369988 -> 107974 bytes
-rw-r--r--public/wojak-brainchair.jpgbin77785 -> 0 bytes
-rw-r--r--public/wojak-brainchair.pngbin0 -> 80111 bytes
5 files changed, 30 insertions, 32 deletions
diff --git a/blog/2021-07-15.md b/blog/2021-07-15.md
index f53009e..45f9f37 100644
--- a/blog/2021-07-15.md
+++ b/blog/2021-07-15.md
@@ -63,11 +63,11 @@ jobs:
The `defaults` part might look scary, but you could just move everything from defaults directly under `upload_stickers` job.
Defaults are useful when you have multiple jobs, and I planned to have 2 initially. Let's now move to the `steps`:
```YAML
- - checkout
+- checkout
- - run:
- name: Install python dependencies
- command: pip3 install .
+- run:
+ name: Install python dependencies
+ command: pip3 install .
```
Obviously we checkout our code first, and then install all the dependencies for our `Python` script.
@@ -87,11 +87,11 @@ orbs:
Now back to the steps. Let's install the tool and use it to generate our `config.json`:
```YAML
- - envsubst/install
+- envsubst/install
- - run:
- name: Create config.json from template
- command: envsubst < config.template.json > config.json
+- run:
+ name: Create config.json from template
+ command: envsubst < config.template.json > config.json
```
Ok so we can now login into `Matrix`, but what about `Telegram`? The script uses `Telethon` package under the hood which works with a `sticker-import.session` file. This is basically an `SQL` database, and I don't really
@@ -100,33 +100,33 @@ Of course, someone could try to decrypt my `Telethon` session since it's now pub
Our next steps in config will be to decrypt the session and finally pipe our `telegram-packs.txt` to the script using `xargs`:
```YAML
- - run:
- name: Decrypt telethon session
- command: gpg --batch --passphrase $PASSPHRASE --decrypt sticker-import.session.gpg > sticker-import.session
+- run:
+ name: Decrypt telethon session
+ command: gpg --batch --passphrase $PASSPHRASE --decrypt sticker-import.session.gpg > sticker-import.session
- - run:
- name: Reupload and install stickers
- command: cat telegram-packs.txt | xargs sticker-import
+- run:
+ name: Reupload and install stickers
+ command: cat telegram-packs.txt | xargs sticker-import
```
At this point, the stickers are uploaded to the server, but the UI is updated via it's own `.json` file which contains information about uploaded stickers. It's already updated by the script, we just have to push it to our repo.
For that I've created a new SSH key and added it to `CircleCI` secrets so that it can push commits to my repository. So the final steps would be:
```YAML
- - add_ssh_keys
-
- - run:
- name: Add github to known_hosts
- command: |
- mkdir -p ~/.ssh
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- - run:
- name: Commit stickerpack JSON's
- command: |
- git config --global user.email "eug-vs@keemail.me"
- git config --global user.name "eug-vs"
- git add .
- git commit -m "feat: add stickerpacks with CircleCI [ci skip]"
- git push -u
+- add_ssh_keys
+
+- run:
+ name: Add github to known_hosts
+ command: |
+ mkdir -p ~/.ssh
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
+- run:
+ name: Commit stickerpack JSON's
+ command: |
+ git config --global user.email "eug-vs@keemail.me"
+ git config --global user.name "eug-vs"
+ git add .
+ git commit -m "feat: add stickerpacks with CircleCI [ci [skip](skip.md)]"
+ git push -u
```
The `[ci skip]` flag tells Circle to avoid running on this commit, otherwise it would have to run once again since we pushed a new commit with it.
@@ -136,6 +136,6 @@ need to check the **new** packs in the `telegram-packs.txt` - the script is actu
And that's it! Now every time I add new URLs to the `telegram-packs.txt`, they will automatically appear in my widget within a minute or so. Enjoy your stickers!
-![wojak-brain-chair](/public/wojak-brainchair.jpg)
+![wojak-brain-chair](/public/wojak-brainchair.png)
You can find full version of the config here: https://github.com/eug-vs/stickerpicker/blob/master/.circleci/config.yml
diff --git a/index.md b/index.md
index fd98b35..a5b9763 100755
--- a/index.md
+++ b/index.md
@@ -1,8 +1,6 @@
# About me
I'm **Eugene** - software developer, enthusiast and a cool guy. Here I share information based on my experience in different topics. I'm interested in tech, math, privacy, linguistics, nutrition, health, psychology and philosophy.
-[Visit my blog!](./blog/index.md)
-
# About this website
This website runs on my local *Raspberry Pi* and features secure **HTTPS** connection! It's just a series of interlinked wiki-pages that I write in `Markdown`. Checkout more info on my [recent blog post](/blog/2021-07-02.md)!
diff --git a/public/emoji/imagemagick.png b/public/emoji/imagemagick.png
index bb81bc0..4b67ed6 100644
--- a/public/emoji/imagemagick.png
+++ b/public/emoji/imagemagick.png
Binary files differ
diff --git a/public/wojak-brainchair.jpg b/public/wojak-brainchair.jpg
deleted file mode 100644
index d6b5c3e..0000000
--- a/public/wojak-brainchair.jpg
+++ /dev/null
Binary files differ
diff --git a/public/wojak-brainchair.png b/public/wojak-brainchair.png
new file mode 100644
index 0000000..39ffa32
--- /dev/null
+++ b/public/wojak-brainchair.png
Binary files differ