Project Steel Plate for Arctic Fox (or 雪狐桑)
You can help improve the UI design by pulling request.
Additionally, authorized media materials will also be highly appreciated.
(Tested on Apple Silicon ONLY)
1. Install Rust develop environment
2. Add target x86_64-unknown-linux-musl
with command below:
shell
$ rustup target add x86_64-unknown-linux-musl
3. Install ross-compilation toolchain
shell
$ brew install filosottile/musl-cross/musl-cross
4. Navigate into project root, then run
shell
$ mkdir .cargo
$ echo '[target.x86_64-unknown-linux-musl]
linker = "x86_64-linux-musl-gcc"' > .cargo/config
5. Add command alias for x86_64-linux-musl-gcc
shell
$ ln -s `where x86_64-linux-musl-gcc` /usr/local/bin/musl-gcc
6. Cross compile
shell
$ cargo build --release --target x86_64-unknown-linux-musl
7. Pack as zip file
shell
$ zip -j rust.zip ./target/x86_64-unknown-linux-musl/release/bootstrap
!!! TO BE TESTED !!!
1. Install Rust develop environment
2. Navigate into project root
3. Compile
shell
$ cargo build --release
4. Pack as zip file
shell
$ zip -j rust.zip ./target/release/bootstrap
Create function
on Lambda Functions pageAuthor from scratch
Runtime
to Provide your own bootstrap on Amazon Linux 2
Architecture
to x86_64
Create function
to finish createUpload from
under card Code source
.zip file
rust.zip
packed in the previous step, and click Save
Wait until it finishes
Click Create table
on DynamoDB Tables page
Table name
Partition key
to key
with type String
Table settings
according to your needsCreate table
to finish createExplore items
on sidebarTable name
you set beforeCreate item
Add new attribute
, choose Number
total
where Attribute name shows key
NewValue
to value
and set its Value to 0
Click Create item
to finish
Go to IAM and open Roles
Attach policies
under Add permissions
AmazonDynamoDBFullAccess
provides by AWS (more dangerous, but easier)Click Attach policies
to finish role edition
Example custom policy:
json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "0",
"Effect": "Allow",
"Action": [
"dynamodb:PutItem",
"dynamodb:GetItem",
"dynamodb:UpdateItem"
],
"Resource": "arn:aws:dynamodb:xxxxxx:xxxxxxx:table/xxxxxx"
},
{
"Sid": "1",
"Effect": "Allow",
"Action": "dynamodb:ListTables",
"Resource": "*"
}
]
}
Create a HTTP API
Integrations
to your lambda functionConfigure routes
, set Method to ANY
, Resource path to /{proxy+}
and Integration target to your lambda function Invoke URL
, and you can finally enjoy the 100% pure steel plate of Arctic Fox!!! Standalone will store total clicks in the server memory and ONLY in the memory !!!
However, by setting env STEEL_PLATE_COUNT_BASE
, you can set the base clicks count number
shell
$ cargo build --release
shell
$ ./target/release/steel-plate
http://127.0.0.1:8082/
MIT LICENSE
2022 Richard Chen