Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "srdnlen-website-dc",
"image": "ghcr.io/lore-corrias/devcontainer",
"service": "srdnlen-website-dc",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,z,rw",
"workspaceFolder": "/workspace",
"runArgs": [
"--name",
"srdnlen-website-dc",
"-p",
"1337:1337"
]
}
8 changes: 6 additions & 2 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
# Allow manual deploys via the GitHub Actions Web UI.
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -19,6 +23,7 @@ jobs:
with:
# Fetch all history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
submodules: recursive

- name: Cache Hugo resources
uses: actions/cache@v3
Expand Down Expand Up @@ -79,10 +84,9 @@ jobs:
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v3
if: github.event_name == 'pull_request'
# Update 'your-project-name' below
with:
message: |
## Deployed your-project-name with Cloudflare Pages
## Deployed srdnlen-website with Cloudflare Pages

| **Latest commit:** | `${{ steps.short-sha.outputs.short_sha }}` |
|:-|:-|
Expand Down
105 changes: 104 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,104 @@
__pycache__
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/blowfish"]
path = themes/blowfish
url = https://github.com/nunocoracao/blowfish.git
Empty file added .hugo_build.lock
Empty file.
2 changes: 2 additions & 0 deletions FUNDING.YML
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [nunocoracao]
custom: ["https://www.paypal.me/nunocoracao", "https://www.buymeacoffee.com/nunocoracao"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Nuno Coração

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# srdnlen.it

![](readme/homepage.png)

This is the code for the official website of Srdnlen.

## Adding a member

In order to add a member, you can run the `add-author.py` script and follow the instructions. Please note the following:

1. Do not add captain members (for obvious reasons).
2. If you want to add a professor, select "Y" on the "Is the user a professor option", and then do not add any other tag.
3. The trainer/professor/captain tag are always the main roles, so please do not change the order manually.
4. Please note that members may have any number of secondary tag, but be modest :)
5. Follow steps 4-6 of "Adding a post".

> [!IMPORTANT]
>
> The members' informations are stored under the `data/authors` repository. If you need to make any changes, please edit this file. If you need to edit your image, you can edit the file under `assets/img/members`

## Adding a post

There are mainly two different type of posts:

