Compare commits

..

No commits in common. "cac7d8f0e2456783491b27447086af41c2d91052" and "6d8af9b60a7dd3a8b8754fff422359d81ffff0c3" have entirely different histories.

8 changed files with 16 additions and 53 deletions

View File

@ -8,46 +8,24 @@ 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 (Badgey)
- name: Pre-seed known_hosts
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
- 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
- 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[format('{0}_POSTGRES_DATABASE_NAME', matrix.bot) }}
POSTGRES_DATABASE_NAME: ${{ vars.POSTGRES_DATABASE_NAME }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
DOGPICS_API_KEY: ${{ secrets.DOGPICS_API_KEY }}
@ -55,4 +33,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 ${{ matrix.bot }}
run: bash cicd/deploy.sh

1
Cargo.lock generated
View File

@ -1269,6 +1269,7 @@ 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,6 +1,6 @@
[package]
name = "badgey"
version = "4.1.0"
version = "4.0.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

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

View File

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

View File

@ -1,14 +0,0 @@
[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]