Compare commits

..

No commits in common. "main" and "1.0.0" have entirely different histories.
main ... 1.0.0

10 changed files with 45 additions and 82 deletions

View file

@ -1 +0,0 @@
tabWidth = 4

View file

@ -17,7 +17,6 @@
- [ ] more themes - [ ] more themes
- [ ] more variations of the themes in version 1.0 - [ ] more variations of the themes in version 1.0
- [X] Dockerize - [X] Dockerize
- [ ] Redirection with Routes (your-domain.xyz/mastodon redirects to your mastodon account)
### TODO until 1.0: ### TODO until 1.0:
- [X] Import my themes from the old socialtree - [X] Import my themes from the old socialtree
@ -30,7 +29,7 @@
A up to date docker image is provided at my gitea, but you can also build it yourself. A up to date docker image is provided at my gitea, but you can also build it yourself.
### Build ### Build
1. Clone the repository `git clone https://dev.cat-enby.club/Nikurasu/socialtree.git` 1. Clone the repository `git clone https://git.oishi-ra.men/Nikurasu/socialtree-js.git`
2. Copy .env.example to .env and edit it to your needs 2. Copy .env.example to .env and edit it to your needs
3. Build the image. For unix like systems I provide a bash script in `dev/shell/docker-prod.sh`. I hated the hassle to type the full command every time ;) 3. Build the image. For unix like systems I provide a bash script in `dev/shell/docker-prod.sh`. I hated the hassle to type the full command every time ;)

View file

@ -1,8 +1,6 @@
name: "Nikurasu" # The name on the linktree name: "Nikurasu" # The name on the linktree
# summaryText: 'A simple sample text' # A short summary for what you do, will appear if uncommened # summaryText: 'A simple sample text' # A short summary for what you do, will appear if uncommened
# profilePic: # uncomment and set this if your profile pic has a custom name # profilePic: # uncomment and set this if your profile pic has a custom name
url: "https://links.nikurasu.gay" # URL of your SocialTree
siteName: 'NikuHost' # Name of the site visible in embeds, used for Link previews
roundPB: false # Set true if you want a round profile picture roundPB: false # Set true if you want a round profile picture
theme: '98' # Your theme theme: '98' # Your theme
links: # the links to your social accounts links: # the links to your social accounts

View file

@ -2,7 +2,9 @@ FROM node:lts-alpine
LABEL maintainer="nikurasu_tan publicmail@nikurasu.gay" LABEL maintainer="nikurasu_tan publicmail@nikurasu.gay"
WORKDIR /app WORKDIR /app
COPY src/ ./src COPY src/ ./src
COPY package.json yarn.loc[k] .en[v] ./ COPY package.json ./
COPY yarn.lock ./
COPY .env ./.env
COPY assets /assets COPY assets /assets
RUN mv /assets/config/config.yml.example /assets/config/config.yml RUN mv /assets/config/config.yml.example /assets/config/config.yml
COPY dev/shell/entrypoint.sh /entrypoint.sh COPY dev/shell/entrypoint.sh /entrypoint.sh

View file

@ -1,4 +1,3 @@
cd /app cd /app
yarn yarn
yarn build
yarn dev yarn dev

View file

@ -1,7 +1,7 @@
version: '3' version: '3'
services: services:
app: app:
image: dev.cat-enby.club/nikurasu/socialtree:latest image: git.oishi-ra.men/nikurasu/socialtree-js:latest
container_name: socialtree container_name: socialtree
environment: environment:
PORT: 3000 PORT: 3000

View file

@ -1,2 +1,2 @@
docker build -t dev.cat-enby.club/nikurasu/socialtree:latest -f dev/docker/images/main/Dockerfile --no-cache . docker build -t dev.cat-enby.club/nikurasu/socialtree-js:latest -f dev/docker/images/main/Dockerfile --no-cache .
docker build -t dev.cat-enby.club/nikurasu/socialtree:$1 -f dev/docker/images/main/Dockerfile . docker build -t dev.cat-enby.club/nikurasu/socialtree-js:$1 -f dev/docker/images/main/Dockerfile .

View file