1. Writeups, which can be added by any member of the team through a pull request
2. News, which can be added by authorized members only (note that a PR for a news article will be rejected if you haven't asked for permission first!)

If you would like to submit a new writeup, you can follow these steps:

1. Create a new branch or fork the repository to your personal profile
2. Clone the repository locally
3. If you want to create a writeup, add a folder to `content/writeups/<writeup-name>`.
```bash
hugo new content/writeups/<title>/index.md -k writeup
```
4. Once you are done making your edits, create a pull request. This will trigger a GitHub action that will build the website on a temporary URL, from which you can see your edits. The new link will be added as a comment to the PR like this:

![](readme/pr.png)
5. Double check your edits, then add the label "ready" to the request

![](readme/label.png)
6. Wait for an admin to merge your PR

> [!IMPORTANT]
> If you need to use images for a post, please add them to the same directory where your index.md is stored. You can set a thumbnail for your post by simply uploading an image named featured.{png,jpg}.

### Credits

This website was built using Hugo with the [Blowfish](https://github.com/nunocoracao/blowfish) theme.
65 changes: 65 additions & 0 deletions add-author.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import os
from unidecode import unidecode
import json

categories = ["web","pwn","rev","crypto","foren","misc"]
data = {}
category = 0
social = None
confirm = ""

data["name"] = input("Write the full name: ")
data["nick"] = input("Write the nickname (enter if none): ")
data["bio"] = input("Write a short biography (keep it under 100 chars): ")

data["categories"] = {"main": "", "secondary": []}
confirm = input("Is the user the team's captain? (y/N): ")
if confirm == "y":
data["categories"]["main"] = "captain"
confirm = input("Is the user a trainer? (y/N): ")
if confirm == "y":
data["categories"]["main"] = "trainer"

while category in range(0, len(categories)):
print("Add a user's category. The first one will be the main one, if the user is not a captain/trainer/professor (empty if none): ")
for i, cat in enumerate(categories):
print(f"{i + 1}) {cat}")
try:
category = int(input("?> "))
if data["categories"]["main"] == "":
data["categories"]["main"] = categories[category - 1]
else:
data["categories"]["secondary"].append(categories[category - 1])
except:
category = None


data["social"] = []
print("Select the socials to link with the author.")
print("You can add a social by checking available icons at https://blowfish.page/samples/icons/.")
print("Enter an empty social to exit.")
while social != "":
social = input("Enter the social name: ")
if social != "":
data["social"].append({social: input("Enter the social link: ")})

data["image"] = "/img/members/" + input("Add the image's name: ")

key = ""
if data["nick"] != "":
key = unidecode(data["nick"]).lower()
else:
key = unidecode(data["name"]).lower().replace(" ", "-")

with open("./data/authors/" + key + ".json", "w") as f2:
json.dump(data, f2, indent=1)

os.mkdir(f"./content/authors/{key}")
with open(f"./content/authors/{key}/_index.md", "w") as f2:
f2.write(f"""---
title: {data["name"]}
layout: profile
---""")

print("Author added.")
print(f"Add the author's avatar at assets/{data['image']}")
7 changes: 7 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: false
showAuthor: true
---

13 changes: 13 additions & 0 deletions archetypes/writeup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
authors: [""]
summary: "" # for open graph optimization in link previews
description: "" # can be the same as the summary
tags: ["writeup", "pwn", "rev"]
layout: "single"
showAuthor: false
showBreadcrumbs: false
showDate: false
---

52 changes: 52 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.badge-custom {
display: inline-flex;
padding: 4px 12px;
border-radius: 6px;
font-weight: 700;
font-size: 0.9rem;
justify-content: center;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-radius: 8px;
font-weight: 700;
font-size: 0.95rem;
}

.badge-custom svg {
width: 30px !important;
height: 30px !important;
min-width: 30px;
min-height: 30px;
flex-shrink: 0;
flex-direction: column;
fill: currentColor;
display: block;
}

.badge-web { background-color: #dbeafe; color: #1e40af; border: 1px solid #1e40af; }
.dark .badge-web { background-color: #1e3a8a; color: #dbeafe; border: 1px solid #60a5fa; }

.badge-crypto { background-color: #ca8a04; color: #ffffff; border: 1px solid #854d0e; }
.dark .badge-crypto { background-color: #a16207; color: #ffffff; border: 1px solid #fde047; }

.badge-pwn { background-color: #dc2626; color: #ffffff; border: 1px solid #991b1b; }
.dark .badge-pwn { background-color: #b91c1c; color: #ffffff; border: 1px solid #f87171; }

.badge-rev { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #6b21a8; }
.dark .badge-rev { background-color: #581c87; color: #f3e8ff; border: 1px solid #c084fc; }

.badge-forensics { background-color: #15803d; color: #ffffff; border: 1px solid #14532d; }
.dark .badge-forensics { background-color: #166534; color: #ffffff; border: 1px solid #4ade80; }

.badge-misc { background-color: #ea580c; color: #ffffff; border: 1px solid #9a3412; }
.dark .badge-misc { background-color: #c2410c; color: #ffffff; border: 1px solid #fb923c; }

.badge-trainer { background-color: #db2777; color: #ffffff; border: 1px solid #9d174d; }
.dark .badge-trainer { background-color: #be185d; color: #ffffff; border: 1px solid #f472b6; }

.badge-captain { background-color: #0891b2; color: #ffffff; border: 1px solid #155e75; }
.dark .badge-captain { background-color: #164e63; color: #ffffff; border: 1px solid #22d3ee; }

.badge-professor { background-color: #475569; color: #ffffff; border: 1px solid #1e293b; }
.dark .badge-professor { background-color: #334155; color: #ffffff; border: 1px solid #94a3b8; }
1 change: 1 addition & 0 deletions assets/icons/book-solid-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/captain-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/crypto-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/forensics-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/medal-solid-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/misc-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/professor-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/pwn-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/rev-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/trainer-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading