feature/string-translation #5

Merged
xyon merged 4 commits from feature/string-translation into main 2024-10-07 23:14:07 +00:00
7 changed files with 52 additions and 15 deletions
Showing only changes of commit 6d8af9b60a - Show all commits

View File

@ -8,24 +8,46 @@ on:
jobs:
build:
runs-on: rust
container:
options: --dns 172.16.255.254
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pre-seed known_hosts
- name: Pre-seed known_hosts (Badgey)
run: mkdir -pv ~/.ssh && ssh-keyscan -t rsa badgey >> ~/.ssh/known_hosts
- name: Pre-seed known_hosts (M5)
run: mkdir -pv ~/.ssh && ssh-keyscan -t rsa m5-computer >> ~/.ssh/known_hosts
- name: Build (Release)
run: cargo build --release --color=always
- uses: cschleiden/replace-tokens@v1.2
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: badgey
path: target/release/badgey
deploy:
runs-on: rust
container:
options: --dns 172.16.255.254
strategy:
matrix:
bot: [ BADGEY, M5_COMPUTER ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: badgey
- name: Seed config file
uses: cschleiden/replace-tokens@v1.2
with:
files: config/production.badgey.json
env:
BOT_NICKNAME: ${{ vars[format('{0}_BOT_NICKNAME', matrix.bot) }}
LOG_CHANNEL_ID: ${{ vars[format('{0}_LOG_CHANNEL_ID', matrix.bot) }}
POSTGRES_HOST: ${{ vars.POSTGRES_HOST }}
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
POSTGRES_DATABASE_NAME: ${{ vars.POSTGRES_DATABASE_NAME }}
POSTGRES_DATABASE_NAME: ${{ vars[format('{0}_POSTGRES_DATABASE_NAME', matrix.bot) }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
DOGPICS_API_KEY: ${{ secrets.DOGPICS_API_KEY }}
@ -33,4 +55,4 @@ jobs:
- name: Seed SSH key for deploy
run: echo "${{ secrets.DEPLOY_KEY }}" | tr -d '\r' > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa
- name: Deploy
run: bash cicd/deploy.sh
run: bash cicd/deploy.sh ${{ matrix.bot }}

1
Cargo.lock generated
View File

@ -1269,7 +1269,6 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "manifold"
version = "6.0.0"
source = "git+https://code.orbiter-radio.uk/discord/manifold.git#da04f2d4e0e81c301b2549ddedf5aa231a3632ec"
dependencies = [
"built",
"chrono",

View File

@ -1,7 +1,9 @@
#!/bin/bash
ssh badgey@badgey sudo /usr/bin/systemctl stop badgey
rsync -avP target/release/badgey badgey@badgey:/srv/badgey/
rsync -avP config badgey@badgey:/srv/badgey/
rsync -avP txt badgey@badgey:/srv/badgey/
ssh badgey@badgey sudo /usr/bin/systemctl start badgey
bot=$(echo "$1" | tr '[:upper:]' '[:lower:]')
ssh $bot@$bot sudo /usr/bin/systemctl stop $bot
rsync -avP badgey $bot@$bot:/srv/$bot/
rsync -avP config $bot@$bot:/srv/$bot/
rsync -avP txt $bot@$bot:/srv/$bot/
ssh $bot@$bot sudo /usr/bin/systemctl start $bot

View File

@ -1,8 +1,8 @@
{
"prefix": ".",
"nickname": "Badgey",
"nickname": "#{BOT_NICKNAME}#",
"channels": {
"log": 1143479696886087801
"log": "#{LOG_CHANNEL_ID}#"
},
"database": {
"host": "#{POSTGRES_HOST}#",
@ -11,7 +11,7 @@
"database_name": "#{POSTGRES_DATABASE_NAME}#",
"port": 5432
},
"responses_file_path": "txt/responses.txt",
"responses_file_path": "txt/responses.#{BOT_IDENTIFIER}#",
"services": {
"weather": {
"source_uri": "https://api.weatherapi.com/v1",

View File

@ -0,0 +1,14 @@
[bot startup]
M5 COMPUTER SYSTEM ACTIVATING
This unit has been attached. Programming includes full freedom to choose defensive actions in all attack situations.
Reticulating splines....
[help footer]
M5 READOUT
[weather card footer]
M5 WEATHER CIRCUIT OPERATIONAL EFFICIENCY NOW 43%
This weather broadcast and all which preceded it are entirely fictional. Starfleet Command takes no responsibility for any harm caused by believing otherwise.
Weather by M5. Not the reporting. The actual weather. I can do what I want.
This report will self destruct in five seconds.
Any information contained within the above weather report is not safe for human consumption. In case of contact with eyes, please consult a medical professional.
I think your warp core is leaking.
[end]