@ -1,6 +1,6 @@
{ {
"name": "socialtree", "name": "socialtree",
"version": "1.0.0", "version": "0.3.0",
"description": "The awesome and damn simple, selfhosted alternative to linktree", "description": "The awesome and damn simple, selfhosted alternative to linktree",
"main": "src/index.js", "main": "src/index.js",
"author": "nikurasu", "author": "nikurasu",

View file

@ -1,48 +1,36 @@
import express from "express"; import express from 'express'
import yaml from "js-yaml"; import yaml from 'js-yaml'
import fs from "node:fs"; import fs from 'node:fs'
import * as dotenv from "dotenv"; import * as dotenv from 'dotenv'
console.log("🔧 Configuring socialtree..."); console.log('🔧 Configuring socialtree...')
dotenv.config(); dotenv.config()
const app = express(); const app = express()
const port = process.env.PORT || 3000; const port = process.env.PORT || 3000
const engine = "ejs"; const engine = 'ejs'
const customMainPartialThemes = [ const customMainPartialThemes = [ // Array of themes that require a custom main partial
// Array of themes that require a custom main partial '98'
"98", ]
];
app.set("view engine", engine); app.set('view engine', engine)
app.set("views", "./src/views"); app.set('views', './src/views')
app.use(express.static("src/dist")); app.use(express.static('src/dist'))
app.use(express.static("assets")); app.use(express.static('assets'))
app.get("/", (req, res) => { app.get('/', (req, res) => {
let config = yaml.load(fs.readFileSync("assets/config/config.yml"), "utf8"); let config = yaml.load(fs.readFileSync('assets/config/config.yml'), 'utf8')
res.render("index", { res.render('index', {
name: config.name, name: config.name,
url: config.url, filenameProfilePic: config.profilePic ? config.profilePic : 'profilepic.jpg',
filenameProfilePic: config.profilePic summaryText: config.summaryText ? config.summaryText: '',
? config.profilePic
: "profilepic.jpg",
summaryText: config.summaryText ? config.summaryText : "",
links: config.links, links: config.links,
smallLinks: config.smallLinks, smallLinks: config.smallLinks,
theme: config.theme, theme: config.theme,
roundPB: config.roundPB, roundPB: config.roundPB,
customMainPartialThemes: customMainPartialThemes, customMainPartialThemes: customMainPartialThemes
metaDescription: config.summaryText })
? config.summaryText })
: config.links.map((link) => link.text).join(" | "),
siteName: config.siteName ? config.siteName : "SocialTree",
});
});
app.listen(port, () => app.listen(port, () => console.log(`🚀 Socialtree started on port ${port}, with view engine ${engine}`))
console.log(
`🚀 Socialtree started on port ${port}, with view engine ${engine}`
)
);

View file

@ -1,35 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1">
<link <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
rel="stylesheet" <link rel="stylesheet" href="style/<%= theme %>.css">
href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css"
integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY="
crossorigin="anonymous"
/>
<link rel="stylesheet" href="style/<%= theme %>.css" />
<% if(theme === '98') { %> <% if(theme === '98') { %>
<link rel="stylesheet" href="https://unpkg.com/98.css" /> <link rel="stylesheet" href="https://unpkg.com/98.css">
<% } %> <% if(roundPB) { %>
<link rel="stylesheet" href="style/round-pb.css" />
<% } %> <% } %>
<title><%= name %> - SocialTree</title> <% if(roundPB) { %>
<meta property="og:title" content="<%= name %> - SocialTree" /> <link rel="stylesheet" href="style/round-pb.css">
<meta <% } %>
property="og:image" </head>
content="<%= url %>/img/<%= filenameProfilePic %>"
/>
<meta property="description" content="<%= metaDescription %>" />
<meta property="og:description" content="<%= metaDescription %>" />
<meta property="og:site_name" content="<%= siteName %>" />
<meta property="og:url" content="<%= url %>" />
<meta
property="twitter:image"
content="<%= url %>/img/<%= filenameProfilePic %>"
/>
<meta property="twitter:card" content="summary" />
<meta property="twitter:title" content="<%= name %> - SocialTree" />
<meta property="twitter:description" content="<%= metaDescription %>" />
</head>
</html>