Compare commits
90 Commits
8432789521
...
master
Author | SHA1 | Date | |
---|---|---|---|
5de347550b | |||
077b0e801d | |||
69f957e46a | |||
92e02c856b | |||
097d2dc2d1 | |||
d4e93f3dc7 | |||
fad304521b | |||
f52e1c10bc | |||
d8ea386388 | |||
466c30dde6 | |||
7a8a74f7ec | |||
ba42ac52b8 | |||
7468a242a4 | |||
cbd3eac827 | |||
029a3197b0 | |||
becd731912 | |||
38ebcd3084 | |||
317f6772e9 | |||
b273ef0785 | |||
e6fc23fb52 | |||
ca2aea93e1 | |||
706e916d92 | |||
ce1890fa34 | |||
4193af75fc | |||
9effe13a7d | |||
0d3a08a0c0 | |||
3db462229d | |||
5be61dae6b | |||
6d3f43fe9f | |||
fea3aa0d08 | |||
71e301154d | |||
621273c988 | |||
eb38948134 | |||
b5326b8412 | |||
5c1126d493 | |||
859a90e149 | |||
ade5d19e45 | |||
06439fd958 | |||
3d12753c3b | |||
35aaf2b703 | |||
0a38dc1a28 | |||
6d014b55b7 | |||
51563f932c | |||
141f360387 | |||
aed8156c81 | |||
255fcb0dc1 | |||
427d136048 | |||
35225919c8 | |||
bd87cfbde2 | |||
9c253348ab | |||
a950c7fbfd | |||
1d649a7913 | |||
6f001937de | |||
f6b56015c1 | |||
fc8c533c26 | |||
1b0a78517c | |||
b6f19f4dd4 | |||
2a2f146a24 | |||
36c29ae557 | |||
8bd8cfd5f4 | |||
d04bd06ebe | |||
bad85adb4a | |||
fa7f8c42aa | |||
eb175b0eb2 | |||
16c526634c | |||
4904215464 | |||
33b5ce0499 | |||
e7a1cc1dec | |||
0e2aa4429d | |||
bdd9664f60 | |||
cf25811ff1 | |||
4e67931400 | |||
ddc1c69c06 | |||
2d10670d56 | |||
dafd9e20c7 | |||
e720c771ff | |||
1974152a7f | |||
ad5b76116a | |||
b4c4aa4c64 | |||
55e59c183f | |||
767413c4bd | |||
009963fe0f | |||
605ad5053a | |||
85cd2abb3b | |||
d9ab180b90 | |||
a30001228d | |||
d401e475ea | |||
b77bdeaa3d | |||
d9a2b8cfaf | |||
212e5f71ab |
132
.drone.yml
132
.drone.yml
@ -7,7 +7,6 @@ clone:
|
||||
|
||||
steps:
|
||||
- name: testing
|
||||
pull: always
|
||||
image: jekyll/jekyll:latest
|
||||
commands:
|
||||
- touch Gemfile.lock
|
||||
@ -18,90 +17,68 @@ steps:
|
||||
- bundle install
|
||||
- bundle exec jekyll build
|
||||
|
||||
# - name: ssh commands
|
||||
# image: appleboy/drone-ssh
|
||||
# settings:
|
||||
# host:
|
||||
# from_secret: homelab_host
|
||||
# username:
|
||||
# from_secret: homelab_user
|
||||
# key:
|
||||
# from_secret: homelab_pwd
|
||||
# port: 22
|
||||
# script:
|
||||
# - bash ~/scripts/sthopedevupdate
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
- name: running
|
||||
image: jekyll/jekyll:latest
|
||||
- name: deploying
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
TZ: Europe/Amsterdam
|
||||
port: 4000
|
||||
host:
|
||||
from_secret: homelab_host
|
||||
username:
|
||||
from_secret: homelab_user
|
||||
key:
|
||||
from_secret: homelab_key
|
||||
port:
|
||||
from_secret: homelab_port
|
||||
script:
|
||||
- jekyll serve --force_polling
|
||||
- bash /scripts/ssh_website_pull
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
|
||||
# website:
|
||||
# image: jekyll/jekyll:latest
|
||||
# container_name: website
|
||||
# hostname: website
|
||||
# command: jekyll serve --force_polling
|
||||
# network_mode: SWAG
|
||||
# environment:
|
||||
# - TZ=Europe/Amsterdam
|
||||
# restart: unless-stopped
|
||||
# volumes:
|
||||
# - /home/sthope/docker/website:/srv/jekyll
|
||||
# - /etc/localtime:/etc/localtime:ro
|
||||
# - /etc/timezone:/etc/timezone:ro
|
||||
# - website_cache:/srv/jekyll/.jekyll-cache
|
||||
# - website_site:/srv/jekyll/_site
|
||||
# labels:
|
||||
# - swag=enable
|
||||
# - swag_port=4000
|
||||
# - swag_proto=http
|
||||
# - swag_url=www.sthope.dev
|
||||
# - swag_auth=authelia
|
||||
# - swag_auth_bypass=/api,/otherfolder
|
||||
- name: semantic-release
|
||||
image: cenk1cenk2/drone-semantic-release
|
||||
settings:
|
||||
semantic_release: true
|
||||
git_method: cr
|
||||
git_user_name:
|
||||
from_secret: user_gitea
|
||||
git_user_email:
|
||||
from_secret: email_gitea
|
||||
git_login:
|
||||
from_secret: user_gitea
|
||||
git_password:
|
||||
from_secret: gitea_token
|
||||
update_readme_toc: true
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> f7090510b1b31c9fbe921ebd9372fa91944c8531
|
||||
# - name: discord
|
||||
# pull: always
|
||||
# image: appleboy/drone-discord
|
||||
# avatar_url: "https://git.sthope.dev/sthope/drone_test/raw/branch/master/rick.png"
|
||||
# environment:
|
||||
# DISCORD_WEBHOOK_ID:
|
||||
# from_secret: discord_webhook_id
|
||||
# DISCORD_WEBHOOK_TOKEN:
|
||||
# from_secret: discord_webhook_token
|
||||
# settings:
|
||||
# message: >
|
||||
# {{#success build.status}}
|
||||
# ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
|
||||
- name: discord
|
||||
image: appleboy/drone-discord
|
||||
avatar_url: "https://git.sthope.dev/sthope/drone_test/raw/branch/master/rick.png"
|
||||
environment:
|
||||
DISCORD_WEBHOOK_ID:
|
||||
from_secret: discord_webhook_id
|
||||
DISCORD_WEBHOOK_TOKEN:
|
||||
from_secret: discord_webhook_token
|
||||
settings:
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
|
||||
|
||||
# 📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
||||
# ```
|
||||
# {{commit.message}}
|
||||
# ```
|
||||
# 🌐 <{{ build.link }}>
|
||||
# {{else}}
|
||||
# ❌ Build #{{build.number}} of `{{repo.name}}` failed.
|
||||
# 📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
||||
# ```
|
||||
# {{commit.message}}
|
||||
# ```
|
||||
# 🌐 <{{ build.link }}>
|
||||
# {{/success}}
|
||||
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
||||
```
|
||||
{{commit.message}}
|
||||
```
|
||||
🌐 <{{ build.link }}>
|
||||
{{else}}
|
||||
❌ Build #{{build.number}} of `{{repo.name}}` failed.
|
||||
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
||||
```
|
||||
{{commit.message}}
|
||||
```
|
||||
🌐 <{{ build.link }}>
|
||||
{{/success}}
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
|
||||
|
||||
# # when:
|
||||
# # event:
|
||||
@ -113,3 +90,4 @@ steps:
|
||||
# # - changed
|
||||
# # - failure
|
||||
# # - success
|
||||
|
||||
|
72
.releaserc
Normal file
72
.releaserc
Normal file
@ -0,0 +1,72 @@
|
||||
---
|
||||
branch: master
|
||||
preset: "angular"
|
||||
tagFormat: "${version}"
|
||||
plugins:
|
||||
- "@semantic-release/commit-analyzer"
|
||||
- "@semantic-release/release-notes-generator"
|
||||
- "@semantic-release/changelog"
|
||||
- "@semantic-release/git"
|
||||
- "@semantic-release/github"
|
||||
|
||||
verifyConditions:
|
||||
- '@semantic-release/git'
|
||||
- "@semantic-release/github"
|
||||
analyzeCommits:
|
||||
- path: "@semantic-release/commit-analyzer"
|
||||
releaseRules:
|
||||
- type: "feat"
|
||||
release: "patch"
|
||||
- type: "hotfix"
|
||||
release: "patch"
|
||||
- type: "patch"
|
||||
release: "patch"
|
||||
- type: "minor"
|
||||
release: "minor"
|
||||
- type: "breaking"
|
||||
release: "major"
|
||||
generateNotes:
|
||||
- path: "@semantic-release/release-notes-generator"
|
||||
writerOpts:
|
||||
groupBy: "type"
|
||||
commitGroupsSort:
|
||||
- "feat"
|
||||
- "perf"
|
||||
- "fix"
|
||||
commitsSort: "header"
|
||||
types:
|
||||
- type: "feat"
|
||||
- section: "Features"
|
||||
# Tracked bug fix with a hotfix branch
|
||||
- type: "hotfix"
|
||||
- section: "Bug Fixes"
|
||||
# Uninmportent fix (CI testing, etc)
|
||||
- type: "fix"
|
||||
- hidden: true
|
||||
- type: "chore"
|
||||
- hidden: true
|
||||
- type: "docs"
|
||||
- hidden: true
|
||||
- type: "doc"
|
||||
- hidden: true
|
||||
- type: "style"
|
||||
- hidden: true
|
||||
- type: "refactor"
|
||||
- hidden: true
|
||||
- type: "perf"
|
||||
- hidden: true
|
||||
- type: "test"
|
||||
- hidden: true
|
||||
presetConfig: true
|
||||
prepare:
|
||||
- path: "@semantic-release/git"
|
||||
- path: "@semantic-release/changelog"
|
||||
changelogFile: "docs/CHANGELOG.md"
|
||||
publish:
|
||||
- path: "@semantic-release/github"
|
||||
|
||||
success:
|
||||
- "@semantic-release/github"
|
||||
|
||||
fail:
|
||||
- "@semantic-release/github"
|
@ -1,3 +1,9 @@
|
||||
# [Sthope.dev](https://www.Sthope.dev)
|
||||
|
||||
[](https://drone.sthope.dev/sthope/website)
|
||||
[](https://drone.sthope.dev/sthope/website)
|
||||
|
||||
|
||||
Installing Drone-CLI
|
||||
```
|
||||
curl -L https://github.com/drone/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx;sudo install -t /usr/local/bin drone
|
||||
```
|
||||
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Portainer Oauth"
|
||||
description: "Login into Portainer using your Github account or even better.. your private Gitea account (with 2FA)"
|
||||
author: sthope
|
||||
image:
|
||||
categories: [ Docker, Portainer, Portainer Agent ]
|
||||
comments: true
|
||||
pic01: "/assets/images/portainer_oauth/1.jpg"
|
||||
pic02: "/assets/images/portainer_oauth/2.jpg"
|
||||
pic03: "/assets/images/portainer_oauth/3.jpg"
|
||||
pic04: "/assets/images/portainer_oauth/4.jpg"
|
||||
pic05: "/assets/images/portainer_oauth/5.jpg"
|
||||
pic06: "/assets/images/portainer_oauth/6.jpg"
|
||||
pic07: "/assets/images/portainer_oauth/7.jpg"
|
||||
---
|
||||
|
||||
|
||||
# Github
|
||||
|
||||
Login into Github and go to https://github.com/settings/profile on the right side menu near the end enter `Developer settings` and select `OAuth Apps`
|
||||

|
||||
|
||||
# Gitea
|
||||
|
||||
Enter https://git.sthope.dev/user/settings and go to `Applications`
|
98
_posts/2021-09-04-portainer-oauth-authentication.md
Normal file
98
_posts/2021-09-04-portainer-oauth-authentication.md
Normal file
@ -0,0 +1,98 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Portainer OAuth Authentication"
|
||||
description: "Login into Portainer using your Github account or even better.. your private Gitea account (with 2FA)"
|
||||
author: sthope
|
||||
image:
|
||||
categories: [ Docker, Portainer, OAuth ]
|
||||
comments: true
|
||||
pic01: "/assets/images/portainer_oauth/1.png"
|
||||
pic02: "/assets/images/portainer_oauth/2.png"
|
||||
pic03: "/assets/images/portainer_oauth/3.png"
|
||||
pic04: "/assets/images/portainer_oauth/4.png"
|
||||
pic05: "/assets/images/portainer_oauth/5.png"
|
||||
pic06: "/assets/images/portainer_oauth/6.png"
|
||||
pic07: "/assets/images/portainer_oauth/7.png"
|
||||
pic08: "/assets/images/portainer_oauth/8.png"
|
||||
pic09: "/assets/images/portainer_oauth/9.png"
|
||||
pic10: "/assets/images/portainer_oauth/10.png"
|
||||
---
|
||||
|
||||
|
||||
# Github
|
||||
Login into Github and go to https://github.com/settings/profile on the right side menu near the end enter `Developer settings` and select `OAuth Apps`
|
||||
<img src="{{page.pic02}}"/>
|
||||
<img src="{{page.pic03}}"/>
|
||||
<br>
|
||||
<br>
|
||||
Create your app details
|
||||
<img src="{{page.pic04}}"/>
|
||||
`Application name`: Whatever you wanna call it
|
||||
`Homepage URL`: eg: http://IP:9000
|
||||
`Application description`: can be empty
|
||||
`Authorization callback URL`: eg: http://IP:9000
|
||||
<br>
|
||||
<br>
|
||||
After Github creates the application click on `Generate a new client secret` and copy `Client ID` and the `Secret` it created.
|
||||
<img src="{{page.pic05}}"/>
|
||||
<br>
|
||||
This is it Github Part is finish!
|
||||
<br>
|
||||
|
||||
# Portainer
|
||||
|
||||
Open Portainer UI and go to `Settings` on the right side menu then click on `Authentication` under it.
|
||||
<img src="{{page.pic08}}"/>
|
||||
|
||||
Now choose this options, you can use other `Session lifetime` if you want
|
||||
<img src="{{page.pic09}}"/>
|
||||
`Automatic user provisioning`: If set ON anyone with Github account will be able to login and Portainer will automaticily create the user without authorizations, better leave it off and handle the users creation/allowance to you.
|
||||
|
||||
### OAuth Configuration
|
||||
|
||||
<img src="{{page.pic10}}"/>
|
||||
|
||||
| :-------------------- | :------------------------------------------ |
|
||||
| **Client ID** | ClientID you copied from Github |
|
||||
| **Client secret** | Secret you copied from Github |
|
||||
| **Authorization URL** | https://github.com/login/oauth/authozize |
|
||||
| **Access token URL** | https://github.com/login/oauth/access_token |
|
||||
| **Resource URL** | https://api.github.com/user |
|
||||
| **Redirect URL** | your Portainer URL eg: http://IP:9000 |
|
||||
| **Logout URL** | *leave empty* |
|
||||
| **User identifier** | login |
|
||||
| **Scopes** | id,email,name |
|
||||
|
||||
Remember Gitea Username and Portainer Username need to math otherwise create a new username in Portainer with same name or enable `Automatic user provisioning` and then after login disable it again
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
# Gitea
|
||||
|
||||
For Gitea instead of Github, enter your user `Settings` and go to `Applications` and create a new one.
|
||||
|
||||
<img src="{{page.pic06}}"/>
|
||||
`Redirect URL`= use your Portainer URL, eg: http://IP:9000
|
||||
|
||||
<br>
|
||||
|
||||
After that is created, Gitea will give you the ClientID and Secret you should save to use with Portainer.
|
||||
<img src="{{page.pic07}}"/>
|
||||
|
||||
Now for Gitea the configs are a little different, follow:
|
||||
|
||||
| :-------------------- | :---------------------------------------- |
|
||||
| **Client ID** | ClientID you copied from Gitea |
|
||||
| **Client secret** | Secret you copied from Gitea |
|
||||
| **Authorization URL** | http://GITEA_URL/login/oauth/authorize |
|
||||
| **Access token URL** | http://GITEA_URL/login/oauth/access_token |
|
||||
| **Resource URL** | http://GITEA_URL/login/oauth/userinfo |
|
||||
| **Redirect URL** | your Portainer URL eg: http://IP:9000 |
|
||||
| **Logout URL** | *leave empty* |
|
||||
| **User identifier** | preferred_username |
|
||||
| **Scopes** | *leave empty* |
|
||||
|
||||
Should now be configured and you should be able to login using your Gitea Account
|
||||
|
||||
Remember Gitea Username and Portainer Username need to math otherwise create a new username in Portainer with same name or enable `Automatic user provisioning` and then after login disable it again
|
83
_posts/2021-09-05-gitea.md
Normal file
83
_posts/2021-09-05-gitea.md
Normal file
@ -0,0 +1,83 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Gitea"
|
||||
description: "Gitea docker container"
|
||||
author: sthope
|
||||
image:
|
||||
categories: [ Docker, Portainer, Gitea, Git ]
|
||||
comments: true
|
||||
pic01: "/assets/images/portainer_oauth/1.png"
|
||||
pic02: "/assets/images/portainer_oauth/2.png"
|
||||
pic03: "/assets/images/portainer_oauth/3.png"
|
||||
pic04: "/assets/images/portainer_oauth/4.png"
|
||||
pic05: "/assets/images/portainer_oauth/5.png"
|
||||
pic06: "/assets/images/portainer_oauth/6.png"
|
||||
pic07: "/assets/images/portainer_oauth/7.png"
|
||||
pic08: "/assets/images/portainer_oauth/8.png"
|
||||
pic09: "/assets/images/portainer_oauth/9.png"
|
||||
pic10: "/assets/images/portainer_oauth/10.png"
|
||||
---
|
||||
|
||||
Portainer Stack:
|
||||
```yaml
|
||||
---
|
||||
version: "3.8"
|
||||
|
||||
networks:
|
||||
EXTERNAL:
|
||||
external:
|
||||
name: EXTERNAL
|
||||
INTERNAL:
|
||||
external:
|
||||
name: INTERNAL
|
||||
|
||||
services:
|
||||
gitea:
|
||||
image: gitea/gitea:latest
|
||||
restart: unless-stopped
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
networks:
|
||||
- EXTERNAL
|
||||
- INTERNAL
|
||||
volumes:
|
||||
- /gitea/data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "22:22"
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
depends_on:
|
||||
- gitea_db
|
||||
|
||||
gitea_db:
|
||||
image: ghcr.io/linuxserver/mariadb:latest
|
||||
container_name: gitea_db
|
||||
networks:
|
||||
- INTERNAL
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- MYSQL_ROOT_PASSWORD=qtzZzVt4sRcAt682
|
||||
- MYSQL_DATABASE=z7twLnmEmK7A3FMv
|
||||
- MYSQL_USER=b2nngTxbJXbGUHkz
|
||||
- MYSQL_PASSWORD=yBDK68gAwJrp3Pgp
|
||||
- TZ=Europe/Lisbon
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /gitea/db:/config
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
- hide_db_container=true
|
||||
```
|
||||
If you are running reverse proxy in same docker you might not need the `ports` in the stack, otherwise change them from the default.
|
||||
Also before running the container, create the folders for Gitea and the DB and change the `volumes` to math.
|
||||
Run on the Terminal `id $USER` to know what are your `PUID`/`USER_UID` and `PGID`/`USER_GID`.
|
||||
|
||||
|
||||
|
||||
<small>[Official Documentation](https://docs.gitea.io/en-us/install-with-docker/)</small>
|
BIN
assets/images/portainer_oauth/10.png
Normal file
BIN
assets/images/portainer_oauth/10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/portainer_oauth/8.png
Normal file
BIN
assets/images/portainer_oauth/8.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
assets/images/portainer_oauth/9.png
Normal file
BIN
assets/images/portainer_oauth/9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
49
package.json
Normal file
49
package.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@semantic-release/gitlab",
|
||||
"version": "1.1.1",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"release": {
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
[
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"npmPublish": false
|
||||
}
|
||||
],
|
||||
"@semantic-release/changelog",
|
||||
"@semantic-release/git"
|
||||
],
|
||||
"branch": "master"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^5.0.1",
|
||||
"@semantic-release/commit-analyzer": "^8.0.1",
|
||||
"@semantic-release/git": "^9.0.0",
|
||||
"@semantic-release/npm": "^7.0.5",
|
||||
"@semantic-release/release-notes-generator": "^9.0.1",
|
||||
"@types/express": "^4.17.6",
|
||||
"@typescript-eslint/eslint-plugin": "^2.28.0",
|
||||
"@typescript-eslint/parser": "^2.28.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-airbnb-base": "^14.1.0",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-import-resolver-typescript": "^2.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"prettier": "^2.0.4",
|
||||
"semantic-release": "^17.0.6",
|
||||
"ts-node-dev": "^1.0.0-pre.44",
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.17.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev:server": "ts-node-dev --inspect --transpileOnly --ignore-watch node_modules src/server.ts"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user